use getter
parent
6895638814
commit
5f7b63d9b5
|
@ -22,8 +22,7 @@ class _MoodFormState extends State<MoodForm> {
|
||||||
void submitForm() {
|
void submitForm() {
|
||||||
if (_moodFormKey.currentState!.validate()) {
|
if (_moodFormKey.currentState!.validate()) {
|
||||||
_moodFormKey.currentState?.save(); //call every onSave Method
|
_moodFormKey.currentState?.save(); //call every onSave Method
|
||||||
Mood mood =
|
Mood mood = Mood(slider.sliderValue.toInt(), _textInput, DateTime.now());
|
||||||
Mood(slider.getSliderValue().toInt(), _textInput, DateTime.now());
|
|
||||||
DatabaseService.instance.addMood(mood);
|
DatabaseService.instance.addMood(mood);
|
||||||
_moodFormKey.currentState?.reset();
|
_moodFormKey.currentState?.reset();
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ class _SleepFormState extends State<SleepForm> {
|
||||||
if (_sleepFormKey.currentState!.validate()) {
|
if (_sleepFormKey.currentState!.validate()) {
|
||||||
_sleepFormKey.currentState?.save(); //call every onSave Method
|
_sleepFormKey.currentState?.save(); //call every onSave Method
|
||||||
Sleep sleep = Sleep(
|
Sleep sleep = Sleep(
|
||||||
slider.getSliderValue().toInt(),
|
slider.sliderValue.toInt(),
|
||||||
_textInput,
|
_textInput,
|
||||||
DateTime.now(),
|
DateTime.now(),
|
||||||
sleepTimePicker.getCurrentTime,
|
sleepTimePicker.getCurrentTime,
|
||||||
|
|
Loading…
Reference in New Issue