feat:theme changing done

This commit is contained in:
jahongireshonqulov
2025-11-01 15:37:05 +05:00
parent 44878e79b3
commit b734fc9ce6
9 changed files with 142 additions and 45 deletions

View File

@@ -3,6 +3,8 @@ abstract class AppLocaleKeys {
static const String language = 'language';
static const String browseSearchHistory = 'browse-search-history';
static const String token = 'token';
static const String theme = 'theme';
static const String appName = "Felix Eats";

View File

@@ -40,6 +40,8 @@ import '../../feature/auth/presentation/blocs/verify_phone_bloc/verify_phone_blo
as _i224;
import '../../feature/common/presentation/blocs/language_bloc/language_bloc.dart'
as _i942;
import '../../feature/common/presentation/blocs/theme_bloc/theme_bloc.dart'
as _i465;
import '../../feature/main/presentation/blocs/main_bloc/main_bloc.dart'
as _i580;
import '../../feature/onboarding/presentation/blocs/splash_bloc/splash_bloc.dart'
@@ -68,6 +70,9 @@ extension GetItInjectableX on _i174.GetIt {
gh.factory<_i28.SplashBloc>(
() => _i28.SplashBloc(gh<_i321.StorageService>()),
);
gh.factory<_i465.ThemeBloc>(
() => _i465.ThemeBloc(gh<_i321.StorageService>()),
);
gh.lazySingleton<_i361.Dio>(() => dioModule.dio(gh<_i667.DioClient>()));
gh.singleton<_i354.RequestHandlerService>(
() => _i354.RequestHandlerService(gh<_i361.Dio>()),

View File

@@ -8,6 +8,10 @@ class StorageService {
_sharedPreference = await SharedPreferences.getInstance();
}
void setBool({required String key, required bool value}) {
_sharedPreference.setBool(key, value);
}
void setString({required String key, required String value}) {
_sharedPreference.setString(key, value);
}
@@ -25,6 +29,10 @@ class StorageService {
String? getString({required String key}) {
return _sharedPreference.getString(key);
}
bool getBool({required String key}) {
return _sharedPreference.getBool(key) ?? false;
}
}
/*