Skip to content

Commit

Permalink
Fix time picker time format
Browse files Browse the repository at this point in the history
  • Loading branch information
AhsanSarwar45 committed Jun 2, 2024
1 parent e724b98 commit 40c4552
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/common/widgets/time_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2820,8 +2820,15 @@ class _TimePickerDialogState extends State<TimePickerDialog>
TextTheme textTheme = theme.textTheme;
ColorScheme colorScheme = theme.colorScheme;

bool use24hMode = MediaQuery.of(context).alwaysUse24HourFormat ||
appSettings.getSetting("Time Format").value == TimeFormat.h24;
TimeFormat timeFormat = appSettings.getSetting("Time Format").value;

bool use24hMode = false;
if (timeFormat == TimeFormat.device) {
use24hMode = MediaQuery.of(context).alwaysUse24HourFormat;
} else {
use24hMode =
appSettings.getSetting("Time Format").value == TimeFormat.h24;
}

switch (type) {
case TimePickerType.spinner:
Expand Down

0 comments on commit 40c4552

Please sign in to comment.