-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: adding authentication page UI based on Figma #12
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class LoginScreen extends StatelessWidget { | ||
const LoginScreen({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: ListView( | ||
padding: EdgeInsets.symmetric( | ||
horizontal: MediaQuery.of(context).size.width / 8), | ||
sumit-158 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
children: const [ | ||
Menu(), | ||
Body(), | ||
], | ||
), | ||
); | ||
} | ||
} | ||
|
||
class Menu extends StatelessWidget { | ||
const Menu({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.symmetric(vertical: 30), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To have a consistency between all screens, could you store all dimensions in a separated file please? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you mark this as resolved, as the dimension is still hardcoded? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how I can put in a centralized file? Is creating a const for appappding would be good in theme_constants file? |
||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.start, | ||
children: [ | ||
Image.asset( | ||
'icons/release_icon_transparent.png', | ||
width: 41, | ||
height: 65, | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} | ||
|
||
class Body extends StatelessWidget { | ||
const Body({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
TextTheme texttheme = Theme.of(context).textTheme; | ||
return Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
SizedBox( | ||
width: 380, | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
' Sign In to the\nCommunity Portal', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you plan to use a translation service? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @g123k suggestions please. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello Sumit You can have a look here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @AshAman999 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please ask @teolemon how to use Crowdin (the same as Smoothie) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's as simple as tweaking the config file in the PR, with the path to the translation file (typically *.arb for flutter) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
style: texttheme.headline1, | ||
), | ||
Text( | ||
"If you don't have an account", | ||
sumit-158 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
style: texttheme.subtitle2, | ||
), | ||
Row( | ||
children: [ | ||
RichText( | ||
text: TextSpan( | ||
text: 'You can', | ||
style: texttheme.subtitle2, | ||
), | ||
), | ||
Text( | ||
' Register here!', | ||
style: TextStyle( | ||
color: Theme.of(context).primaryColor, | ||
fontWeight: FontWeight.bold), | ||
), | ||
], | ||
), | ||
Image.asset( | ||
'icons/release_icon_with_name_transparent.png', | ||
sumit-158 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
width: 400, | ||
), | ||
], | ||
), | ||
), | ||
Padding( | ||
padding: EdgeInsets.symmetric( | ||
vertical: MediaQuery.of(context).size.height / 6), | ||
child: SizedBox( | ||
width: 320, | ||
child: _formLogin(context), | ||
), | ||
), | ||
], | ||
); | ||
} | ||
|
||
Widget _formLogin(context) { | ||
return Column( | ||
children: [ | ||
const TextField( | ||
decoration: InputDecoration( | ||
hintText: 'Enter email or Phone number', | ||
sumit-158 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
labelStyle: TextStyle(fontSize: 12), | ||
), | ||
), | ||
const SizedBox(height: 30), | ||
const TextField( | ||
decoration: InputDecoration( | ||
sumit-158 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
hintText: 'Password', | ||
counterText: 'Forgot password?', | ||
suffixIcon: Icon( | ||
Icons.visibility_off_outlined, | ||
), | ||
labelStyle: TextStyle(fontSize: 12), | ||
), | ||
), | ||
const SizedBox( | ||
height: 40, | ||
), | ||
Container( | ||
decoration: BoxDecoration( | ||
color: Theme.of(context).primaryColor, | ||
borderRadius: BorderRadius.circular(30), | ||
), | ||
child: ElevatedButton( | ||
onPressed: () => ("it's pressed"), | ||
style: ElevatedButton.styleFrom( | ||
onPrimary: Colors.white, | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(15), | ||
), | ||
), | ||
child: const SizedBox( | ||
width: double.infinity, | ||
height: 50, | ||
child: Center(child: Text('Sign In'))), | ||
), | ||
), | ||
const SizedBox(height: 40), | ||
], | ||
); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
Color primary = const Color(0xFFFF8714); | ||
Color onprimary = const Color(0xFF000000); | ||
Color secondary = const Color(0xFFF5F5F5); | ||
Color onsecondary = const Color(0xFFFFFFFF); | ||
Color background = const Color(0xFFFFFFFF); | ||
|
||
ThemeData lightTheme = ThemeData( | ||
brightness: Brightness.light, | ||
primaryColor: primary, | ||
floatingActionButtonTheme: FloatingActionButtonThemeData( | ||
backgroundColor: primary, | ||
), | ||
elevatedButtonTheme: ElevatedButtonThemeData( | ||
style: ButtonStyle( | ||
shape: MaterialStateProperty.all<OutlinedBorder>( | ||
RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(20.0), | ||
), | ||
), | ||
backgroundColor: MaterialStateProperty.all<Color>(primary), | ||
), | ||
), | ||
inputDecorationTheme: InputDecorationTheme( | ||
border: OutlineInputBorder( | ||
borderRadius: BorderRadius.circular(15), borderSide: BorderSide.none), | ||
filled: true, | ||
fillColor: secondary.withOpacity(1.0), | ||
suffixIconColor: Colors.grey, | ||
contentPadding: const EdgeInsetsDirectional.only(start: 30), | ||
), | ||
textTheme: const TextTheme( | ||
headline1: TextStyle( | ||
fontSize: 45.0, | ||
fontWeight: FontWeight.bold, | ||
color: Colors.black, | ||
), | ||
headline2: TextStyle( | ||
fontSize: 24.0, | ||
fontWeight: FontWeight.bold, | ||
color: Colors.black, | ||
), | ||
headline3: TextStyle( | ||
fontSize: 18.0, | ||
fontWeight: FontWeight.bold, | ||
), | ||
headline4: TextStyle( | ||
fontSize: 16.0, | ||
fontWeight: FontWeight.bold, | ||
color: Colors.black, | ||
), | ||
bodyText2: TextStyle( | ||
fontSize: 14, | ||
letterSpacing: 0.5, | ||
), | ||
subtitle1: TextStyle( | ||
fontSize: 14.0, | ||
), | ||
subtitle2: TextStyle( | ||
fontSize: 12.0, | ||
), | ||
), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a ListView for only two items is not recommanded.
Instead you should a SingleChildScrollView + Flex (which can be horizontal/vertical according to the space available)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't change the listview, but it is responsive now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please show me your code without the
ListView
please.It should work without any issue here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.