dark_light_button 0.0.2 copy "dark_light_button: ^0.0.2" to clipboard
dark_light_button: ^0.0.2 copied to clipboard

A package containing ready to use widgets for switching between dark and light theme

dark_light_button #

A Flutter package containing ready to use widgets for switching between dark and light theme.

pub package

Installation #

To install this package, add dark_light_button as a dependency in your pubspec.yaml file.

Usage #

You need to use DarlightButton widget, and you are DONE!

  DarlightButton(    
      onChange: (ThemeMode theme) {
              // change your theme here
      },
  ),

You can change the widget type by using type property of DarlightButton, which takes a Darlights enum as argument. there are currently 3 type of darlight buttons to use and more darlight types will be added soon.

  DarlightButton(    
      type: Darlights.DarlightThree
      onChange: (ThemeMode theme) {
              // change your theme here
      },
  ),

Optional arguments #

height as double which indicates the height of widget
animationDuration as Duration to control duration of animation
options which is class extending DarlightOption. this property is named after each button name
for example, for Darlights.DarlightThree you must provide DarlightThreeOption
each options contain widget-specific properties like background color,etc

Examples #

  DarlightButton(
    type: Darlights.DarlightOne,
    onChange: (ThemeMode theme) {

    },
    options: DarlightOneOption()
  )

darlight_one


  DarlightButton(
    type: Darlights.DarlightTwo,
    onChange: (ThemeMode theme) {

    },
    options: DarlightTwoOption()
  )

darlight_two


  DarlightButton(
    type: Darlights.DarlightThree,
    onChange: (ThemeMode theme) {

    },
    options: DarlightThreeOption()
  )

darlight_three


  DarlightButton(
    type: Darlights.DarlightFour,
    onChange: (ThemeMode theme) {

    },
    options: DarlightFourOption()
  )

darlight_4

17
likes
120
pub points
73%
popularity

Publisher

unverified uploader

A package containing ready to use widgets for switching between dark and light theme

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, sprung

More

Packages that depend on dark_light_button