From 9d5a392db38aa184fd377dffd5c9f68b6a1256a8 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Wed, 26 Feb 2025 15:23:42 +0800 Subject: [PATCH] update --- .../arm64-v8a/configure_fingerprint.bin | 24 +-- .../armeabi-v7a/configure_fingerprint.bin | 24 +-- .../14495r4k/x86/configure_fingerprint.bin | 24 +-- .../14495r4k/x86_64/configure_fingerprint.bin | 24 +-- lib/pages/index_page.dart | 73 +++++---- lib/pages/main_page.dart | 149 +++++++++--------- lib/widgets/pull_refresh_widget.dart | 35 ++++ pubspec.lock | 8 + pubspec.yaml | 1 + 9 files changed, 206 insertions(+), 156 deletions(-) create mode 100644 lib/widgets/pull_refresh_widget.dart diff --git a/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/configure_fingerprint.bin b/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/configure_fingerprint.bin index 3e52768..58cb8a9 100644 --- a/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/configure_fingerprint.bin +++ b/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Log  /home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  퇏2 +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ­2  퇏2 ~ -|/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/android_gradle_build.json  2 퇏2 +|/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/android_gradle_build.json  ­2 퇏2  -/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/android_gradle_build_mini.json  2 퇏2r +/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/android_gradle_build_mini.json  ­2 퇏2r p -n/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/build.ninja  2ߺ 퇏2v +n/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/build.ninja  ­2ߺ 퇏2v t -r/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/build.ninja.txt  2{ +r/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/build.ninja.txt  ­2{ y -w/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/build_file_index.txt  2 ^ 퇏2| +w/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/build_file_index.txt  ­2 ^ 퇏2| z -x/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/compile_commands.json  2 +x/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/compile_commands.json  ­2 ~ -|/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/compile_commands.json.bin  2  +|/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/compile_commands.json.bin  ­2   -/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/metadata_generation_command.txt  2 +/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/metadata_generation_command.txt  ­2  퇏2y w -u/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/prefab_config.json  2  ( 퇏2~ +u/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/prefab_config.json  ­2  ( 퇏2~ | -z/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/symbol_folder_index.txt  2  q 퇏2b +z/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/arm64-v8a/symbol_folder_index.txt  ­2  q 퇏2b ` -^/home/patrick/fvm/versions/3.29.0/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  2  ȼ2 \ No newline at end of file +^/home/patrick/fvm/versions/3.29.0/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  ­2  ȼ2 \ No newline at end of file diff --git a/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/configure_fingerprint.bin b/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/configure_fingerprint.bin index 59a4c26..a8acb05 100644 --- a/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/configure_fingerprint.bin +++ b/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Log  /home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  2 +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ­2  2  -~/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/android_gradle_build.json  2 2 +~/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/android_gradle_build.json  ­2 2  -/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/android_gradle_build_mini.json  2 2t +/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/android_gradle_build_mini.json  ­2 2t r -p/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/build.ninja  2 2x +p/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/build.ninja  ­2 2x v -t/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/build.ninja.txt  2} +t/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/build.ninja.txt  ­2} { -y/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/build_file_index.txt  2 ^ 2~ +y/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/build_file_index.txt  ­2 ^ 2~ | -z/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/compile_commands.json  2 +z/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/compile_commands.json  ­2  -~/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/compile_commands.json.bin  2  +~/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/compile_commands.json.bin  ­2   -/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/metadata_generation_command.txt  2 +/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/metadata_generation_command.txt  ­2  2{ y -w/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/prefab_config.json  2  ( 2 +w/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/prefab_config.json  ­2  ( 2 ~ -|/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/symbol_folder_index.txt  2  s 2b +|/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/armeabi-v7a/symbol_folder_index.txt  ­2  s 2b ` -^/home/patrick/fvm/versions/3.29.0/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  2  ȼ2 \ No newline at end of file +^/home/patrick/fvm/versions/3.29.0/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  ­2  ȼ2 \ No newline at end of file diff --git a/android/app/.cxx/RelWithDebInfo/14495r4k/x86/configure_fingerprint.bin b/android/app/.cxx/RelWithDebInfo/14495r4k/x86/configure_fingerprint.bin index 3ff7236..337d09f 100644 --- a/android/app/.cxx/RelWithDebInfo/14495r4k/x86/configure_fingerprint.bin +++ b/android/app/.cxx/RelWithDebInfo/14495r4k/x86/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Log} { y/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  2z +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ­2  2z x -v/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/android_gradle_build.json  2 2 +v/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/android_gradle_build.json  ­2 2 } -{/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/android_gradle_build_mini.json  2 2l +{/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/android_gradle_build_mini.json  ­2 2l j -h/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/build.ninja  2 2p +h/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/build.ninja  ­2 2p n -l/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/build.ninja.txt  2u +l/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/build.ninja.txt  ­2u s -q/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/build_file_index.txt  2 ^ 2v +q/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/build_file_index.txt  ­2 ^ 2v t -r/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/compile_commands.json  2z +r/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/compile_commands.json  ­2z x -v/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/compile_commands.json.bin  2  +v/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/compile_commands.json.bin  ­2  ~ -|/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/metadata_generation_command.txt  2 +|/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/metadata_generation_command.txt  ­2  2s q -o/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/prefab_config.json  2  ( 2x +o/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/prefab_config.json  ­2  ( 2x v -t/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/symbol_folder_index.txt  2  k 2b +t/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86/symbol_folder_index.txt  ­2  k 2b ` -^/home/patrick/fvm/versions/3.29.0/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  2  ȼ2 \ No newline at end of file +^/home/patrick/fvm/versions/3.29.0/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  ­2  ȼ2 \ No newline at end of file diff --git a/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/configure_fingerprint.bin b/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/configure_fingerprint.bin index 18210e7..7bc270b 100644 --- a/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/configure_fingerprint.bin +++ b/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Log ~ |/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  2} +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  í2  2} { -y/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/android_gradle_build.json  2 2 +y/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/android_gradle_build.json  í2 2  -~/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/android_gradle_build_mini.json  2 2o +~/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/android_gradle_build_mini.json  í2 2o m -k/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/build.ninja  2к 2s +k/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/build.ninja  í2к 2s q -o/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/build.ninja.txt  2x +o/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/build.ninja.txt  í2x v -t/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/build_file_index.txt  2 ^ 2y +t/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/build_file_index.txt  í2 ^ 2y w -u/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/compile_commands.json  2} +u/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/compile_commands.json  í2} { -y/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/compile_commands.json.bin  2  +y/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/compile_commands.json.bin  í2   -/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/metadata_generation_command.txt  2 +/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/metadata_generation_command.txt  í2  2v t -r/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/prefab_config.json  2  ( 2{ +r/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/prefab_config.json  í2  ( 2{ y -w/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/symbol_folder_index.txt  2  n 2b +w/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/RelWithDebInfo/14495r4k/x86_64/symbol_folder_index.txt  í2  n 2b ` -^/home/patrick/fvm/versions/3.29.0/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  2  ȼ2 \ No newline at end of file +^/home/patrick/fvm/versions/3.29.0/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt  í2  ȼ2 \ No newline at end of file diff --git a/lib/pages/index_page.dart b/lib/pages/index_page.dart index 20f3a7c..3a0a402 100644 --- a/lib/pages/index_page.dart +++ b/lib/pages/index_page.dart @@ -3,6 +3,7 @@ import 'package:go_router/go_router.dart'; import 'package:gap/gap.dart'; import 'package:pharmacy_mobile/widgets/button_widget.dart'; import 'package:pharmacy_mobile/widgets/page_background_widget.dart'; +import 'package:pharmacy_mobile/widgets/pull_refresh_widget.dart'; import 'package:pharmacy_mobile/widgets/slogan_widget.dart'; import 'package:pharmacy_mobile/widgets/text_widget.dart'; import 'package:pharmacy_mobile/widgets/title_widget.dart'; @@ -22,41 +23,43 @@ class IndexPage extends StatelessWidget { return Scaffold( resizeToAvoidBottomInset: false, - body: PageBackgroundWidget( - child: Column( - children: [ - const Gap(88), - const TitleWidget( - firstTextSize: 24, - secondTextSize: 40, - logoSize: 124, - ), - const Gap(32), - Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 38, 0), - child: Image.asset('assets/ph_logo.webp', - width: 192, cacheWidth: (192 * MediaQuery.of(context).devicePixelRatio).round()), - ), - const Gap(64), - ButtonWidget(text: 'Login', onPressed: gotoLogin), - const Gap(8), - ButtonWidget(text: 'Register', onPressed: gotoRegister, outline: true), - const Gap(32), - const SloganWidget(), - const Gap(32), - const MaxGap(500), - const TextWidget( - text: 'Copyright © 2025 - Ofelia Franco-Alcala Pharmacy', - size: 10, - bold: true, - ), - const TextWidget( - text: 'Developed By: Pat Alcala', - size: 8, - opacity: 0.8, - ), - const Gap(16), - ], + body: PullRefreshWidget( + child: PageBackgroundWidget( + child: Column( + children: [ + const Gap(88), + const TitleWidget( + firstTextSize: 24, + secondTextSize: 40, + logoSize: 124, + ), + const Gap(32), + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 38, 0), + child: Image.asset('assets/ph_logo.webp', + width: 192, cacheWidth: (192 * MediaQuery.of(context).devicePixelRatio).round()), + ), + const Gap(64), + ButtonWidget(text: 'Login', onPressed: gotoLogin), + const Gap(8), + ButtonWidget(text: 'Register', onPressed: gotoRegister, outline: true), + const Gap(32), + const SloganWidget(), + const Gap(32), + const MaxGap(500), + const TextWidget( + text: 'Copyright © 2025 - Ofelia Franco-Alcala Pharmacy', + size: 10, + bold: true, + ), + const TextWidget( + text: 'Developed By: Pat Alcala', + size: 8, + opacity: 0.8, + ), + const Gap(16), + ], + ), ), )); } diff --git a/lib/pages/main_page.dart b/lib/pages/main_page.dart index e1a9cb5..54da789 100644 --- a/lib/pages/main_page.dart +++ b/lib/pages/main_page.dart @@ -6,6 +6,7 @@ import 'package:pharmacy_mobile/auth/auth_service.dart'; import 'package:pharmacy_mobile/widgets/button_widget.dart'; import 'package:pharmacy_mobile/widgets/menu_widget2.dart'; import 'package:pharmacy_mobile/widgets/page_background_widget.dart'; +import 'package:pharmacy_mobile/widgets/pull_refresh_widget.dart'; import 'package:pharmacy_mobile/widgets/snackbar_widget.dart'; import 'package:pharmacy_mobile/widgets/text_widget.dart'; import 'package:pharmacy_mobile/widgets/title_widget.dart'; @@ -31,81 +32,83 @@ class _MainPageState extends State { canPop: false, child: Scaffold( resizeToAvoidBottomInset: false, - body: SingleChildScrollView( - child: PageBackgroundWidget( - height: MediaQuery.of(context).size.height + 400, - page: 'menu', - child: Center( - child: Column( - children: [ - const Gap(96), - const TitleWidget( - firstTextSize: 14, - secondTextSize: 24, - logoSize: 90, - ), - const Gap(32), - const TextWidget( - text: 'Menu', - title: true, - ), - const Gap(16), - MenuWidget( - icon: FontAwesomeIcons.circlePlus, - text: 'Add Type', - description: 'Create a new medical type', - onPressed: () => {context.push('/addtype')}, - color: 'blue', - ), - const Gap(16), - MenuWidget( - icon: FontAwesomeIcons.circlePlus, - text: 'Add Category', - description: 'Create a new medicine category', - onPressed: () => {context.push('/addcategory')}, - color: 'blue', - ), - const Gap(16), - MenuWidget( + body: PullRefreshWidget( + child: SingleChildScrollView( + child: PageBackgroundWidget( + height: MediaQuery.of(context).size.height + 400, + page: 'menu', + child: Center( + child: Column( + children: [ + const Gap(96), + const TitleWidget( + firstTextSize: 14, + secondTextSize: 24, + logoSize: 90, + ), + const Gap(32), + const TextWidget( + text: 'Menu', + title: true, + ), + const Gap(16), + MenuWidget( icon: FontAwesomeIcons.circlePlus, - text: 'Add Generics', - description: 'Add generic name on the list', - onPressed: () => {context.push('/addgenerics')}, - color: 'blue'), - const Gap(32), - MenuWidget( + text: 'Add Type', + description: 'Create a new medical type', + onPressed: () => {context.push('/addtype')}, + color: 'blue', + ), + const Gap(16), + MenuWidget( icon: FontAwesomeIcons.circlePlus, - text: 'Add Medicine', - description: 'Add generic name on the list', - onPressed: () => {context.push('/addmedicines')}, - color: 'green'), - const Gap(16), - MenuWidget( - icon: FontAwesomeIcons.circlePlus, - text: 'Add Stock', - description: 'Add generic name on the list', - onPressed: () => {context.push('/addstock')}, - color: 'green'), - const Gap(32), - MenuWidget( - icon: Icons.delete, - text: 'Remove Stock', - description: 'Add generic name on the list', - onPressed: () => {context.push('/deletestock')}, - color: 'red'), - const Gap(32), - MenuWidget( - icon: FontAwesomeIcons.listCheck, - text: 'List of Stocks', - description: 'Add generic name on the list', - onPressed: () => {context.push('/liststocks')}, - color: 'yellow'), - const Gap(40), - ButtonWidget( - text: 'Logout', - onPressed: signOut, - ) - ], + text: 'Add Category', + description: 'Create a new medicine category', + onPressed: () => {context.push('/addcategory')}, + color: 'blue', + ), + const Gap(16), + MenuWidget( + icon: FontAwesomeIcons.circlePlus, + text: 'Add Generics', + description: 'Add generic name on the list', + onPressed: () => {context.push('/addgenerics')}, + color: 'blue'), + const Gap(32), + MenuWidget( + icon: FontAwesomeIcons.circlePlus, + text: 'Add Medicine', + description: 'Add generic name on the list', + onPressed: () => {context.push('/addmedicines')}, + color: 'green'), + const Gap(16), + MenuWidget( + icon: FontAwesomeIcons.circlePlus, + text: 'Add Stock', + description: 'Add generic name on the list', + onPressed: () => {context.push('/addstock')}, + color: 'green'), + const Gap(32), + MenuWidget( + icon: Icons.delete, + text: 'Remove Stock', + description: 'Add generic name on the list', + onPressed: () => {context.push('/deletestock')}, + color: 'red'), + const Gap(32), + MenuWidget( + icon: FontAwesomeIcons.listCheck, + text: 'List of Stocks', + description: 'Add generic name on the list', + onPressed: () => {context.push('/liststocks')}, + color: 'yellow'), + const Gap(40), + ButtonWidget( + text: 'Logout', + onPressed: signOut, + ) + ], + ), ), ), ), diff --git a/lib/widgets/pull_refresh_widget.dart b/lib/widgets/pull_refresh_widget.dart new file mode 100644 index 0000000..c33422a --- /dev/null +++ b/lib/widgets/pull_refresh_widget.dart @@ -0,0 +1,35 @@ +import 'package:flutter/material.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; + +class PullRefreshWidget extends StatefulWidget { + final Widget child; + const PullRefreshWidget({super.key, required this.child}); + + @override + State createState() => _PullRefreshWidgetState(); +} + +class _PullRefreshWidgetState extends State { + final RefreshController refreshController = RefreshController(initialRefresh: false); + + void onRefresh() async { + await Future.delayed(Duration(milliseconds: 1000)); + refreshController.refreshCompleted(); + } + + void onLoading() async { + await Future.delayed(Duration(milliseconds: 1000)); + if (mounted) setState(() {}); + refreshController.loadComplete(); + } + + @override + Widget build(BuildContext context) { + return SmartRefresher( + controller: refreshController, + enablePullDown: true, + onRefresh: onRefresh, + onLoading: onLoading, + child: widget.child); + } +} diff --git a/pubspec.lock b/pubspec.lock index 99147d6..02ee08f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -744,6 +744,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.4.1" + pull_to_refresh: + dependency: "direct main" + description: + name: pull_to_refresh + sha256: bbadd5a931837b57739cf08736bea63167e284e71fb23b218c8c9a6e042aad12 + url: "https://pub.dev" + source: hosted + version: "2.0.0" realtime_client: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index b0e9ead..246b3f6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,6 +24,7 @@ dependencies: flutter_image_compress: ^2.4.0 simple_barcode_scanner: ^0.3.0 lazyxchacha: ^1.0.1 + pull_to_refresh: ^2.0.0 dev_dependencies: flutter_test: