routing fix

This commit is contained in:
VINISTAN 2024-12-19 15:16:51 +05:30
parent 82a54be301
commit 5be9097964
2 changed files with 78 additions and 57 deletions

View File

@ -311,8 +311,13 @@ final GoRouter router = GoRouter(
routes: [
GoRoute(
path: '/',
//builder: (context, state) => LoginRoute(),
builder: (context, state) => MyHomePage(),
builder: (context, state) => LoginRoute(),
//builder: (context, state) => MyHomePage(),
),
GoRoute(
path: '/login',
builder: (context, state) => LoginRoute(),
),
GoRoute(
path: '/myhomepage',

View File

@ -515,8 +515,14 @@ class _LoginRouteState extends State<LoginRoute> {
bool _obscurePassword = true;
@override
Widget build(BuildContext context) {
double screenheight = MediaQuery.of(context).size.height;
double screenwidth = MediaQuery.of(context).size.width;
double screenheight = MediaQuery
.of(context)
.size
.height;
double screenwidth = MediaQuery
.of(context)
.size
.width;
return Scaffold(
body: Padding(
padding: const EdgeInsets.all(20.0),
@ -556,14 +562,18 @@ class _LoginRouteState extends State<LoginRoute> {
decoration: InputDecoration(
hintText: "Username",
//hintText: _showHints[0] ? 'Username' : null,
prefixIcon: Image.asset("assets/icons/misc/person.png",scale: 2,color: Colors.lightBlueAccent,),
border: OutlineInputBorder(borderRadius: BorderRadius.circular(15)),
prefixIcon: Image.asset(
"assets/icons/misc/person.png", scale: 2,
color: Colors.lightBlueAccent,),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(15)),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: BorderSide(color: Colors.blue.shade900,)
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10), // Keep rounded corners
borderRadius: BorderRadius.circular(10),
// Keep rounded corners
borderSide: BorderSide(
color: Colors.blue, // Default border color
width: 1.0, // Border width when not focused
@ -584,7 +594,9 @@ class _LoginRouteState extends State<LoginRoute> {
decoration: InputDecoration(
hintText: "Password",
// 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(
icon: Icon(
_obscurePassword
@ -598,14 +610,16 @@ class _LoginRouteState extends State<LoginRoute> {
});
},
),
border: OutlineInputBorder(borderRadius: BorderRadius.circular(15)),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(15)),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: BorderSide(color: Colors.blue.shade900,),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10), // Keep rounded corners
borderRadius: BorderRadius.circular(10),
// Keep rounded corners
borderSide: BorderSide(
color: Colors.blue, // Default border color
width: 1.0, // Border width when not focused
@ -621,8 +635,10 @@ class _LoginRouteState extends State<LoginRoute> {
SizedBox(height: 10),
Row(mainAxisAlignment: MainAxisAlignment.end,
children: [Text("Forgot Password?",
style: TextStyle(color: Color(0xFF985400),fontWeight: FontWeight.bold
),)],),
style: TextStyle(
color: Color(0xFF985400), fontWeight: FontWeight.bold
),)
],),
SizedBox(height: 20),
SizedBox(
width: screenwidth,
@ -729,7 +745,8 @@ class _LoginRouteState extends State<LoginRoute> {
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
"assets/splash_screen/logo.png"), // Background image asset
"assets/splash_screen/logo.png"),
// Background image asset
fit: BoxFit.fill,
),
),
@ -740,8 +757,8 @@ class _LoginRouteState extends State<LoginRoute> {
),
),
);
<<<<<<< HEAD
=======
final form = Form(
key: formKey,
child: Column(
@ -940,6 +957,5 @@ class _LoginRouteState extends State<LoginRoute> {
body: SafeArea(child: scaffoldBody),
);
return bgScaffold;
>>>>>>> b0c5ebce3deb7da2aa24b0ea5ffe684df7dfb7bf
}
}