A customizable toggle switch widget to add asset background images to the toggle switch.

Last update: Jul 26, 2022

A customizable toggle switch widget to add asset background images to the toggle switch.

All fancy images

Features

Use this package to give fancy background images to the switch for your app.

Parameters

  • Required

    1. bool value: A boolean value that determines whether the switch is active or not.
    2. ValueChanged<bool> onChanged: A callback function called whenever the switch is tapped.
    3. double height: A double value that sets height of the switch.
    4. String activeModeBackgroundImage: A string value that contains the path of the asset background image when the switch is active.
    5. String inactiveModeBackgroundImage: A string value that contains the path of the asset background image when the switch is inactive.
  • Optional

    1. Color activeThumbColor: Sets color of the thumb when the switch is active. Default value is Colors.white.
    2. Color inactiveThumbColor: Sets color of the thumb when the switch is inactive. Default value is Colors.white.
    3. Image activeThumbImage: Used to give image to the thumb when the switch is active.
    4. Image inactiveThumbImage: Used to give image to the thumb when the switch is inactive.

Getting started

  • Add the package to your dependencies
dependencies:
  fancy_switch: ^0.0.1
  • Import the package to the dart file
import 'package:fancy_switch/fancy_switch.dart';
  • Use it as widget wherever it is convenient
class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Demo'),
        actions: [
            FancySwitch(
                value: foo,
                onChanged: foobar,
                height: 25,
                activeModeBackgroundImage: 'assets/active_mode_background_color.png',
                inactiveModeBackgroundImage: 'assets/inactive_mode_background_color.png',
            ),
        ],
      ),
    );
  }
}

Usage

Switching between dark mode and light mode using FancySwitch

Support the pacakge (optional)

If you find this package useful, you can support it for free by giving it a thumbs up at the top of this page. Here's another option to support the package:

Buy Me A Coffee

Contributing to this package

If you would like to contribute to the package, go here.

GitHub

https://github.com/Smit56R/fancy_switch
You might also like...

A new Flutter package customtoggleswitch is used to toggle a setting between on/off which is true/false respectively Created by suryadevsingh.

A new Flutter package customtoggleswitch is used to toggle a setting between on/off which is true/false respectively Created by suryadevsingh.

CustomToggleSwitch A new Flutter package customtoggleswitch is used to toggle a setting between on/off which is true/false respectively Created by sur

Jun 9, 2020

Library to create custom Toggle / Tab on your apps

Library to create custom Toggle / Tab on your apps

Flutter Tab Toggle A Beautiful and Simple Tab/Toggle switch widget. It can be fully customized with desired icons, width, colors, text, corner radius

May 26, 2022

Daynightswitch - A day night switch widget for Flutter.

Daynightswitch - A day night switch widget for Flutter.

DayNightSwitch A day night switch widget for Flutter. Installation Add to pubspec.yaml. dependencies: day_night_switch: Usage To use plugin, just i

Jun 25, 2022

Automatically generate profile picture with random first name and background color. But you can still provide pictures if you have them. As the default color, based on the name of the first letter. :fire: :fire: :fire:

Automatically generate profile picture with random first name and background color. But you can still provide pictures if you have them. As the default color, based on the name of the first letter. :fire: :fire: :fire:

FLUTTER PROFILE PICTURE Automatically generate profile picture with random first name and background color. But you can still provide pictures if you

May 3, 2022

dos downloader app is developed for downloading video. You can download video from YouTube and Facebook. You can also play video on background

dosdownloader Dos downloader app is developed for downloading video. You can download video from YouTube and Facebook. You can also play video on back

Dec 8, 2021

Background upload plugin for flutter

Background upload plugin for flutter

Flutter Uploader A plugin for creating and managing upload tasks. Supports iOS and Android. This plugin is based on WorkManager in Android and NSURLSe

Aug 8, 2022

App de teste que executa uma função de fibonacci em background utilizando compute.

app_isolate_compute A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you star

Jan 7, 2022

Aplicativo de teste que roda em background timer atual utilizando Isolate.

# isolate_app A new Flutter project. ## Getting Started This project is a starting point for a Flutter application. A few resources to get you sta

Jun 20, 2022

User onboarding library with smooth animation of objects and background colors

User onboarding library with smooth animation of objects and background colors

SlidingTutorial Cleveroad introduces Sliding Tutorial Library for Flutter Hey guys, hope you haven’t started developing a tutorial for your Flutter ap

Apr 12, 2022
Comments
  • 1. Make onChanged type same as Switch

    Make it similar to how Switch works

    FancySwitch(
      value: _value,
      onChanged: (value) {
        setState(() {
          _value = value;
        });
      },
      ...,
      ...,
    ),
    
    Reviewed by SuperPenguin at 2022-07-10 15:14

Related

Flutter Image add drag sort, Image add drag sort, support click event, delete, add, long press drag sort.
Flutter Image add drag sort, Image add drag sort, support click event, delete, add, long press drag sort.

flutter_image_add_drag_sort Flutter Image add drag sort, Image add drag sort, support click event, delete, add, long press drag sort, support video fi

Jun 23, 2020
Asset File Generator For Flutter

A simple command line tool that is used to generate the file containing a class, where all the assets present in the given directory will be mapped to a unique variable name.

Feb 16, 2022
Custom dropdown widget allows to add highly customizable widget in your projects with proper open and close animations and also comes with form required validation.
Custom dropdown widget allows to add highly customizable widget in your projects with proper open and close animations and also comes with form required validation.

Custom Dropdown Custom Dropdown package lets you add customizable animated dropdown widget. Features Lots of properties to use and customize dropdown

Aug 8, 2022
In this repo you will see how to pick images from the image library and also, see how to store the selected images on Firebase.
In this repo you will see how to pick images from the image library and also, see how to store the selected images on Firebase.

flutterimageapp Flutter Tutorial - Upload Images using Firebase Storage. Flutter Tutorial - Upload Images using Firebase Storage Video series can be w

May 26, 2022
Display images flutter - Simple app to display images in flutter
Display images flutter - Simple app to display images in flutter

Display Images In Flutter Simple app to display images in a flutter. In this dem

Jan 29, 2022
A Flutter package providing an easy way to add floating ribbon to images.
A Flutter package providing an easy way to add floating ribbon to images.

Floating Ribbon A new Flutter package for creating floating ribbons on images. Dependency dependencies: floating_ribbon: any How To Use In order to

May 29, 2020
Flutter plugin, support android/ios.Support crop, flip, rotate, color martix, mix image, add text. merge multi images.
Flutter plugin, support android/ios.Support crop, flip, rotate, color martix, mix image, add text. merge multi images.

image_editor The version of readme pub and github may be inconsistent, please refer to github. Use native(objc,kotlin) code to handle image data, it i

Aug 2, 2022
Add beautiful animated effects & builders in Flutter, via an easy, highly customizable unified API.
Add beautiful animated effects & builders in Flutter, via an easy, highly customizable unified API.

Flutter Animate A performant library that makes it simple to add almost any kind of animated effect in Flutter. Pre-built effects, like fade, scale, s

Aug 4, 2022
A customizable carousel slider widget in Flutter which supports inifinte scrolling, auto scrolling, custom child widget, custom animations and built-in indicators.
A customizable carousel slider widget in Flutter which supports inifinte scrolling, auto scrolling, custom child widget, custom animations and built-in indicators.

flutter_carousel_widget A customizable carousel slider widget in Flutter. Features Infinite Scroll Custom Child Widget Auto Play Horizontal and Vertic

Jun 12, 2022