import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:pharmacy_mobile/blocs/caches/typelist/typelist_cache_bloc.dart';
import 'package:pharmacy_mobile/blocs/caches/typelist/typelist_cache_event.dart';

Future<List> cacheGetTypeList(BuildContext context) async {
  try {
    final typeListCache = context.read<TypeListBloc>();
    typeListCache.add(TypeListCacheGet());
    return typeListCache.state.value;
  } catch (e) {
    return [];
  }
}
