Og1ThemeModeSelector constructor

const Og1ThemeModeSelector({
  1. Key? key,
  2. int durationInMs = 750,
  3. Color? lightBackgroundColor,
  4. Color? lightToggleColor,
  5. Color? darkBackgroundColor,
  6. Color? darkToggleColor,
  7. double height = 39,
  8. required ValueChanged<ThemeMode> onChanged,
  9. required ThemeMode themeMode,
})

Creates a ThemeMode Selector.

This selector maintains its own state and the widget calls the onChanged callback when its state is changed.

  • height allows the user to control the height of the widget and a default height of 39 is used.
  • onChanged is called while the user is selecting a new value for the slider.
  • lightBackground and lightToggle are colors which control the foreground and background colors representing the "light" theme mode
  • darkBackground and darkToggle are colors which control the foreground and background colors representing the "dark" theme mode

Implementation

const Og1ThemeModeSelector({
  Key? key,
  this.durationInMs = 750,
  this.lightBackgroundColor,
  this.lightToggleColor,
  this.darkBackgroundColor,
  this.darkToggleColor,
  this.height = 39,
  required this.onChanged,
  required this.themeMode,
}) : super(key: key);