Add explicit types and improve type safety across codebase
This commit adds explicit type annotations to variables, function parameters, and return types throughout the codebase, particularly in widget trees, Bloc logic, and repository implementations. The changes improve code readability, maintainability, and type safety, and align with Dart best practices. No business logic was changed.
This commit is contained in:
@@ -46,8 +46,8 @@ class LocaleBloc extends Bloc<LocaleEvent, LocaleState> {
|
||||
LoadLocale event,
|
||||
Emitter<LocaleState> emit,
|
||||
) async {
|
||||
final savedLocale = await getLocaleUseCase();
|
||||
final locale = const Locale('es');
|
||||
final Locale? savedLocale = await getLocaleUseCase();
|
||||
final Locale locale = const Locale('es');
|
||||
|
||||
LocaleSettings.setLocaleRaw(locale.languageCode);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class LocaleRepositoryImpl implements LocaleRepositoryInterface {
|
||||
|
||||
@override
|
||||
Future<Locale?> getSavedLocale() async {
|
||||
final languageCode = await _localDataSource.getLanguageCode();
|
||||
final String? languageCode = await _localDataSource.getLanguageCode();
|
||||
if (languageCode != null) {
|
||||
return Locale(languageCode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user