# Material & Cupertino widget

**URL:** <https://forums.kodeco.com/t/material-cupertino-widget/153607>\
**Category:** Flutter Apprentice\
**Created:** [October 17, 2021, 11:00pm UTC](https://forums.kodeco.com/t/material-cupertino-widget/153607 "2021-10-17T23:00:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lanzoninicola](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/lanzoninicola/32/81494_2.png) [@lanzoninicola](https://forums.kodeco.com/u/lanzoninicola)\
**Post date:** [October 17, 2021, 11:00pm UTC](https://forums.kodeco.com/t/material-cupertino-widget/153607/1 "2021-10-17T23:00:53Z")

</div>

Building the recipe app we are using the Material App widget.

How can I support the IOS devices also with the Cupertino widget? The Material App widget wrap all the children widget.

How can I detect the device and apply the appropriate widget?

Thanks

---

<div class="post-metadata">

**Author:** ![jomoka](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jomoka/32/109828_2.png) [@jomoka](https://forums.kodeco.com/u/jomoka)\
**Post date:** [October 18, 2021, 4:43am UTC](https://forums.kodeco.com/t/material-cupertino-widget/153607/2 "2021-10-18T04:43:13Z")

</div>

@lanzoninicola i am not 100% sure, but I think you would have to create a way to switch between Cupertino style widgets vs Material style widgets.

You may be able to find some package that handles this on pub.dev

You can maybe check out:

> **[flutter\_platform\_widgets | Flutter Package](https://pub.dev/packages/flutter_platform_widgets)**
>
> Simplifying the use of both Material and Cupertino widgets with a single widget

But in my opinion i think sticking to one UI library is ideal so you don’t have to have bottleneck of supporting two different design systems.

You can build a lot of beautiful UI with just Material UI alone!

The beauty with cross-platform toolkit like Flutter is you build the same UI with a single code base!

---

<div class="post-metadata">

**Author:** ![jefff9511](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jefff9511/32/102075_2.png) [@jefff9511](https://forums.kodeco.com/u/jefff9511)\
**Post date:** [October 18, 2021, 10:51am UTC](https://forums.kodeco.com/t/material-cupertino-widget/153607/3 "2021-10-18T10:51:18Z")

</div>

I’m also a newbie to Flutter but my understanding is that Flutter’s Material Design out of the box gives you a great user interface on Android but on IOS it won’t always give you an IOS look-and-feel (even though it will work). So, for each widget you have, you will need to either (a) use

> if (Platform.isIOS)

to  
use an alternate widget or (b) within your own widgets, use the same if test to build a Cupertino section of code.

The thing to remember is that even though Flutter builds working apps on all supported platforms, the look-and-feel may not be the correct look-and-feel for a particular device unless you customize the code.

[See this article](https://stackoverflow.com/questions/45924474/how-do-you-detect-the-host-platform-from-dart-code)

---

<div class="post-metadata">

**Author:** ![lanzoninicola](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/lanzoninicola/32/81494_2.png) [@lanzoninicola](https://forums.kodeco.com/u/lanzoninicola)\
**Post date:** [October 18, 2021, 12:01pm UTC](https://forums.kodeco.com/t/material-cupertino-widget/153607/4 "2021-10-18T12:01:32Z")

</div>

Thanks @jomoka @jefff9511 for the reply.

I didn’t see much information on the internet about this topic. Now it is clearer.

Initially I thought there was some sort of automatic mechanism provided by Flutter, but I had no idea how it would work if I have to explicitly set the relevant widget to handle the UI.  
Thanks

---

<div class="post-metadata">

**Author:** ![jefff9511](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jefff9511/32/102075_2.png) [@jefff9511](https://forums.kodeco.com/u/jefff9511)\
**Post date:** [October 18, 2021, 1:45pm UTC](https://forums.kodeco.com/t/material-cupertino-widget/153607/5 "2021-10-18T13:45:50Z")

</div>

We should look at this article on RayWenderlich … [Platform-Aware Widgets in Flutter](https://www.raywenderlich.com/4968762-platform-aware-widgets-in-flutter) by By Kevin Moore.
