Skip to content

Commit c03dfaa

Browse files
committed
Included v3.11.4 changes
1 parent 7c5e401 commit c03dfaa

11 files changed

+95
-36
lines changed

example/ios/Flutter/flutter_export_environment.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ export "FLUTTER_APPLICATION_PATH=/Users/danvick/code/playground/flutter_form_bui
55
export "FLUTTER_TARGET=/Users/danvick/code/playground/flutter_form_builder/example/lib/main.dart"
66
export "FLUTTER_BUILD_DIR=build"
77
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
8+
export "OTHER_LDFLAGS=$(inherited) -framework Flutter"
89
export "FLUTTER_FRAMEWORK_DIR=/Users/danvick/flutter/bin/cache/artifacts/engine/ios"
910
export "FLUTTER_BUILD_NAME=1.0.0"
1011
export "FLUTTER_BUILD_NUMBER=1"
1112
export "TRACK_WIDGET_CREATION=true"
13+
export "DART_DEFINES=flutter.inspector.structuredErrors=true"

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1111
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12-
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
13-
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1412
64C63106B45E49DD7F628B0C /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FE2D282FF075D0669CDC60BE /* libPods-Runner.a */; };
15-
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
16-
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1713
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
1814
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
1915
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
@@ -29,8 +25,6 @@
2925
dstPath = "";
3026
dstSubfolderSpec = 10;
3127
files = (
32-
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
33-
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
3428
);
3529
name = "Embed Frameworks";
3630
runOnlyForDeploymentPostprocessing = 0;
@@ -42,14 +36,12 @@
4236
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
4337
28351E1278E0A755200AB738 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
4438
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
45-
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
4639
72CA1E3E2BDF74F03AC64FC3 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
4740
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
4841
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
4942
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
5043
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
5144
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
52-
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
5345
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
5446
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
5547
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
@@ -64,8 +56,6 @@
6456
isa = PBXFrameworksBuildPhase;
6557
buildActionMask = 2147483647;
6658
files = (
67-
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
68-
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
6959
64C63106B45E49DD7F628B0C /* libPods-Runner.a in Frameworks */,
7060
);
7161
runOnlyForDeploymentPostprocessing = 0;
@@ -84,9 +74,7 @@
8474
9740EEB11CF90186004384FC /* Flutter */ = {
8575
isa = PBXGroup;
8676
children = (
87-
3B80C3931E831B6300D905FE /* App.framework */,
8877
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
89-
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9078
9740EEB21CF90195004384FC /* Debug.xcconfig */,
9179
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9280
9740EEB31CF90195004384FC /* Generated.xcconfig */,
@@ -162,6 +150,7 @@
162150
9705A1C41CF9048500538489 /* Embed Frameworks */,
163151
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
164152
9ED9A28711126C77C037EB08 /* [CP] Embed Pods Frameworks */,
153+
D1877523B5DC3DF50BBC7B10 /* [CP] Copy Pods Resources */,
165154
);
166155
buildRules = (
167156
);
@@ -232,7 +221,7 @@
232221
);
233222
runOnlyForDeploymentPostprocessing = 0;
234223
shellPath = /bin/sh;
235-
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
224+
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
236225
};
237226
9740EEB61CF901F6004384FC /* Run Script */ = {
238227
isa = PBXShellScriptBuildPhase;
@@ -288,6 +277,24 @@
288277
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
289278
showEnvVarsInLog = 0;
290279
};
280+
D1877523B5DC3DF50BBC7B10 /* [CP] Copy Pods Resources */ = {
281+
isa = PBXShellScriptBuildPhase;
282+
buildActionMask = 2147483647;
283+
files = (
284+
);
285+
inputPaths = (
286+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh",
287+
"${PODS_ROOT}/PhoneNumberKit/PhoneNumberKit/Resources/PhoneNumberMetadata.json",
288+
);
289+
name = "[CP] Copy Pods Resources";
290+
outputPaths = (
291+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/PhoneNumberMetadata.json",
292+
);
293+
runOnlyForDeploymentPostprocessing = 0;
294+
shellPath = /bin/sh;
295+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
296+
showEnvVarsInLog = 0;
297+
};
291298
/* End PBXShellScriptBuildPhase section */
292299

293300
/* Begin PBXSourcesBuildPhase section */

example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings

Lines changed: 0 additions & 8 deletions
This file was deleted.

