From 19f9dd9b3bd1ee41f513dfeb14a4f77ddba68f60 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Thu, 30 Nov 2023 10:37:50 +1300 Subject: [PATCH] Remove circular progress indicators Our app is so fast these will look like bugs to flicker in front of the user. --- lib/plans_page.dart | 3 +-- lib/set_list.dart | 4 ---- lib/settings_page.dart | 3 +-- lib/start_plan.dart | 11 +++++++++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/plans_page.dart b/lib/plans_page.dart index fd5a4df..1273fb6 100644 --- a/lib/plans_page.dart +++ b/lib/plans_page.dart @@ -76,8 +76,7 @@ class _PlansPageState extends State<_PlansPage> { )), ); - if (plans == null) - return const Center(child: CircularProgressIndicator()); + if (plans == null) return Container(); return PlanList(plans: plans); }), diff --git a/lib/set_list.dart b/lib/set_list.dart index c60817b..5a92936 100644 --- a/lib/set_list.dart +++ b/lib/set_list.dart @@ -69,10 +69,6 @@ class _SetList extends State { pagingController: pagingController, gymSet: gymSet, ), - firstPageProgressIndicatorBuilder: (_) => - const Center(child: CircularProgressIndicator()), - newPageProgressIndicatorBuilder: (_) => - const Center(child: CircularProgressIndicator()), ), ), floatingActionButton: FloatingActionButton( diff --git a/lib/settings_page.dart b/lib/settings_page.dart index 180a76a..06fe184 100644 --- a/lib/settings_page.dart +++ b/lib/settings_page.dart @@ -53,8 +53,7 @@ class _SettingsPageState extends State<_SettingsPage> { final settings = snapshot.data; print('build: $settings'); - if (settings == null) - return const Center(child: CircularProgressIndicator()); + if (settings == null) return Container(); final filteredItems = [ {'title': 'Alarm', 'value': settings.alarm}, diff --git a/lib/start_plan.dart b/lib/start_plan.dart index fa490ad..9c538da 100644 --- a/lib/start_plan.dart +++ b/lib/start_plan.dart @@ -112,8 +112,7 @@ class _StartPlanState extends State { }, icon: const Icon(Icons.edit))); - if (totals.isEmpty || counts.isEmpty) - return const CircularProgressIndicator(); + if (totals.isEmpty || counts.isEmpty) return Container(); return SafeArea( child: Scaffold( @@ -156,11 +155,19 @@ class _StartPlanState extends State { decoration: const InputDecoration(labelText: 'Reps'), controller: repsController, focusNode: repsNode, + onTap: () { + repsController.selection = TextSelection( + baseOffset: 0, extentOffset: repsController.text.length); + }, ), TextFormField( decoration: const InputDecoration(labelText: 'Weight'), controller: weightController, focusNode: weightNode, + onTap: () { + weightController.selection = TextSelection( + baseOffset: 0, extentOffset: weightController.text.length); + }, ), ], ),