4

Does anybody know: Can I build an iOS app completely with Flutter's Material Widgets, or are there any functionality issues? Is there any documentation on what Material Widgets are working on iOS?

(I'm not talking about design / UX implications here...)

Thanks!

1 Answer 1

8

All Material widgets or Cupertino widgets work in the two platforms (iOS and Android, and also in the web if you wanna try the Flutter beta) and both of them change its UX behavior based on the platform (like the way the physics of the scroll view when you pull or the look of the top navbar).

The Flutter works as a canvas that draws everything, so the UI does not depend on the target platform.

But if you start to mix Material with Cupertino you will have problems because there are some Widgets, like Scaffold, that expect only Material widgets.

You can see that what I am talking about is true seeing the source code of the widgets. In the Scaffold (a Material widget) there is a change of behavior based on the platform: https://github.com/flutter/flutter/blob/1ba4f1f509202f3d2ec16f053edcbe2df6b7107e/packages/flutter/lib/src/material/scaffold.dart#L2481

Here you can see in the first 15 seconds the Flutter Team member saying that the Material works both in iOS and Android and the same apply to Cupertino. There is no restriction in using Cupertino or Material to build multi-platform applications. These are some of the advantages of the Flutter, everything in the screen is drawn pixel by pixel by the Flutter.

Sign up to request clarification or add additional context in comments.

2 Comments

material.io/components/time-pickers/flutter#types Certain material widgets such as time picker are marked as not working for ios in material docs. And yet I was able to run it on ios seemingly without a problem. Not sure what to make of this.
@BenjaminLee the Material is a project not directly related to Flutter and it has its own libraries to be used with iOS, Android, and Web (those must be used with native languages: swift, Java/Kotlin, Swift/ObjC). Besides these platforms, there is also the Material Flutter library (not to be used with native code). So in this case, the Material Flutter library has support for this component but the Swift/Obj-C version (github.com/material-components/material-components-ios) does not. So with Flutter, you can use any Material widget in iOS, Web, macOS, Linux, and Windows platforms.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.