From c41c19b46967edf08269cf530ed0a9e18f1d5a04 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Wed, 26 Feb 2025 18:00:41 +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 +- .../customer_pages/customer_main_page.dart | 97 +++++--- .../customer_pages/customer_search_page.dart | 209 ++++++++++-------- lib/tables/stocks.dart | 4 +- lib/widgets/consultation_widget.dart | 49 ++++ lib/widgets/menu_widget2.dart | 5 +- lib/widgets/page_background_widget.dart | 20 +- 10 files changed, 299 insertions(+), 181 deletions(-) create mode 100644 lib/widgets/consultation_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 58cb8a9..066a3f3 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 a8acb05..0b16d50 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 337d09f..dab7851 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 7bc270b..70822a2 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/customer_pages/customer_main_page.dart b/lib/pages/customer_pages/customer_main_page.dart index 0c15396..2d063ca 100644 --- a/lib/pages/customer_pages/customer_main_page.dart +++ b/lib/pages/customer_pages/customer_main_page.dart @@ -2,6 +2,8 @@ import 'package:flutter/material.dart'; import 'package:gap/gap.dart'; import 'package:pharmacy_mobile/auth/auth_service.dart'; import 'package:pharmacy_mobile/widgets/button_widget.dart'; +import 'package:pharmacy_mobile/widgets/consultation_widget.dart'; +import 'package:pharmacy_mobile/widgets/logo_widget.dart'; import 'package:pharmacy_mobile/widgets/menu_widget2.dart'; import 'package:pharmacy_mobile/widgets/page_background_widget.dart'; import 'package:pharmacy_mobile/widgets/snackbar_widget.dart'; @@ -29,31 +31,76 @@ class _CustomerMainPageState extends State { Widget build(BuildContext context) { return Scaffold( body: PageBackgroundWidget( + dark: true, child: Column( - children: [ - Column( - children: [ - const Gap(96), - const TitleWidget( - firstTextSize: 14, - secondTextSize: 24, - logoSize: 90, - ), - const Gap(32), - const TextWidget(text: 'Menu'), - const Gap(16), - MenuWidget( - // icon: FontAwesomeIcons.diagramNext, - text: 'Diagnose by ', - description: 'aaa', - onPressed: () => {context.push('/deletestock')}, - color: 'green', - ), - const Gap(32), - ButtonWidget(text: 'Log Out', onPressed: signOut) - ], - ) - ], - ))); + children: [ + Column( + children: [ + const Gap(96), + const Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Gap(16), + LogoWidget(size: 56), + ], + ), + const Gap(16), + const Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Gap(16), + TextWidget( + text: 'Pharmacist Consultation', + title: true, + size: 14, + ), + ], + ), + const Gap(8), + ConsultationWidget(name: 'Ofelia Franco-Alcala, RPh'), + MenuWidget( + // icon: FontAwesomeIcons.diagramNext, + text: 'Ofelia Franco-Alcala, RPh', + description: 'aaa', + onPressed: () => {context.push('/deletestock')}, + color: 'green', + width: MediaQuery.of(context).size.width - 32, + ), + const Gap(8), + MenuWidget( + // icon: FontAwesomeIcons.diagramNext, + text: 'Pamela Claire Alcala, RPh', + description: 'aaa', + onPressed: () => {context.push('/deletestock')}, + color: 'green', + width: MediaQuery.of(context).size.width - 32, + ), + const Gap(16), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + const Gap(16), + const TextWidget( + text: 'Doctor Consultation', + title: true, + size: 14, + ), + ], + ), + const Gap(8), + MenuWidget( + // icon: FontAwesomeIcons.diagramNext, + text: 'Floherna Franco-Diccion, PhD', + description: 'aaa', + onPressed: () => {context.push('/deletestock')}, + color: 'green', + width: MediaQuery.of(context).size.width - 32, + ), + const Gap(32), + ButtonWidget(text: 'Log Out', onPressed: signOut) + ], + ) + ], + ))); } } diff --git a/lib/pages/customer_pages/customer_search_page.dart b/lib/pages/customer_pages/customer_search_page.dart index 50528e3..a710897 100644 --- a/lib/pages/customer_pages/customer_search_page.dart +++ b/lib/pages/customer_pages/customer_search_page.dart @@ -3,10 +3,12 @@ import 'dart:developer'; import 'package:flutter/material.dart'; import 'package:gap/gap.dart'; import 'package:pharmacy_mobile/tables/ref_medicines.dart'; +import 'package:pharmacy_mobile/tables/stocks.dart'; import 'package:pharmacy_mobile/tables/storage.dart'; import 'package:pharmacy_mobile/widgets/button_widget.dart'; import 'package:pharmacy_mobile/widgets/input_widget.dart'; import 'package:pharmacy_mobile/widgets/item_card_widget.dart'; +import 'package:pharmacy_mobile/widgets/logo_widget.dart'; import 'package:pharmacy_mobile/widgets/page_background_widget.dart'; import 'package:pharmacy_mobile/widgets/text_widget.dart'; import 'package:pharmacy_mobile/widgets/title_widget.dart'; @@ -23,18 +25,20 @@ class CustomerSearchPage extends StatefulWidget { class _CustomerSearchPageState extends State { final _searchController = TextEditingController(); final _storage = Storage(); + final _stocks = Stocks(); // final _refMedicines = RefMedicines(); late String imageUrl = ''; - // List imageUrl = []; + late List _stockList = []; - void getURL() async { - final image = await _storage.getPublicURL('ref_medicines_images', 'cb6eafdb-d86f-460a-9571-44446570d4cb.webp'); + Future _getURL() async { + final image = await _storage.getPublicURL('ref_medicines_images', 'a3e430fe-86c1-4d46-9c6a-aed2dae57fef.webp'); setState(() { imageUrl = image; }); + } - // final meds = await _refMedicines.getList2(); - // log(meds.toString()); + Future _getAllStocks() async { + _stockList = await _stocks.getList(); } // void getURLs() async { @@ -57,9 +61,14 @@ class _CustomerSearchPageState extends State { void _filterList() {} + void autoRun() async { + await _getAllStocks(); + await _getURL(); + } + @override void initState() { - getURL(); + autoRun(); super.initState(); } @@ -67,6 +76,7 @@ class _CustomerSearchPageState extends State { void dispose() { _searchController.dispose(); imageUrl = ''; + _stockList = []; super.dispose(); } @@ -76,103 +86,106 @@ class _CustomerSearchPageState extends State { return Scaffold( body: PageBackgroundWidget( + dark: true, // height: MediaQuery.of(context).size.height * 2, child: Column( - children: [ - Column( - children: [ - const Gap(96), - const TitleWidget( - firstTextSize: 14, - secondTextSize: 24, - logoSize: 90, - ), - const Gap(32), - Container( - padding: EdgeInsets.only(left: 64, right: 64), - child: Column( - children: [ - InputWidget( - label: '', - controller: _searchController, - placeholder: 'Search for medicine', - ), - // const Gap(8), - // ButtonWidget( - // text: 'Search', - // onPressed: _filterList, - // width: 160, - // ) - ], - ), - ), - const Gap(32), - // Center( - // child: imageUrl.isNotEmpty - // ? ClipRRect( - // borderRadius: BorderRadius.circular(12), // Add your desired border radius here - // child: Image.network(imageUrl, - // fit: BoxFit.cover, - // width: 250, - // height: 250, - // cacheWidth: (250 * MediaQuery.of(context).devicePixelRatio).round())) - // : const CircularProgressIndicator( - // color: Colors.white, - // strokeWidth: 4, - // padding: EdgeInsets.all(8), - // ), - // ) - Column( children: [ - Padding( - padding: const EdgeInsets.fromLTRB(0, 8, 0, 8), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - ItemCardWidget( - imageUrl: imageUrl, - text: 'sample', - price: 500, - quantity: 15, + Column( + children: [ + const Gap(96), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + const Gap(16), + const LogoWidget(size: 56), + ], + ), + const Gap(8), + Container( + padding: EdgeInsets.only(left: 64, right: 64), + child: Column( + children: [ + InputWidget( + label: '', + controller: _searchController, + placeholder: 'Search for medicine', + ), + // const Gap(8), + // ButtonWidget( + // text: 'Search', + // onPressed: _filterList, + // width: 160, + // ) + ], ), - ItemCardWidget( - imageUrl: imageUrl, - text: 'sample', - price: 20, - quantity: 85, - ), - ], - ), + ), + const Gap(32), + // Center( + // child: imageUrl.isNotEmpty + // ? ClipRRect( + // borderRadius: BorderRadius.circular(12), // Add your desired border radius here + // child: Image.network(imageUrl, + // fit: BoxFit.cover, + // width: 250, + // height: 250, + // cacheWidth: (250 * MediaQuery.of(context).devicePixelRatio).round())) + // : const CircularProgressIndicator( + // color: Colors.white, + // strokeWidth: 4, + // padding: EdgeInsets.all(8), + // ), + // ) + Column( + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(0, 8, 0, 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + ItemCardWidget( + imageUrl: imageUrl, + text: 'sample', + price: 500, + quantity: 15, + ), + ItemCardWidget( + imageUrl: imageUrl, + text: 'sample', + price: 20, + quantity: 85, + ), + ], + ), + ) + ], + ), + Column( + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(0, 8, 0, 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + ItemCardWidget( + imageUrl: imageUrl, + text: 'sample', + price: 500, + quantity: 15, + ), + ItemCardWidget( + imageUrl: imageUrl, + text: 'sample', + price: 20, + quantity: 85, + ), + ], + ), + ) + ], + ) + ], ) ], - ), - Column( - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(0, 8, 0, 8), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - ItemCardWidget( - imageUrl: imageUrl, - text: 'sample', - price: 500, - quantity: 15, - ), - ItemCardWidget( - imageUrl: imageUrl, - text: 'sample', - price: 20, - quantity: 85, - ), - ], - ), - ) - ], - ) - ], - ) - ], - ))); + ))); } } diff --git a/lib/tables/stocks.dart b/lib/tables/stocks.dart index af497d9..ff4439e 100644 --- a/lib/tables/stocks.dart +++ b/lib/tables/stocks.dart @@ -9,13 +9,15 @@ class Stocks { Future getList() async { List> stockData = []; - final data = await _supabase.from('stocks').select('ref_medicines(medicine_name), expiration_date, quantity'); + final data = + await _supabase.from('stocks').select('ref_medicines(medicine_name), expiration_date, quantity, price'); for (var item in data) { stockData.add({ 'medicine_name': item['ref_medicines']['medicine_name'], 'quantity': item['quantity'].toString(), 'expiration_date': item['expiration_date'], + 'price': item['price'], }); } diff --git a/lib/widgets/consultation_widget.dart b/lib/widgets/consultation_widget.dart new file mode 100644 index 0000000..d94d4af --- /dev/null +++ b/lib/widgets/consultation_widget.dart @@ -0,0 +1,49 @@ +import 'package:flutter/material.dart'; +import 'package:gap/gap.dart'; +import 'package:pharmacy_mobile/widgets/text_widget.dart'; + +class ConsultationWidget extends StatelessWidget { + final String name; + // final IconData? icon; + final VoidCallback? onTap; + final double? width; + // final String? color; + // final String description; + + const ConsultationWidget({super.key, required this.name, this.onTap, this.width}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + width: width ?? MediaQuery.of(context).size.width - 96, + padding: const EdgeInsets.symmetric(vertical: 16), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + // gradient: LinearGradient( + // colors: Colors.white, + // begin: Alignment.centerLeft, + // end: Alignment.centerRight, + // ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + const Gap(32), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + TextWidget( + text: name, + size: 18, + bold: true, + ), + ], + ), + ], + ), + ), + ); + } +} diff --git a/lib/widgets/menu_widget2.dart b/lib/widgets/menu_widget2.dart index 1d46db4..3fdb86d 100644 --- a/lib/widgets/menu_widget2.dart +++ b/lib/widgets/menu_widget2.dart @@ -9,6 +9,7 @@ class MenuWidget extends StatelessWidget { final VoidCallback? onPressed; final String? color; final String description; + final double? width; final List blue = [ const Color.fromRGBO(59, 101, 156, 0.8), @@ -34,14 +35,14 @@ class MenuWidget extends StatelessWidget { const Color.fromRGBO(104, 156, 59, 0.8), ]; - MenuWidget({super.key, required this.text, required this.description, this.icon, this.onPressed, this.color}); + MenuWidget({super.key, required this.text, required this.description, this.icon, this.onPressed, this.color, this.width}); @override Widget build(BuildContext context) { return GestureDetector( onTap: onPressed, child: Container( - width: MediaQuery.of(context).size.width - 96, + width: width ?? MediaQuery.of(context).size.width - 96, padding: const EdgeInsets.symmetric(vertical: 16), decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), diff --git a/lib/widgets/page_background_widget.dart b/lib/widgets/page_background_widget.dart index a7ba5c1..941f25a 100644 --- a/lib/widgets/page_background_widget.dart +++ b/lib/widgets/page_background_widget.dart @@ -4,8 +4,9 @@ class PageBackgroundWidget extends StatelessWidget { final Widget child; final String? page; final double? height; + final bool? dark; - const PageBackgroundWidget({super.key, required this.child, this.page, this.height}); + const PageBackgroundWidget({super.key, required this.child, this.page, this.height, this.dark}); @override Widget build(BuildContext context) { @@ -27,14 +28,19 @@ class PageBackgroundWidget extends StatelessWidget { ), fit: BoxFit.cover, // Ensures the background covers the entire container alignment: Alignment.center, - opacity: 0.3, // Adjusts the opacity as needed + opacity: dark == true ? 0.1 : 0.3, // Adjusts the opacity as needed ), - gradient: const RadialGradient( + gradient: RadialGradient( tileMode: TileMode.clamp, - colors: [ - Color.fromRGBO(26, 8, 25, 1), - Color.fromRGBO(60, 22, 57, 1), - ], + colors: dark == true + ? [ + Color.fromRGBO(19, 8, 26, 1), + Color.fromRGBO(43, 22, 60, 1), + ] + : [ + Color.fromRGBO(26, 8, 25, 1), + Color.fromRGBO(60, 22, 57, 1), + ], ), ), child: Center(