PramodJoshi / toggle_switch

A simple toggle switch widget for Flutter.
https://pub.dev/packages/toggle_switch
MIT License
113 stars 64 forks source link

Allow Custom Font Style but still respect activeFgColor and inactiveFgColor #64

Closed ryanheitner closed 1 year ago

ryanheitner commented 2 years ago

Is your feature request related to a problem? Please describe. I would like a custom font that changes color on active and inactive.

Describe the solution you'd like textStyle = widget.customTextStyles!.length == 1 ? widget.customTextStyles![0]! : (widget.customTextStyles!.length > index ~/ 2 && widget.customTextStyles![index ~/ 2] != null ? widget.customTextStyles![index ~/ 2]! : defaultTextStyle);

       change requested:
              if (active && activeFgColor != null) {
                textStyle = textStyle.copyWith(color: activeFgColor);
              } else if (!active && inactiveFgColor != null) {
                textStyle = textStyle.copyWith(color: inactiveFgColor);
              }

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

Aljnk commented 2 years ago

Same request - very important thing as for me.

mohabmm commented 1 year ago

74 Solved here

PramodJoshi commented 1 year ago

Available in toggle_switch: ^2.1.0 . Cheers!