GithubHelp home page GithubHelp logo

amirmohammadkargar / fl_three_state_switch Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 2.3 MB

Flutter Three State Switch Package

License: BSD 3-Clause "New" or "Revised" License

Kotlin 0.23% Swift 2.13% Objective-C 0.07% Dart 19.61% CMake 33.42% C++ 38.55% C 2.63% HTML 3.35%

fl_three_state_switch's Introduction

fl_three_state_switch

All Contributors

pub package

Use this package as a library

Add

dependencies:
  fl_three_state_switch: ^0.0.1

to your pubspec.yaml, and run

$ flutter pub get

in your project's root directory.

Import in your project:

import 'package:fl_three_state_switch/fl_three_state_switch.dart';

Sample Usage

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
  SwitchState _state = SwitchState.start;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Flutter Three State Switch Demo"),
      ),
      body: Center(
        child:FlThreeStateSwtich(
          onChanged: (state) {
            setState(() {
              _state = state;
            });
          },
          state: _state,
        ),
      ),
    );
  }
}

Constructor

Parameter Default Description
disable false Disable the Switch
width 70.0 Width of Switch Container
height 30.0 Height of Switch Container
dotVerticalPadding 2 Vertical Padding of Dot
dotHorizontalPadding 1 Horizontal Padding of Dot
borderRadius BorderRadius.circular(200) Border Radius of Switch Container
startBackgroundColor SwitchColors.backgroundColor //Color(0xFFd1d1d1) Switch Container Color in start State
middleBackgroundColor SwitchColors.backgroundColor //Color(0xFFd1d1d1) Switch Container Color in middle State
endBackgroundColor SwitchColors.backgroundColor //Color(0xFFd1d1d1) Switch Container Color in end State
dotColor SwitchColors.dotColor //Color(0xFFFFFFFF) Dot Color
disableBackgroundColor SwitchColors.disableBackgroundColor //Color(0xFFbfbfbf) Switch Container Color in disable mode
disableDotColor SwitchColors.disableDotColor //Color(0xFFe3e3e3) Dot Color in disable mode
child null You can change Dot with any widget you want but be careful you must handle disable mode of your widget by yourself
state SwitchState.start enum type SwitchState -> SwitchState{start,middle,end}
dotShadow [const BoxShadow(color: Colors.black,blurRadius: 10,spreadRadius: -5,)] Dot shadow

fl_three_state_switch's People

Contributors

amirmohammadkargar avatar

Stargazers

 avatar  avatar Meysam avatar Hojat ghanbarzadeh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.