update
This commit is contained in:
parent
55de28532f
commit
ff619ac88a
13 changed files with 192 additions and 145 deletions
|
|
@ -1,7 +1,4 @@
|
|||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:pharmacy_mobile/tables/ref_medicines.dart';
|
||||
import 'package:pharmacy_mobile/tables/stocks.dart';
|
||||
|
|
@ -11,8 +8,6 @@ import 'package:pharmacy_mobile/widgets/customer_title_widget.dart';
|
|||
import 'package:pharmacy_mobile/widgets/indicator_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/input_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/item_card_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
import 'package:toggle_switch/toggle_switch.dart';
|
||||
|
||||
class CustomerSearchPage extends StatefulWidget {
|
||||
const CustomerSearchPage({super.key});
|
||||
|
|
@ -24,12 +19,12 @@ class CustomerSearchPage extends StatefulWidget {
|
|||
class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
||||
final _searchController = TextEditingController();
|
||||
final _storage = Storage();
|
||||
final _refMedicines = RefMedicines();
|
||||
// final _refMedicines = RefMedicines();
|
||||
final _stocks = Stocks();
|
||||
// final _refMedicines = RefMedicines();
|
||||
late String imageUrl = '';
|
||||
late List _stockList = [];
|
||||
late List _medicinesList = [];
|
||||
// late final List _medicinesList = [];
|
||||
|
||||
Future<void> _getURL() async {
|
||||
final image = await _storage.getPublicURL('ref_medicines_images', 'a3e430fe-86c1-4d46-9c6a-aed2dae57fef.webp');
|
||||
|
|
@ -42,12 +37,12 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
_stockList = await _stocks.getList();
|
||||
}
|
||||
|
||||
Future<void> _getAllMedicines() async {
|
||||
_medicinesList = await _refMedicines.getList();
|
||||
}
|
||||
// Future<void> _getAllMedicines() async {
|
||||
// _medicinesList = await _refMedicines.getList();
|
||||
// }
|
||||
|
||||
// void getURLs() async {
|
||||
// try {
|
||||
// try {demo@
|
||||
// for (int i = 1; i <= 4; i++) {
|
||||
// final image = await _storage.getPublicURL(
|
||||
// context,
|
||||
|
|
@ -88,8 +83,6 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// const double imageSize = 180;
|
||||
|
||||
return Scaffold(
|
||||
body: CustomerPagebackgroundWidget(
|
||||
height: MediaQuery.of(context).size.height + 800,
|
||||
|
|
@ -150,6 +143,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
ItemCardWidget(
|
||||
imageUrl: 'imageUrl',
|
||||
text: 'item[medicine_name]',
|
||||
subtext: 'item[generic_name]',
|
||||
price: 123,
|
||||
quantity: 123,
|
||||
isLoading: true,
|
||||
|
|
@ -157,6 +151,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
ItemCardWidget(
|
||||
imageUrl: 'imageUrl',
|
||||
text: 'item[medicine_name]',
|
||||
subtext: 'item[generic_name]',
|
||||
price: 123,
|
||||
quantity: 123,
|
||||
isLoading: true,
|
||||
|
|
@ -164,6 +159,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
ItemCardWidget(
|
||||
imageUrl: 'imageUrl',
|
||||
text: 'item[medicine_name]',
|
||||
subtext: 'item[generic_name]',
|
||||
price: 123,
|
||||
quantity: 123,
|
||||
isLoading: true,
|
||||
|
|
@ -175,6 +171,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: item['medicine_name'].toString(),
|
||||
subtext: item['generic_name'].toString(),
|
||||
price: item['price'].toDouble(),
|
||||
quantity: item['quantity'].toDouble(),
|
||||
isLoading: false,
|
||||
|
|
@ -191,6 +188,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
subtext: 'generic_name',
|
||||
price: 500,
|
||||
quantity: 0,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
|
|
@ -198,6 +196,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
subtext: 'generic_name',
|
||||
price: 500,
|
||||
quantity: 15,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
|
|
@ -205,6 +204,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
subtext: 'generic_name',
|
||||
price: 500,
|
||||
quantity: 15,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
|
|
@ -221,6 +221,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
subtext: 'generic_name',
|
||||
price: 500,
|
||||
quantity: 15,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
|
|
@ -228,6 +229,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
subtext: 'generic_name',
|
||||
price: 500,
|
||||
quantity: 15,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
|
|
@ -235,6 +237,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
subtext: 'generic_name',
|
||||
price: 500,
|
||||
quantity: 15,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
|
|
@ -251,6 +254,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
subtext: 'generic_name',
|
||||
price: 500,
|
||||
quantity: 15,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
|
|
@ -258,6 +262,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
subtext: 'generic_name',
|
||||
price: 500,
|
||||
quantity: 15,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
|
|
@ -265,6 +270,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
subtext: 'generic_name',
|
||||
price: 500,
|
||||
quantity: 15,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
|
|
@ -281,6 +287,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
subtext: 'generic_name',
|
||||
price: 500,
|
||||
quantity: 15,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
|
|
@ -288,6 +295,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
subtext: 'generic_name',
|
||||
price: 500,
|
||||
quantity: 15,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
|
|
@ -295,6 +303,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
subtext: 'generic_name',
|
||||
price: 500,
|
||||
quantity: 15,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue