diff --git a/app/lib/app/data/data.dart b/app/lib/app/data/data.dart index b2b62960..a3d76b1f 100644 --- a/app/lib/app/data/data.dart +++ b/app/lib/app/data/data.dart @@ -1,8 +1,8 @@ export 'repository/app_repositoty_impl.dart'; export 'repository/theme_repository_impl.dart'; export 'repository/auth_repositoty_impl.dart'; -export 'models/user_model.dart'; export 'source/app_local_data_source.dart'; export 'source/theme_local_data_source.dart'; export 'source/auth_local_data_source.dart'; export 'source/auth_remote_data_source.dart'; +export 'models/user_model.dart'; diff --git a/app/lib/app/domain/domain.dart b/app/lib/app/domain/domain.dart index 8abc4f65..5825d10c 100644 --- a/app/lib/app/domain/domain.dart +++ b/app/lib/app/domain/domain.dart @@ -1,7 +1,6 @@ export 'repository/app_repositoty.dart'; export 'repository/theme_repository.dart'; export 'repository/auth_repository.dart'; -export 'entity/user_entity.dart'; export 'usecase/get_initial_locale_use_case.dart'; export 'usecase/get_initial_theme_use_case.dart'; export 'usecase/set_color_use_case.dart'; @@ -10,3 +9,4 @@ export 'usecase/set_mode_use_case.dart'; export 'usecase/get_initial_user_use_case.dart'; export 'usecase/login_use_case.dart'; export 'usecase/set_gender_use_case.dart'; +export 'entity/user_entity.dart'; diff --git a/app/lib/app/domain/usecase/get_initial_locale_use_case.dart b/app/lib/app/domain/usecase/get_initial_locale_use_case.dart index 649d34f1..e26067a9 100644 --- a/app/lib/app/domain/usecase/get_initial_locale_use_case.dart +++ b/app/lib/app/domain/usecase/get_initial_locale_use_case.dart @@ -7,7 +7,7 @@ final class GetCurrentLocaleUseCase { final AppRepository appRepository; - Locale get getCurrentLocale { + Locale get call { return appRepository.getLocale; } } diff --git a/app/lib/app/domain/usecase/get_initial_user_use_case.dart b/app/lib/app/domain/usecase/get_initial_user_use_case.dart index 9b0e1dc3..fc3b7faf 100644 --- a/app/lib/app/domain/usecase/get_initial_user_use_case.dart +++ b/app/lib/app/domain/usecase/get_initial_user_use_case.dart @@ -7,7 +7,7 @@ final class GetInitialUserUseCase { final AuthRepository repository; - UserEntity? get init { + UserEntity? get call { return repository.init; } } diff --git a/app/lib/app/domain/usecase/login_use_case.dart b/app/lib/app/domain/usecase/login_use_case.dart index 45764a4a..6e309324 100644 --- a/app/lib/app/domain/usecase/login_use_case.dart +++ b/app/lib/app/domain/usecase/login_use_case.dart @@ -8,7 +8,7 @@ final class LoginUseCase { final AuthRepository repository; - Future> login(String languageCode, Gender gender) async { + Future> call(String languageCode, Gender gender) async { return repository.login(languageCode, gender); } } diff --git a/app/lib/app/domain/usecase/set_color_use_case.dart b/app/lib/app/domain/usecase/set_color_use_case.dart index 544be494..27be8f3b 100644 --- a/app/lib/app/domain/usecase/set_color_use_case.dart +++ b/app/lib/app/domain/usecase/set_color_use_case.dart @@ -7,7 +7,7 @@ final class SetColorUseCase { final ThemeRepository themeRepository; - Future setColor(int index, Color color) async { + Future call(int index, Color color) async { await themeRepository.saveThemePrimaryColor(index); } } diff --git a/app/lib/app/domain/usecase/set_gender_use_case.dart b/app/lib/app/domain/usecase/set_gender_use_case.dart index 18dc7767..f47a1e7a 100644 --- a/app/lib/app/domain/usecase/set_gender_use_case.dart +++ b/app/lib/app/domain/usecase/set_gender_use_case.dart @@ -7,7 +7,7 @@ final class SetGenderUseCase { final AuthRepository repository; - Future saveGender(Gender gender) async { + Future call(Gender gender) async { return repository.saveGender(gender); } } diff --git a/app/lib/app/domain/usecase/set_locale_use_case.dart b/app/lib/app/domain/usecase/set_locale_use_case.dart index a73a2292..7bc1bb77 100644 --- a/app/lib/app/domain/usecase/set_locale_use_case.dart +++ b/app/lib/app/domain/usecase/set_locale_use_case.dart @@ -7,7 +7,7 @@ final class SetLocaleUseCase { final AppRepository appRepository; - Future setLocal(String langKey) async { + Future call(String langKey) async { await appRepository.setLocale(langKey); return Locale(langKey); } diff --git a/app/lib/app/domain/usecase/set_mode_use_case.dart b/app/lib/app/domain/usecase/set_mode_use_case.dart index 8c9c72d3..d6f05b36 100644 --- a/app/lib/app/domain/usecase/set_mode_use_case.dart +++ b/app/lib/app/domain/usecase/set_mode_use_case.dart @@ -7,7 +7,7 @@ final class SetModeUseCase { final ThemeRepository themeRepository; - Future setMode({required bool isDark}) async { + Future call({required bool isDark}) async { await themeRepository.saveThemeMode(isDark: isDark); } } diff --git a/app/lib/app/presentation/cubit/app_cubit.dart b/app/lib/app/presentation/cubit/app_cubit.dart index 924160ca..922fd4b4 100644 --- a/app/lib/app/presentation/cubit/app_cubit.dart +++ b/app/lib/app/presentation/cubit/app_cubit.dart @@ -14,7 +14,7 @@ class AppCubit extends Cubit { required this.getInitialThemeUseCase, required this.setModeUseCase, required this.setColorUseCase, - }) : super(AppState(getLocalLocaleUseCase.getCurrentLocale, getInitialThemeUseCase.call)); + }) : super(AppState(getLocalLocaleUseCase.call, getInitialThemeUseCase.call)); final GetCurrentLocaleUseCase getLocalLocaleUseCase; final SetLocaleUseCase setLocaleUseCase; @@ -23,17 +23,17 @@ class AppCubit extends Cubit { final SetColorUseCase setColorUseCase; Future changeLang(String langKey) async { - final local = await setLocaleUseCase.setLocal(langKey); + final local = await setLocaleUseCase.call(langKey); emit(state.copyWith(currentLocale: local)); } Future changeMode({required bool isDark}) async { - await setModeUseCase.setMode(isDark: isDark); + await setModeUseCase.call(isDark: isDark); emit(state.copyWith(theme: state.theme.copyWith(brightness: isDark ? Brightness.dark : Brightness.light))); } Future changeColor(int index, Color color) async { - await setColorUseCase.setColor(index, color); + await setColorUseCase.call(index, color); emit(state.copyWith(theme: state.theme.copyWith(targetColor: color))); } diff --git a/app/lib/app/presentation/cubit/auth_cubit.dart b/app/lib/app/presentation/cubit/auth_cubit.dart index d462422e..7fac4f6a 100644 --- a/app/lib/app/presentation/cubit/auth_cubit.dart +++ b/app/lib/app/presentation/cubit/auth_cubit.dart @@ -10,14 +10,14 @@ class AuthCubit extends Cubit { this.getInitialUserUseCase, this.loginUseCase, this.setGenderUseCase, - ) : super(AuthState(user: getInitialUserUseCase.init)); + ) : super(AuthState(user: getInitialUserUseCase.call)); final GetInitialUserUseCase getInitialUserUseCase; final LoginUseCase loginUseCase; final SetGenderUseCase setGenderUseCase; Future login(String languageCode, Gender gender) async { - final user = await loginUseCase.login(languageCode, gender); + final user = await loginUseCase.call(languageCode, gender); user.fold( (l) => emit(state.copyWith(exception: l)), (r) => emit(state.copyWith(user: r)), @@ -26,7 +26,7 @@ class AuthCubit extends Cubit { } Future setGender(Gender gender) async { - await setGenderUseCase.saveGender(gender); + await setGenderUseCase.call(gender); emit(state.copyWith(user: state.user?.copyWith(gender: gender))); }