import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:pharmacy_mobile/blocs/caches/supplierlist/supplierlist_cache_bloc.dart';
import 'package:pharmacy_mobile/blocs/caches/supplierlist/supplierlist_cache_event.dart';

Future<List> cacheGetSupplierList(BuildContext context) async {
  try {
    final supplierListCache = context.read<SupplierListBloc>();
    supplierListCache.add(SupplierListCacheGet());
    return supplierListCache.state.value;
  } catch (e) {
    return [];
  }
}
