アプリの背景色が黒です。そのため、入力テキストの色は表示されません。そのため、入力テキストの色を黒から白に変更する必要があります。
Widget showPasswordInput() {
return Padding(
padding: const EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0),
child: new TextFormField(
maxLines: 1,
cursorColor: Colors.white,
obscureText: true,
autofocus: false,
decoration: new InputDecoration(
labelStyle: TextStyle(color: Colors.white),
hintText: 'Password',
hintStyle: TextStyle(color:Colors.white),
icon: new Icon(
Icons.lock,
color: Colors.white,
)),
validator: (value) => value.isEmpty ? 'Password can\'t be empty' : null,
onSaved: (value) => _password = value.trim(),
),
);
}
TextFormFieldのTextStyleプロパティを使用します
Widget showPasswordInput() {
return Padding(
padding: const EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0),
child: new TextFormField(
style: TextStyle(color: Colors.white),
maxLines: 1,
cursorColor: Colors.white,
obscureText: true,
autofocus: false,
decoration: new InputDecoration(
labelStyle: TextStyle(color: Colors.white),
hintText: 'Password',
hintStyle: TextStyle(color:Colors.white),
icon: new Icon(
Icons.lock,
color: Colors.white,
)),
validator: (value) => value.isEmpty ? 'Password can\'t be empty' : null,
onSaved: (value) => _password = value.trim(),
),
);
}
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加