i'm trying to supply an initial value however i keep getting errors. how do i approach this. stuff is a list of values by the way so it holds a list<map<string, dynamic>> function
Widget _buildDescriptionTextField(){
return Padding(
padding: const EdgeInsets.only(right: 30),
child: TextFormField(
decoration: InputDecoration(labelText: 'Description',),
initialValue: widget.stuff['description'],
maxLines: 4,
validator: (String? value){
//if (value!.length <= 0){ // use one or the other
if (value!.isEmpty || value.length < 10 ){ // (||) means or
return 'Description is required and should be 10+ characters';
}
},
onSaved: (String? value){
setState(() {
formData['description'] = value!;
// descriptionValue = value!;
});
},),
);
}