Mulder
Mulder

Reputation: 153

How to run Flutter app styled as iOS on Android

I have some widgets in my Flutter app which are styled differently between Android and iOS (where I have done this, I always used Theme.of(context).platform).

I'm using an old MacBook Air to build my iOS apps and did some screenshots using it, but they are too low res, so I want to redo these on my PC using an Android emulator.

I can adjust a few things and run the app styled as iOS on the Android emulator, but rather than adjusting my code, is there a command line parameter I can pass to tell it to run as an iOS device?

I just want the app to look like it would as if it is running on an iOS device for the purposes of taking some screenshots.

Upvotes: 6

Views: 2519

Answers (1)

Günter Zöchbauer
Günter Zöchbauer

Reputation: 657168

You can use

MaterialApp(theme: ThemeData(platform: TargetPlatform.iOS),

or use Cupertino widgets https://flutter.io/docs/development/ui/widgets/cupertino

Upvotes: 2

Related Questions