Flutter different designs for Android and IOS

Viewed 1035

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?

3 Answers

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.

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
  );
}

Use "flutter_platform_widgets" where you can separate each widgets to Android & IOS

Related