Skip to content

feat: Refactor error handling and improve UI components with animations #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .taskmaster/tasks/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"id": 2,
"title": "Modernize the User Interface",
"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.",
"status": "pending",
"status": "done",
"priority": "high",
"dependencies": [
1
Expand Down Expand Up @@ -92,7 +92,7 @@
],
"metadata": {
"created": "2025-07-21T07:47:36.467Z",
"updated": "2025-07-21T10:19:22.468Z",
"updated": "2025-07-21T13:00:48.148Z",
"description": "Tasks for master context"
}
}
Expand Down
65 changes: 60 additions & 5 deletions lib/app.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,74 @@
import "package:flutter/foundation.dart";
import "package:flutter/material.dart";
import "package:flutter/services.dart";

import "Screens/login_page.dart";
import "core/theme/app_theme.dart";
import "screens/login_page.dart";

class FirebaseAuthenticationDDD extends StatelessWidget {
const FirebaseAuthenticationDDD({Key? key}) : super(key: key);
const FirebaseAuthenticationDDD({super.key});

@override
Widget build(BuildContext context) {
// Set system UI overlay style
SystemChrome.setSystemUIOverlayStyle(
const SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
statusBarIconBrightness: Brightness.dark,
statusBarBrightness: Brightness.light,
systemNavigationBarColor: Colors.transparent,
systemNavigationBarDividerColor: Colors.transparent,
systemNavigationBarIconBrightness: Brightness.dark,
),
);

return MaterialApp(
title: "Firebase Auth DDD",
debugShowCheckedModeBanner: kDebugMode,
theme: ThemeData(
useMaterial3: true,
),

// Apply our modern Material You theme system
theme: AppTheme.lightTheme,
darkTheme: AppTheme.darkTheme,
themeMode: ThemeMode.system,

// Improved route transitions
onGenerateRoute: (settings) {
switch (settings.name) {
case "/":
return _createRoute(LoginPage());
default:
return _createRoute(LoginPage());
}
},

home: LoginPage(),
);
}

// Custom page route with smooth transitions
PageRoute _createRoute(Widget page) {
return PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) => page,
transitionsBuilder: (context, animation, secondaryAnimation, child) {
const begin = Offset(0.0, 0.1);
const end = Offset.zero;
const curve = Curves.easeOutCubic;

var tween = Tween(begin: begin, end: end).chain(CurveTween(curve: curve));

var fadeAnimation = Tween(begin: 0.0, end: 1.0).animate(
CurvedAnimation(parent: animation, curve: curve),
);

return SlideTransition(
position: animation.drive(tween),
child: FadeTransition(
opacity: fadeAnimation,
child: child,
),
);
},
transitionDuration: const Duration(milliseconds: 400),
);
}
}
12 changes: 4 additions & 8 deletions lib/application/authentication/auth_events.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ part "auth_events.freezed.dart";

@freezed
class AuthEvents with _$AuthEvents {
const factory AuthEvents.emailChanged({required String? email}) =
EmailChanged;
const factory AuthEvents.emailChanged({required String? email}) = EmailChanged;

const factory AuthEvents.passwordChanged({required String? password}) =
PasswordChanged;
const factory AuthEvents.passwordChanged({required String? password}) = PasswordChanged;

const factory AuthEvents.signUpWithEmailAndPasswordPressed() =
SignUPWithEmailAndPasswordPressed;
const factory AuthEvents.signUpWithEmailAndPasswordPressed() = SignUPWithEmailAndPasswordPressed;

const factory AuthEvents.signInWithEmailAndPasswordPressed() =
SignInWithEmailAndPasswordPressed;
const factory AuthEvents.signInWithEmailAndPasswordPressed() = SignInWithEmailAndPasswordPressed;
}
75 changes: 24 additions & 51 deletions lib/application/authentication/auth_events.freezed.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions lib/application/authentication/auth_state_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ class AuthStateController extends Notifier<AuthStates> {
}

Future<void> _performAuthAction(
Future<Either<AuthFailures, Unit>> Function(
{required EmailAddress emailAddress, required Password password})
Future<Either<AuthFailures, Unit>> Function({required EmailAddress emailAddress, required Password password})
forwardCall,
) async {
final isEmailValid = state.emailAddress.isValid();
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy