routing fix
This commit is contained in:
parent
82a54be301
commit
5be9097964
@ -311,8 +311,13 @@ final GoRouter router = GoRouter(
|
|||||||
routes: [
|
routes: [
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: '/',
|
path: '/',
|
||||||
//builder: (context, state) => LoginRoute(),
|
builder: (context, state) => LoginRoute(),
|
||||||
builder: (context, state) => MyHomePage(),
|
//builder: (context, state) => MyHomePage(),
|
||||||
|
),
|
||||||
|
GoRoute(
|
||||||
|
path: '/login',
|
||||||
|
builder: (context, state) => LoginRoute(),
|
||||||
|
|
||||||
),
|
),
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: '/myhomepage',
|
path: '/myhomepage',
|
||||||
|
|||||||
@ -515,8 +515,14 @@ class _LoginRouteState extends State<LoginRoute> {
|
|||||||
bool _obscurePassword = true;
|
bool _obscurePassword = true;
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
double screenheight = MediaQuery.of(context).size.height;
|
double screenheight = MediaQuery
|
||||||
double screenwidth = MediaQuery.of(context).size.width;
|
.of(context)
|
||||||
|
.size
|
||||||
|
.height;
|
||||||
|
double screenwidth = MediaQuery
|
||||||
|
.of(context)
|
||||||
|
.size
|
||||||
|
.width;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Padding(
|
body: Padding(
|
||||||
padding: const EdgeInsets.all(20.0),
|
padding: const EdgeInsets.all(20.0),
|
||||||
@ -533,20 +539,20 @@ class _LoginRouteState extends State<LoginRoute> {
|
|||||||
fontSize: 32, fontWeight: FontWeight.w400),
|
fontSize: 32, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
SizedBox(height: 5),
|
SizedBox(height: 5),
|
||||||
Text('Please login to access',style: TextStyle(
|
Text('Please login to access', style: TextStyle(
|
||||||
fontFamily: context.translate(
|
fontFamily: context.translate(
|
||||||
'Roboto',
|
'Roboto',
|
||||||
'NotoKufi',
|
'NotoKufi',
|
||||||
),
|
),
|
||||||
color: Color(0xFF898C81),
|
color: Color(0xFF898C81),
|
||||||
fontSize: 18, fontWeight: FontWeight.bold),),
|
fontSize: 18, fontWeight: FontWeight.bold),),
|
||||||
Text("UAE's key official statistics",style: TextStyle(
|
Text("UAE's key official statistics", style: TextStyle(
|
||||||
fontFamily: context.translate(
|
fontFamily: context.translate(
|
||||||
'Roboto',
|
'Roboto',
|
||||||
'NotoKufi',
|
'NotoKufi',
|
||||||
),
|
),
|
||||||
color: Color(0xFF898C81),
|
color: Color(0xFF898C81),
|
||||||
fontSize: 16, fontWeight: FontWeight.bold),),
|
fontSize: 16, fontWeight: FontWeight.bold),),
|
||||||
|
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
// Display this if registration is pending approval
|
// Display this if registration is pending approval
|
||||||
@ -556,16 +562,20 @@ class _LoginRouteState extends State<LoginRoute> {
|
|||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: "Username",
|
hintText: "Username",
|
||||||
//hintText: _showHints[0] ? 'Username' : null,
|
//hintText: _showHints[0] ? 'Username' : null,
|
||||||
prefixIcon: Image.asset("assets/icons/misc/person.png",scale: 2,color: Colors.lightBlueAccent,),
|
prefixIcon: Image.asset(
|
||||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(15)),
|
"assets/icons/misc/person.png", scale: 2,
|
||||||
|
color: Colors.lightBlueAccent,),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(15)),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
borderSide: BorderSide(color: Colors.blue.shade900,)
|
borderSide: BorderSide(color: Colors.blue.shade900,)
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(10), // Keep rounded corners
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
// Keep rounded corners
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Colors.blue,// Default border color
|
color: Colors.blue, // Default border color
|
||||||
width: 1.0, // Border width when not focused
|
width: 1.0, // Border width when not focused
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -583,8 +593,10 @@ class _LoginRouteState extends State<LoginRoute> {
|
|||||||
// obscureText: _obscurePassword,
|
// obscureText: _obscurePassword,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: "Password",
|
hintText: "Password",
|
||||||
// hintText: _showHints[2] ? 'Enter your password' : null,
|
// hintText: _showHints[2] ? 'Enter your password' : null,
|
||||||
prefixIcon: Image.asset("assets/icons/misc/lock.png",scale: 2,color: Colors.lightBlueAccent,),
|
prefixIcon: Image.asset(
|
||||||
|
"assets/icons/misc/lock.png", scale: 2,
|
||||||
|
color: Colors.lightBlueAccent,),
|
||||||
suffixIcon: IconButton(
|
suffixIcon: IconButton(
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
_obscurePassword
|
_obscurePassword
|
||||||
@ -598,16 +610,18 @@ class _LoginRouteState extends State<LoginRoute> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(15)),
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(15)),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
borderSide: BorderSide(color: Colors.blue.shade900,),
|
borderSide: BorderSide(color: Colors.blue.shade900,),
|
||||||
|
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(10), // Keep rounded corners
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
// Keep rounded corners
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Colors.blue,// Default border color
|
color: Colors.blue, // Default border color
|
||||||
width: 1.0, // Border width when not focused
|
width: 1.0, // Border width when not focused
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -620,14 +634,16 @@ class _LoginRouteState extends State<LoginRoute> {
|
|||||||
|
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
Row(mainAxisAlignment: MainAxisAlignment.end,
|
Row(mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [Text("Forgot Password?",
|
children: [Text("Forgot Password?",
|
||||||
style: TextStyle(color: Color(0xFF985400),fontWeight: FontWeight.bold
|
style: TextStyle(
|
||||||
),)],),
|
color: Color(0xFF985400), fontWeight: FontWeight.bold
|
||||||
|
),)
|
||||||
|
],),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: screenwidth,
|
width: screenwidth,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: (){
|
onPressed: () {
|
||||||
context.go('/profile');
|
context.go('/profile');
|
||||||
},
|
},
|
||||||
//_registerUser,
|
//_registerUser,
|
||||||
@ -648,33 +664,33 @@ class _LoginRouteState extends State<LoginRoute> {
|
|||||||
),
|
),
|
||||||
SizedBox(width: 8),
|
SizedBox(width: 8),
|
||||||
Icon(Icons.arrow_forward_ios,
|
Icon(Icons.arrow_forward_ios,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
size: 10,
|
size: 10,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: screenheight/20),
|
SizedBox(height: screenheight / 20),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Don't have an account? ",
|
"Don't have an account? ",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: context.translate(
|
fontFamily: context.translate(
|
||||||
'Roboto',
|
'Roboto',
|
||||||
'NotoKufi',
|
'NotoKufi',
|
||||||
),
|
),
|
||||||
color: Color(0xFF898C81),
|
color: Color(0xFF898C81),
|
||||||
fontSize: 18, fontWeight: FontWeight.bold),
|
fontSize: 18, fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: (){
|
onTap: () {
|
||||||
context.go('/registration');
|
context.go('/registration');
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
" Register Now",
|
" Register Now",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: context.translate(
|
fontFamily: context.translate(
|
||||||
'Roboto',
|
'Roboto',
|
||||||
@ -682,12 +698,12 @@ class _LoginRouteState extends State<LoginRoute> {
|
|||||||
),
|
),
|
||||||
color: Color(0xFF985400),
|
color: Color(0xFF985400),
|
||||||
fontSize: 18, fontWeight: FontWeight.bold),
|
fontSize: 18, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
],),
|
||||||
],),
|
|
||||||
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: screenheight/20,
|
height: screenheight / 20,
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: screenwidth,
|
width: screenwidth,
|
||||||
@ -714,13 +730,13 @@ class _LoginRouteState extends State<LoginRoute> {
|
|||||||
),
|
),
|
||||||
SizedBox(width: 8),
|
SizedBox(width: 8),
|
||||||
Icon(Icons.arrow_forward_ios,
|
Icon(Icons.arrow_forward_ios,
|
||||||
color: Colors.white,size: 10,),
|
color: Colors.white, size: 10,),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: screenheight/15,
|
height: screenheight / 15,
|
||||||
),
|
),
|
||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -729,7 +745,8 @@ class _LoginRouteState extends State<LoginRoute> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage(
|
image: AssetImage(
|
||||||
"assets/splash_screen/logo.png"), // Background image asset
|
"assets/splash_screen/logo.png"),
|
||||||
|
// Background image asset
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -740,8 +757,8 @@ class _LoginRouteState extends State<LoginRoute> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
final form = Form(
|
final form = Form(
|
||||||
key: formKey,
|
key: formKey,
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -940,6 +957,5 @@ class _LoginRouteState extends State<LoginRoute> {
|
|||||||
body: SafeArea(child: scaffoldBody),
|
body: SafeArea(child: scaffoldBody),
|
||||||
);
|
);
|
||||||
return bgScaffold;
|
return bgScaffold;
|
||||||
>>>>>>> b0c5ebce3deb7da2aa24b0ea5ffe684df7dfb7bf
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user