Skip to content

Commit

Permalink
Merge pull request #7 from Team4-DevWave/Mario
Browse files Browse the repository at this point in the history
login/register screens
  • Loading branch information
AhmedYasser20 authored Mar 12, 2024
2 parents b6ef4e2 + ebebfa8 commit dd73b19
Show file tree
Hide file tree
Showing 12 changed files with 403 additions and 101 deletions.
40 changes: 0 additions & 40 deletions threddit_app/lib/features/user_system/view/register_screen.dart

This file was deleted.

121 changes: 121 additions & 0 deletions threddit_app/lib/features/user_system/view/screens/login_screen.dart
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,
)),
)
],
),
),
],
),
),
);
}
}
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 threddit_app/lib/features/user_system/view/screens/signup_screen.dart
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,
)),
)
],
),
),
],
),
),
);
}
}
Loading

0 comments on commit dd73b19

Please sign in to comment.