-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor home state and UI classes * Refactor network error page layout * Fix response handling and URL generation in media classes * Refactor generateGreeting function to use a constant array * Remove shorebird.yaml from assets * Add session cubit and sign out functionality * Fix UI overlay style and sign out on error * Add login page and update router configuration * Add login page UI and input validators * Refactor login page UI and add form validation * Add sign in functionality to login page * Add FilledInputField widget * Add session authentication features and login/signup pages * Add signup route and page * Add Google SVG icon and update UI in AuthPage * Refactor button styles and text formatting * Delete unused assets
- Loading branch information
1 parent
8b1116d
commit a5011c5
Showing
32 changed files
with
833 additions
and
215 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
extensions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,77 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
import 'package:varanasi_mobile_app/features/session/cubit/session_cubit.dart'; | ||
import 'package:varanasi_mobile_app/gen/assets.gen.dart'; | ||
import 'package:varanasi_mobile_app/utils/extensions/extensions.dart'; | ||
import 'package:varanasi_mobile_app/utils/helpers/ressponsive_sizer.dart'; | ||
import 'package:varanasi_mobile_app/utils/routes.dart'; | ||
|
||
class AuthPage extends StatelessWidget { | ||
const AuthPage({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return AnnotatedRegion( | ||
value: const SystemUiOverlayStyle(statusBarBrightness: Brightness.dark), | ||
child: Scaffold( | ||
body: SafeArea( | ||
child: Align( | ||
alignment: Alignment.center, | ||
child: SizedBox( | ||
width: Device.width * 0.8, | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
children: [ | ||
Assets.icon.appIconMonotone.svg( | ||
placeholderBuilder: (ctx) => | ||
const SizedBox(width: 48, height: 48), | ||
return Scaffold( | ||
body: SafeArea( | ||
child: Align( | ||
alignment: Alignment.center, | ||
child: SizedBox( | ||
width: Device.width * 0.8, | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
children: [ | ||
Assets.icon.appIconMonotone.svg( | ||
placeholderBuilder: (ctx) => | ||
const SizedBox(width: 48, height: 48), | ||
), | ||
const SizedBox(height: 20), | ||
Text( | ||
"Millions of Songs.\nForever Free.", | ||
style: context.textTheme.titleLarge?.copyWith( | ||
fontWeight: FontWeight.bold, | ||
), | ||
const SizedBox(height: 20), | ||
Text( | ||
"Millions of Songs.\nForever Free.", | ||
style: context.textTheme.titleLarge?.copyWith( | ||
fontWeight: FontWeight.bold, | ||
), | ||
textAlign: TextAlign.center, | ||
textAlign: TextAlign.center, | ||
), | ||
const SizedBox(height: 36), | ||
FilledButton.tonal( | ||
style: _buildButtonStyles(), | ||
onPressed: () => context.pushNamed(AppRoutes.signup.name), | ||
child: _buildText(context, "Sign up for free"), | ||
), | ||
const SizedBox(height: 8), | ||
OutlinedButton.icon( | ||
icon: Assets.icon.google.svg(width: 24, height: 24), | ||
onPressed: context.read<SessionCubit>().continueWithGoogle, | ||
style: _buildButtonStyles(), | ||
label: Center( | ||
child: _buildText(context, "Continue with Google"), | ||
), | ||
const SizedBox(height: 36), | ||
FilledButton.tonal( | ||
onPressed: () {}, | ||
child: const Text( | ||
"Sign up for free", | ||
style: TextStyle( | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
), | ||
OutlinedButton.icon( | ||
icon: const Icon(Icons.facebook), | ||
onPressed: context.read<SessionCubit>().continueWithGoogle, | ||
style: OutlinedButton.styleFrom( | ||
foregroundColor: context.colorScheme.onBackground, | ||
), | ||
label: const Center( | ||
child: Text( | ||
"Continue with Google", | ||
style: TextStyle( | ||
fontWeight: FontWeight.w800, | ||
), | ||
), | ||
), | ||
), | ||
TextButton( | ||
style: TextButton.styleFrom( | ||
foregroundColor: context.colorScheme.onBackground, | ||
), | ||
onPressed: () {}, | ||
child: const Text( | ||
"Log in", | ||
style: TextStyle(fontWeight: FontWeight.bold), | ||
), | ||
) | ||
], | ||
), | ||
), | ||
const SizedBox(height: 8), | ||
TextButton( | ||
onPressed: () => context.pushNamed(AppRoutes.login.name), | ||
child: _buildText(context, "Log in"), | ||
) | ||
], | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
|
||
ButtonStyle _buildButtonStyles() { | ||
return OutlinedButton.styleFrom( | ||
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16), | ||
); | ||
} | ||
|
||
Text _buildText(BuildContext context, String text) { | ||
return Text( | ||
text, | ||
style: context.textTheme.bodyLarge?.copyWith(fontWeight: FontWeight.bold), | ||
); | ||
} | ||
} |
Oops, something went wrong.