Site icon Flutter Packages | Pub dev Packages – Flutter Mobile App World

Flutter Triple Status Button can use toggle button

triple_status_button

Triple Status Button. Flutter Triple Status Button can use toggle button but in three statuses.

PropertyDescription
heightheight of widget, height of widget. the width will be height * 2. it’s required.
leftIconleftIcon will show left of widget
rightIconrightIcon will show right of widget
hasIconif hasIcon=true leftWidget and rightWidget will show. default value is [true].
circleColorcircleColor is color of circle in middle of widget. it’s required.
backgroundColorbackgroundColor is color of main (background) widget. it’s required.
circleAnimStatewith circleAnimState you can get state of widget. [left,middle,right].

Usage

TripleStatusButton(
            height: 20,
            hasIcon: false,
            backgroundColor: const Color(0xffA28DF8).withOpacity(.4),
            circleColor: Colors.white,
            circleAnimState: (state) {
              if (state == CircleAnimState.right) {
                print('right');
              } else if (state == CircleAnimState.middle) {
                print('middle');
              } else if (state == CircleAnimState.left) {
                print('left');
              }
            },
          )

Download source code on GitHub

https://github.com/mahdibagjani/triple_status_button

Exit mobile version