example/lib/sources/complete_form.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class CompleteFormState extends State<CompleteForm> {
3434
child: Column(
3535
children: <Widget>[
3636
FormBuilder(
37-
// context,
3837
key: _fbKey,
3938
autovalidate: true,
4039
initialValue: {
@@ -225,10 +224,7 @@ class CompleteFormState extends State<CompleteForm> {
225224
),
226225
FormBuilderTextField(
227226
attribute: 'age',
228-
decoration: InputDecoration(
229-
labelText:
230-
'This value is passed along to the [Text.maxLines] attribute of the [Text] widget used to display the hint text.',
231-
),
227+
decoration: InputDecoration(labelText: 'Age'),
232228
onChanged: _onChanged,
233229
// valueTransformer: (text) => num.tryParse(text),
234230
validator: FormBuilderValidators.compose([

lib/src/fields/form_builder_choice_chips.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ class FormBuilderChoiceChip extends FormBuilderField<dynamic> {
4040
final double runSpacing, spacing;
4141
final TextDirection textDirection;
4242
final VerticalDirection verticalDirection;
43+
final EdgeInsets labelPadding;
44+
final TextStyle labelStyle;
45+
final EdgeInsets padding;
46+
final VisualDensity visualDensity;
4347

4448
FormBuilderChoiceChip({
4549
Key key,
@@ -69,6 +73,10 @@ class FormBuilderChoiceChip extends FormBuilderField<dynamic> {
6973
this.spacing = 0.0,
7074
this.textDirection,
7175
this.verticalDirection = VerticalDirection.down,
76+
this.labelPadding,
77+
this.labelStyle,
78+
this.padding,
79+
this.visualDensity,
7280
}) : super(
7381
key: key,
7482
initialValue: initialValue,
@@ -114,6 +122,10 @@ class FormBuilderChoiceChip extends FormBuilderField<dynamic> {
114122
var choice = selected ? option.value : null;
115123
field.didChange(choice);
116124
},
125+
labelStyle: labelStyle,
126+
labelPadding: labelPadding,
127+
padding: padding,
128+
visualDensity: visualDensity,
117129
),
118130
],
119131
),

lib/src/fields/form_builder_dropdown.dart

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ class FormBuilderDropdown extends FormBuilderField {
3535
@override
3636
final FormFieldSetter onSaved;
3737

38+
final VoidCallback onTap;
39+
final FocusNode focusNode;
40+
final bool autofocus;
41+
final Color dropdownColor;
42+
final Color focusColor;
43+
final double itemHeight;
44+
final List<Widget> Function(BuildContext) selectedItemBuilder;
45+
3846
FormBuilderDropdown({
3947
Key key,
4048
@required this.attribute,
@@ -59,6 +67,13 @@ class FormBuilderDropdown extends FormBuilderField {
5967
this.allowClear = false,
6068
this.clearIcon = const Icon(Icons.close),
6169
this.onSaved,
70+
this.onTap,
71+
this.focusNode,
72+
this.autofocus = false,
73+
this.dropdownColor,
74+
this.focusColor,
75+
this.itemHeight,
76+
this.selectedItemBuilder,
6277
}) : /*: assert(allowClear == true || clearIcon != null)*/ super(
6378
key: key,
6479
initialValue: initialValue,
@@ -105,6 +120,13 @@ class FormBuilderDropdown extends FormBuilderField {
105120
: (value) {
106121
_changeValue(field, value);
107122
},
123+
onTap: onTap,
124+
focusNode: focusNode,
125+
autofocus: autofocus,
126+
dropdownColor: dropdownColor,
127+
focusColor: focusColor,
128+
itemHeight: itemHeight,
129+
selectedItemBuilder: selectedItemBuilder,
108130
),
109131
),
110132
if (allowClear && !readOnly && field.value != null) ...[

lib/src/fields/form_builder_phone_field.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class FormBuilderPhoneField extends FormBuilderField {
159159
},
160160
child: Row(
161161
children: <Widget>[
162-
Icon(Icons.arrow_drop_down),
162+
const Icon(Icons.arrow_drop_down),
163163
SizedBox(width: 10),
164164
CountryPickerUtils.getDefaultFlagImage(
165165
state._selectedDialogCountry,

lib/src/fields/form_builder_radio_group.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class FormBuilderRadioGroup extends FormBuilderField {
7171
: (value) {
7272
FocusScope.of(state.context).requestFocus(FocusNode());
7373
field.didChange(value);
74-
if (onChanged != null) onChanged(value);
74+
onChanged?.call(value);
7575
},
7676
items: options
7777
.map((option) => option.value)

lib/src/fields/form_builder_range_slider.dart

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter/widgets.dart';
33
import 'package:flutter_form_builder/flutter_form_builder.dart';
4+
import 'package:intl/intl.dart';
45

56
class FormBuilderRangeSlider extends FormBuilderField {
67
@override
@@ -29,6 +30,10 @@ class FormBuilderRangeSlider extends FormBuilderField {
2930
final RangeLabels labels;
3031
final RangeSemanticFormatterCallback semanticFormatterCallback;
3132
final DisplayValues displayValues;
33+
final TextStyle minTextStyle;
34+
final TextStyle textStyle;
35+
final TextStyle maxTextStyle;
36+
final NumberFormat numberFormat;
3237

3338
FormBuilderRangeSlider({
3439
Key key,
@@ -50,6 +55,10 @@ class FormBuilderRangeSlider extends FormBuilderField {
5055
this.semanticFormatterCallback,
5156
this.onSaved,
5257
this.displayValues = DisplayValues.all,
58+
this.minTextStyle,
59+
this.textStyle,
60+
this.maxTextStyle,
61+
this.numberFormat,
5362
}) : super(
5463
key: key,
5564
initialValue: initialValue,
@@ -60,6 +69,8 @@ class FormBuilderRangeSlider extends FormBuilderField {
6069
readOnly: readOnly,
6170
builder: (FormFieldState field) {
6271
final _FormBuilderRangeSliderState state = field;
72+
var _numberFormat = numberFormat ?? NumberFormat.compact();
73+
6374
return InputDecorator(
6475
decoration: decoration.copyWith(
6576
enabled: !state.readOnly,
@@ -91,16 +102,24 @@ class FormBuilderRangeSlider extends FormBuilderField {
91102
children: <Widget>[
92103
if (displayValues != DisplayValues.none &&
93104
displayValues != DisplayValues.current)
94-
Text('${min}'),
105+
Text(
106+
'${_numberFormat.format(min)}',
107+
style: minTextStyle ?? textStyle,
108+
),
95109
Spacer(),
96110
if (displayValues != DisplayValues.none &&
97111
displayValues != DisplayValues.minMax)
98112
Text(
99-
'${field.value.start} - ${field.value.end}'),
113+
'${_numberFormat.format(field.value.start)} - ${_numberFormat.format(field.value.end)}',
114+
style: textStyle,
115+
),
100116
Spacer(),
101117
if (displayValues != DisplayValues.none &&
102118
displayValues != DisplayValues.current)
103-
Text('${max}'),
119+
Text(
120+
'${_numberFormat.format(max)}',
121+
style: maxTextStyle ?? textStyle,
122+
),
104123
],
105124
),
106125
],

lib/src/fields/form_builder_slider.dart

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ class FormBuilderSlider extends FormBuilderField {
3434
final SemanticFormatterCallback semanticFormatterCallback;
3535
final NumberFormat numberFormat;
3636
final DisplayValues displayValues;
37+
final TextStyle minTextStyle;
38+
final TextStyle textStyle;
39+
final TextStyle maxTextStyle;
3740

3841
FormBuilderSlider({
3942
Key key,
@@ -56,6 +59,9 @@ class FormBuilderSlider extends FormBuilderField {
5659
this.numberFormat,
5760
this.onSaved,
5861
this.displayValues = DisplayValues.all,
62+
this.minTextStyle,
63+
this.textStyle,
64+
this.maxTextStyle,
5965
}) : super(
6066
key: key,
6167
initialValue: initialValue,
@@ -66,7 +72,7 @@ class FormBuilderSlider extends FormBuilderField {
6672
readOnly: readOnly,
6773
builder: (FormFieldState field) {
6874
final _FormBuilderSliderState state = field;
69-
// var _numberFormat = numberFormat ?? NumberFormat('##0.0');
75+
var _numberFormat = numberFormat ?? NumberFormat.compact();
7076
return InputDecorator(
7177
decoration: decoration.copyWith(
7278
enabled: !state.readOnly,
@@ -98,15 +104,18 @@ class FormBuilderSlider extends FormBuilderField {
98104
children: <Widget>[
99105
if (displayValues != DisplayValues.none &&
100106
displayValues != DisplayValues.current)
101-
Text('${min}'),
107+
Text('${_numberFormat.format(min)}',
108+
style: minTextStyle ?? textStyle),
102109
Spacer(),
103110
if (displayValues != DisplayValues.none &&
104111
displayValues != DisplayValues.minMax)
105-
Text('${field.value}'),
112+
Text('${_numberFormat.format(field.value)}',
113+
style: textStyle),
106114
Spacer(),
107115
if (displayValues != DisplayValues.none &&
108116
displayValues != DisplayValues.current)
109-
Text('${max}'),
117+
Text('${_numberFormat.format(max)}',
118+
style: maxTextStyle ?? textStyle),
110119
],
111120
),
112121
],

0 commit comments

Comments
 (0)