import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:pharmacy_mobile/blocs/caches/medicinelist/medicinelist_cache_bloc.dart';
import 'package:pharmacy_mobile/blocs/caches/medicinelist/medicinelist_cache_event.dart';

Future<List> cacheGetMedicineList(BuildContext context) async {
  try {
    final medicineListCache = context.read<MedicineListBloc>();
    medicineListCache.add(MedicineListCacheGet());
    return medicineListCache.state.value;
  } catch (e) {
    return [];
  }
}
