keepswitch

Last updated:

0 purchases

keepswitch Image
keepswitch Images
Add to Cart

Description:

keepswitch

Settings UI for Flutter #




















## Installing:
In your pubspec.yaml
dependencies:
keepswitch: <latest-version>
copied to clipboard
Then in dart file , do
import 'package:keepswitch/keepswitch.dart';
copied to clipboard
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,
);
}
copied to clipboard
Example App #
https://github.com/ProblematicDude/settings_ui

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.