I am currently developing an app that I want to release for Android and IOS. My problem is that I don't want to use Material Design for both platforms, as that wouldn't match the IOS design language. Is there any way to use one codebase and compile it for Android using Material Design and for IOS using Cupertino? If not, what is the usual way to go?
Asked
Active
Viewed 2,339 times
3 Answers
3
Checkout: https://pub.dev/packages/flutter_platform_widgets
Its a library that has already done this for a bunch of widgets. If the library doesn't have something you want you can make use of the PlatformWidget from the library. Under the hood it will be doing something similar to fartem's answer.

JayDev
- 1,340
- 2
- 13
- 21
-
This is not longer available in latest update – Dani Jul 19 '22 at 08:16
1
You can build widgets tree with platform separation or move your widgets to a separated classes/files. Example:
Example with just if
:
if (Platform.isAndroid) {
return Column(
// Android specific layout
);
} else {
return Column(
// iOS specific layout
);
}

fartem
- 2,361
- 2
- 8
- 20
-
Ok, but wouldn't that be bad for Performence, because I would have unused Code in my App, that is only used for the other Platform? – isi_ko Jan 20 '21 at 10:09
1
Use "flutter_platform_widgets" where you can separate each widgets to Android & IOS

SOUGAT RIYADH
- 562
- 2
- 10
- 26