update
This commit is contained in:
parent
5840df0879
commit
b45cf8bd73
11 changed files with 222 additions and 34 deletions
|
|
@ -1,8 +1,12 @@
|
|||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
|
||||
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';
|
||||
import 'package:pharmacy_mobile/widgets/datatable_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
|
|
@ -17,6 +21,7 @@ class ListStocksPage extends StatefulWidget {
|
|||
|
||||
class _ListStocksPageState extends State<ListStocksPage> {
|
||||
final _stocks = Stocks();
|
||||
final _storage = Storage();
|
||||
|
||||
late List _stockList = [];
|
||||
bool _isLoading = false;
|
||||
|
|
@ -54,9 +59,9 @@ class _ListStocksPageState extends State<ListStocksPage> {
|
|||
|
||||
List<DataColumn> _createColumns() {
|
||||
return [
|
||||
DataColumn(label: Text('Medicine')),
|
||||
DataColumn(label: Text('Quantity')),
|
||||
DataColumn(label: Text('Expiration'))
|
||||
const DataColumn(label: Text('Medicine')),
|
||||
const DataColumn(label: Text('Quantity')),
|
||||
const DataColumn(label: Text('Expiration'))
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -64,7 +69,13 @@ class _ListStocksPageState extends State<ListStocksPage> {
|
|||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
_stockList = await _stocks.getList();
|
||||
// _stockList = await _stocks.getList();
|
||||
// final ff = File('assets/ph_logo.webp');
|
||||
// await _storage.uploadFile(ff);
|
||||
final aa = await _storage.getList();
|
||||
// final aa = await _storage.createBucket('aa');
|
||||
log(aa.toString());
|
||||
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
|
|
@ -99,7 +110,6 @@ class _ListStocksPageState extends State<ListStocksPage> {
|
|||
color: Color.fromRGBO(255, 255, 255, 1),
|
||||
))
|
||||
else if (_stockList.isEmpty)
|
||||
// TextWidget(text: 'No Stock Listed')
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: const Color.fromRGBO(205, 59, 208, 0.702), width: 2),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue