tarkalabs / tarka-ui-kit-flutter

UI Kit and Design System for building apps with Flutter
https://pub.dev/packages/tarka_ui
MIT License
7 stars 0 forks source link

Invert ToggleSwitch value interpretation #61

Closed kalpeshp0310 closed 4 months ago

kalpeshp0310 commented 4 months ago

Fixes #60

bool _enable = false;

@override
Widget build(BuildContext context) {
  Row(
    children: [
      TUIToggleSwitch(
        value: _enable,
        onChanged: (bool val) {
          setState(() {
            _enable = val;
          });
        },
      ),
      const SizedBox(
        width: 40,
      ),
      TUIToggleSwitch(
        value: _enable,
      ),
    ],
  ),
}

Will render the component like this now.

Screenshot 2024-04-15 at 12 32 19 PM