Gwhyyy
Gwhyyy

Reputation: 9166

How to make the flutter app shows as it's an IOS version app inside android

I have a flutter app on an android device, it shows the app with the android adaptive things such as the date picker, the app bar, the dialogs...

I want to try a version of the app like it's on IOS, I mean I want that date picker shows as the IOS's, also for the app bar.

I'm pretty sure that this is related to the MediaQuery, but I just don't know what is it.

I know that I can show forcefully the widgets from the Cupertino library, however, I don't want to do it, I want just to get how the app will show when it runs on IOS with the current code.

Thank you !

Upvotes: 0

Views: 241

Answers (1)

rmtmckenzie
rmtmckenzie

Reputation: 40433

Wherever you're setting your theme, you can simply set the platform property on it to TargetPlatform.iOS.

This should allow the theming to use iOS-specific widgets rather than their android counterparts. Note that this may not work everywhere; if Dart:io's Platform were used incorrectly in your code or 3rd party code for theming, this would not be overridden.

Upvotes: 1

Related Questions