keepswitch 0.0.5 icon indicating copy to clipboard operation
keepswitch: ^0.0.5 copied to clipboard

A Beautiful custom Switch for your tiles. With granular control over the look and feel.

Settings UI for Flutter #
















## Installing:

In your pubspec.yaml

dependencies:
  keepswitch: <latest-version>

Then in dart file , do

import 'package:keepswitch/keepswitch.dart';

Basic Usage: #


@override
Widget build(BuildContext context) {
return Scaffold(
  appBar: AppBar(
    shape: BeveledRectangleBorder(),
    toolbarHeight: 60,
    title: Center(child: const Text('Settings UI')),
  ),
  body: Padding(
    padding: const EdgeInsets.only(top: 10),
    child: SafeArea(
      child: settingsList(),
    ),
  ),
);
}
  
Widget settingsList() {
    return ListTile(
        leading: leading,
        trailing: KeepSwitch(
          value: switchValue!,
          onChanged: enabled ? onToggle : null,
          activeColor: Theme.of(context).accentColor,
          inactiveColor: Colors.grey,
          inactiveText: 'Off',
          activeText: 'On',
          activeTextColor : Colors.white70,
          inactiveTextColor : Colors.white70,
          isSwitchDisabled : false,
          switchHeight:55,
          switchWidth:27,
          switchButtonColor:Colors.white,

        ),
        title: Text(
          title,
          style: titleTextStyle,
          maxLines: titleMaxLines,
          overflow: TextOverflow.ellipsis,
        ),
        subtitle: subtitle != null
            ? Text(
                subtitle!,
                style: subtitleTextStyle ?? titleTextStyle,
                maxLines: subtitleMaxLines,
                overflow: TextOverflow.ellipsis,
              )
            : null,
      );
  }

Example App #

https://github.com/ProblematicDude/settings_ui

1
likes
120
pub points
35%
popularity

Publisher

unverified uploader

A Beautiful custom Switch for your tiles. With granular control over the look and feel.

Homepage

Documentation

API reference

License

Icon for licenses.GPL-3.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on keepswitch