import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:pharmacy_mobile/blocs/caches/manufacturerlist/manufacturerlist_cache_bloc.dart';
import 'package:pharmacy_mobile/blocs/caches/manufacturerlist/manufacturerlist_cache_event.dart';

Future<List> cacheGetManufacturerList(BuildContext context) async {
  try {
    final manufacturerListCache = context.read<ManufacturerListBloc>();
    manufacturerListCache.add(ManufacturerListCacheGet());
    return manufacturerListCache.state.value;
  } catch (e) {
    return [];
  }
}
