My application supports the datepicker framework. This builder was working great until a few days ago. My code is like this:
child: SingleChildScrollView(
child: Column(
children: <Widget>[
FormBuilder(
key: _fbKey,
autovalidateMode: AutovalidateMode.always,
initialValue: {
'movie_rating': 5,
},
enabled: false,
child: Column(
children: <Widget>[
FormBuilderDateTimePicker(
onChanged: (val) => onEditing(val),
autofocus: true,
locale: Locale(_myLocale),
name: "choose_date_range",
firstDate: DateTime(2017),
lastDate: DateTime( DateTime.now().year 1),
format: DateFormat("yyyy-MM-dd"),
...
I'm using flutter_form_builder package.
This is the hierarchy of my code, FormBuilderDateTimePicker does not show a calendar anymore, any thoughts?
CodePudding user response:
The issue coming from FormBuilder
enabled: false,
. Comment or set enabled: true,
FormBuilder(
// // key: _fbKey,
autovalidateMode: AutovalidateMode.always,
initialValue: {
'movie_rating': 5,
},
enabled: true, //<- here
child: Column(
children: <Widget>[
enabled
=> Whether the form is able to receive user input.
Whenfalse
all the form fields will be disabled - won't accept input - and their enabled state will be ignored.