Skip to content

Commit 6f81b3d

Browse files
authored
Merge pull request #65 from pythonhubdev/feat/ui
feat: Refactor error handling and improve UI components with animations
2 parents b15271f + 4a38e4a commit 6f81b3d

20 files changed

+1692
-324
lines changed

.taskmaster/tasks/tasks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"id": 2,
1414
"title": "Modernize the User Interface",
1515
"description": "Redesign the login, registration, and home pages to be more modern and visually appealing. Adopt a clean design language like Material You, create a consistent theme, and add animations to enhance the user experience.",
16-
"status": "pending",
16+
"status": "done",
1717
"priority": "high",
1818
"dependencies": [
1919
1
@@ -92,7 +92,7 @@
9292
],
9393
"metadata": {
9494
"created": "2025-07-21T07:47:36.467Z",
95-
"updated": "2025-07-21T10:19:22.468Z",
95+
"updated": "2025-07-21T13:00:48.148Z",
9696
"description": "Tasks for master context"
9797
}
9898
}

lib/app.dart

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,74 @@
11
import "package:flutter/foundation.dart";
22
import "package:flutter/material.dart";
3+
import "package:flutter/services.dart";
34

4-
import "Screens/login_page.dart";
5+
import "core/theme/app_theme.dart";
6+
import "screens/login_page.dart";
57

68
class FirebaseAuthenticationDDD extends StatelessWidget {
7-
const FirebaseAuthenticationDDD({Key? key}) : super(key: key);
9+
const FirebaseAuthenticationDDD({super.key});
810

911
@override
1012
Widget build(BuildContext context) {
13+
// Set system UI overlay style
14+
SystemChrome.setSystemUIOverlayStyle(
15+
const SystemUiOverlayStyle(
16+
statusBarColor: Colors.transparent,
17+
statusBarIconBrightness: Brightness.dark,
18+
statusBarBrightness: Brightness.light,
19+
systemNavigationBarColor: Colors.transparent,
20+
systemNavigationBarDividerColor: Colors.transparent,
21+
systemNavigationBarIconBrightness: Brightness.dark,
22+
),
23+
);
24+
1125
return MaterialApp(
26+
title: "Firebase Auth DDD",
1227
debugShowCheckedModeBanner: kDebugMode,
13-
theme: ThemeData(
14-
useMaterial3: true,
15-
),
28+
29+
// Apply our modern Material You theme system
30+
theme: AppTheme.lightTheme,
31+
darkTheme: AppTheme.darkTheme,
32+
themeMode: ThemeMode.system,
33+
34+
// Improved route transitions
35+
onGenerateRoute: (settings) {
36+
switch (settings.name) {
37+
case "/":
38+
return _createRoute(LoginPage());
39+
default:
40+
return _createRoute(LoginPage());
41+
}
42+
},
43+
1644
home: LoginPage(),
1745
);
1846
}
47+
48+
// Custom page route with smooth transitions
49+
PageRoute _createRoute(Widget page) {
50+
return PageRouteBuilder(
51+
pageBuilder: (context, animation, secondaryAnimation) => page,
52+
transitionsBuilder: (context, animation, secondaryAnimation, child) {
53+
const begin = Offset(0.0, 0.1);
54+
const end = Offset.zero;
55+
const curve = Curves.easeOutCubic;
56+
57+
var tween = Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
58+
59+
var fadeAnimation = Tween(begin: 0.0, end: 1.0).animate(
60+
CurvedAnimation(parent: animation, curve: curve),
61+
);
62+
63+
return SlideTransition(
64+
position: animation.drive(tween),
65+
child: FadeTransition(
66+
opacity: fadeAnimation,
67+
child: child,
68+
),
69+
);
70+
},
71+
transitionDuration: const Duration(milliseconds: 400),
72+
);
73+
}
1974
}

lib/application/authentication/auth_events.dart

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@ part "auth_events.freezed.dart";
44

55
@freezed
66
class AuthEvents with _$AuthEvents {
7-
const factory AuthEvents.emailChanged({required String? email}) =
8-
EmailChanged;
7+
const factory AuthEvents.emailChanged({required String? email}) = EmailChanged;
98

10-
const factory AuthEvents.passwordChanged({required String? password}) =
11-
PasswordChanged;
9+
const factory AuthEvents.passwordChanged({required String? password}) = PasswordChanged;
1210

13-
const factory AuthEvents.signUpWithEmailAndPasswordPressed() =
14-
SignUPWithEmailAndPasswordPressed;
11+
const factory AuthEvents.signUpWithEmailAndPasswordPressed() = SignUPWithEmailAndPasswordPressed;
1512

16-
const factory AuthEvents.signInWithEmailAndPasswordPressed() =
17-
SignInWithEmailAndPasswordPressed;
13+
const factory AuthEvents.signInWithEmailAndPasswordPressed() = SignInWithEmailAndPasswordPressed;
1814
}

lib/application/authentication/auth_events.freezed.dart

Lines changed: 24 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/application/authentication/auth_state_controller.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ class AuthStateController extends Notifier<AuthStates> {
7373
}
7474

7575
Future<void> _performAuthAction(
76-
Future<Either<AuthFailures, Unit>> Function(
77-
{required EmailAddress emailAddress, required Password password})
76+
Future<Either<AuthFailures, Unit>> Function({required EmailAddress emailAddress, required Password password})
7877
forwardCall,
7978
) async {
8079
final isEmailValid = state.emailAddress.isValid();

0 commit comments

Comments
 (0)