huge progess, start the login buttons and etc on the bottom

This commit is contained in:
zypherift 2024-05-01 22:58:30 +02:00
parent 3cbfee7220
commit 30a9a23b86

View File

@ -1,5 +1,6 @@
// import 'dart:async'; // import 'dart:async';
import 'package:flutter/widgets.dart';
import 'package:refilc/api/client.dart'; import 'package:refilc/api/client.dart';
import 'package:refilc/api/login.dart'; import 'package:refilc/api/login.dart';
import 'package:refilc/theme/colors/colors.dart'; import 'package:refilc/theme/colors/colors.dart';
@ -97,8 +98,6 @@ class LoginScreenState extends State<LoginScreen> {
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
child: SafeArea( child: SafeArea(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// app icon // app icon
Padding( Padding(
@ -127,6 +126,9 @@ class LoginScreenState extends State<LoginScreen> {
), ),
], ],
)), )),
Stack(
alignment: Alignment.bottomCenter,
children: [
Column( Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -143,8 +145,10 @@ class LoginScreenState extends State<LoginScreen> {
return Builder( return Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
mainAxisAlignment: MainAxisAlignment.start, CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: padding:
@ -161,20 +165,24 @@ class LoginScreenState extends State<LoginScreen> {
color: Color(0xFF050B15), color: Color(0xFF050B15),
fontSize: 19, fontSize: 19,
fontFamily: 'Montserrat', fontFamily: 'Montserrat',
fontWeight: FontWeight.w700, fontWeight:
FontWeight.w700,
height: 1.3), height: 1.3),
), ),
const SizedBox( const SizedBox(
height: 14.375), //meth height: 14.375), //meth
Padding( Padding(
padding: const EdgeInsets.only( padding:
const EdgeInsets.only(
right: 20), right: 20),
child: Text( child: Text(
"welcome_text_$i".i18n, "welcome_text_$i".i18n,
style: const TextStyle( style: const TextStyle(
color: Color(0xFF050B15), color:
Color(0xFF050B15),
fontFamily: 'FigTree', fontFamily: 'FigTree',
fontWeight: FontWeight.w500, fontWeight:
FontWeight.w500,
fontSize: 17, fontSize: 17,
height: 1.3), height: 1.3),
), ),
@ -186,8 +194,7 @@ class LoginScreenState extends State<LoginScreen> {
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: 16, right: 16), left: 16, right: 16),
child: Image.asset( child: Image.asset(
'assets/images/showcase$i.png', 'assets/images/showcase$i.png'))
fit: BoxFit.fitWidth)),
], ],
); );
}, },
@ -195,8 +202,62 @@ class LoginScreenState extends State<LoginScreen> {
}).toList(), }).toList(),
), ),
], ],
) ),
// // inputs Container(
height: 250,
width: 250,
decoration: const BoxDecoration(
color: Color.fromARGB(255, 107, 107, 107)),
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(bottom: 6.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
"username".i18n,
maxLines: 1,
style: TextStyle(
color: AppColors.of(context)
.loginPrimary,
fontWeight: FontWeight.w500,
fontSize: 12.0,
),
),
),
Expanded(
child: Text(
"usernameHint".i18n,
maxLines: 1,
textAlign: TextAlign.right,
style: TextStyle(
color: AppColors.of(context)
.loginSecondary,
fontWeight: FontWeight.w500,
fontSize: 12.0,
),
),
),
],
),
),
Padding(
padding: const EdgeInsets.only(bottom: 12.0),
child: LoginInput(
style: LoginInputStyle.username,
controller: usernameController,
),
),
],
))
// Column(
// //login buttons and ui starts here
// mainAxisAlignment: MainAxisAlignment.end,
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// Padding( // Padding(
// padding: const EdgeInsets.only( // padding: const EdgeInsets.only(
// left: 22.0, // left: 22.0,
@ -205,61 +266,25 @@ class LoginScreenState extends State<LoginScreen> {
// ), // ),
// child: AutofillGroup( // child: AutofillGroup(
// child: Column( // child: Column(
// crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.end,
// children: [ // children: [
// // username // // username
// Padding(
// padding: const EdgeInsets.only(bottom: 6.0),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Expanded(
// child: Text(
// "username".i18n,
// maxLines: 1,
// style: TextStyle(
// color: AppColors.of(context).loginPrimary,
// fontWeight: FontWeight.w500,
// fontSize: 12.0,
// ),
// ),
// ),
// Expanded(
// child: Text(
// "usernameHint".i18n,
// maxLines: 1,
// textAlign: TextAlign.right,
// style: TextStyle(
// color:
// AppColors.of(context).loginSecondary,
// fontWeight: FontWeight.w500,
// fontSize: 12.0,
// ),
// ),
// ),
// ],
// ),
// ),
// Padding(
// padding: const EdgeInsets.only(bottom: 12.0),
// child: LoginInput(
// style: LoginInputStyle.username,
// controller: usernameController,
// ),
// ),
// // password // // password
// Padding( // Padding(
// padding: const EdgeInsets.only(bottom: 6.0), // padding:
// const EdgeInsets.only(bottom: 6.0),
// child: Row( // child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
// children: [ // children: [
// Expanded( // Expanded(
// child: Text( // child: Text(
// "password".i18n, // "password".i18n,
// maxLines: 1, // maxLines: 1,
// style: TextStyle( // style: TextStyle(
// color: AppColors.of(context).loginPrimary, // color: AppColors.of(context)
// .loginPrimary,
// fontWeight: FontWeight.w500, // fontWeight: FontWeight.w500,
// fontSize: 12.0, // fontSize: 12.0,
// ), // ),
@ -271,8 +296,8 @@ class LoginScreenState extends State<LoginScreen> {
// maxLines: 1, // maxLines: 1,
// textAlign: TextAlign.right, // textAlign: TextAlign.right,
// style: TextStyle( // style: TextStyle(
// color: // color: AppColors.of(context)
// AppColors.of(context).loginSecondary, // .loginSecondary,
// fontWeight: FontWeight.w500, // fontWeight: FontWeight.w500,
// fontSize: 12.0, // fontSize: 12.0,
// ), // ),
@ -282,7 +307,8 @@ class LoginScreenState extends State<LoginScreen> {
// ), // ),
// ), // ),
// Padding( // Padding(
// padding: const EdgeInsets.only(bottom: 12.0), // padding:
// const EdgeInsets.only(bottom: 12.0),
// child: LoginInput( // child: LoginInput(
// style: LoginInputStyle.password, // style: LoginInputStyle.password,
// controller: passwordController, // controller: passwordController,
@ -291,12 +317,14 @@ class LoginScreenState extends State<LoginScreen> {
// // school // // school
// Padding( // Padding(
// padding: const EdgeInsets.only(bottom: 6.0), // padding:
// const EdgeInsets.only(bottom: 6.0),
// child: Text( // child: Text(
// "school".i18n, // "school".i18n,
// maxLines: 1, // maxLines: 1,
// style: TextStyle( // style: TextStyle(
// color: AppColors.of(context).loginPrimary, // color: AppColors.of(context)
// .loginPrimary,
// fontWeight: FontWeight.w500, // fontWeight: FontWeight.w500,
// fontSize: 12.0, // fontSize: 12.0,
// ), // ),
@ -310,8 +338,6 @@ class LoginScreenState extends State<LoginScreen> {
// ), // ),
// ), // ),
// ), // ),
// // login button
// Padding( // Padding(
// padding: const EdgeInsets.only( // padding: const EdgeInsets.only(
// top: 35.0, // top: 35.0,
@ -323,8 +349,8 @@ class LoginScreenState extends State<LoginScreen> {
// replacement: const Padding( // replacement: const Padding(
// padding: EdgeInsets.symmetric(vertical: 6.0), // padding: EdgeInsets.symmetric(vertical: 6.0),
// child: CircularProgressIndicator( // child: CircularProgressIndicator(
// valueColor: // valueColor: AlwaysStoppedAnimation<Color>(
// AlwaysStoppedAnimation<Color>(Colors.white), // Colors.white),
// ), // ),
// ), // ),
// child: LoginButton( // child: LoginButton(
@ -338,46 +364,43 @@ class LoginScreenState extends State<LoginScreen> {
// ), // ),
// ), // ),
// ), // ),
// ],
// ),
],
),
// // error messages if (_loginState == LoginState.missingFields ||
// if (_loginState == LoginState.missingFields || _loginState == LoginState.invalidGrant ||
// _loginState == LoginState.invalidGrant || _loginState == LoginState.failed)
// _loginState == LoginState.failed) Padding(
// Padding( padding: const EdgeInsets.only(
// padding: const EdgeInsets.only( top: 8.0, left: 12.0, right: 12.0),
// top: 8.0, left: 12.0, right: 12.0), child: Text(
// child: Text( [
// [ "missing_fields",
// "missing_fields", "invalid_grant",
// "invalid_grant", "error"
// "error" ][_loginState.index]
// ][_loginState.index] .i18n,
// .i18n, style: const TextStyle(
// style: const TextStyle( color: Colors.red,
// color: Colors.red, fontWeight: FontWeight.w500,
// fontWeight: FontWeight.w500, ),
// ), textAlign: TextAlign.center,
// textAlign: TextAlign.center, ),
// ), ),
// ), // privacy policy
// const SizedBox(height: 22.0), GestureDetector(
onTap: () => PrivacyView.show(context),
// // privacy policy child: Text(
// GestureDetector( 'privacy'.i18n,
// onTap: () => PrivacyView.show(context), style: TextStyle(
// child: Text( color: AppColors.of(context).loginSecondary,
// 'privacy'.i18n, fontWeight: FontWeight.w500,
// style: TextStyle( fontSize: 14.0,
// color: AppColors.of(context).loginSecondary, ),
// fontWeight: FontWeight.w500, ),
// fontSize: 14.0, ),
// ),
// ),
// ),
// const Spacer(
// flex: 1,
// ),
], ],
), ),
), ),