Building an iOS-specific UI with CupertinoApp
Now that we have familiarized ourselves with Flutter’s platform detection capabilities, let’s put what we’ve learned into action by building a uniquely Cupertino Settings UI.
In Flutter, you can build an application that uses the iOS design system created by Apple by wrapping your application in CupertinoApp
. This widget builds on WidgetsApp
, which provides basic navigation and some foundational widgets by configuring the design system’s standards.
Because CupertinoApp
is just a widget, the design system that you decide to use is not restricted by platform. You could very well use Material for iOS applications and Cupertino for Android applications, or even build something completely custom!
As we want to use a generic theme mode to represent iOS, let’s extend SettingsService
first. Open settings_service.dart
and replace the code with the following:
class SettingsService { Future...