rolling_switch 0.0.2 rolling_switch: ^0.0.2 copied to clipboard
Custom Switch button with attractive animation, made to allow you to customize colors, icons and other cosmetic content.
Basic use: #
Create a RollingSwitch Widget with Flutter Icons. #
RollingSwitch.icon(
onChanged: (bool state) {
print('turned ${(state) ? 'on' : 'off'}');
},
rollingInfoRight: const RollingIconInfo(
icon: Icons.flag,
text: Text('Flag'),
),
rollingInfoLeft: const RollingIconInfo(
icon: Icons.check,
backgroundColor: Colors.grey,
text: Text('Check'),
),
)
Create a RollingSwitch Widget with custom Widget. #
RollingSwitch.widget(
onChanged: (bool state) {
print('turned ${(state) ? 'on' : 'off'}');
},
rollingInfoRight: RollingWidgetInfo(
icon: FlutterLogo(),
text: Text('Flutter'),
),
rollingInfoLeft: RollingWidgetInfo(
icon: FlutterLogo(
style: FlutterLogoStyle.stacked,
),
backgroundColor: Colors.grey,
text: Text('Stacked'),
),
),