analog_clock_picker 0.0.5 analog_clock_picker: ^0.0.5 copied to clipboard
A customable time picker using analog clock format
A customable time picker using analog clock format
Features #
- Customizable background color and widget
- Customizable clock hand color and widget
- Ability to change period AM/PM type via Controller
- Fluid animation movement of clock hand
Screenshot #
Demo Video #
Getting started #
Add package to pubspec.yaml
dependencies:
analog_clock_picker: 0.0.5
How to use #
Create controller for control the value of the clock
AnalogClockController analogClockController = AnalogClockController();
You can provide default value inside the controller
AnalogClockController analogClockController = AnalogClockController(
value: DateTime.now(),
periodType: PeriodType.am,
onPeriodTypeChange: (date, period) {
//TODO : Do Something
},
);
you can set period change listener after initialize it
analogClockController.setOnPeriodTypeChangeListener((date, period) {
//TODO : Do Something
});
Minimal usage
AnalogClockPicker(
controller: analogClockController,
size: MediaQuery.of(context).size.width * 0.74,
secondHandleColor: Colors.red,
minutesHandleColor: Colors.black,
hourHandleColor: Colors.black,
clockBackground: Image.asset(
AssetImages.clockBackground,
),
onClockChange: (date){
//TODO : Do Something
},
)