Zena Radwan
Zena Radwan

Reputation: 113

Flutter 2.5 flutter brightness is deprecated

flutter AppBarTheme brightness is deprecated and recommend colorScheme what is colorScheme and how to implement it

Upvotes: 3

Views: 6331

Answers (1)

Omar Mahmoud
Omar Mahmoud

Reputation: 3087

ColorScheme is A set of colors based on the Material color system that can be used to configure the color properties of most components.

you can use it like this

  static const ColorScheme colorSchemeLight = ColorScheme(
    primary: primaryColor,
    secondary: accentColor,
    surface: background,
    background: background,
    brightness: Brightness.light,
    error: failurRed,
    onBackground: Colors.black,
    onError: Colors.white,
    onPrimary: Colors.white,
    onSecondary: Colors.white,
    onSurface: Colors.black,
    primaryContainer: primaryColor,
    secondaryContainer: accentColor,
  );
    mainTheme = ThemeData(
            appBarTheme: appBarTheme,
            brightness: Brightness.light,
            primaryColor: primaryColor,
            colorScheme: colorSchemeLight,
            textTheme: viatoTextTheme,
            backgroundColor: background,
            scaffoldBackgroundColor: background);

Upvotes: 6

Related Questions