@@ -100,14 +100,16 @@ class _FormBuilderCountryPickerState extends State<FormBuilderCountryPicker> {
100
100
},
101
101
builder: (FormFieldState <Country > field) {
102
102
return GestureDetector (
103
- onTap: () {
104
- FocusScope .of (context).requestFocus (FocusNode ());
105
- if (widget.isCupertinoPicker) {
106
- _openCupertinoCountryPicker (field);
107
- } else {
108
- _openCountryPickerDialog (field);
109
- }
110
- },
103
+ onTap: _readOnly
104
+ ? null
105
+ : () {
106
+ FocusScope .of (context).requestFocus (FocusNode ());
107
+ if (widget.isCupertinoPicker) {
108
+ _openCupertinoCountryPicker (field);
109
+ } else {
110
+ _openCountryPickerDialog (field);
111
+ }
112
+ },
111
113
child: InputDecorator (
112
114
decoration: widget.decoration.copyWith (
113
115
errorText: field.errorText,
@@ -116,14 +118,9 @@ class _FormBuilderCountryPickerState extends State<FormBuilderCountryPicker> {
116
118
key: ObjectKey (field.value),
117
119
children: [
118
120
CountryPickerUtils .getDefaultFlagImage (field.value),
119
- SizedBox (
120
- width: 10 ,
121
- ),
121
+ SizedBox (width: 10 ),
122
122
Expanded (
123
- child: Text (
124
- field.value? .name ?? '' ,
125
- style: widget.style,
126
- ),
123
+ child: Text (field.value? .name ?? '' , style: widget.style),
127
124
),
128
125
],
129
126
),
@@ -192,8 +189,8 @@ class _FormBuilderCountryPickerState extends State<FormBuilderCountryPicker> {
192
189
child: ListTile (
193
190
contentPadding: EdgeInsets .zero,
194
191
leading: CountryPickerUtils .getDefaultFlagImage (country),
195
- title: Text (country.name),
196
- // visualDensity: VisualDensity.compact, //TODO: Re-enable after Flutter 1.17
192
+ title: Text ('${ country .name }' ),
193
+ visualDensity: VisualDensity .compact,
197
194
),
198
195
);
199
196
}
0 commit comments