A customable time picker using analog clock format
- 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
Add package to pubspec.yaml
dependencies:
analog_clock_picker: 0.0.6
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
},
)