sign in page changes
This commit is contained in:
parent
02bce8318a
commit
a97ec0411d
@ -86,6 +86,7 @@ class _MainAppState extends State<MainApp> {
|
||||
filled: true,
|
||||
fillColor: Colors.grey.withOpacity(0.1),
|
||||
labelStyle: const TextStyle(color: Colors.grey),
|
||||
outlineBorder: BorderSide(color: Colors.grey.shade700),
|
||||
floatingLabelStyle: WidgetStateTextStyle.resolveWith((states) {
|
||||
if (states.contains(WidgetState.focused) &&
|
||||
!states.contains(WidgetState.hovered)) {
|
||||
@ -118,6 +119,8 @@ class _MainAppState extends State<MainApp> {
|
||||
filled: true,
|
||||
fillColor: Colors.grey.withOpacity(0.25),
|
||||
labelStyle: TextStyle(color: Colors.grey.shade700),
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.grey.shade700)),
|
||||
floatingLabelStyle: WidgetStateTextStyle.resolveWith((states) {
|
||||
if (states.contains(WidgetState.focused) &&
|
||||
!states.contains(WidgetState.hovered)) {
|
||||
|
||||
@ -37,7 +37,7 @@ class _SignInPageState extends State<SignInPage> {
|
||||
heightFactor: 1.0,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.fromLTRB(12, 50, 12, 50),
|
||||
height: 475,
|
||||
height: 450,
|
||||
width: 500,
|
||||
child: Card(
|
||||
child: Padding(
|
||||
@ -60,9 +60,12 @@ class _SignInPageState extends State<SignInPage> {
|
||||
controller: _usernameController,
|
||||
autocorrect: false,
|
||||
decoration: const InputDecoration(
|
||||
prefixIcon: Icon(Icons.person_outline),
|
||||
prefixIcon: Padding(
|
||||
padding: EdgeInsets.all(16.0),
|
||||
child: Icon(Icons.person_outline),
|
||||
),
|
||||
labelText: 'Username',
|
||||
border: OutlineInputBorder()),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@ -107,11 +110,13 @@ class _SignInPageState extends State<SignInPage> {
|
||||
autocorrect: false,
|
||||
obscureText: obscurePassword,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.fingerprint),
|
||||
prefixIcon: const Padding(
|
||||
padding: EdgeInsets.all(16.0),
|
||||
child: Icon(Icons.fingerprint),
|
||||
),
|
||||
labelText: 'Password',
|
||||
border: const OutlineInputBorder(),
|
||||
suffixIcon: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
padding: const EdgeInsets.only(right: 16.0),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
@ -131,22 +136,21 @@ class _SignInPageState extends State<SignInPage> {
|
||||
errorMessage!,
|
||||
style: const TextStyle(color: Colors.red),
|
||||
),
|
||||
CheckboxListTile(
|
||||
value: rememberMe,
|
||||
onChanged: (value) async {
|
||||
setState(() {
|
||||
rememberMe = value!;
|
||||
});
|
||||
},
|
||||
title: const Text('Remember me'),
|
||||
),
|
||||
ElevatedButton.icon(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor:
|
||||
Theme.of(context).colorScheme.primary,
|
||||
// padding: const EdgeInsets.only(left: 20.0, right: 20.0, top: 12.0, bottom: 12.0),
|
||||
),
|
||||
icon: _isloading
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: FilledButton(
|
||||
style: FilledButton.styleFrom(
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(6)))),
|
||||
child: SizedBox(
|
||||
width: 374,
|
||||
height: 40,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
_isloading
|
||||
? const SizedBox(
|
||||
width: 20,
|
||||
height: 20,
|
||||
@ -154,12 +158,19 @@ class _SignInPageState extends State<SignInPage> {
|
||||
color: Colors.white,
|
||||
strokeWidth: 3,
|
||||
))
|
||||
: const Icon(Icons.done, color: Colors.white),
|
||||
label: const Text('Sign In',
|
||||
style: TextStyle(color: Colors.white)),
|
||||
: const Padding(
|
||||
padding: EdgeInsets.only(right: 8.0),
|
||||
child: Icon(Icons.done,
|
||||
color: Colors.white),
|
||||
),
|
||||
const Text('Sign in',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 18)),
|
||||
],
|
||||
),
|
||||
),
|
||||
onPressed: () async {
|
||||
setState(() {
|
||||
errorMessage = null;
|
||||
_isloading = true;
|
||||
});
|
||||
jwt = await signIn(username, password).timeout(
|
||||
@ -189,6 +200,44 @@ class _SignInPageState extends State<SignInPage> {
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.bottomLeft,
|
||||
child: Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: MouseRegion(
|
||||
cursor: SystemMouseCursors.click,
|
||||
child: GestureDetector(
|
||||
child: Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: rememberMe,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
rememberMe = value!;
|
||||
});
|
||||
}),
|
||||
const Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Text('Remember me'),
|
||||
)
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
rememberMe = !rememberMe;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user