v1.0.1lite_rolling_switch
具有美觀且吸引人動畫的自訂開關按鈕,可讓您自訂顏色、圖示和其他外觀內容。現在支援空值安全性。
基於Pedro Massango的'crazy-switch'組件的全自訂滾動開關小部件 https://github.com/pedromassango/crazy-switch
{"sdk":"flutter"}^0.18.0{"sdk":"flutter"}以下為英文專案原文快照,最新內容請造訪 GitHub。
Full customable rolling switch widget for flutter apps based on Pedro Massango's 'crazy-switch' widget https://github.com/pedromassango/crazy-switch
Custom Switch button with attractive animation, made to allow you to customize colors, icons and other cosmetic content. Manage the widget states in the same way you do with the classical material's switch widget.
NOTE: Currently, you cannot directly change the widget height properties. This feature will be available soon.
Image preview
Image preview 2
import 'package:lite_rolling_switch/lite_rolling_switch.dart';
LiteRollingSwitch(
//initial value
value: true,
textOn: 'disponible',
textOff: 'ocupado',
colorOn: Colors.greenAccent[700],
colorOff: Colors.redAccent[700],
iconOn: Icons.done,
iconOff: Icons.remove_circle_outline,
textSize: 16.0,
onChanged: (bool state) {
//Use it to manage the different states
print('Current State of SWITCH IS: $state');
},
),
To executed included unit tests run flutter test. Feel free to Pull Request your own Unit Test to improve this package!
Visit the complete changelog here.
This project has been published under an MIT license, you can consult the license terms in detail here.