import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:pharmacy_mobile/blocs/caches/categorylist/categorylist_cache_bloc.dart';
import 'package:pharmacy_mobile/blocs/caches/categorylist/categorylist_cache_event.dart';

Future<List> cacheGetCategoryList(BuildContext context) async {
  try {
    final categoryListCache = context.read<CategoryListBloc>();
    categoryListCache.add(CategoryListCacheGet());
    return categoryListCache.state.value;
  } catch (e) {
    return [];
  }
}
