import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:pharmacy_mobile/blocs/caches/distributorlist/distributorlist_cache_bloc.dart';
import 'package:pharmacy_mobile/blocs/caches/distributorlist/distributorlist_cache_event.dart';

Future<List> cacheGetDistributorList(BuildContext context) async {
  try {
    final distributorListCache = context.read<DistributorListBloc>();
    distributorListCache.add(DistributorListCacheGet());
    return distributorListCache.state.value;
  } catch (e) {
    return [];
  }
}
