Day night switch Flutter Widget

Flutter widget is a way to declare and construct UI in our flutter app. This is a flutter widget that switches the UI from day to night and vise versa.

DayNightSwitch

A day night switch widget for Flutter.

Installation

Add to pubspec.yaml just as we talked in

dependencies:
  day_night_switch:

Usage

To use plugin, just import package import 'package:day_night_switch/day_night_switch.dart';

Example

DayNightSwitch(
  value: val,
  moonImage: AssetImage('assets/moon.png'),
  sunImage: AssetImage('assets/sun.png'),
  sunColor: sunColor,
  moonColor: moonColor,
  dayColor: dayColor,
  nightColor: nightColor,
  onChanged: (value) {
    setState(() {
    val = value;
    });
  },
)

GitHub Repository

If you want to follow this project more closely, https://github.com/divyanshub024/day_night_switch

SHARE Day night switch Flutter Widget

You may also like...

Leave a Reply

Your email address will not be published.

Share