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

Overview

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.

You might also like...

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

Dec 25, 2022

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

Sep 6, 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

Oct 25, 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

Nov 26, 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

Dec 20, 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

Jan 3, 2023

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
Comments
  • Make onChanged type same as Switch

    Make onChanged type same as Switch

    Make it similar to how Switch works

    FancySwitch(
      value: _value,
      onChanged: (value) {
        setState(() {
          _value = value;
        });
      },
      ...,
      ...,
    ),
    
    opened by SuperPenguin 0
Owner
null
Asset manager helps you auto-generate the assets code and add it to your pubspec.yaml .

Asset Manager Asset manager helps you auto-generate the assets code and add it to your pubspec.yaml . Quick start dart pub global activate asset_manag

Rutvik Tak 9 Nov 1, 2022
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

null 5 Jun 23, 2020
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

Abdullah Chauhan 22 Dec 29, 2022
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.

null 5 Feb 16, 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.

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

Whatsupcoders 60 Nov 4, 2022
camilo velandia 69 Dec 30, 2022
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

Manish Ahire 1 Jan 29, 2022
Memebaaz is a video/images sharing app, Anyone can share short videos and images through app, the media will go through admin's approval.

MemeBaaz - Memes & Short Videos App Memebaaz is a Video/images Sharing App, Anyone can share short videos and images through app, the media will go th

Rakesh K. 18 Nov 14, 2022
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

101Loop 12 Sep 26, 2022
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

FlutterCandies 317 Jan 3, 2023