Вы можете использовать так:
Form(
key: _formKey,
child: ListView(
//physics: const NeverScrollableScrollPhysics(),
children: <Widget>[
Center(
child: Text(
'Token',
style: TextStyle(fontSize: 36, fontWeight: FontWeight.w300),
),
),
Container(
height: 40,
),
TextFormField(
style: textStyle,
controller: authControllername,
// ignore: missing_return
validator: (String value) {
if (value.isEmpty) {
return 'Please enter name';
}
},
decoration: InputDecoration(
labelText: 'Name',
hintText: 'Enter name',
labelStyle: textStyle,
errorStyle: TextStyle(color: Colors.red, fontSize: 14.0),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0))),
),
Container(
height: 20,
),
TextFormField(
style: textStyle,
controller: authController,
validator: (String value) {
if (value.isEmpty) {
return 'Please enter OAuth token';
}
},
decoration: InputDecoration(
labelText: 'OAuth token',
hintText: 'Enter OAuth token',
labelStyle: textStyle,
errorStyle: TextStyle(color: Colors.red, fontSize: 14.0),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0))),
),
],
),
),