Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: TextFormField(
validator: (String? value) {
if (value != null && value.isEmpty) {
return 'Insira o nome da tarefa';
}
return null;
},
controller: nameController,
decoration: InputDecoration(
border: OutlineInputBorder(),
hintText: 'Nome',
fillColor: Colors.white70,
filled: true,
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: TextFormField(
validator: (value) {
if (value!.isEmpty ||
int.parse(value) > 5 ||
int.parse(value) < 1) {
return 'Insira um número entre 1 a 5';
}
return null;
},
keyboardType: TextInputType.number,
controller: difficultyController,
decoration: InputDecoration(
border: OutlineInputBorder(),
hintText: 'Dificuldade',
fillColor: Colors.white70,
filled: true,
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: TextFormField(
validator: (value) {
if (value!.isEmpty) {
return 'insira um URL de imagem';
}
return null;
},
onChanged: (text) {
setState(() {});
},
keyboardType: TextInputType.url,
controller: imageController,
decoration: InputDecoration(
border: OutlineInputBorder(),
hintText: 'imagem',
fillColor: Colors.white70,
filled: true,
),
),
),