update
This commit is contained in:
parent
a76d3a0f35
commit
e3dc94a768
33 changed files with 368 additions and 184 deletions
|
|
@ -1,8 +1,13 @@
|
|||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:pharmacy_mobile/auth/auth_service.dart';
|
||||
import 'package:pharmacy_mobile/blocs/user/functions/bloc_getuser.dart';
|
||||
import 'package:pharmacy_mobile/blocs/user/functions/bloc_setuser.dart';
|
||||
import 'package:pharmacy_mobile/blocs/user/user_bloc.dart';
|
||||
import 'package:pharmacy_mobile/blocs/user/user_event.dart';
|
||||
import 'package:pharmacy_mobile/tables/cart.dart';
|
||||
import 'package:pharmacy_mobile/tables/stocks.dart';
|
||||
import 'package:pharmacy_mobile/tables/storage.dart';
|
||||
|
|
@ -43,16 +48,14 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
_stockList = await _stocks.getList();
|
||||
}
|
||||
|
||||
Future<String> _getCurrentUser() async {
|
||||
final result = _authService.getCurrentUser();
|
||||
Future<String> _getCurrentUserId() async {
|
||||
final result = _authService.getCurrentUserId();
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
Future<void> _getCarts() async {
|
||||
final currentUser = await _getCurrentUser();
|
||||
log('currentUser: $currentUser');
|
||||
final currentUser = await _getCurrentUserId();
|
||||
_cartList = await _carts.getCart(currentUser);
|
||||
log('cart: ${_cartList.toString()}');
|
||||
}
|
||||
|
||||
// Future<void> _getAllMedicines() async {
|
||||
|
|
@ -82,7 +85,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
void autoRun() async {
|
||||
await _getAllStocks();
|
||||
await _getCarts();
|
||||
// await _getAllMedicines();
|
||||
// // // await _getAllMedicines();
|
||||
await _getURL();
|
||||
}
|
||||
|
||||
|
|
@ -125,31 +128,6 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
),
|
||||
),
|
||||
const Gap(32),
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.end,
|
||||
// children: [
|
||||
// ToggleSwitch(
|
||||
// fontSize: 12,
|
||||
// minWidth: 64,
|
||||
// minHeight: 32,
|
||||
// initialLabelIndex: 1,
|
||||
// cornerRadius: 20,
|
||||
// activeFgColor: Colors.white,
|
||||
// inactiveBgColor: const Color.fromRGBO(81, 81, 81, 1),
|
||||
// inactiveFgColor: const Color.fromRGBO(177, 175, 175, 1),
|
||||
// totalSwitches: 2,
|
||||
// labels: ['All', 'Stocks'],
|
||||
// activeBgColors: [
|
||||
// [const Color.fromRGBO(40, 112, 143, 1)],
|
||||
// [const Color.fromRGBO(40, 112, 143, 1)],
|
||||
// ],
|
||||
// // onToggle: (index) {
|
||||
// // print('switched to: $index');
|
||||
// // },
|
||||
// ),
|
||||
// const Gap(8)
|
||||
// ],
|
||||
// ),
|
||||
const IndicatorWidget(text: 'All Stocks'),
|
||||
const Gap(8),
|
||||
SingleChildScrollView(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue