Widget for selecting between ThemeMode.dark and ThemeMode.light

Overview

ThemeModeSelector Widget

I am currently working with the concept of Theme's in Flutter and I wanted to build a widget which would allow me to switch between light and dark themes. Seeking a design for a simple toggle, I was lucky enough to stumble into some of Zhenya Karapetyan's amazing work on Dribbble. Zhenya's simple yet fun design of a toggle component would look very nice in Flutter, and it has some really cool animations which I wanted to learn.

Zhenya Karapetyan's Light/Dark Toggle

https://dribbble.com/shots/7635203-Light-Dark-mode-toggle-switcher/attachments/396864?mode=media

thememode_selector

A widget to toggle between a light or dark ThemeMode

Features

  • Configurable colors for background and foreground colors for both light and dark modes
  • API similar to standard Material Slider widget

Supported Platforms

  • Flutter Android
  • Flutter iOS
  • Flutter Web
  • Flutter Desktop

Installation

Add thememode_selector: ^0.1.0 to your pubspec.yaml configuration.

import 'package:thememode_selector/thememode_selector.dart'

How to use

Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(
      title: Text(title),
    ),
    body: Center(
      child: ThemeModeSelector(
        height: 39,
        onChanged: (mode) {
          print('ThemeMode changed to $mode');
          ThemeModeManager.of(context)!.themeMode = mode;
        },
      ),
    ),
  );
}

License

MIT

You might also like...

Light and Dark mode with cubit

Light and Dark mode with cubit This project will explain how we can implement the light and dark mode with Cubit state management architecture. Projec

Oct 9, 2022

This is a message/chat app with light and dark theme options

This is a message/chat app with light and dark theme options

this is a message/chat app #ui using #flutter that runs both Android and iOS devices also has a dark and light theme. We create in total 4 screens all

Dec 30, 2022

Flutter chat-app UI with multiple themes & light + Dark mode.

Flutter chat-app UI with multiple themes & light + Dark mode.

Chat-App UI Only a PART of code available, for complete code ping here Features of the app - Light Mode + Dark Mode 4 different color themes - pink/te

Oct 5, 2022

Chat messaging app for multiple users in light/dark theme with ios/android.

Chat messaging app for multiple users in light/dark theme with ios/android.

Chat/Messaging App Light and Dark Theme - Flutter UI Watch it on YouTube Complete Source Code (Patreon only) Packages we are using: goole_fonts: link

Dec 3, 2022

Flutter plugin for selecting images from the Android and iOS image library, taking new pictures with the camera, and edit them before using such as rotation, cropping, adding sticker/text/filters.

Flutter plugin for selecting images from the Android and iOS image library, taking new pictures with the camera, and edit them before using such as rotation, cropping, adding sticker/text/filters.

advance_image_picker Flutter plugin for selecting multiple images from the Android and iOS image library, taking new pictures with the camera, and edi

Dec 19, 2022

Movies4u app UI is simple enough to use and the app is a fun way to get an overview of your movie experience. This repo created with help of awesome UI, material Design and latest feature. this repo contain major feature like : dark theme.

Movies4u app UI is simple enough to use and the app is a fun way to get an overview of your movie experience. This repo created with help of awesome UI, material Design and latest feature. this repo contain major feature like : dark theme.

Moviesfree4U This is simple repository, that help in fetch latest, upcomming movies. Website https://movies4u-ef56f.firebaseapp.com/#/ https://movies4

Dec 10, 2022

Pasar parametros - App to practice navigation between screens and passing parameters from A-B and B-A

Pasar parametros - App to practice navigation between screens and passing parameters from A->B and B->A

App 5 App para practicar navegacion entre pantallas y paso de parametros de A-B

Feb 6, 2022
Owner
null
Picture upload widget for Flutter which helps selecting and uploading one or multiple images to firebase storage.

Flutter Firebase Picture Uploader This library offers a Picture Upload widget which can be used to upload one or multiple images to your Firebase Stor

Christoph Rothermel 12 Oct 21, 2022
This Flutter package provides a Search Widget for selecting an option from a data list

Search Widget This Flutter package provides a Search Widget for selecting an option from a data list. Provides filtering of items based on the search

Ayush P Gupta 194 Oct 31, 2022
This perfect starter kit is an app based on React Native and UI Kitten library with Light and Dark themes support.

Kitten Tricks This perfect starter kit is an app based on React Native and UI Kitten library with Light and Dark themes support. It’s completely free

Akveo 7k Dec 30, 2022
Easiest way to add support for light and dark theme in your flutter app.

Adaptive Theme Easiest way to add support for light and dark theme in your Flutter app. It allows to manually set light or dark theme and also lets yo

Birju Vachhani 287 Dec 27, 2022
Chat Messaging App Light and Dark Theme

Chat/Messaging App Light and Dark Theme - Flutter UI Watch it on YouTube Complete Source Code (Patreon only) Packages we are using: goole_fonts: link

Abu Anwar 1.4k Jan 6, 2023
An awesome flutter app which artistically animates light and dark mode 😍

Light Dark Toggle Made with ?? in India This flutter app is based on the design made by Matthieu Souteyrand on Dribble.He describes the design as: Bac

Shubham Soni 221 Nov 9, 2022
Hotel-Booking-App-UI - Beautiful Hotel Booking App UI with support for dark and light mode

Flutter Hotel Booking App UI with support for dark and light mode. Flutter 2.8.1

Martin Gogołowicz 11 Nov 1, 2022
Shoes-Store-App-UI-Flutter - Beautiful Shoes Store App UI with support for dark and light mode

Flutter Shoes Store App UI with support for dark and light mode. Flutter 2.8.1 N

Jakub Sobański 4 Nov 23, 2022
Flutter-Theme-Changer - Change theme of your app from light to dark theme and vice versa

Flutter Theme Changer - Hard Coded This is a flutter theme changer without using

Shametha K G 4 Oct 17, 2022
Custom Clock App With GetX And Dark Theme & Light Mode

Clock App ✍?? Clock App with GetX [MVC pattern] ????‍?? Clock App app is open-source app for Android & ios. It is built with Dart on top of Google's F

null 12 Oct 21, 2022