import 'package:flutter/widgets.dart'; import 'package:pharmacy_mobile/blocs/caches/stocklist/functions/cache_getstocklist.dart'; Future getListCache(BuildContext context, String type) async { late final List cache; switch (type) { case 'stock': cache = await cacheGetStockList(context); break; default: return []; } if (cache.isNotEmpty) { return cache; } else { return []; } }