Skip to content

Commit efb5577

Browse files
feat: update flutter form builder version
1 parent 0ccaa87 commit efb5577

9 files changed

+167
-105
lines changed

example/ios/Podfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Uncomment this line to define a global platform for your project
2+
# platform :ios, '11.0'
3+
4+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6+
7+
project 'Runner', {
8+
'Debug' => :debug,
9+
'Profile' => :release,
10+
'Release' => :release,
11+
}
12+
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17+
end
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
22+
end
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24+
end
25+
26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27+
28+
flutter_ios_podfile_setup
29+
30+
target 'Runner' do
31+
use_frameworks!
32+
use_modular_headers!
33+
34+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35+
end
36+
37+
post_install do |installer|
38+
installer.pods_project.targets.each do |target|
39+
flutter_additional_ios_build_settings(target)
40+
end
41+
end

example/pubspec.lock

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ packages:
3737
dependency: transitive
3838
description:
3939
name: characters
40-
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
40+
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
4141
url: "https://pub.dev"
4242
source: hosted
43-
version: "1.3.0"
43+
version: "1.2.1"
4444
clock:
4545
dependency: transitive
4646
description:
@@ -53,10 +53,10 @@ packages:
5353
dependency: transitive
5454
description:
5555
name: collection
56-
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
56+
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
5757
url: "https://pub.dev"
5858
source: hosted
59-
version: "1.17.1"
59+
version: "1.17.0"
6060
convert:
6161
dependency: transitive
6262
description:
@@ -77,10 +77,10 @@ packages:
7777
dependency: transitive
7878
description:
7979
name: dropdown_search
80-
sha256: "8862928805520ea7fdf60fee64195a2d460f4bf5ccf224c016c773a873756c5e"
80+
sha256: "55106e8290acaa97ed15bea1fdad82c3cf0c248dd410e651f5a8ac6870f783ab"
8181
url: "https://pub.dev"
8282
source: hosted
83-
version: "5.0.5"
83+
version: "5.0.6"
8484
fake_async:
8585
dependency: transitive
8686
description:
@@ -114,10 +114,10 @@ packages:
114114
dependency: "direct main"
115115
description:
116116
name: flutter_form_builder
117-
sha256: "9551c7379adc01a3a3a1100057396407c9534ea8adc937d14a0edd96fcd9e1dc"
117+
sha256: "236c96dad143a0e67c0f11522606d6b17b6510e97530cb73af355b018ded7c10"
118118
url: "https://pub.dev"
119119
source: hosted
120-
version: "7.8.0"
120+
version: "8.0.0"
121121
flutter_keyboard_visibility:
122122
dependency: transitive
123123
description:
@@ -204,10 +204,10 @@ packages:
204204
dependency: transitive
205205
description:
206206
name: flutter_typeahead
207-
sha256: "3f7509bc1d43e245e0bfdc180f206508bc5ab0e0d84ce1b891cb0e4176b7802f"
207+
sha256: edfc51579ca3756adaa32b6849cf44af03276b93e8a8a68d8247ee243598f1b2
208208
url: "https://pub.dev"
209209
source: hosted
210-
version: "4.3.6"
210+
version: "4.3.7"
211211
flutter_web_plugins:
212212
dependency: transitive
213213
description: flutter
@@ -248,10 +248,10 @@ packages:
248248
dependency: transitive
249249
description:
250250
name: js
251-
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
251+
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
252252
url: "https://pub.dev"
253253
source: hosted
254-
version: "0.6.7"
254+
version: "0.6.5"
255255
lints:
256256
dependency: transitive
257257
description:
@@ -264,10 +264,10 @@ packages:
264264
dependency: transitive
265265
description:
266266
name: matcher
267-
sha256: c94db23593b89766cda57aab9ac311e3616cf87c6fa4e9749df032f66f30dcb8
267+
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
268268
url: "https://pub.dev"
269269
source: hosted
270-
version: "0.12.14"
270+
version: "0.12.13"
271271
material_color_utilities:
272272
dependency: transitive
273273
description:
@@ -280,18 +280,18 @@ packages:
280280
dependency: transitive
281281
description:
282282
name: meta
283-
sha256: "12307e7f0605ce3da64cf0db90e5fcab0869f3ca03f76be6bb2991ce0a55e82b"
283+
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
284284
url: "https://pub.dev"
285285
source: hosted
286-
version: "1.9.0"
286+
version: "1.8.0"
287287
path:
288288
dependency: transitive
289289
description:
290290
name: path
291-
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
291+
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
292292
url: "https://pub.dev"
293293
source: hosted
294-
version: "1.8.3"
294+
version: "1.8.2"
295295
path_parsing:
296296
dependency: transitive
297297
description:
@@ -381,10 +381,10 @@ packages:
381381
dependency: transitive
382382
description:
383383
name: test_api
384-
sha256: "6182294da5abf431177fccc1ee02401f6df30f766bc6130a0852c6b6d7ee6b2d"
384+
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
385385
url: "https://pub.dev"
386386
source: hosted
387-
version: "0.4.18"
387+
version: "0.4.16"
388388
typed_data:
389389
dependency: transitive
390390
description:

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ environment:
1111
dependencies:
1212
flutter:
1313
sdk: flutter
14-
flutter_form_builder: ^7.8.0
14+
flutter_form_builder: ^8.0.0
1515
flutter_localizations:
1616
sdk: flutter
1717
form_builder_extra_fields:

