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<bool> cacheSetCategoryList(BuildContext context, List value) async {
  try {
    final categoryListCache = context.read<CategoryListBloc>();
    categoryListCache.add(CategoryListCacheSet(value));
    return true;
  } catch (e) {
    return false;
  }
}
