auth changes

This commit is contained in:
mohammad
2024-08-08 12:47:12 +03:00
parent 73d49d5518
commit 8e8f810d1e
7 changed files with 35 additions and 44 deletions

View File

@ -2,8 +2,8 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:syncrow_web/pages/auth/bloc/auth_bloc.dart'; import 'package:syncrow_web/pages/auth/bloc/auth_bloc.dart';
import 'package:syncrow_web/pages/auth/view/login_page.dart'; import 'package:syncrow_web/pages/auth/view/login_page.dart';
import 'package:syncrow_web/pages/home/view/home_page.dart';
import 'package:syncrow_web/services/locator.dart'; import 'package:syncrow_web/services/locator.dart';
import 'package:syncrow_web/utils/color_manager.dart';
Future<void> main() async { Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
@ -34,18 +34,25 @@ class MyApp extends StatelessWidget {
), ),
theme: ThemeData( theme: ThemeData(
textTheme: const TextTheme( textTheme: const TextTheme(
bodySmall:TextStyle(), bodySmall: TextStyle(
bodyLarge:TextStyle(), fontSize: 13,
bodyMedium:TextStyle(), color: ColorsManager.whiteColors,
fontWeight: FontWeight.bold),
bodyMedium: TextStyle(color: Colors.black87, fontSize: 14),
bodyLarge: TextStyle(fontSize: 16,color: Colors.white),
headlineSmall: TextStyle(color: Colors.black87, fontSize: 18),
headlineMedium: TextStyle(color: Colors.black87, fontSize: 20),
headlineLarge: TextStyle(
color: Colors.white,
fontSize: 24,
fontWeight: FontWeight.bold,
),
), ),
colorScheme: ColorScheme.fromSeed( colorScheme: ColorScheme.fromSeed(
seedColor: Colors.deepPurple), // Set up color scheme seedColor: Colors.deepPurple), // Set up color scheme
useMaterial3: true, // Enable Material 3 useMaterial3: true, // Enable Material 3
), ),
home: isLoggedIn == 'Success'? home:LoginPage(),
const HomePage()
:
const LoginPage(),
); );
} }
} }

View File

