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.
Flutter is an open source framework developed by Google that lets you build natively compiled, multiplatform applications from a single codebase. Flutter 3 supports six platform targets: Android, iOS, Windows, macOS, Linux, and web applications.
You need to go to your Settings > General > Device Management. Inside Device Management, select the developer name and tap Trust “YOUR DEVELOPER NAME”. You should now be able to run your Flutter app on your local device.
Add an app icon Review the iOS App Icon guidelines. In the Xcode project navigator, select Assets.xcassets in the Runner folder. Update the placeholder icons with your own app icons. Verify the icon has been replaced by running your app using flutter run .
You can use
MaterialApp(theme: ThemeData(platform: TargetPlatform.iOS),
or use Cupertino widgets https://flutter.io/docs/development/ui/widgets/cupertino
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With