lib/src/fields/form_builder_rating_bar.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import 'package:flutter_rating_bar/flutter_rating_bar.dart';
44

55
/// Field for selection of a numerical value using a star* rating widget
66
class FormBuilderRatingBar extends FormBuilderField<double> {
7-
final bool shouldRequestFocus;
8-
97
/// Defines color for glow.
108
///
119
/// Default is [ThemeData.colorScheme.secondary].
@@ -122,7 +120,6 @@ class FormBuilderRatingBar extends FormBuilderField<double> {
122120
this.maxRating,
123121
this.minRating = 0,
124122
this.ratingWidget,
125-
this.shouldRequestFocus = false,
126123
this.tapOnlyMode = false,
127124
this.textDirection,
128125
this.unratedColor,
@@ -156,10 +153,6 @@ class FormBuilderRatingBar extends FormBuilderField<double> {
156153
itemPadding: widget.itemPadding,
157154
// itemBuilder: widget.itemBuilder
158155
onRatingUpdate: (rating) {
159-
if (shouldRequestFocus) {
160-
state.requestFocus();
161-
}
162-
163156
field.didChange(rating);
164157
},
165158
ratingWidget: widget.ratingWidget ??

lib/src/fields/form_builder_searchable_dropdown.dart

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ import 'package:flutter_form_builder/flutter_form_builder.dart';
44

55
/// Field for selecting value(s) from a searchable list
66
class FormBuilderSearchableDropdown<T> extends FormBuilderField<T> {
7-
final bool shouldRequestFocus;
8-
9-
///true if the filter on items is applied online (via API)
10-
// final bool isFilteredOnline;
11-
12-
///show/hide clear selected item
13-
final bool showClearButton;
14-
157
///offline items list
168
final List<T> items;
179

@@ -126,9 +118,6 @@ class FormBuilderSearchableDropdown<T> extends FormBuilderField<T> {
126118
this.popupSelectionWidget,
127119
this.selectedItem,
128120
this.selectedItems = const [],
129-
this.shouldRequestFocus = false,
130-
@Deprecated('Please use [clearButtonProps] instead')
131-
this.showClearButton = false,
132121
this.popupProps = const PopupProps.menu(
133122
showSearchBox: true,
134123
fit: FlexFit.loose,
@@ -162,8 +151,7 @@ class FormBuilderSearchableDropdown<T> extends FormBuilderField<T> {
162151
return DropdownSearch<T>(
163152
// Hack to rebuild when didChange is called
164153
asyncItems: asyncItems,
165-
clearButtonProps: clearButtonProps ??
166-
ClearButtonProps(isVisible: showClearButton),
154+
clearButtonProps: clearButtonProps ?? const ClearButtonProps(),
167155
compareFn: compareFn,
168156
enabled: state.enabled,
169157
dropdownBuilder: dropdownBuilder,
@@ -180,9 +168,6 @@ class FormBuilderSearchableDropdown<T> extends FormBuilderField<T> {
180168
itemAsString: itemAsString,
181169
onBeforeChange: onBeforeChange,
182170
onChanged: (value) {
183-
if (shouldRequestFocus) {
184-
state.requestFocus();
185-
}
186171
state.didChange(value);
187172
},
188173
popupProps: popupProps,

lib/src/fields/form_builder_signature_pad.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class FormBuilderSignaturePadState
148148

149149
_controller.onDrawEnd = () async {
150150
onDrawEnd?.call();
151-
requestFocus();
151+
focus();
152152
final val = await _getControllerValue();
153153
didChange(val);
154154
};

lib/src/fields/form_builder_touch_spin.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import '../widgets/touch_spin/touch_spin.dart';
66

77
/// Field for selection of a number by tapping on an add or subtract icon
88
class FormBuilderTouchSpin extends FormBuilderField<num> {
9-
final bool shouldRequestFocus;
10-
119
/// Value to increment or decrement by
1210
final num step;
1311

@@ -71,7 +69,6 @@ class FormBuilderTouchSpin extends FormBuilderField<num> {
7169
this.step = 1.0,
7270
this.subtractIcon = const Icon(Icons.remove),
7371
this.textStyle = const TextStyle(fontSize: 24),
74-
this.shouldRequestFocus = false,
7572
}) : super(
7673
autovalidateMode: autovalidateMode,
7774
decoration: decoration,
@@ -100,9 +97,6 @@ class FormBuilderTouchSpin extends FormBuilderField<num> {
10097
iconSize: iconSize,
10198
onChanged: state.enabled
10299
? (value) {
103-
if (shouldRequestFocus) {
104-
state.requestFocus();
105-
}
106100
state.didChange(value);
107101
}
108102
: null,

0 commit comments

Comments
 (0)