remove comment

This commit is contained in:
zypherift 2024-05-03 19:05:19 +02:00
parent 2e14d52c25
commit 56c87b146b

View File

@ -86,483 +86,355 @@ class LoginScreenState extends State<LoginScreen> {
precacheImage(const AssetImage('assets/images/showcase3.png'), context); precacheImage(const AssetImage('assets/images/showcase3.png'), context);
precacheImage(const AssetImage('assets/images/showcase4.png'), context); precacheImage(const AssetImage('assets/images/showcase4.png'), context);
return Portal( return Scaffold(
child: Scaffold( body: Container(
body: Container( decoration: const BoxDecoration(color: Color(0xFFDAE4F7)),
decoration: const BoxDecoration(color: Color(0xFFDAE4F7)), child: SingleChildScrollView(
child: SingleChildScrollView( physics: const ClampingScrollPhysics(),
physics: const ClampingScrollPhysics(), controller: _scrollController,
controller: _scrollController, child: Container(
child: Container( decoration: const BoxDecoration(color: Color(0xFFDAE4F7)),
decoration: const BoxDecoration(color: Color(0xFFDAE4F7)), width: MediaQuery.of(context).size.width,
width: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.height,
height: MediaQuery.of(context).size.height, child: SafeArea(
child: SafeArea( child: Column(
child: Column( children: [
children: [ // app icon
// app icon Padding(
Padding( padding: const EdgeInsets.only(left: 24, top: 20),
padding: const EdgeInsets.only(left: 24, top: 20), child: Row(
child: Row( children: [
children: [ Image.asset(
Image.asset( 'assets/icons/ic_rounded.png',
'assets/icons/ic_rounded.png', width: 30.0,
width: 30.0, ),
), const SizedBox(width: 8),
const SizedBox(width: 8), const Text(
const Text( 'reFilc',
'reFilc', style: TextStyle(
style: TextStyle( color: Color(0xFF050B15),
color: Color(0xFF050B15), fontSize: 18.0,
fontSize: 18.0, fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, fontFamily: 'Montserrat'),
fontFamily: 'Montserrat'), ),
), Material(
Material( type: MaterialType.transparency,
type: MaterialType.transparency, child: showBack
child: showBack ? BackButton(color: AppColors.of(context).text)
? BackButton( : const SizedBox(height: 48.0),
color: AppColors.of(context).text) ),
: const SizedBox(height: 48.0), ],
), )),
], Stack(
)), alignment: Alignment.bottomCenter,
Stack( children: [
alignment: Alignment.bottomCenter, Column(
children: [ //login buttons and ui starts here
// Column( mainAxisAlignment: MainAxisAlignment.end,
// mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.end,
// crossAxisAlignment: CrossAxisAlignment.center, children: [
// children: [ const SizedBox(height: 21),
// const SizedBox(height: 21), CarouselSlider(
// CarouselSlider( options: CarouselOptions(
// options: CarouselOptions( height: MediaQuery.of(context).size.height,
// height: MediaQuery.of(context).size.height, viewportFraction: 1,
// viewportFraction: 1, autoPlay: true,
// autoPlay: true, autoPlayInterval: const Duration(seconds: 6),
// autoPlayInterval: const Duration(seconds: 6), pauseAutoPlayOnTouch: true),
// pauseAutoPlayOnTouch: true), items: [1, 2, 3, 4].map((i) {
// items: [1, 2, 3, 4].map((i) { return Builder(
// return Builder( builder: (BuildContext context) {
// builder: (BuildContext context) { return Column(
// return Column( crossAxisAlignment:
// crossAxisAlignment: CrossAxisAlignment.start,
// CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
// mainAxisAlignment: children: [
// MainAxisAlignment.start, Padding(
// children: [ padding:
// Padding( const EdgeInsets.only(left: 24),
// padding: child: Column(
// const EdgeInsets.only(left: 24), crossAxisAlignment:
// child: Column( CrossAxisAlignment.start,
// crossAxisAlignment: mainAxisAlignment:
// CrossAxisAlignment.start, MainAxisAlignment.start,
// mainAxisAlignment: children: [
// MainAxisAlignment.start, Text(
// children: [ "welcome_title_$i".i18n,
// Text( style: const TextStyle(
// "welcome_title_$i".i18n, color: Color(0xFF050B15),
// style: const TextStyle( fontSize: 19,
// color: Color(0xFF050B15), fontFamily: 'Montserrat',
// fontSize: 19, fontWeight: FontWeight.w700,
// fontFamily: 'Montserrat', height: 1.3),
// fontWeight: ),
// FontWeight.w700, const SizedBox(
// height: 1.3), height: 14.375), //meth
// ), Padding(
// const SizedBox( padding: const EdgeInsets.only(
// height: 14.375), //meth right: 20),
// Padding( child: Text(
// padding: "welcome_text_$i".i18n,
// const EdgeInsets.only(
// right: 20),
// child: Text(
// "welcome_text_$i".i18n,
// style: const TextStyle(
// color:
// Color(0xFF050B15),
// fontFamily: 'FigTree',
// fontWeight:
// FontWeight.w500,
// fontSize: 17,
// height: 1.3),
// ),
// ),
// ],
// )),
// const SizedBox(height: 15.625),
// Padding(
// padding: const EdgeInsets.only(
// left: 16, right: 16),
// child: Image.asset(
// 'assets/images/showcase$i.png'))
// ],
// );
// },
// );
// }).toList(),
// ),
// ],
// ),
// Container(
// height: 250,
// width: double.infinity,
// decoration: const BoxDecoration(
// gradient: LinearGradient(
// colors: [Color(0x00DAE4F7), Color(0xFFDAE4F7)],
// stops: [0, 0.1],
// begin: Alignment.topCenter,
// end: Alignment.bottomCenter,
// ),
// ),
// child: Padding(
// padding: const EdgeInsets.only(top: 3),
// child: Column(
// children: [
// SizedBox(
// height: 48,
// width: double.infinity,
// child: Padding(
// padding: const EdgeInsets.symmetric(
// horizontal: 16),
// child: FilledButton(
// style: ButtonStyle(
// shape: MaterialStateProperty.all<
// RoundedRectangleBorder>(
// const RoundedRectangleBorder(
// borderRadius: BorderRadius.all(
// Radius.circular(12)),
// ))),
// onPressed: () {},
// child: Text(
// "login".i18n,
// style: const TextStyle(
// fontFamily: 'Montserrat',
// fontSize: 20,
// fontWeight: FontWeight.w700),
// )),
// ),
// ),
// const SizedBox(height: 8),
// ],
// ),
// ),
// )
//
//
// TODO: OLD LOGIN FROM HERE
Column(
//login buttons and ui starts here
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
const SizedBox(height: 21),
CarouselSlider(
options: CarouselOptions(
height: MediaQuery.of(context).size.height,
viewportFraction: 1,
autoPlay: true,
autoPlayInterval: const Duration(seconds: 6),
pauseAutoPlayOnTouch: true),
items: [1, 2, 3, 4].map((i) {
return Builder(
builder: (BuildContext context) {
return Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Padding(
padding:
const EdgeInsets.only(left: 24),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"welcome_title_$i".i18n,
style: const TextStyle( style: const TextStyle(
color: Color(0xFF050B15), color: Color(0xFF050B15),
fontSize: 19, fontFamily: 'FigTree',
fontFamily: 'Montserrat',
fontWeight: fontWeight:
FontWeight.w700, FontWeight.w500,
fontSize: 17,
height: 1.3), height: 1.3),
), ),
const SizedBox( ),
height: 14.375), //meth ],
Padding( )),
padding: const SizedBox(height: 15.625),
const EdgeInsets.only( Padding(
right: 20), padding: const EdgeInsets.only(
child: Text( left: 16, right: 16),
"welcome_text_$i".i18n, child: Image.asset(
style: const TextStyle( 'assets/images/showcase$i.png'))
color: ],
Color(0xFF050B15), );
fontFamily: 'FigTree', },
fontWeight: );
FontWeight.w500, }).toList(),
fontSize: 17,
height: 1.3),
),
),
],
)),
const SizedBox(height: 15.625),
Padding(
padding: const EdgeInsets.only(
left: 16, right: 16),
child: Image.asset(
'assets/images/showcase$i.png'))
],
);
},
);
}).toList(),
),
],
),
Container(
height: 250,
width: double.infinity,
decoration: const BoxDecoration(
gradient: LinearGradient(
colors: [Color(0x00DAE4F7), Color(0xFFDAE4F7)],
stops: [0, 0.1],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
), ),
child: Padding( ],
padding: const EdgeInsets.only(top: 3), ),
child: Column( Container(
children: [ height: 250,
SizedBox( width: double.infinity,
height: 48, decoration: const BoxDecoration(
width: double.infinity, gradient: LinearGradient(
child: Padding( colors: [Color(0x00DAE4F7), Color(0xFFDAE4F7)],
padding: const EdgeInsets.symmetric( stops: [0, 0.1],
horizontal: 16), begin: Alignment.topCenter,
child: FilledButton( end: Alignment.bottomCenter,
style: ButtonStyle( ),
shape: MaterialStateProperty.all< ),
RoundedRectangleBorder>( child: Padding(
const RoundedRectangleBorder( padding: const EdgeInsets.only(top: 3),
borderRadius: BorderRadius.all( child: Column(
Radius.circular(12)), children: [
))), SizedBox(
onPressed: () {}, height: 48,
child: Text( width: double.infinity,
"login".i18n, child: Padding(
style: const TextStyle( padding: const EdgeInsets.symmetric(
fontFamily: 'Montserrat', horizontal: 16),
fontSize: 20, child: FilledButton(
fontWeight: FontWeight.w700), style: ButtonStyle(
)), shape: MaterialStateProperty.all<
), RoundedRectangleBorder>(
const RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(12)),
))),
onPressed: () {},
child: Text(
"login".i18n,
style: const TextStyle(
fontFamily: 'Montserrat',
fontSize: 20,
fontWeight: FontWeight.w700),
)),
), ),
const SizedBox(height: 8), ),
], const SizedBox(height: 8),
), ],
), ),
)
// Column(
// //login buttons and ui starts here
// mainAxisAlignment: MainAxisAlignment.end,
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// Padding(
// padding: const EdgeInsets.only(
// left: 22.0,
// right: 22.0,
// top: 0.0,
// ),
// child: AutofillGroup(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// // 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
// Padding(
// padding:
// const EdgeInsets.only(bottom: 6.0),
// child: Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
// children: [
// Expanded(
// child: Text(
// "password".i18n,
// maxLines: 1,
// style: TextStyle(
// color: AppColors.of(context)
// .loginPrimary,
// fontWeight: FontWeight.w500,
// fontSize: 12.0,
// ),
// ),
// ),
// Expanded(
// child: Text(
// "passwordHint".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.password,
// controller: passwordController,
// ),
// ),
// // school
// Padding(
// padding:
// const EdgeInsets.only(bottom: 6.0),
// child: Text(
// "school".i18n,
// maxLines: 1,
// style: TextStyle(
// color: AppColors.of(context)
// .loginPrimary,
// fontWeight: FontWeight.w500,
// fontSize: 12.0,
// ),
// ),
// ),
// SchoolInput(
// scroll: _scrollController,
// controller: schoolController,
// ),
// ],
// ),
// ),
// ),
// Padding(
// padding: const EdgeInsets.only(
// top: 35.0,
// left: 22.0,
// right: 22.0,
// ),
// child: Visibility(
// visible: _loginState != LoginState.inProgress,
// replacement: const Padding(
// padding: EdgeInsets.symmetric(vertical: 6.0),
// child: CircularProgressIndicator(
// valueColor: AlwaysStoppedAnimation<Color>(
// Colors.white),
// ),
// ),
// child: LoginButton(
// child: Text("login".i18n,
// maxLines: 1,
// style: const TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: 20.0,
// )),
// onPressed: () => _loginAPI(context: context),
// ),
// ),
// ),
// ],
// ),
],
),
if (_loginState == LoginState.missingFields ||
_loginState == LoginState.invalidGrant ||
_loginState == LoginState.failed)
Padding(
padding: const EdgeInsets.only(
top: 8.0, left: 12.0, right: 12.0),
child: Text(
[
"missing_fields",
"invalid_grant",
"error"
][_loginState.index]
.i18n,
style: const TextStyle(
color: Colors.red,
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
), ),
), )
// privacy policy // Column(
GestureDetector( // //login buttons and ui starts here
onTap: () => PrivacyView.show(context), // mainAxisAlignment: MainAxisAlignment.end,
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// Padding(
// padding: const EdgeInsets.only(
// left: 22.0,
// right: 22.0,
// top: 0.0,
// ),
// child: AutofillGroup(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// // 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
// Padding(
// padding:
// const EdgeInsets.only(bottom: 6.0),
// child: Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
// children: [
// Expanded(
// child: Text(
// "password".i18n,
// maxLines: 1,
// style: TextStyle(
// color: AppColors.of(context)
// .loginPrimary,
// fontWeight: FontWeight.w500,
// fontSize: 12.0,
// ),
// ),
// ),
// Expanded(
// child: Text(
// "passwordHint".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.password,
// controller: passwordController,
// ),
// ),
// // school
// Padding(
// padding:
// const EdgeInsets.only(bottom: 6.0),
// child: Text(
// "school".i18n,
// maxLines: 1,
// style: TextStyle(
// color: AppColors.of(context)
// .loginPrimary,
// fontWeight: FontWeight.w500,
// fontSize: 12.0,
// ),
// ),
// ),
// SchoolInput(
// scroll: _scrollController,
// controller: schoolController,
// ),
// ],
// ),
// ),
// ),
// Padding(
// padding: const EdgeInsets.only(
// top: 35.0,
// left: 22.0,
// right: 22.0,
// ),
// child: Visibility(
// visible: _loginState != LoginState.inProgress,
// replacement: const Padding(
// padding: EdgeInsets.symmetric(vertical: 6.0),
// child: CircularProgressIndicator(
// valueColor: AlwaysStoppedAnimation<Color>(
// Colors.white),
// ),
// ),
// child: LoginButton(
// child: Text("login".i18n,
// maxLines: 1,
// style: const TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: 20.0,
// )),
// onPressed: () => _loginAPI(context: context),
// ),
// ),
// ),
// ],
// ),
],
),
if (_loginState == LoginState.missingFields ||
_loginState == LoginState.invalidGrant ||
_loginState == LoginState.failed)
Padding(
padding: const EdgeInsets.only(
top: 8.0, left: 12.0, right: 12.0),
child: Text( child: Text(
'privacy'.i18n, [
style: TextStyle( "missing_fields",
color: AppColors.of(context).loginSecondary, "invalid_grant",
"error"
][_loginState.index]
.i18n,
style: const TextStyle(
color: Colors.red,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 14.0,
), ),
textAlign: TextAlign.center,
), ),
), ),
], // privacy policy
), GestureDetector(
onTap: () => PrivacyView.show(context),
child: Text(
'privacy'.i18n,
style: TextStyle(
color: AppColors.of(context).loginSecondary,
fontWeight: FontWeight.w500,
fontSize: 14.0,
),
),
),
],
), ),
), ),
), ),