import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:pharmacy_mobile/blocs/caches/genericlist/genericlist_cache_bloc.dart';
import 'package:pharmacy_mobile/blocs/caches/genericlist/genericlist_cache_event.dart';

Future<List> cacheGetGenericList(BuildContext context) async {
  try {
    final genericListCache = context.read<GenericListBloc>();
    genericListCache.add(GenericListCacheGet());
    return genericListCache.state.value;
  } catch (e) {
    return [];
  }
}
