gradient_timepicker 0.2.0
gradient_timepicker: ^0.2.0 copied to clipboard
A beautiful gradient time picker widget for Flutter with smooth scroll-wheel selection and AM/PM support.
Gradient Timepicker #
A beautiful gradient time picker for Flutter. Opens as a bottom sheet with smooth scroll-wheel selection for hour, minute, and AM/PM. The background gradient animates between a bright blue (AM) and deep navy (PM) theme.
Showcase #

Features #
- Wheel-style scroll pickers for hour, minute, and AM/PM
- Animated gradient background that shifts between AM and PM colour schemes
- Returns the selected
TimeOfDay, ornullif dismissed - Accepts an optional
initialTime; falls back toTimeOfDay.now() - Safe-area aware bottom padding
Installation #
flutter pub add gradient_timepicker
Usage #
import 'package:gradient_timepicker/gradient_timepicker.dart';
// Inside a widget with a BuildContext:
final TimeOfDay? picked = await showTimePickerSheet(
context: context,
initialTime: TimeOfDay.now(),
);
if (picked != null) {
print('Selected: ${picked.format(context)}');
}
API #
showTimePickerSheet #
Future<TimeOfDay?> showTimePickerSheet({
required BuildContext context,
TimeOfDay? initialTime,
})
| Parameter | Type | Required | Description |
|---|---|---|---|
context |
BuildContext |
yes | The build context used to show the bottom sheet. |
initialTime |
TimeOfDay? |
no | Pre-selected time. Defaults to TimeOfDay.now() |
Returns the TimeOfDay chosen by the user, or null if the sheet is dismissed.
TimePickerSheet #
The underlying StatefulWidget if you need to embed the picker directly:
TimePickerSheet(initialTime: const TimeOfDay(hour: 9, minute: 0))
Running Tests #
flutter test --coverage
To view the generated coverage report you can use lcov:
genhtml coverage/lcov.info -o coverage/
open coverage/index.html