import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:pharmacy_mobile/blocs/language/language_bloc.dart';
import 'package:pharmacy_mobile/blocs/language/language_event.dart';

Future<bool> blocSetLanguage(BuildContext context, String value) async {
  try {
    final languageBloc = context.read<LanguageBloc>();
    languageBloc.add(LanguageSetValue(value));
    return true;
  } catch (e) {
    return false;
  }
}
