From 00ae7ae860a63d6ce86c1da66936ed1081b277d3 Mon Sep 17 00:00:00 2001 From: Crondung <1922635@stud.hs-mannheim.de> Date: Sun, 5 Mar 2023 18:17:08 +0100 Subject: [PATCH] structure widget folder --- lib/pages/interval_page.dart | 7 +++---- lib/pages/mood_page.dart | 6 +++--- lib/pages/relapse_page.dart | 6 +++--- lib/pages/sleep_page.dart | 6 +++--- lib/widgets/{ => buttons}/mute_button.dart | 3 +-- lib/widgets/{ => buttons}/round_button_widget.dart | 0 lib/widgets/{ => buttons}/submit_form_button.dart | 0 lib/widgets/{ => buttons}/timer_button.dart | 0 lib/widgets/{ => popup}/missing_config_popup.dart | 0 .../{ => popup}/popup_for_start_and_stop.dart | 0 lib/widgets/{ => popup}/popup_for_task_done.dart | 4 ++-- lib/widgets/{ => view_form}/mood_form.dart | 7 +++---- lib/widgets/{ => view_form}/mood_view.dart | 4 ++-- lib/widgets/{ => view_form}/relapse_form.dart | 10 +++++----- lib/widgets/{ => view_form}/relapse_view.dart | 2 +- lib/widgets/{ => view_form}/sleep_form.dart | 6 +++--- lib/widgets/{ => view_form}/sleep_view.dart | 2 +- lib/widgets/{ => view_form}/view_form_page.dart | 10 +++++----- lib/widgets/{ => view_form}/workout_form.dart | 8 ++++---- lib/widgets/{ => view_form}/workout_view.dart | 2 +- lib/widgets/workout_timer_widget.dart | 14 +++++++------- 21 files changed, 47 insertions(+), 50 deletions(-) rename lib/widgets/{ => buttons}/mute_button.dart (92%) rename lib/widgets/{ => buttons}/round_button_widget.dart (100%) rename lib/widgets/{ => buttons}/submit_form_button.dart (100%) rename lib/widgets/{ => buttons}/timer_button.dart (100%) rename lib/widgets/{ => popup}/missing_config_popup.dart (100%) rename lib/widgets/{ => popup}/popup_for_start_and_stop.dart (100%) rename lib/widgets/{ => popup}/popup_for_task_done.dart (91%) rename lib/widgets/{ => view_form}/mood_form.dart (85%) rename lib/widgets/{ => view_form}/mood_view.dart (89%) rename lib/widgets/{ => view_form}/relapse_form.dart (78%) rename lib/widgets/{ => view_form}/relapse_view.dart (88%) rename lib/widgets/{ => view_form}/sleep_form.dart (89%) rename lib/widgets/{ => view_form}/sleep_view.dart (94%) rename lib/widgets/{ => view_form}/view_form_page.dart (79%) rename lib/widgets/{ => view_form}/workout_form.dart (79%) rename lib/widgets/{ => view_form}/workout_view.dart (94%) diff --git a/lib/pages/interval_page.dart b/lib/pages/interval_page.dart index 2326168..484ae20 100644 --- a/lib/pages/interval_page.dart +++ b/lib/pages/interval_page.dart @@ -1,9 +1,8 @@ import 'package:flutter/material.dart'; import 'package:smoke_cess_app/services/pages_service.dart'; -import 'package:smoke_cess_app/widgets/workout_form.dart'; -import 'package:smoke_cess_app/widgets/workout_view.dart'; - -import '../widgets/view_form_page.dart'; +import 'package:smoke_cess_app/widgets/view_form/workout_form.dart'; +import 'package:smoke_cess_app/widgets/view_form/workout_view.dart'; +import 'package:smoke_cess_app/widgets/view_form/view_form_page.dart'; class IntervalTimerPage extends StatelessWidget { const IntervalTimerPage({super.key}); diff --git a/lib/pages/mood_page.dart b/lib/pages/mood_page.dart index 8c2447d..f5b8009 100644 --- a/lib/pages/mood_page.dart +++ b/lib/pages/mood_page.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:smoke_cess_app/services/pages_service.dart'; -import 'package:smoke_cess_app/widgets/mood_form.dart'; -import 'package:smoke_cess_app/widgets/mood_view.dart'; -import 'package:smoke_cess_app/widgets/view_form_page.dart'; +import 'package:smoke_cess_app/widgets/view_form/mood_form.dart'; +import 'package:smoke_cess_app/widgets/view_form/mood_view.dart'; +import 'package:smoke_cess_app/widgets/view_form/view_form_page.dart'; class MoodPage extends StatelessWidget { const MoodPage({super.key}); diff --git a/lib/pages/relapse_page.dart b/lib/pages/relapse_page.dart index e7b6127..db75e86 100644 --- a/lib/pages/relapse_page.dart +++ b/lib/pages/relapse_page.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:smoke_cess_app/services/pages_service.dart'; -import 'package:smoke_cess_app/widgets/relapse_form.dart'; -import 'package:smoke_cess_app/widgets/relapse_view.dart'; -import '../widgets/view_form_page.dart'; +import 'package:smoke_cess_app/widgets/view_form/relapse_form.dart'; +import 'package:smoke_cess_app/widgets/view_form/relapse_view.dart'; +import 'package:smoke_cess_app/widgets/view_form/view_form_page.dart'; class RelapsePage extends StatelessWidget { const RelapsePage({super.key}); diff --git a/lib/pages/sleep_page.dart b/lib/pages/sleep_page.dart index 3cf3fd5..8d9842d 100644 --- a/lib/pages/sleep_page.dart +++ b/lib/pages/sleep_page.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:smoke_cess_app/services/pages_service.dart'; -import 'package:smoke_cess_app/widgets/sleep_form.dart'; -import 'package:smoke_cess_app/widgets/sleep_view.dart'; -import 'package:smoke_cess_app/widgets/view_form_page.dart'; +import 'package:smoke_cess_app/widgets/view_form/sleep_form.dart'; +import 'package:smoke_cess_app/widgets/view_form/sleep_view.dart'; +import 'package:smoke_cess_app/widgets/view_form/view_form_page.dart'; class SleepPage extends StatelessWidget { const SleepPage({super.key}); diff --git a/lib/widgets/mute_button.dart b/lib/widgets/buttons/mute_button.dart similarity index 92% rename from lib/widgets/mute_button.dart rename to lib/widgets/buttons/mute_button.dart index 29bebf7..d74eb97 100644 --- a/lib/widgets/mute_button.dart +++ b/lib/widgets/buttons/mute_button.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; - -import '../providers/audio_provider.dart'; +import '../../providers/audio_provider.dart'; class MuteButton extends StatelessWidget { const MuteButton({super.key}); diff --git a/lib/widgets/round_button_widget.dart b/lib/widgets/buttons/round_button_widget.dart similarity index 100% rename from lib/widgets/round_button_widget.dart rename to lib/widgets/buttons/round_button_widget.dart diff --git a/lib/widgets/submit_form_button.dart b/lib/widgets/buttons/submit_form_button.dart similarity index 100% rename from lib/widgets/submit_form_button.dart rename to lib/widgets/buttons/submit_form_button.dart diff --git a/lib/widgets/timer_button.dart b/lib/widgets/buttons/timer_button.dart similarity index 100% rename from lib/widgets/timer_button.dart rename to lib/widgets/buttons/timer_button.dart diff --git a/lib/widgets/missing_config_popup.dart b/lib/widgets/popup/missing_config_popup.dart similarity index 100% rename from lib/widgets/missing_config_popup.dart rename to lib/widgets/popup/missing_config_popup.dart diff --git a/lib/widgets/popup_for_start_and_stop.dart b/lib/widgets/popup/popup_for_start_and_stop.dart similarity index 100% rename from lib/widgets/popup_for_start_and_stop.dart rename to lib/widgets/popup/popup_for_start_and_stop.dart diff --git a/lib/widgets/popup_for_task_done.dart b/lib/widgets/popup/popup_for_task_done.dart similarity index 91% rename from lib/widgets/popup_for_task_done.dart rename to lib/widgets/popup/popup_for_task_done.dart index fbaa65d..cf7f7ed 100644 --- a/lib/widgets/popup_for_task_done.dart +++ b/lib/widgets/popup/popup_for_task_done.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:smoke_cess_app/providers/timer_provider.dart'; import 'package:smoke_cess_app/widgets/timer_widget.dart'; -import '../services/date_service.dart'; -import '../services/pages_service.dart'; +import 'package:smoke_cess_app/services/date_service.dart'; +import 'package:smoke_cess_app/services/pages_service.dart'; void showTaskDonePopup(BuildContext context, Pages page) async { Duration duration = await getTimeTill(page); diff --git a/lib/widgets/mood_form.dart b/lib/widgets/view_form/mood_form.dart similarity index 85% rename from lib/widgets/mood_form.dart rename to lib/widgets/view_form/mood_form.dart index e43e97d..2217682 100644 --- a/lib/widgets/mood_form.dart +++ b/lib/widgets/view_form/mood_form.dart @@ -3,11 +3,10 @@ import 'package:provider/provider.dart'; import 'package:smoke_cess_app/providers/tasks_provider.dart'; import 'package:smoke_cess_app/services/pages_service.dart'; import 'package:smoke_cess_app/widgets/slider.dart'; -import 'package:smoke_cess_app/widgets/submit_form_button.dart'; +import 'package:smoke_cess_app/widgets/buttons/submit_form_button.dart'; import 'package:smoke_cess_app/widgets/text_formfield.dart'; - -import '../providers/input_provider.dart'; -import 'elevated_card.dart'; +import 'package:smoke_cess_app/providers/input_provider.dart'; +import 'package:smoke_cess_app/widgets/elevated_card.dart'; class MoodForm extends StatelessWidget { const MoodForm({super.key}); diff --git a/lib/widgets/mood_view.dart b/lib/widgets/view_form/mood_view.dart similarity index 89% rename from lib/widgets/mood_view.dart rename to lib/widgets/view_form/mood_view.dart index 14884b9..b61f8b1 100644 --- a/lib/widgets/mood_view.dart +++ b/lib/widgets/view_form/mood_view.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:syncfusion_flutter_charts/charts.dart'; -import '../models/mood.dart'; -import '../providers/tasks_provider.dart'; +import 'package:smoke_cess_app/models/mood.dart'; +import 'package:smoke_cess_app/providers/tasks_provider.dart'; class MoodView extends StatelessWidget { const MoodView({super.key}); diff --git a/lib/widgets/relapse_form.dart b/lib/widgets/view_form/relapse_form.dart similarity index 78% rename from lib/widgets/relapse_form.dart rename to lib/widgets/view_form/relapse_form.dart index 9451277..ea7ba11 100644 --- a/lib/widgets/relapse_form.dart +++ b/lib/widgets/view_form/relapse_form.dart @@ -2,12 +2,12 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:smoke_cess_app/providers/tasks_provider.dart'; import 'package:smoke_cess_app/widgets/drop_down.dart'; -import 'package:smoke_cess_app/widgets/submit_form_button.dart'; +import 'package:smoke_cess_app/widgets/buttons/submit_form_button.dart'; import 'package:smoke_cess_app/widgets/text_formfield.dart'; -import '../providers/input_provider.dart'; -import '../providers/settings_provider.dart'; -import '../services/pages_service.dart'; -import 'elevated_card.dart'; +import 'package:smoke_cess_app/providers/input_provider.dart'; +import 'package:smoke_cess_app/providers/settings_provider.dart'; +import 'package:smoke_cess_app/services/pages_service.dart'; +import 'package:smoke_cess_app/widgets/elevated_card.dart'; class RelapseForm extends StatelessWidget { const RelapseForm({super.key}); diff --git a/lib/widgets/relapse_view.dart b/lib/widgets/view_form/relapse_view.dart similarity index 88% rename from lib/widgets/relapse_view.dart rename to lib/widgets/view_form/relapse_view.dart index 48c9829..2480640 100644 --- a/lib/widgets/relapse_view.dart +++ b/lib/widgets/view_form/relapse_view.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import '../providers/tasks_provider.dart'; +import 'package:smoke_cess_app/providers/tasks_provider.dart'; class RelapseView extends StatelessWidget { const RelapseView({super.key}); diff --git a/lib/widgets/sleep_form.dart b/lib/widgets/view_form/sleep_form.dart similarity index 89% rename from lib/widgets/sleep_form.dart rename to lib/widgets/view_form/sleep_form.dart index 4996da7..377aed2 100644 --- a/lib/widgets/sleep_form.dart +++ b/lib/widgets/view_form/sleep_form.dart @@ -3,12 +3,12 @@ import 'package:provider/provider.dart'; import 'package:smoke_cess_app/providers/tasks_provider.dart'; import 'package:smoke_cess_app/widgets/elevated_card.dart'; import 'package:smoke_cess_app/widgets/slider.dart'; -import 'package:smoke_cess_app/widgets/submit_form_button.dart'; +import 'package:smoke_cess_app/widgets/buttons/submit_form_button.dart'; import 'package:smoke_cess_app/widgets/text_formfield.dart'; import 'package:smoke_cess_app/widgets/timepicker.dart'; -import '../providers/input_provider.dart'; -import '../services/pages_service.dart'; +import 'package:smoke_cess_app/providers/input_provider.dart'; +import 'package:smoke_cess_app/services/pages_service.dart'; class SleepForm extends StatelessWidget { const SleepForm({Key? key}) : super(key: key); diff --git a/lib/widgets/sleep_view.dart b/lib/widgets/view_form/sleep_view.dart similarity index 94% rename from lib/widgets/sleep_view.dart rename to lib/widgets/view_form/sleep_view.dart index 90a005c..ffc9514 100644 --- a/lib/widgets/sleep_view.dart +++ b/lib/widgets/view_form/sleep_view.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:smoke_cess_app/models/sleep.dart'; import 'package:syncfusion_flutter_charts/charts.dart'; -import '../providers/tasks_provider.dart'; +import 'package:smoke_cess_app/providers/tasks_provider.dart'; class SleepView extends StatelessWidget { const SleepView({super.key}); diff --git a/lib/widgets/view_form_page.dart b/lib/widgets/view_form/view_form_page.dart similarity index 79% rename from lib/widgets/view_form_page.dart rename to lib/widgets/view_form/view_form_page.dart index 702374e..e58d5b0 100644 --- a/lib/widgets/view_form_page.dart +++ b/lib/widgets/view_form/view_form_page.dart @@ -1,11 +1,11 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:smoke_cess_app/services/pages_service.dart'; -import 'package:smoke_cess_app/widgets/round_button_widget.dart'; -import '../providers/input_provider.dart'; -import '../providers/page_provider.dart'; -import '../providers/tasks_provider.dart'; -import 'popup_for_task_done.dart'; +import 'package:smoke_cess_app/widgets/buttons/round_button_widget.dart'; +import 'package:smoke_cess_app/providers/input_provider.dart'; +import 'package:smoke_cess_app/providers/page_provider.dart'; +import 'package:smoke_cess_app/providers/tasks_provider.dart'; +import 'package:smoke_cess_app/widgets/popup/popup_for_task_done.dart'; class ViewFormPage extends StatelessWidget { final Widget form; diff --git a/lib/widgets/workout_form.dart b/lib/widgets/view_form/workout_form.dart similarity index 79% rename from lib/widgets/workout_form.dart rename to lib/widgets/view_form/workout_form.dart index 3e75882..8a678c1 100644 --- a/lib/widgets/workout_form.dart +++ b/lib/widgets/view_form/workout_form.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:smoke_cess_app/providers/audio_provider.dart'; -import '../providers/timer_provider.dart'; -import '../providers/workout_provider.dart'; -import 'mute_button.dart'; -import 'workout_timer_widget.dart'; +import 'package:smoke_cess_app/providers/timer_provider.dart'; +import 'package:smoke_cess_app/providers/workout_provider.dart'; +import 'package:smoke_cess_app/widgets/buttons/mute_button.dart'; +import 'package:smoke_cess_app/widgets/workout_timer_widget.dart'; class WorkoutForm extends StatelessWidget { WorkoutForm({super.key}); diff --git a/lib/widgets/workout_view.dart b/lib/widgets/view_form/workout_view.dart similarity index 94% rename from lib/widgets/workout_view.dart rename to lib/widgets/view_form/workout_view.dart index d0deb4d..8bc2fef 100644 --- a/lib/widgets/workout_view.dart +++ b/lib/widgets/view_form/workout_view.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:smoke_cess_app/models/workout.dart'; import 'package:syncfusion_flutter_charts/charts.dart'; -import '../providers/tasks_provider.dart'; +import 'package:smoke_cess_app/providers/tasks_provider.dart'; class WorkoutView extends StatelessWidget { const WorkoutView({super.key}); diff --git a/lib/widgets/workout_timer_widget.dart b/lib/widgets/workout_timer_widget.dart index 72a8e50..51e7f0c 100644 --- a/lib/widgets/workout_timer_widget.dart +++ b/lib/widgets/workout_timer_widget.dart @@ -4,13 +4,13 @@ import 'package:awesome_dialog/awesome_dialog.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import '../providers/page_provider.dart'; -import '../providers/tasks_provider.dart'; -import '../providers/workout_provider.dart'; -import '../services/pages_service.dart'; -import '../widgets/timer_widget.dart'; -import '../providers/timer_provider.dart'; -import 'popup_for_start_and_stop.dart'; +import 'package:smoke_cess_app/providers/page_provider.dart'; +import 'package:smoke_cess_app/providers/tasks_provider.dart'; +import 'package:smoke_cess_app/providers/workout_provider.dart'; +import 'package:smoke_cess_app/services/pages_service.dart'; +import 'package:smoke_cess_app/widgets/timer_widget.dart'; +import 'package:smoke_cess_app/providers/timer_provider.dart'; +import 'package:smoke_cess_app/widgets/popup/popup_for_start_and_stop.dart'; class WorkoutTimerWidget extends StatelessWidget { const WorkoutTimerWidget({super.key});