Building an Android-specific UI with MaterialApp
Now that we have built the iOS-specific version of our Settings app, we can focus on the Android-specific UI. Like CupertinoApp
, MaterialApp
builds on top of WidgetsApp
by configuring the iOS design system created by Apple.
Inside of the src
directory, create a folder called material
. The first widget that we will create is our MaterialSettingsApp
, which will configure MaterialApp
to use the theme mode defined in SettingsController
. Create a file called material_settings_app.dart
and add the following code:
class MaterialSettingsApp extends StatelessWidget { const MaterialSettingsApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { final settingsController = SettingsScope.of(context); return MaterialApp( theme: ThemeData(), darkTheme: ThemeData...