update
This commit is contained in:
parent
27f00e43a7
commit
3572f90b24
24 changed files with 290 additions and 257 deletions
|
|
@ -2,27 +2,27 @@ C/C++ Structured Logz
|
|||
x
|
||||
v/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/additional_project_files.txtC
|
||||
A
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint ß¶§ÕÔ2 ž•‚ŽÑ2w
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint Ɖ<EFBFBD>×Ô2 ž•‚ŽÑ2w
|
||||
u
|
||||
s/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/android_gradle_build.json ß¶§ÕÔ2Í Ç•‚ŽÑ2|
|
||||
s/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/android_gradle_build.json Ɖ<EFBFBD>×Ô2Í Ç•‚ŽÑ2|
|
||||
z
|
||||
x/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/android_gradle_build_mini.json ß¶§ÕÔ2æ ò•‚ŽÑ2i
|
||||
x/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/android_gradle_build_mini.json Ɖ<EFBFBD>×Ô2æ ò•‚ŽÑ2i
|
||||
g
|
||||
e/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/build.ninja à¶§ÕÔ2 º ¾”‚ŽÑ2m
|
||||
e/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/build.ninja Ɖ<EFBFBD>×Ô2 º ¾”‚ŽÑ2m
|
||||
k
|
||||
i/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/build.ninja.txt à¶§ÕÔ2r
|
||||
i/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/build.ninja.txt Ɖ<EFBFBD>×Ô2r
|
||||
p
|
||||
n/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/build_file_index.txt à¶§ÕÔ2
^ ô•‚ŽÑ2s
|
||||
n/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/build_file_index.txt Ɖ<EFBFBD>×Ô2
^ ô•‚ŽÑ2s
|
||||
q
|
||||
o/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/compile_commands.json à¶§ÕÔ2w
|
||||
o/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/compile_commands.json lj<EFBFBD>×Ô2w
|
||||
u
|
||||
s/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/compile_commands.json.bin à¶§ÕÔ2 }
|
||||
s/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/compile_commands.json.bin lj<EFBFBD>×Ô2 }
|
||||
{
|
||||
y/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/metadata_generation_command.txt à¶§ÕÔ2
|
||||
y/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/metadata_generation_command.txt lj<EFBFBD>×Ô2
|
||||
à ô•‚ŽÑ2p
|
||||
n
|
||||
l/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/prefab_config.json à¶§ÕÔ2
( ô•‚ŽÑ2u
|
||||
l/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/prefab_config.json lj<EFBFBD>×Ô2
( ô•‚ŽÑ2u
|
||||
s
|
||||
q/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/symbol_folder_index.txt à¶§ÕÔ2
h ô•‚ŽÑ2b
|
||||
q/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/arm64-v8a/symbol_folder_index.txt lj<EFBFBD>×Ô2
h ô•‚ŽÑ2b
|
||||
`
|
||||
^/home/patrick/fvm/versions/3.29.0/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt à¶§ÕÔ2
¤ ˆÈ¼<C388>Ñ2
|
||||
^/home/patrick/fvm/versions/3.29.0/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt lj<EFBFBD>×Ô2
¤ ˆÈ¼<C388>Ñ2
|
||||
|
|
@ -2,27 +2,27 @@ C/C++ Structured Log|
|
|||
z
|
||||
x/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/additional_project_files.txtC
|
||||
A
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint ÷§ÕÔ2 ÅÑ2y
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint ͉<EFBFBD>×Ô2 ÅÑ2y
|
||||
w
|
||||
u/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/android_gradle_build.json ÷§ÕÔ2Ñ Æî‚ŽÑ2~
|
||||
u/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/android_gradle_build.json ͉<EFBFBD>×Ô2Ñ Æî‚ŽÑ2~
|
||||
|
|
||||
z/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/android_gradle_build_mini.json ÷§ÕÔ2ê ÇÑ2k
|
||||
z/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/android_gradle_build_mini.json ͉<EFBFBD>×Ô2ê ÇÑ2k
|
||||
i
|
||||
g/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/build.ninja ÷§ÕÔ2ªº ¼î‚ŽÑ2o
|
||||
g/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/build.ninja ͉<EFBFBD>×Ô2ªº ¼î‚ŽÑ2o
|
||||
m
|
||||
k/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/build.ninja.txt ÷§ÕÔ2t
|
||||
k/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/build.ninja.txt ͉<EFBFBD>×Ô2t
|
||||
r
|
||||
p/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/build_file_index.txt ÷§ÕÔ2
^ ÈÑ2u
|
||||
p/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/build_file_index.txt ͉<EFBFBD>×Ô2
^ ÈÑ2u
|
||||
s
|
||||
q/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/compile_commands.json ÷§ÕÔ2y
|
||||
q/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/compile_commands.json ͉<EFBFBD>×Ô2y
|
||||
w
|
||||
u/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/compile_commands.json.bin ÷§ÕÔ2
|
||||
u/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/compile_commands.json.bin ͉<EFBFBD>×Ô2
|
||||
}
|
||||
{/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/metadata_generation_command.txt ÷§ÕÔ2
|
||||
{/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/metadata_generation_command.txt ͉<EFBFBD>×Ô2
|
||||
Í ÈÑ2r
|
||||
p
|
||||
n/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/prefab_config.json ÷§ÕÔ2
( ÈÑ2w
|
||||
n/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/prefab_config.json ͉<EFBFBD>×Ô2
( ÈÑ2w
|
||||
u
|
||||
s/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/symbol_folder_index.txt Ä·§ÕÔ2
j ÈÑ2b
|
||||
s/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/armeabi-v7a/symbol_folder_index.txt ͉<EFBFBD>×Ô2
j ÈÑ2b
|
||||
`
|
||||
^/home/patrick/fvm/versions/3.29.0/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt Ä·§ÕÔ2
¤ ˆÈ¼<C388>Ñ2
|
||||
^/home/patrick/fvm/versions/3.29.0/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt ͉<EFBFBD>×Ô2
¤ ˆÈ¼<C388>Ñ2
|
||||
|
|
@ -2,27 +2,27 @@ C/C++ Structured Logt
|
|||
r
|
||||
p/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/additional_project_files.txtC
|
||||
A
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint €¸§ÕÔ2 –ð‚ŽÑ2q
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint Ô‰<EFBFBD>×Ô2 –ð‚ŽÑ2q
|
||||
o
|
||||
m/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/android_gradle_build.json €¸§ÕÔ2Á ˜ð‚ŽÑ2v
|
||||
m/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/android_gradle_build.json Ô‰<EFBFBD>×Ô2Á ˜ð‚ŽÑ2v
|
||||
t
|
||||
r/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/android_gradle_build_mini.json €¸§ÕÔ2Ú šð‚ŽÑ2c
|
||||
r/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/android_gradle_build_mini.json Ô‰<EFBFBD>×Ô2Ú šð‚ŽÑ2c
|
||||
a
|
||||
_/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/build.ninja €¸§ÕÔ2‚º Žð‚ŽÑ2g
|
||||
_/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/build.ninja Ô‰<EFBFBD>×Ô2‚º Žð‚ŽÑ2g
|
||||
e
|
||||
c/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/build.ninja.txt €¸§ÕÔ2l
|
||||
c/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/build.ninja.txt Ô‰<EFBFBD>×Ô2l
|
||||
j
|
||||
h/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/build_file_index.txt €¸§ÕÔ2
^ ›ð‚ŽÑ2m
|
||||
h/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/build_file_index.txt Ô‰<EFBFBD>×Ô2
^ ›ð‚ŽÑ2m
|
||||
k
|
||||
i/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/compile_commands.json €¸§ÕÔ2q
|
||||
i/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/compile_commands.json Ô‰<EFBFBD>×Ô2q
|
||||
o
|
||||
m/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/compile_commands.json.bin €¸§ÕÔ2 w
|
||||
m/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/compile_commands.json.bin Ô‰<EFBFBD>×Ô2 w
|
||||
u
|
||||
s/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/metadata_generation_command.txt €¸§ÕÔ2
|
||||
s/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/metadata_generation_command.txt Ô‰<EFBFBD>×Ô2
|
||||
¥ ›ð‚ŽÑ2j
|
||||
h
|
||||
f/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/prefab_config.json €¸§ÕÔ2
( ›ð‚ŽÑ2o
|
||||
f/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/prefab_config.json Ô‰<EFBFBD>×Ô2
( ›ð‚ŽÑ2o
|
||||
m
|
||||
k/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/symbol_folder_index.txt €¸§ÕÔ2
b ›ð‚ŽÑ2b
|
||||
k/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86/symbol_folder_index.txt Ô‰<EFBFBD>×Ô2
b ›ð‚ŽÑ2b
|
||||
`
|
||||
^/home/patrick/fvm/versions/3.29.0/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt €¸§ÕÔ2
¤ ˆÈ¼<C388>Ñ2
|
||||
^/home/patrick/fvm/versions/3.29.0/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt Ô‰<EFBFBD>×Ô2
¤ ˆÈ¼<C388>Ñ2
|
||||
|
|
@ -2,27 +2,27 @@ C/C++ Structured Logw
|
|||
u
|
||||
s/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/additional_project_files.txtC
|
||||
A
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint Џ§ÕÔ2 ßñ‚ŽÑ2t
|
||||
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint ݉<EFBFBD>×Ô2 ßñ‚ŽÑ2t
|
||||
r
|
||||
p/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/android_gradle_build.json Џ§ÕÔ2Ç àñ‚ŽÑ2y
|
||||
p/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/android_gradle_build.json ݉<EFBFBD>×Ô2Ç àñ‚ŽÑ2y
|
||||
w
|
||||
u/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/android_gradle_build_mini.json Џ§ÕÔ2à áñ‚ŽÑ2f
|
||||
u/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/android_gradle_build_mini.json ݉<EFBFBD>×Ô2à áñ‚ŽÑ2f
|
||||
d
|
||||
b/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/build.ninja Џ§ÕÔ2‘º Úñ‚ŽÑ2j
|
||||
b/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/build.ninja ݉<EFBFBD>×Ô2‘º Úñ‚ŽÑ2j
|
||||
h
|
||||
f/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/build.ninja.txt Џ§ÕÔ2o
|
||||
f/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/build.ninja.txt ݉<EFBFBD>×Ô2o
|
||||
m
|
||||
k/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/build_file_index.txt Џ§ÕÔ2
^ âñ‚ŽÑ2p
|
||||
k/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/build_file_index.txt ݉<EFBFBD>×Ô2
^ âñ‚ŽÑ2p
|
||||
n
|
||||
l/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/compile_commands.json Џ§ÕÔ2t
|
||||
l/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/compile_commands.json ݉<EFBFBD>×Ô2t
|
||||
r
|
||||
p/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/compile_commands.json.bin Џ§ÕÔ2 z
|
||||
p/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/compile_commands.json.bin ݉<EFBFBD>×Ô2 z
|
||||
x
|
||||
v/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/metadata_generation_command.txt Џ§ÕÔ2
|
||||
v/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/metadata_generation_command.txt ݉<EFBFBD>×Ô2
|
||||
´ âñ‚ŽÑ2m
|
||||
k
|
||||
i/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/prefab_config.json Џ§ÕÔ2
( âñ‚ŽÑ2r
|
||||
i/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/prefab_config.json ݉<EFBFBD>×Ô2
( âñ‚ŽÑ2r
|
||||
p
|
||||
n/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/symbol_folder_index.txt Џ§ÕÔ2
e âñ‚ŽÑ2b
|
||||
n/home/patrick/Documents/WebApps/pharmacy_mobile/android/app/.cxx/Debug/k6q1g3c4/x86_64/symbol_folder_index.txt ݉<EFBFBD>×Ô2
e âñ‚ŽÑ2b
|
||||
`
|
||||
^/home/patrick/fvm/versions/3.29.0/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt Џ§ÕÔ2
¤ ˆÈ¼<C388>Ñ2
|
||||
^/home/patrick/fvm/versions/3.29.0/packages/flutter_tools/gradle/src/main/groovy/CMakeLists.txt ݉<EFBFBD>×Ô2
¤ ˆÈ¼<C388>Ñ2
|
||||
10
lib/functions/checkexisting_function.dart
Normal file
10
lib/functions/checkexisting_function.dart
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import 'package:flutter/widgets.dart';
|
||||
|
||||
Future<bool> checkExisting(dynamic table, TextEditingController controller) async {
|
||||
try {
|
||||
final uuid = await table.getUUID(controller.text);
|
||||
return uuid.isNotEmpty;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,3 @@
|
|||
import 'dart:developer';
|
||||
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:internet_connection_checker/internet_connection_checker.dart';
|
||||
|
|
@ -7,7 +5,6 @@ import 'package:pharmacy_mobile/tables/ref_categories.dart';
|
|||
import 'package:pharmacy_mobile/tables/ref_generic_names.dart';
|
||||
import 'package:pharmacy_mobile/widgets/button_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/dropdown_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/form_border_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/form_border_widget2.dart';
|
||||
import 'package:pharmacy_mobile/widgets/input_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
|
||||
|
|
@ -91,8 +88,6 @@ class _AddGenericsPageState extends State<AddGenericsPage> {
|
|||
}
|
||||
|
||||
_categoryUUID = await _refCategories.getUUID(_selectedCategory);
|
||||
log('_selectedCategory: $_selectedCategory');
|
||||
log('_categoryUUID: $_categoryUUID');
|
||||
|
||||
final post = await _refGenericNames.postGeneric(_nameController.text, _categoryUUID);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:internet_connection_checker/internet_connection_checker.dart';
|
||||
import 'package:pharmacy_mobile/functions/checkexisting_function.dart';
|
||||
import 'package:pharmacy_mobile/tables/ref_manufactorers.dart';
|
||||
import 'package:pharmacy_mobile/widgets/button_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/form_border_widget2.dart';
|
||||
import 'package:pharmacy_mobile/widgets/input_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/page_background_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';
|
||||
|
||||
|
|
@ -19,18 +23,46 @@ class _AddManufactorerPageState extends State<AddManufactorerPage> {
|
|||
final _formKey = GlobalKey<FormState>();
|
||||
final _nameController = TextEditingController();
|
||||
final _addressController = TextEditingController();
|
||||
final _refManufactorers = RefManufactorers();
|
||||
|
||||
late bool _isLoading = false;
|
||||
|
||||
void saveManufactorer() async {
|
||||
void _saveManufactorer() async {
|
||||
setState(() => _isLoading = true);
|
||||
|
||||
try {
|
||||
if (await InternetConnectionChecker.instance.hasConnection) {
|
||||
// final existing = await _checkExisting();
|
||||
final existing = await checkExisting(_refManufactorers, _nameController);
|
||||
|
||||
if (existing && mounted) {
|
||||
showNotification(context, 'Manufactorer already listed', false);
|
||||
return;
|
||||
}
|
||||
|
||||
final post = await _refManufactorers.postManufactorer(_nameController.text, _addressController.text);
|
||||
|
||||
if (post && mounted) {
|
||||
showNotification(context, 'Manufactorer added to list', true);
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) {
|
||||
context.push('/main');
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (mounted) {
|
||||
showNotification(context, 'Error: No Internet Connection', false);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
showNotification(context, 'Error: $e', false);
|
||||
}
|
||||
} finally {
|
||||
setState(() => _isLoading = false);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
|
|
@ -71,7 +103,7 @@ class _AddManufactorerPageState extends State<AddManufactorerPage> {
|
|||
if (_isLoading)
|
||||
const Center(child: CircularProgressIndicator(color: Colors.white))
|
||||
else
|
||||
ButtonWidget(text: 'Add', onPressed: saveManufactorer)
|
||||
ButtonWidget(text: 'Save Manufactorer', onPressed: _saveManufactorer)
|
||||
],
|
||||
)))
|
||||
],
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
|
@ -60,33 +56,6 @@ class _AddMedicinePageState extends State<AddMedicinePage> {
|
|||
late bool imageUploaded = false;
|
||||
late String imageUrl = '';
|
||||
|
||||
// void _checkResult(List list, String name) {
|
||||
// if (list.isEmpty) {
|
||||
// if (mounted) {
|
||||
// showNotification(context, 'Error: No $name Found', false);
|
||||
|
||||
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
// if (mounted) {
|
||||
// context.push('/main');
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// } else {
|
||||
// setState(() => {});
|
||||
// }
|
||||
// }
|
||||
|
||||
// Future<Uint8List> compressFile(XFile file) async {
|
||||
// var result = await FlutterImageCompress.compressWithFile(
|
||||
// file.path,
|
||||
// minWidth: 1020,
|
||||
// minHeight: 765,
|
||||
// quality: 90,
|
||||
// format: CompressFormat.webp,
|
||||
// );
|
||||
// return result;
|
||||
// }
|
||||
|
||||
Future<void> _getGenerics() async {
|
||||
_genericNameList = await _refGenericNames.getList();
|
||||
setState(() {
|
||||
|
|
@ -199,15 +168,16 @@ class _AddMedicinePageState extends State<AddMedicinePage> {
|
|||
|
||||
final imageBytes = await image!.readAsBytes();
|
||||
final webpImage = await _webpConvert(imageBytes);
|
||||
late bool uploaded = false;
|
||||
|
||||
uuid = imageName;
|
||||
|
||||
if (mounted) {
|
||||
imageUrl = await _storage.uploadImage(context, storageName, webpImage, '$imageName.webp');
|
||||
uploaded = await _storage.uploadImage(context, storageName, webpImage, '$imageName.webp');
|
||||
}
|
||||
|
||||
setState(() {
|
||||
if (imageUrl.isEmpty) {
|
||||
if (!uploaded) {
|
||||
if (mounted) {
|
||||
showNotification(context, 'Image Upload failed, try again.', false);
|
||||
}
|
||||
|
|
@ -218,8 +188,6 @@ class _AddMedicinePageState extends State<AddMedicinePage> {
|
|||
Future<Uint8List> _webpConvert(Uint8List file) async {
|
||||
final result = await FlutterImageCompress.compressWithList(
|
||||
file,
|
||||
// minHeight: 1080,
|
||||
// minWidth: 1080,
|
||||
quality: 70,
|
||||
rotate: 0,
|
||||
keepExif: false,
|
||||
|
|
|
|||
|
|
@ -1,12 +1,8 @@
|
|||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:internet_connection_checker/internet_connection_checker.dart';
|
||||
import 'package:pharmacy_mobile/functions/barcode_scan_function.dart';
|
||||
import 'package:pharmacy_mobile/functions/checkresult_function.dart';
|
||||
import 'package:pharmacy_mobile/security/encryption.dart';
|
||||
import 'package:pharmacy_mobile/tables/ref_medicines.dart';
|
||||
import 'package:pharmacy_mobile/tables/stocks.dart';
|
||||
import 'package:pharmacy_mobile/widgets/button_widget.dart';
|
||||
|
|
@ -20,7 +16,6 @@ import 'package:pharmacy_mobile/widgets/snackbar_widget.dart';
|
|||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/title_widget.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:simple_barcode_scanner/simple_barcode_scanner.dart';
|
||||
|
||||
class AddStockPage extends StatefulWidget {
|
||||
const AddStockPage({super.key});
|
||||
|
|
@ -34,18 +29,16 @@ class _AddStockPageState extends State<AddStockPage> with WidgetsBindingObserver
|
|||
final _refMedicines = RefMedicines();
|
||||
final _quantityController = TextEditingController();
|
||||
final _dateController = TextEditingController();
|
||||
final _medicineController = TextEditingController();
|
||||
final _stocks = Stocks();
|
||||
|
||||
final bool _isLoading = false;
|
||||
|
||||
late bool _isLoading = false;
|
||||
late List _medicineList = [];
|
||||
late String _selectedMedicine = '';
|
||||
late DateTime selectedDate = DateTime.now();
|
||||
late String barcode = '';
|
||||
|
||||
void _getMedicines() async {
|
||||
_medicineList = await _refMedicines.getList2();
|
||||
_medicineList = await _refMedicines.getList();
|
||||
|
||||
setState(() {
|
||||
checkResult(context, _medicineList, 'Medicines');
|
||||
|
|
@ -71,11 +64,27 @@ class _AddStockPageState extends State<AddStockPage> with WidgetsBindingObserver
|
|||
}
|
||||
|
||||
void _saveStock() async {
|
||||
setState(() => _isLoading = true);
|
||||
|
||||
try {
|
||||
if (await InternetConnectionChecker.instance.hasConnection) {
|
||||
final stockNameUUID = await _refMedicines.getUUID(_selectedMedicine);
|
||||
final stockQuantity = _quantityController.text;
|
||||
final stockExpiration = _dateController.text;
|
||||
|
||||
await _stocks.postStock(stockNameUUID, stockExpiration, stockQuantity);
|
||||
} else {
|
||||
if (mounted) {
|
||||
showNotification(context, 'Error: No Internet Connection', false);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
showNotification(context, 'Error: $e', false);
|
||||
}
|
||||
} finally {
|
||||
setState(() => _isLoading = false);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _scanBarcode() async {
|
||||
|
|
@ -188,12 +197,10 @@ class _AddStockPageState extends State<AddStockPage> with WidgetsBindingObserver
|
|||
value: selectedDate,
|
||||
),
|
||||
const Gap(32),
|
||||
if (_isLoading)
|
||||
const Center(child: CircularProgressIndicator(color: Colors.white))
|
||||
else
|
||||
ButtonWidget(text: 'Add Stock', onPressed: _saveStock),
|
||||
const Gap(16),
|
||||
TextWidget(
|
||||
text: barcode,
|
||||
size: 14,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@ import 'package:flutter/material.dart';
|
|||
import 'package:internet_connection_checker/internet_connection_checker.dart';
|
||||
import 'package:pharmacy_mobile/tables/ref_types.dart';
|
||||
import 'package:pharmacy_mobile/widgets/button_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/form_border_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/form_border_widget2.dart';
|
||||
import 'package:pharmacy_mobile/widgets/input_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/logo_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/snackbar_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:pharmacy_mobile/tables/storage.dart';
|
||||
import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
|
||||
|
||||
class CustomerItemviewPage extends StatelessWidget {
|
||||
|
|
@ -7,13 +6,13 @@ class CustomerItemviewPage extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final storage = Storage();
|
||||
// final storage = Storage();
|
||||
|
||||
void getURL() async {
|
||||
final image = await storage.getPublicURL('ref_medicines_images', 'cb6eafdb-d86f-460a-9571-44446570d4cb.webp');
|
||||
// setState(() {
|
||||
// imageUrl = image;
|
||||
}
|
||||
// void getURL() async {
|
||||
// final image = await storage.getPublicURL('ref_medicines_images', 'cb6eafdb-d86f-460a-9571-44446570d4cb.webp');
|
||||
// // setState(() {
|
||||
// // imageUrl = image;
|
||||
// }
|
||||
|
||||
return Scaffold(
|
||||
body: PageBackgroundWidget(
|
||||
|
|
|
|||
|
|
@ -1,15 +1,9 @@
|
|||
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_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/page_background_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';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
class CustomerMainPage extends StatefulWidget {
|
||||
// final NotchBottomBarController? controller;
|
||||
|
|
|
|||
|
|
@ -1,17 +1,11 @@
|
|||
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';
|
||||
|
||||
class CustomerSearchPage extends StatefulWidget {
|
||||
// final NotchBottomBarController? controller;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:pharmacy_mobile/tables/stocks.dart';
|
||||
import 'package:pharmacy_mobile/tables/storage.dart';
|
||||
|
|
@ -18,7 +17,6 @@ class ListStocksPage extends StatefulWidget {
|
|||
|
||||
class _ListStocksPageState extends State<ListStocksPage> {
|
||||
final _stocks = Stocks();
|
||||
final _storage = Storage();
|
||||
|
||||
late List _stockList = [];
|
||||
bool _isLoading = false;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class _MainPageState extends State<MainPage> {
|
|||
MenuWidget(
|
||||
icon: FontAwesomeIcons.circlePlus,
|
||||
text: 'Add Manufactorer',
|
||||
description: 'Add Manufactorer to the record',
|
||||
description: 'Register manufactorer to the list',
|
||||
onPressed: () => {context.push('/addmanufactorer')},
|
||||
color: 'blue',
|
||||
),
|
||||
|
|
@ -61,7 +61,7 @@ class _MainPageState extends State<MainPage> {
|
|||
MenuWidget(
|
||||
icon: FontAwesomeIcons.circlePlus,
|
||||
text: 'Add Type',
|
||||
description: 'Create a new medical type',
|
||||
description: 'Register new medical type',
|
||||
onPressed: () => {context.push('/addtype')},
|
||||
color: 'blue',
|
||||
),
|
||||
|
|
@ -69,7 +69,7 @@ class _MainPageState extends State<MainPage> {
|
|||
MenuWidget(
|
||||
icon: FontAwesomeIcons.circlePlus,
|
||||
text: 'Add Category',
|
||||
description: 'Create a new medicine category',
|
||||
description: 'Register new medicine category',
|
||||
onPressed: () => {context.push('/addcategory')},
|
||||
color: 'blue',
|
||||
),
|
||||
|
|
@ -77,35 +77,35 @@ class _MainPageState extends State<MainPage> {
|
|||
MenuWidget(
|
||||
icon: FontAwesomeIcons.circlePlus,
|
||||
text: 'Add Generics',
|
||||
description: 'Add generic name on the list',
|
||||
description: 'Register generic name',
|
||||
onPressed: () => {context.push('/addgenerics')},
|
||||
color: 'blue'),
|
||||
const Gap(32),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.circlePlus,
|
||||
text: 'Add Medicine',
|
||||
description: 'Add generic name on the list',
|
||||
description: 'Register medicine to the global list',
|
||||
onPressed: () => {context.push('/addmedicines')},
|
||||
color: 'green'),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.circlePlus,
|
||||
text: 'Add Stock',
|
||||
description: 'Add generic name on the list',
|
||||
description: 'Add a new stock',
|
||||
onPressed: () => {context.push('/addstock')},
|
||||
color: 'green'),
|
||||
const Gap(32),
|
||||
MenuWidget(
|
||||
icon: Icons.delete,
|
||||
text: 'Remove Stock',
|
||||
description: 'Add generic name on the list',
|
||||
description: 'Reduce stock based on purchase',
|
||||
onPressed: () => {context.push('/deletestock')},
|
||||
color: 'red'),
|
||||
const Gap(32),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.listCheck,
|
||||
text: 'List of Stocks',
|
||||
description: 'Add generic name on the list',
|
||||
description: 'View the list of available stocks',
|
||||
onPressed: () => {context.push('/liststocks')},
|
||||
color: 'yellow'),
|
||||
const Gap(40),
|
||||
|
|
|
|||
|
|
@ -1,12 +1,9 @@
|
|||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:internet_connection_checker/internet_connection_checker.dart';
|
||||
import 'package:pharmacy_mobile/auth/auth_service.dart';
|
||||
import 'package:pharmacy_mobile/widgets/button_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/input_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/logo_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/snackbar_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
|
|
@ -35,7 +32,6 @@ class _RegisterPageState extends State<RegisterPage> {
|
|||
final confirmPassword = _confirmPasswordController.text;
|
||||
|
||||
if (email.isEmpty) {
|
||||
log('message');
|
||||
if (mounted) {
|
||||
showNotification(context, 'Error: Please enter a valid email', false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,13 +44,4 @@ class RefGenericNames {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<List> getSample() async {
|
||||
try {
|
||||
final data = await _supabase.from('ref_generic_names').select('''generic_name, ref_categories(category_name)''');
|
||||
return data.toList();
|
||||
} catch (e) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,41 @@
|
|||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
class RefManufactorers {
|
||||
final SupabaseClient _supabase = Supabase.instance.client;
|
||||
|
||||
Future<List> getList() async {
|
||||
try {
|
||||
final data = await _supabase
|
||||
.from('ref_manufactorers')
|
||||
.select('manufactorer_name')
|
||||
.order('manufactorer_name', ascending: true);
|
||||
return data.toList();
|
||||
} catch (e) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> getUUID(String name) async {
|
||||
try {
|
||||
final data =
|
||||
await _supabase.from('ref_manufactorers').select('ref_manufactorers_uuid').eq('manufactorer_name', name);
|
||||
return data.first['ref_manufactorers_uuid'].toString();
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> postManufactorer(String name, String address) async {
|
||||
try {
|
||||
final genericUUID = Uuid().v4();
|
||||
|
||||
await _supabase
|
||||
.from('ref_manufactorers')
|
||||
.insert({'ref_manufactorers_uuid': genericUUID, 'manufactorer_name': name, 'manufactorer_address': address});
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,37 +4,48 @@ class RefMedicines {
|
|||
final SupabaseClient _supabase = Supabase.instance.client;
|
||||
|
||||
Future<List> getList() async {
|
||||
final data = await _supabase.from('ref_medicines').select('medicine_name').order('medicine_name', ascending: true);
|
||||
return data.toList();
|
||||
}
|
||||
|
||||
Future<List> getList2() async {
|
||||
try {
|
||||
final data = await _supabase
|
||||
.from('ref_medicines')
|
||||
.select('medicine_name, ref_manufactorers(manufactorer_name)')
|
||||
.order('medicine_name', ascending: true);
|
||||
return data.toList();
|
||||
} catch (e) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Future<List> getListWithUUID() async {
|
||||
try {
|
||||
final data = await _supabase
|
||||
.from('ref_medicines')
|
||||
.select('ref_medicines_uuid, medicine_name')
|
||||
.order('medicine_name', ascending: true);
|
||||
return data.toList();
|
||||
} catch (e) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> getUUID(String name) async {
|
||||
try {
|
||||
final data = await _supabase.from('ref_medicines').select('ref_medicines_uuid').eq('medicine_name', name);
|
||||
return data.first['ref_medicines_uuid'];
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> getBarcode(String name) async {
|
||||
try {
|
||||
final data = await _supabase.from('ref_medicines').select('barcode').eq('medicine_name', name);
|
||||
return data.first['barcode'];
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> postMedicine(String uuid, String name, String muuid, String guuid, String tuuid, String barcode) async {
|
||||
Future<bool> postMedicine(String uuid, String name, String muuid, String guuid, String tuuid, String barcode) async {
|
||||
final medicine = {
|
||||
'ref_medicines_uuid': uuid,
|
||||
'medicine_name': name,
|
||||
|
|
@ -44,6 +55,11 @@ class RefMedicines {
|
|||
'barcode': barcode
|
||||
};
|
||||
|
||||
try {
|
||||
await _supabase.from('ref_medicines').insert(medicine);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,18 +5,31 @@ class RefTypes {
|
|||
final SupabaseClient _supabase = Supabase.instance.client;
|
||||
|
||||
Future<List> getList() async {
|
||||
try {
|
||||
final data = await _supabase.from('ref_types').select('type_name').order('type_name', ascending: true);
|
||||
return data.toList();
|
||||
} catch (e) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> getUUID(String name) async {
|
||||
try {
|
||||
final data = await _supabase.from('ref_types').select('ref_types_uuid').eq('type_name', name);
|
||||
return data.first['ref_types_uuid'].toString();
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> postType(String name) async {
|
||||
Future<bool> postType(String name) async {
|
||||
final typeUUID = Uuid().v4();
|
||||
|
||||
try {
|
||||
await _supabase.from('ref_types').insert({'ref_types_uuid': typeUUID, 'type_name': name});
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ class Stocks {
|
|||
Future<List> getList() async {
|
||||
List<Map<String, dynamic>> stockData = [];
|
||||
|
||||
try {
|
||||
final data =
|
||||
await _supabase.from('stocks').select('ref_medicines(medicine_name), expiration_date, quantity, price');
|
||||
|
||||
|
|
@ -22,18 +23,25 @@ class Stocks {
|
|||
}
|
||||
|
||||
return stockData;
|
||||
} catch (e) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> getUUID(String name) async {
|
||||
try {
|
||||
final medUUID = await _supabase.from('ref_medicines').select('ref_medicines_uuid').eq('medicine_name', name);
|
||||
final data = await _supabase
|
||||
.from('stocks')
|
||||
.select('stocks_uuid')
|
||||
.eq('ref_medicines_uuid', medUUID.first['ref_medicines_uuid']);
|
||||
return data.first['stocks_uuid'].toString();
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> postStock(String muuid, String name, String quantity) async {
|
||||
Future<bool> postStock(String muuid, String name, String quantity) async {
|
||||
final uuid = Uuid().v4();
|
||||
|
||||
final stock = {
|
||||
|
|
@ -43,15 +51,29 @@ class Stocks {
|
|||
'quantity': quantity,
|
||||
};
|
||||
|
||||
try {
|
||||
await _supabase.from('stocks').insert(stock);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> getQuantity(String uuid) async {
|
||||
try {
|
||||
final data = await _supabase.from('stocks').select('quantity').eq('stocks_uuid', uuid);
|
||||
return data.first['quantity'].toString();
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> updateStock(String uuid, String column, String value) async {
|
||||
Future<bool> updateStock(String uuid, String column, String value) async {
|
||||
try {
|
||||
await _supabase.from('stocks').update({column: value}).eq('stocks_uuid', uuid).select();
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,69 +1,47 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:pharmacy_mobile/widgets/snackbar_widget.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
|
||||
class Storage {
|
||||
final SupabaseClient _supabase = Supabase.instance.client;
|
||||
|
||||
Future<String> createBucket(String name) async {
|
||||
Future<bool> createBucket(String name) async {
|
||||
try {
|
||||
final response = await _supabase.storage.createBucket(name);
|
||||
return response;
|
||||
} catch (e, stackTrace) {
|
||||
log('Error creating bucket: $e', stackTrace: stackTrace);
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
Future<List> getList() async {
|
||||
try {
|
||||
final response = await _supabase.storage.listBuckets();
|
||||
return response;
|
||||
} catch (e, stackTrace) {
|
||||
log('Error getting list: $e', stackTrace: stackTrace);
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> uploadFile(XFile image, String name) async {
|
||||
try {
|
||||
final imageString = await image.readAsString(encoding: utf8);
|
||||
final imageFile = File(imageString);
|
||||
await _supabase.storage.from('images').upload(name, imageFile);
|
||||
log('upload Complete');
|
||||
return response.isNotEmpty;
|
||||
} catch (e) {
|
||||
log('Error getting list: $e');
|
||||
rethrow;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> uploadImage(BuildContext context, String storage, Uint8List image, String name) async {
|
||||
Future<bool> uploadImage(BuildContext context, String storage, Uint8List image, String name) async {
|
||||
try {
|
||||
final imageBytes = image;
|
||||
final imagePath = name;
|
||||
|
||||
await _supabase.storage.from(storage).uploadBinary(imagePath, imageBytes);
|
||||
final imageUrl = _supabase.storage.from(storage).getPublicUrl(imagePath);
|
||||
return imageUrl;
|
||||
return imageUrl.isNotEmpty;
|
||||
} catch (e) {
|
||||
// ignore: use_build_context_synchronously
|
||||
showNotification(context, 'Error uploading image: $e', false);
|
||||
rethrow;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<Uint8List> downloadImage(String storage, String name) async {
|
||||
try {
|
||||
final Uint8List file = await _supabase.storage.from(storage).download(name);
|
||||
return file;
|
||||
} catch (e) {
|
||||
return Uint8List(0);
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> getPublicURL(String storage, String name) async {
|
||||
try {
|
||||
final String file = _supabase.storage.from(storage).getPublicUrl(name);
|
||||
return file;
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,11 @@ import 'package:google_fonts/google_fonts.dart';
|
|||
import 'package:gap/gap.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class DatePickerWidget extends StatefulWidget {
|
||||
final String label;
|
||||
final TextEditingController controller;
|
||||
DateTime value;
|
||||
late DateTime value;
|
||||
|
||||
DatePickerWidget({super.key, required this.label, required this.controller, required this.value});
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ 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, this.width});
|
||||
MenuWidget(
|
||||
{super.key, required this.text, required this.description, this.icon, this.onPressed, this.color, this.width});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue