Skip to content

Commit de28a5a

Browse files
lvyandev吕彦
andauthored
🍭 Finish lvyan login page (#3)
Co-authored-by: 吕彦 <lvyan@lvyandeMacBook-Pro.local>
1 parent 2a7b87a commit de28a5a

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

1 - 注册表单的实现 - 20201127/lvyan_main.dart

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ class _MyHomePageState extends State<MyHomePage> {
118118
controller: _passwordController,
119119
maxLength: 20,
120120
obscureText: !_visible,
121-
style: const TextStyle(fontStyle: FontStyle.italic),
122121
obscuringCharacter: '*',
123122
decoration: InputDecoration(
124123
prefixIcon: const Icon(Icons.lock),
@@ -127,7 +126,6 @@ class _MyHomePageState extends State<MyHomePage> {
127126
helperText: helperText,
128127
border: const UnderlineInputBorder(),
129128
suffixIcon: visibilityIcon,
130-
hintStyle: const TextStyle(fontStyle: FontStyle.normal),
131129
),
132130
);
133131
},
@@ -168,6 +166,30 @@ class _MyHomePageState extends State<MyHomePage> {
168166
},
169167
);
170168

169+
final Widget displayNameText = Text.rich(
170+
TextSpan(
171+
children: <InlineSpan>[
172+
const TextSpan(text: '用户名:'),
173+
TextSpan(
174+
text: _usernameController.text.isEmpty ? '未填写' : _usernameController.text,
175+
style: const TextStyle(decoration: TextDecoration.underline),
176+
),
177+
],
178+
),
179+
);
180+
181+
final Widget displayPasswordText = Text.rich(
182+
TextSpan(
183+
children: <InlineSpan>[
184+
const TextSpan(text: '密码:'),
185+
TextSpan(
186+
text: _passwordController.text.isEmpty ? '未填写' : _passwordController.text,
187+
style: const TextStyle(fontStyle: FontStyle.italic),
188+
),
189+
],
190+
),
191+
);
192+
171193
return Scaffold(
172194
appBar: AppBar(title: Text(widget.title)),
173195
body: Center(
@@ -177,6 +199,9 @@ class _MyHomePageState extends State<MyHomePage> {
177199
usernameField,
178200
passwordField,
179201
loginButton,
202+
const SizedBox(height: 20),
203+
displayNameText,
204+
displayPasswordText,
180205
],
181206
),
182207
),

0 commit comments

Comments
 (0)