Skip to content

Commit 73ca2ed

Browse files
committed
Login page
1 parent c7864ed commit 73ca2ed

File tree

7 files changed

+199
-17
lines changed

7 files changed

+199
-17
lines changed

lib/constants/themes.dart

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,25 @@ ThemeData themeBy({
6363
inputDecorationTheme: InputDecorationTheme(
6464
border: InputBorder.none,
6565
enabledBorder: InputBorder.none,
66-
hintStyle: TextStyle(color: tg.iconColor),
66+
hintStyle: TextStyle(color: tg.iconColor, height: 1.35),
67+
prefixIconColor: tg.iconColor,
6768
),
6869
scaffoldBackgroundColor: tg.backgroundColor,
70+
elevatedButtonTheme: ElevatedButtonThemeData(
71+
style: ElevatedButton.styleFrom(
72+
backgroundColor: themeColorDark,
73+
),
74+
),
75+
outlinedButtonTheme: OutlinedButtonThemeData(
76+
style: OutlinedButton.styleFrom(
77+
foregroundColor: themeColorDark.withAlpha(200),
78+
),
79+
),
80+
textButtonTheme: TextButtonThemeData(
81+
style: TextButton.styleFrom(
82+
foregroundColor: themeColorDark.withAlpha(200),
83+
),
84+
),
6985
textSelectionTheme: TextSelectionThemeData(
7086
cursorColor: tg.themeColor,
7187
selectionColor: tg.themeColor.withOpacity(.25),

lib/l10n/app_en.arb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@
7575
"sortRecommend": "Recommend",
7676
"sortLatest": "Latest",
7777

78+
"loginTitle": "Sign in",
79+
"loginSlogan": "Log in to experience more",
80+
"hintUsername":"Phone/email",
81+
"hintPassword":"Password",
82+
"buttonSignIn":"Sign in",
83+
"linkSignUp":"Create an account",
84+
"linkRetrieve":"Fogot password?",
85+
7886
"durationYears": "{many, plural, =1{1 year}other{{many} years}} ago",
7987
"@durationYears": {
8088
"placeholders": {"many": {"type": "int"}}

lib/l10n/app_zh.arb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@
6464
"sortRecommend": "推荐",
6565
"sortLatest": "最新",
6666

67+
"loginTitle": "登录",
68+
"loginSlogan": "登录体验更多精彩",
69+
"hintUsername":"手机号/邮箱",
70+
"hintPassword":"密码",
71+
"buttonSignIn":"登录",
72+
"linkSignUp":"注册新用户",
73+
"linkRetrieve":"找回密码",
74+
6775
"durationYears": "{many, plural, =other{{many}年前}}",
6876
"durationMonths": "{many, plural, =other{{many}月前}}",
6977
"durationDays": "{many, plural, =other{{many}天前}}",

lib/l10n/gen/jj_localizations.dart

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,48 @@ abstract class JJLocalizations {
399399
/// **'Latest'**
400400
String get sortLatest;
401401

402+
/// No description provided for @loginTitle.
403+
///
404+
/// In en, this message translates to:
405+
/// **'Sign in'**
406+
String get loginTitle;
407+
408+
/// No description provided for @loginSlogan.
409+
///
410+
/// In en, this message translates to:
411+
/// **'Log in to experience more'**
412+
String get loginSlogan;
413+
414+
/// No description provided for @hintUsername.
415+
///
416+
/// In en, this message translates to:
417+
/// **'Phone/email'**
418+
String get hintUsername;
419+
420+
/// No description provided for @hintPassword.
421+
///
422+
/// In en, this message translates to:
423+
/// **'Password'**
424+
String get hintPassword;
425+
426+
/// No description provided for @buttonSignIn.
427+
///
428+
/// In en, this message translates to:
429+
/// **'Sign in'**
430+
String get buttonSignIn;
431+
432+
/// No description provided for @linkSignUp.
433+
///
434+
/// In en, this message translates to:
435+
/// **'Create an account'**
436+
String get linkSignUp;
437+
438+
/// No description provided for @linkRetrieve.
439+
///
440+
/// In en, this message translates to:
441+
/// **'Fogot password?'**
442+
String get linkRetrieve;
443+
402444
/// No description provided for @durationYears.
403445
///
404446
/// In en, this message translates to:

lib/l10n/gen/jj_localizations_en.dart

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,27 @@ class JJLocalizationsEn extends JJLocalizations {
169169
@override
170170
String get sortLatest => 'Latest';
171171

172+
@override
173+
String get loginTitle => 'Sign in';
174+
175+
@override
176+
String get loginSlogan => 'Log in to experience more';
177+
178+
@override
179+
String get hintUsername => 'Phone/email';
180+
181+
@override
182+
String get hintPassword => 'Password';
183+
184+
@override
185+
String get buttonSignIn => 'Sign in';
186+
187+
@override
188+
String get linkSignUp => 'Create an account';
189+
190+
@override
191+
String get linkRetrieve => 'Fogot password?';
192+
172193
@override
173194
String durationYears(num many) {
174195
final String pluralString = intl.Intl.pluralLogic(

lib/l10n/gen/jj_localizations_zh.dart

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,27 @@ class JJLocalizationsZh extends JJLocalizations {
169169
@override
170170
String get sortLatest => '最新';
171171

172+
@override
173+
String get loginTitle => '登录';
174+
175+
@override
176+
String get loginSlogan => '登录体验更多精彩';
177+
178+
@override
179+
String get hintUsername => '手机号/邮箱';
180+
181+
@override
182+
String get hintPassword => '密码';
183+
184+
@override
185+
String get buttonSignIn => '登录';
186+
187+
@override
188+
String get linkSignUp => '注册新用户';
189+
190+
@override
191+
String get linkRetrieve => '找回密码';
192+
172193
@override
173194
String durationYears(num many) {
174195
return intl.Intl.pluralLogic(

lib/pages/login/login.dart

Lines changed: 82 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,91 @@ class _LoginPageState extends State<LoginPage> {
1919
@override
2020
Widget build(BuildContext context) {
2121
return Scaffold(
22-
body: Padding(
22+
appBar: AppBar(
23+
title: Text(context.l10n.loginTitle),
24+
),
25+
body: SingleChildScrollView(
2326
padding: const EdgeInsets.all(16.0),
24-
child: Form(
25-
child: Column(
26-
children: [
27-
Center(
28-
child: Text('登录体验更多精彩'),
29-
),
30-
TextFormField(
31-
decoration: InputDecoration(
32-
hintText: '手机号/邮箱',
27+
child: Container(
28+
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 64),
29+
padding: const EdgeInsets.all(16),
30+
decoration: BoxDecoration(
31+
color: context.surfaceColor,
32+
borderRadius: BorderRadius.circular(8),
33+
),
34+
child: Form(
35+
child: Column(
36+
children: [
37+
SizedBox(
38+
height: 25,
39+
width: 80,
40+
child: OverflowBox(
41+
maxHeight: 80,
42+
alignment: Alignment.bottomCenter,
43+
child: SizedBox(
44+
width: 80,
45+
height: 80,
46+
child: FittedBox(
47+
child: CircleAvatar(
48+
backgroundColor: context.surfaceColor,
49+
child: SvgPicture.asset(
50+
'assets/brand.svg',
51+
),
52+
),
53+
),
54+
),
55+
),
56+
),
57+
const Gap.v(8),
58+
Row(
59+
mainAxisAlignment: MainAxisAlignment.center,
60+
children: [
61+
Text(context.l10n.loginSlogan),
62+
],
63+
),
64+
const Gap.v(16),
65+
TextFormField(
66+
keyboardType: TextInputType.emailAddress,
67+
decoration: InputDecoration(
68+
hintText: context.l10n.hintUsername,
69+
prefixIcon: const Icon(Icons.person_outline),
70+
focusColor: Colors.red,
71+
prefixIconColor: Colors.red,
72+
),
73+
),
74+
const Gap.v(8),
75+
TextFormField(
76+
obscureText: true,
77+
obscuringCharacter: '*',
78+
keyboardType: TextInputType.visiblePassword,
79+
decoration: InputDecoration(
80+
hintText: context.l10n.hintPassword,
81+
prefixIcon: const Icon(Icons.lock_outline),
82+
),
83+
),
84+
const Gap.v(8),
85+
ElevatedButton(
86+
onPressed: () {},
87+
child: Center(
88+
child: Text(context.l10n.buttonSignIn),
89+
),
3390
),
34-
),
35-
TextFormField(
36-
decoration: InputDecoration(
37-
hintText: '密码',
91+
const Gap.v(8),
92+
Row(
93+
children: [
94+
TextButton(
95+
onPressed: () {},
96+
child: Text(context.l10n.linkSignUp),
97+
),
98+
const Spacer(),
99+
TextButton(
100+
onPressed: () {},
101+
child: Text(context.l10n.linkRetrieve),
102+
),
103+
],
38104
),
39-
)
40-
],
105+
],
106+
),
41107
),
42108
),
43109
),

0 commit comments

Comments
 (0)