-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from Team4-DevWave/Mario
login/register screens
- Loading branch information
Showing
12 changed files
with
403 additions
and
101 deletions.
There are no files selected for viewing
40 changes: 0 additions & 40 deletions
40
threddit_app/lib/features/user_system/view/register_screen.dart
This file was deleted.
Oops, something went wrong.
121 changes: 121 additions & 0 deletions
121
threddit_app/lib/features/user_system/view/screens/login_screen.dart
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,121 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
import 'package:threddit_app/features/user_system/view/screens/signup_screen.dart'; | ||
import 'package:threddit_app/features/user_system/view/widgets/app_agreement.dart'; | ||
import 'package:threddit_app/features/user_system/view/widgets/continue_with_google.dart'; | ||
import 'package:threddit_app/theme/button_styles.dart'; | ||
import 'package:threddit_app/theme/colors.dart'; | ||
import 'package:threddit_app/theme/photos.dart'; | ||
import 'package:threddit_app/theme/text_styles.dart'; | ||
|
||
class LogInScreen extends StatelessWidget { | ||
const LogInScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: Center( | ||
child: Image.asset( | ||
Photos.snoLogo, | ||
width: 40.w, | ||
), | ||
), | ||
actions: [ | ||
TextButton( | ||
onPressed: () { | ||
Navigator.of(context).pushReplacement( | ||
MaterialPageRoute( | ||
builder: (ctx) => const SignUpScreen(), | ||
), | ||
); | ||
}, | ||
child: Text( | ||
'Sign up', | ||
style: AppTextStyles.primaryTextStyle, | ||
), | ||
), | ||
], | ||
), | ||
body: Padding( | ||
padding: EdgeInsets.symmetric(horizontal: 13.w), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
children: [ | ||
Column(children: [ | ||
SizedBox(height: 20.h), | ||
Text( | ||
'Log in to Reddit', | ||
style: AppTextStyles.primaryTextStyle | ||
.copyWith(fontSize: 28.sp, fontWeight: FontWeight.w600), | ||
textAlign: TextAlign.center, | ||
), | ||
SizedBox(height: 25.h), | ||
const ContinueWithGoogle(), | ||
SizedBox(height: 15.h), | ||
Row( | ||
children: [ | ||
const Expanded( | ||
child: Divider( | ||
color: AppColors.whiteColor, | ||
height: 1, | ||
thickness: 1, | ||
), | ||
), | ||
Padding( | ||
padding: EdgeInsets.symmetric(horizontal: 13.w), | ||
child: Text( | ||
'OR', | ||
style: AppTextStyles.primaryTextStyle, | ||
), | ||
), | ||
const Expanded( | ||
child: Divider( | ||
color: AppColors.whiteColor, | ||
height: 1, | ||
thickness: 1, | ||
), | ||
), | ||
], | ||
), | ||
]), | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
TextButton( | ||
onPressed: () {}, | ||
child: Text( | ||
'Forget password?', | ||
style: AppTextStyles.primaryTextStyle.copyWith( | ||
color: AppColors.redditOrangeColor, | ||
fontWeight: FontWeight.w600, | ||
), | ||
)), | ||
], | ||
), | ||
Container( | ||
margin: EdgeInsets.only(bottom: 15.h), | ||
child: Column( | ||
mainAxisSize: MainAxisSize.max, | ||
children: [ | ||
const AppAgreement(), | ||
const SizedBox(height: 24), | ||
ElevatedButton( | ||
onPressed: () {}, | ||
style: AppButtons.registerButtons, | ||
child: Text('Continue', | ||
style: AppTextStyles.primaryTextStyle.copyWith( | ||
fontSize: 16, | ||
fontWeight: FontWeight.w600, | ||
)), | ||
) | ||
], | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
85 changes: 85 additions & 0 deletions
85
threddit_app/lib/features/user_system/view/screens/register_screen.dart
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,85 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:threddit_app/features/user_system/view/screens/login_screen.dart'; | ||
import 'package:threddit_app/features/user_system/view/widgets/app_agreement.dart'; | ||
import 'package:threddit_app/features/user_system/view/widgets/register_buttons.dart'; | ||
import 'package:threddit_app/theme/colors.dart'; | ||
import 'package:threddit_app/theme/photos.dart'; | ||
import 'package:threddit_app/theme/text_styles.dart'; | ||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
|
||
class RegisterScreen extends StatelessWidget { | ||
const RegisterScreen({super.key}); | ||
|
||
void _login(BuildContext context) { | ||
Navigator.of(context) | ||
.push(MaterialPageRoute(builder: (ctx) => const LogInScreen())); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: Column( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
SizedBox(height: ScreenUtil().statusBarHeight), | ||
Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
Image.asset( | ||
Photos.snoLogo, | ||
width: 55.w, | ||
), | ||
SizedBox(height: 10.h), | ||
Padding( | ||
padding: EdgeInsets.symmetric(horizontal: 15.w), | ||
child: Text( | ||
'All your interests in one place', | ||
style: AppTextStyles.welcomeScreen, | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
], | ||
), | ||
Container( | ||
margin: EdgeInsets.only(bottom: 10.h, left: 13.w, right: 13.w), | ||
child: Column( | ||
children: [ | ||
const RegisterButtons(), | ||
SizedBox(height: 16.h), | ||
const AppAgreement(), | ||
SizedBox(height: 20.h), | ||
TextButton( | ||
onPressed: () { | ||
_login(context); | ||
}, | ||
child: RichText( | ||
textAlign: TextAlign.center, | ||
text: TextSpan( | ||
children: [ | ||
TextSpan( | ||
text: 'Already a redditor? ', | ||
style: AppTextStyles.primaryTextStyle.copyWith( | ||
fontSize: 16.sp, | ||
fontWeight: FontWeight.w600, | ||
), | ||
), | ||
TextSpan( | ||
text: 'Log in', | ||
style: AppTextStyles.primaryTextStyle.copyWith( | ||
fontSize: 16, | ||
fontWeight: FontWeight.w600, | ||
color: AppColors.redditOrangeColor), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
108 changes: 108 additions & 0 deletions
108
threddit_app/lib/features/user_system/view/screens/signup_screen.dart
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,108 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
import 'package:threddit_app/features/user_system/view/screens/login_screen.dart'; | ||
import 'package:threddit_app/features/user_system/view/screens/signup_screen.dart'; | ||
import 'package:threddit_app/features/user_system/view/widgets/app_agreement.dart'; | ||
import 'package:threddit_app/features/user_system/view/widgets/continue_with_google.dart'; | ||
import 'package:threddit_app/theme/button_styles.dart'; | ||
import 'package:threddit_app/theme/colors.dart'; | ||
import 'package:threddit_app/theme/photos.dart'; | ||
import 'package:threddit_app/theme/text_styles.dart'; | ||
|
||
class SignUpScreen extends StatelessWidget { | ||
const SignUpScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: Center( | ||
child: Image.asset( | ||
Photos.snoLogo, | ||
width: 40.w, | ||
), | ||
), | ||
actions: [ | ||
TextButton( | ||
onPressed: () { | ||
Navigator.of(context).pushReplacement( | ||
MaterialPageRoute( | ||
builder: (ctx) => const LogInScreen(), | ||
), | ||
); | ||
}, | ||
child: Text( | ||
'Log in', | ||
style: AppTextStyles.primaryTextStyle, | ||
), | ||
), | ||
], | ||
), | ||
body: Padding( | ||
padding: EdgeInsets.symmetric(horizontal: 13.w), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
children: [ | ||
Column(children: [ | ||
SizedBox(height: 20.h), | ||
Text( | ||
'Hi new friend, welcome to Reddit', | ||
style: AppTextStyles.primaryTextStyle | ||
.copyWith(fontSize: 25.sp, fontWeight: FontWeight.w600), | ||
textAlign: TextAlign.center, | ||
), | ||
SizedBox(height: 25.h), | ||
const ContinueWithGoogle(), | ||
SizedBox(height: 15.h), | ||
Row( | ||
children: [ | ||
const Expanded( | ||
child: Divider( | ||
color: AppColors.whiteColor, | ||
height: 1, | ||
thickness: 1, | ||
), | ||
), | ||
Padding( | ||
padding: EdgeInsets.symmetric(horizontal: 13.w), | ||
child: Text( | ||
'OR', | ||
style: AppTextStyles.primaryTextStyle, | ||
), | ||
), | ||
const Expanded( | ||
child: Divider( | ||
color: AppColors.whiteColor, | ||
height: 1, | ||
thickness: 1, | ||
), | ||
), | ||
], | ||
), | ||
]), | ||
Container( | ||
margin: EdgeInsets.only(bottom: 15.h), | ||
child: Column( | ||
mainAxisSize: MainAxisSize.max, | ||
children: [ | ||
const AppAgreement(), | ||
const SizedBox(height: 24), | ||
ElevatedButton( | ||
onPressed: () {}, | ||
style: AppButtons.registerButtons, | ||
child: Text('Continue', | ||
style: AppTextStyles.primaryTextStyle.copyWith( | ||
fontSize: 16, | ||
fontWeight: FontWeight.w600, | ||
)), | ||
) | ||
], | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.