theme property

ThemeData theme

Shows when the current mode is a light theme.

Implementation

ThemeData get theme => ThemeData(
      scaffoldBackgroundColor: Colors.white,
      unselectedWidgetColor: Colors.black54,
      textTheme: textTheme,
      appBarTheme: const AppBarTheme(
        elevation: 0,
        centerTitle: false,
        backgroundColor: Colors.white,
        foregroundColor: Colors.black,
      ),
      switchTheme: SwitchThemeData(
        thumbColor: MaterialStateColor.resolveWith((states) {
          return states.contains(MaterialState.selected)
              ? Colors.red
              : Colors.white;
        }),
        trackColor: MaterialStateColor.resolveWith((states) {
          return states.contains(MaterialState.selected)
              ? Colors.red.withOpacity(0.5)
              : Colors.grey;
        }),
      ),
      bottomNavigationBarTheme: BottomNavigationBarThemeData(
        elevation: 0,
        type: BottomNavigationBarType.fixed,
        selectedLabelStyle: textTheme.labelSmall,
        unselectedLabelStyle: textTheme.labelSmall,
        showSelectedLabels: true,
        showUnselectedLabels: true,
        backgroundColor: Colors.white,
      ),
      popupMenuTheme: const PopupMenuThemeData(
        color: Colors.white,
        shape: RoundedRectangleBorder(),
      ),
      dialogTheme: const DialogTheme(
        backgroundColor: Colors.white,
        shape: RoundedRectangleBorder(),
      ),
      cardColor: Colors.white,
      textButtonTheme: TextButtonThemeData(
        style: TextButton.styleFrom(
          foregroundColor: Colors.black,
        ),
      ),
      listTileTheme: ListTileThemeData(
        dense: true,
        selectedTileColor: Colors.grey.shade300,
        selectedColor: Colors.black,
        horizontalTitleGap: 0,
      ),
      inputDecorationTheme: const InputDecorationTheme(
        enabledBorder: UnderlineInputBorder(
          borderSide: BorderSide(
            color: Colors.black54,
          ),
        ),
        focusedBorder: UnderlineInputBorder(
          borderSide: BorderSide(color: Colors.red),
        ),
      ),
      scrollbarTheme: ScrollbarThemeData(
        thickness: MaterialStateProperty.all(3),
        thumbVisibility: MaterialStateProperty.all(true),
      ),
      sliderTheme: const SliderThemeData(
        thumbColor: Colors.red,
        activeTrackColor: Colors.red,
        inactiveTrackColor: Colors.grey,
        trackShape: RectangularSliderTrackShape(),
        trackHeight: 2,
        thumbShape: RoundSliderThumbShape(enabledThumbRadius: 6),
      ),
      colorScheme: ColorScheme.fromSwatch()
          .copyWith(
            primary: Colors.red,
            secondary: Colors.red,
            brightness: Brightness.light,
          )
          .copyWith(background: Colors.white),
    );