build method

  1. @override
Widget build(
  1. BuildContext context,
  2. SettingsModel model
)
override

Builds the UI according to the state in model.

Implementation

@override
Widget build(BuildContext context, SettingsModel model) => MaterialApp(
    title: "Binghamton University Rover Team",
    home: SplashPage(),
    debugShowCheckedModeBanner: false,
    themeMode: models.isReady ? model.dashboard.themeMode : ThemeMode.system,
    theme: ThemeData(
      useMaterial3: false,
      colorScheme: const ColorScheme.light(
        primary: binghamtonGreen,
        secondary: binghamtonGreen,
      ),
      appBarTheme: const AppBarTheme(
        backgroundColor: binghamtonGreen,
        foregroundColor: Colors.white,
      ),
    ),
    darkTheme: ThemeData.from(
      colorScheme: const ColorScheme.dark(
        primary: binghamtonGreen,
        secondary: binghamtonGreen,
      ),
    ),
    routes: {
      Routes.home: (_) => HomePage(),
      Routes.settings: (_) => SettingsPage(),
    },
);