@ -11,7 +11,6 @@ import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/utils/style.dart'; import 'package:syncrow_web/utils/style.dart';
class ForgetPasswordWebPage extends StatelessWidget { class ForgetPasswordWebPage extends StatelessWidget {
const ForgetPasswordWebPage({super.key}); const ForgetPasswordWebPage({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -113,7 +112,7 @@ class ForgetPasswordWebPage extends StatelessWidget {
const SizedBox(height: 10), const SizedBox(height: 10),
Text( Text(
'Please fill in your account information to\nretrieve your password', 'Please fill in your account information to\nretrieve your password',
style: smallTextStyle, style: Theme.of(context).textTheme.bodySmall,
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
Column( Column(
@ -122,7 +121,7 @@ class ForgetPasswordWebPage extends StatelessWidget {
children: [ children: [
Text( Text(
"Country/Region", "Country/Region",
style: smallTextStyle, style: Theme.of(context).textTheme.bodySmall,
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
SizedBox( SizedBox(
@ -167,7 +166,7 @@ class ForgetPasswordWebPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text("Account", Text("Account",
style: smallTextStyle, style: Theme.of(context).textTheme.bodySmall,
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
SizedBox( SizedBox(
@ -186,7 +185,7 @@ class ForgetPasswordWebPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text("One Time Password", Text("One Time Password",
style: smallTextStyle,), style: Theme.of(context).textTheme.bodySmall,),
const SizedBox(height: 10), const SizedBox(height: 10),
SizedBox( SizedBox(
child: TextFormField( child: TextFormField(
@ -225,7 +224,7 @@ class ForgetPasswordWebPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text("Password", Text("Password",
style: smallTextStyle,), style: Theme.of(context).textTheme.bodySmall,),
const SizedBox(height: 10), const SizedBox(height: 10),
SizedBox( SizedBox(
child: TextFormField( child: TextFormField(

View File

@ -127,7 +127,7 @@ class LoginMobilePage extends StatelessWidget {
children: [ children: [
Text( Text(
"Country/Region", "Country/Region",
style: smallTextStyle, style: Theme.of(context).textTheme.bodySmall,
), ),
SizedBox( SizedBox(
child: DropdownButtonFormField<String>( child: DropdownButtonFormField<String>(
@ -168,7 +168,7 @@ class LoginMobilePage extends StatelessWidget {
children: [ children: [
Text( Text(
"Email", "Email",
style: smallTextStyle, style: Theme.of(context).textTheme.bodySmall,
), ),
SizedBox( SizedBox(
child: TextFormField( child: TextFormField(
@ -188,7 +188,7 @@ class LoginMobilePage extends StatelessWidget {
children: [ children: [
Text( Text(
"Password", "Password",
style: smallTextStyle, style: Theme.of(context).textTheme.bodySmall,
), ),
SizedBox( SizedBox(
child: TextFormField( child: TextFormField(
@ -221,7 +221,7 @@ class LoginMobilePage extends StatelessWidget {
}, },
child: Text( child: Text(
"Forgot Password?", "Forgot Password?",
style: smallTextStyle, style: Theme.of(context).textTheme.bodySmall,
), ),
), ),
], ],

View File

@ -26,7 +26,6 @@ class _LoginWebPageState extends State<LoginWebPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
body: BlocProvider( body: BlocProvider(
create: (BuildContext context) => AuthBloc(), create: (BuildContext context) => AuthBloc(),
@ -119,13 +118,9 @@ class _LoginWebPageState extends State<LoginWebPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
const SizedBox(height: 40), const SizedBox(height: 40),
const Text( Text(
'Login', 'Login',
style: TextStyle( style:Theme.of(context).textTheme.headlineLarge),
color: Colors.white,
fontSize: 24,
fontWeight: FontWeight.bold),
),
SizedBox(height: size.height*0.03), SizedBox(height: size.height*0.03),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -133,7 +128,7 @@ class _LoginWebPageState extends State<LoginWebPage> {
children: [ children: [
Text( Text(
"Country/Region", "Country/Region",
style: smallTextStyle, style: Theme.of(context).textTheme.bodySmall,
), ),
const SizedBox(height: 10,), const SizedBox(height: 10,),
SizedBox( SizedBox(
@ -164,9 +159,7 @@ class _LoginWebPageState extends State<LoginWebPage> {
child: Text(region), child: Text(region),
); );
}).toList(), }).toList(),
onChanged: (String? value) { onChanged: (String? value) {},
print(value);
},
), ),
) )
], ],
@ -177,7 +170,7 @@ class _LoginWebPageState extends State<LoginWebPage> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text("Email", Text("Email",
style: smallTextStyle, style: Theme.of(context).textTheme.bodySmall,
), ),
const SizedBox( const SizedBox(
height: 10, height: 10,
@ -197,7 +190,7 @@ class _LoginWebPageState extends State<LoginWebPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text("Password", style: smallTextStyle,), Text("Password", style: Theme.of(context).textTheme.bodySmall,),
const SizedBox( const SizedBox(
height: 10, height: 10,
), ),
@ -241,7 +234,7 @@ class _LoginWebPageState extends State<LoginWebPage> {
}, },
child: Text( child: Text(
"Forgot Password?", "Forgot Password?",
style: smallTextStyle, style: Theme.of(context).textTheme.bodySmall,
), ),
), ),
], ],

View File

@ -1,6 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:syncrow_web/utils/color_manager.dart'; import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/style.dart';
class DefaultButton extends StatelessWidget { class DefaultButton extends StatelessWidget {
const DefaultButton({ const DefaultButton({
@ -48,7 +47,7 @@ class DefaultButton extends StatelessWidget {
ButtonStyle( ButtonStyle(
textStyle: MaterialStateProperty.all( textStyle: MaterialStateProperty.all(
customTextStyle customTextStyle
?? smallTextStyle.copyWith( ?? Theme.of(context).textTheme.bodySmall!.copyWith(
fontSize: 13, fontSize: 13,
color: foregroundColor, color: foregroundColor,
fontWeight: FontWeight.normal fontWeight: FontWeight.normal

View File

@ -22,11 +22,5 @@ InputDecoration? textBoxDecoration({bool suffixIcon = false}) => InputDecoration
); );
TextStyle appBarTextStyle =
const TextStyle(fontSize: 20, color: ColorsManager.whiteColors);
TextStyle smallTextStyle =
const TextStyle(fontSize: 13, color: ColorsManager.whiteColors,fontWeight: FontWeight.bold);
Decoration containerDecoration = const BoxDecoration(color: Colors.white,borderRadius: BorderRadius.all(Radius.circular(20))); Decoration containerDecoration = const BoxDecoration(color: Colors.white,borderRadius: BorderRadius.all(Radius.circular(20)));

View File

@ -18,9 +18,8 @@ class WebAppBar extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
title!,style: const TextStyle( title!,
fontSize: 30, style: Theme.of(context).textTheme.headlineLarge,)
color: Colors.white),)
), ),
if (body != null) if (body != null)
Expanded( Expanded(
@ -49,7 +48,7 @@ class WebAppBar extends StatelessWidget {
), ),
), ),
const SizedBox(width: 10,), const SizedBox(width: 10,),
const Text('mohamamd alnemer ',style: TextStyle(fontSize: 16,color: Colors.white),), Text('mohamamd alnemer ',style:Theme.of(context).textTheme.bodyLarge ,),
], ],
) )
], ],