Flutter InputDecoration 效果图

效果图


Flutter InputDecoration 效果图_第1张图片
b475a229bd86d3fef64725b1a907605.jpg
  new TextField(
          onChanged: (str) {
            username = str;
            print(username);
          },
          decoration: new InputDecoration(
            labelText: '用户名',
            hintText: '请输入英文或数字',
          ),
          maxLines: 1,
          onSubmitted: (text) {
            FocusScope.of(context).reparentIfNeeded(node);
          },
        ),
        new TextField(
          onChanged: (text) {
            pwd = text;
            print(pwd);
          },
          obscureText: true,
          maxLines: 1,
          decoration:
              new InputDecoration(hintText: '请输入长度大于6的密码', labelText: '密码'),
          keyboardType: TextInputType.text,
          onSubmitted: (text) {},
        ),

你可能感兴趣的:(Flutter InputDecoration 效果图)