add slide to stock and cleanup

This commit is contained in:
Patrick Alvin Alcala 2025-04-04 10:11:48 +08:00
parent b892cc485f
commit 1222f15766
5 changed files with 17 additions and 39 deletions

View file

@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:internet_connection_checker/internet_connection_checker.dart';
import 'package:pharmacy_mobile/blocs/caches/stocklist/functions/cache_getstocklist.dart';
import 'package:pharmacy_mobile/functions/checkresult_function.dart';
import 'package:pharmacy_mobile/functions/getlist_cache_function.dart';
import 'package:pharmacy_mobile/tables/stocks.dart';
@ -51,17 +50,6 @@ class _DeleteStockPageState extends State<DeleteStockPage> {
}
}
// Future<bool> _getStocksCache() async {
// final cache = await cacheGetStockList(context);
// if (cache.isNotEmpty) {
// _stockList = cache;
// return true;
// } else {
// return false;
// }
// }
void _updateStock(dynamic stock) {
_selectedStock = stock;
_getQuantity(_selectedStock);
@ -70,7 +58,7 @@ class _DeleteStockPageState extends State<DeleteStockPage> {
void _saveDeletion() async {
final newQuantity = _serverQuantity - double.parse(_quantityController.text);
final newQuantityFixed = newQuantity.toStringAsFixed(0);
// log(newQuantityFixed);
try {
_stocks.updateStock(_selectedUUID, 'quantity', newQuantityFixed);
if (mounted) {