import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:pharmacy_mobile/blocs/caches/stocklist/stocklist_cache_bloc.dart';
import 'package:pharmacy_mobile/blocs/caches/stocklist/stocklist_cache_event.dart';

Future<List> cacheGetStockList(BuildContext context) async {
  try {
    final stockListCache = context.read<StockListBloc>();
    stockListCache.add(StockListCacheGet());
    return stockListCache.state.value;
  } catch (e) {
    return [];
  }
}
