做一个简单的Flutter应用程序,但由于某种原因,当我选择TextFields时键盘不会显示?我浏览了周围,看不到任何我错过的东西?当我运行Flutter Doctor时,一切都很好。
(请忽略导入,尚未使用它们将要使用的方法)
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:t2/helpers/currentuser.dart';
class Login extends StatefulWidget{
@override
_LoginState createState() => new _LoginState();
}
class _LoginState extends State<Login> {
final TextEditingController _usrTextController = new TextEditingController();
final TextEditingController _pwdTextcontroller = new TextEditingController();
CurrentUser cUser = new CurrentUser();
// cUser.loginUser();
@override
Widget build (BuildContext context) {
return new Scaffold(
appBar: new AppBar(title: new Text('Member Login')),
body: new Container(
child: new Center(
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new TextField(
controller: _usrTextController,
decoration: new InputDecoration(hintText: 'Username'),
),
new TextField(
controller: _pwdTextcontroller,
decoration: new InputDecoration(hintText: 'Password'),
)
],
),
)
)
);
}
}
答案 0 :(得分:1)
这结果是模拟器中的一个设置。它设置为硬件键盘,而不是软件。