Skip to content

Commit

Permalink
document problem
Browse files Browse the repository at this point in the history
  • Loading branch information
derdilla committed Jul 18, 2023
1 parent ad85ca5 commit 0366174
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/components/date_time_picker.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

/// First shows a DatePicker for the day then shows a TimePicker for the time of day.
///
/// As per the decision of the material design team a TimePicker isn't able to limit the range
/// (https://github.com/flutter/flutter/issues/23717#issuecomment-966601311), therefore a manual check for the time of
/// day will be needed. Please refer to the validator on the AddMeasurementPage for an example
Future<DateTime?> showDateTimePicker({
required BuildContext context,
DateTime? initialDate,
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/add_measurement.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class _AddMeasurementPageState extends State<AddMeasurementPage> {
messenger.showSnackBar(SnackBar(content: Text(errTimeAfterNow)));
if (selectedTime.hour > now.hour) selectedTime = selectedTime.copyWith(hour: now.hour);
if (selectedTime.minute > now.minute) selectedTime = selectedTime.copyWith(minute: now.minute);
}
} // validation for first date is not needed here as intervall starts at 00:00
setState(() {
_time = selectedTime!;
});
Expand Down

0 comments on commit 0366174

Please sign in to comment.