Skip to content

Commit 7044d4c

Browse files
committed
fix copilot suggestions
1 parent e5a9f5b commit 7044d4c

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

app/lib/presentation/ui/pages/home/home_view.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'package:app/presentation/ui/custom/app_theme_switch.dart';
55

66
class HomeView extends StatelessWidget {
77
/// Given this is a global cubit, we can access it directly from getIt
8-
/// other wise use context.read<AuthCubit>() to read the Cubit under that context
8+
/// otherwise use context.read<AuthCubit>() to read the Cubit under that context
99
AuthCubit get _authCubit => getIt();
1010

1111
const HomeView({super.key});

app/lib/presentation/ui/pages/splash/splash_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class SplashPage extends StatefulWidget {
1111

1212
class _SplashPageState extends State<SplashPage> {
1313
/// Given this is a global cubit, we can access it directly from getIt
14-
/// other wise use context.read<AuthCubit>() to read the Cubit under that context
14+
/// otherwise use context.read<AuthCubit>() to read the Cubit under that context
1515
AuthCubit get _authCubit => getIt();
1616

1717
@override

modules/domain/lib/bloc/auth/auth_cubit.dart

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,14 @@ class AuthCubit extends BaseCubit<AuthState> {
88
final AuthService _authService;
99
AuthCubit(this._authService) : super(RSuccess(data: AuthStateUnknown()));
1010

11-
Future login(String username, String password) async {
11+
Future<void> login(String username, String password) async {
1212
isLoading();
1313
final authResult =
1414
await _authService.logInWithCredentials(username, password);
1515

16-
authResult.map(
17-
success: (_) => isLogin(),
18-
error: (failure) {
19-
isError(failure);
20-
return failure;
21-
},
22-
);
16+
authResult
17+
..mapSuccess((_) => isLogin())
18+
..mapError((failure) => isError(failure));
2319
}
2420

2521
Future<void> onValidate() async {

modules/domain/lib/init.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'package:get_it/get_it.dart';
55

66
class DomainInit {
77
static Future<void> initialize(GetIt getIt) async {
8-
//Services (with dependencies to repositories)
8+
//Services
99
getIt.registerLazySingleton(() => AuthService(getIt()));
1010

1111
//Global Cubits

0 commit comments

Comments
 (0)