A day-night switch widget for Flutter

  Switch, Widgets

DayNightSwitch

A day night switch widget for Flutter.

Installation

Add to pubspec.yaml.

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;
    });
  },
)

Download Day-Night Switch widget source code on GitHub

Implementation guide on Day Night Switch package on pub.dev

https://pub.dev/packages/day_night_switch