Merge branch 'feature/sleep-page' of https://gitlab.com/Crondung/hsma_cpd into feature/sleep-page
commit
9db3d6c2d8
|
@ -25,7 +25,8 @@ class _SleepFormState extends State<SleepForm> {
|
|||
|
||||
void submitForm() {
|
||||
if (_sleepFormKey.currentState!.validate()) {
|
||||
_sleepFormKey.currentState?.save();
|
||||
_sleepFormKey.currentState?.save(); //call every onSave Method
|
||||
//TODO Businesslogik aufrufen!
|
||||
print(_textInput);
|
||||
print(slider.getSliderValue());
|
||||
print('Eingeschlafen um: ${sleepTimePicker.getCurrentTime}');
|
||||
|
|
|
@ -43,6 +43,36 @@ class TimePickerState extends State<TimePicker> {
|
|||
});
|
||||
},
|
||||
child: const Text('Zeit einstellen'))
|
||||
widget.descriptionText,
|
||||
style: const TextStyle(fontSize: 12),
|
||||
),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
Text(
|
||||
'${widget._initialTime.hour.toString().padLeft(2, '0')}:${widget._initialTime.minute.toString().padLeft(2, '0')}',
|
||||
style: const TextStyle(fontSize: 22),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
//TODO auslagern
|
||||
TimeOfDay? newTime = await showTimePicker(
|
||||
context: context,
|
||||
initialTime: widget._initialTime,
|
||||
builder: (context, child) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context)
|
||||
.copyWith(alwaysUse24HourFormat: true),
|
||||
child: child!,
|
||||
);
|
||||
},
|
||||
);
|
||||
if (newTime == null) return;
|
||||
setState(() {
|
||||
widget._initialTime = newTime;
|
||||
});
|
||||
},
|
||||
child: const Text('Zeit einstellen'))
|
||||
])
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue