Skip to content

Commit 860f795

Browse files
committed
Merge branch 'null_safety'
# Conflicts: # CHANGELOG.md # example/lib/code_page.dart # example/lib/sources/complete_form.dart # example/lib/sources/signup_form.dart # example/pubspec.yaml # lib/l10n/messages_all.dart # lib/src/fields/form_builder_color_picker.dart # lib/src/fields/form_builder_date_range_picker.dart # lib/src/fields/form_builder_date_time_picker.dart # lib/src/fields/form_builder_searchable_dropdown.dart # lib/src/fields/form_builder_text_field.dart # lib/src/fields/form_builder_typeahead.dart # pubspec.yaml
2 parents 0c26444 + ef2892d commit 860f795

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+889
-2666
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,4 @@ pubspec.lock
7373
*.ipr
7474
*.iws
7575
.idea/
76+
.DS_Store

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## [6.0.0] - 20-Apr-2021
2+
* Re-introduced DateTimePicker field without external dependencies
3+
* Minor fixes
4+
5+
## [6.0.0-nullsafety.1] - 24-Mar-2021
6+
* Static analysis improvements
7+
* Documentation improvements
8+
9+
## [6.0.0-nullsafety.0] - 24-Mar-2021
10+
* Started working on null-safety
11+
12+
**BREAKING CHANGES**:
13+
* Removed fields that depend on external dependencies incuding: `FormBuilderChipsInput`, `FormBuilderColorPicker`, `FormBuilderRating`, `FormBuilderSearchableDropdown`, `FormBuilderSignaturePad`, `FormBuilderTouchSpin`, `FormBuilderTypeAhead`
14+
115
## [5.0.0] - 24-Mar-2020
216
* Flutter 2.* support
317

README.md

Lines changed: 2 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -77,65 +77,6 @@ Widget build(BuildContext context) {
7777
value: 'Test 4', child: Text('Test 4')),
7878
],
7979
),
80-
FormBuilderColorPickerField(
81-
name: 'color_picker',
82-
// initialValue: Colors.yellow,
83-
colorPickerType: ColorPickerType.MaterialPicker,
84-
decoration: InputDecoration(labelText: 'Pick Color'),
85-
),
86-
FormBuilderChipsInput(
87-
decoration: InputDecoration(labelText: 'Chips'),
88-
name: 'chips_test',
89-
onChanged: _onChanged,
90-
initialValue: [
91-
Contact('Andrew', '[email protected]',
92-
'https://d2gg9evh47fn9z.cloudfront.net/800px_COLOURBOX4057996.jpg'),
93-
],
94-
maxChips: 5,
95-
findSuggestions: (String query) {
96-
if (query.isNotEmpty) {
97-
var lowercaseQuery = query.toLowerCase();
98-
return contacts.where((profile) {
99-
return profile.name
100-
.toLowerCase()
101-
.contains(query.toLowerCase()) ||
102-
profile.email
103-
.toLowerCase()
104-
.contains(query.toLowerCase());
105-
}).toList(growable: false)
106-
..sort((a, b) => a.name
107-
.toLowerCase()
108-
.indexOf(lowercaseQuery)
109-
.compareTo(b.name
110-
.toLowerCase()
111-
.indexOf(lowercaseQuery)));
112-
} else {
113-
return const <Contact>[];
114-
}
115-
},
116-
chipBuilder: (context, state, profile) {
117-
return InputChip(
118-
key: ObjectKey(profile),
119-
label: Text(profile.name),
120-
avatar: CircleAvatar(
121-
backgroundImage: NetworkImage(profile.imageUrl),
122-
),
123-
onDeleted: () => state.deleteChip(profile),
124-
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
125-
);
126-
},
127-
suggestionBuilder: (context, state, profile) {
128-
return ListTile(
129-
key: ObjectKey(profile),
130-
leading: CircleAvatar(
131-
backgroundImage: NetworkImage(profile.imageUrl),
132-
),
133-
title: Text(profile.name),
134-
subtitle: Text(profile.email),
135-
onTap: () => state.selectSuggestion(profile),
136-
);
137-
},
138-
),
13980
FormBuilderDateTimePicker(
14081
name: 'date',
14182
// onChanged: _onChanged,
@@ -232,66 +173,6 @@ Widget build(BuildContext context) {
232173
))
233174
.toList(),
234175
),
235-
FormBuilderTypeAhead(
236-
decoration: InputDecoration(
237-
labelText: 'Country',
238-
),
239-
name: 'country',
240-
onChanged: _onChanged,
241-
itemBuilder: (context, country) {
242-
return ListTile(
243-
title: Text(country),
244-
);
245-
},
246-
controller: TextEditingController(text: ''),
247-
initialValue: 'Uganda',
248-
suggestionsCallback: (query) {
249-
if (query.isNotEmpty) {
250-
var lowercaseQuery = query.toLowerCase();
251-
return allCountries.where((country) {
252-
return country.toLowerCase().contains(lowercaseQuery);
253-
}).toList(growable: false)
254-
..sort((a, b) => a
255-
.toLowerCase()
256-
.indexOf(lowercaseQuery)
257-
.compareTo(
258-
b.toLowerCase().indexOf(lowercaseQuery)));
259-
} else {
260-
return allCountries;
261-
}
262-
},
263-
),
264-
FormBuilderRadioList(
265-
decoration:
266-
InputDecoration(labelText: 'My chosen language'),
267-
name: 'best_language',
268-
onChanged: _onChanged,
269-
validator: FormBuilderValidators.compose(
270-
[FormBuilderValidators.required(context)]),
271-
options: ['Dart', 'Kotlin', 'Java', 'Swift', 'Objective-C']
272-
.map((lang) => FormBuilderFieldOption(
273-
value: lang,
274-
child: Text('$lang'),
275-
))
276-
.toList(growable: false),
277-
),
278-
FormBuilderTouchSpin(
279-
decoration: InputDecoration(labelText: 'Stepper'),
280-
name: 'stepper',
281-
initialValue: 10,
282-
step: 1,
283-
iconSize: 48.0,
284-
addIcon: Icon(Icons.arrow_right),
285-
subtractIcon: Icon(Icons.arrow_left),
286-
),
287-
FormBuilderRating(
288-
decoration: InputDecoration(labelText: 'Rate this form'),
289-
name: 'rate',
290-
iconSize: 32.0,
291-
initialValue: 1.0,
292-
max: 5.0,
293-
onChanged: _onChanged,
294-
),
295176
],
296177
),
297178
),
@@ -356,25 +237,18 @@ Just add the `FormBuilderLocalizations.delegate` in the list of your app's `
356237
## Input widgets
357238
The currently supported fields include:
358239
* `FormBuilderCheckbox` - Single Checkbox field
359-
* `FormBuilderCheckboxList` - List of Checkboxes for multiple selection
360-
* `FormBuilderChipsInput` - Takes a list of `Chip`s as input and suggests more options on typing
240+
* `FormBuilderCheckboxGroup` - List of Checkboxes for multiple selection
361241
* `FormBuilderChoiceChip` - Creates a chip that acts like a radio button.
362-
* `FormBuilderColorPicker` - For `Color` input selection
363242
* `FormBuilderDateRangePicker` - For selection of a range of dates
364243
* `FormBuilderDateTimePicker` - For `Date`, `Time` and `DateTime` input
365244
* `FormBuilderDropdown` - Used to select one value from a list as a Dropdown
366245
* `FormBuilderFilterChip` - Creates a chip that acts like a checkbox.
367-
* `FormBuilderRadioGroup` - Used to select one value from a list of Radio Widgets
246+
* `FormBuilderRadioGroup` - Used to select one value from a list of Radio Widgets
368247
* `FormBuilderRangeSlider` - Used to select a range from a range of values
369-
* `FormBuilderRating` - For selection of a numerical value as a rating
370-
* `FormBuilderSearchableDropdown` - Field for selecting value(s) from a searchable list
371248
* `FormBuilderSegmentedControl` - For selection of a value from the `CupertinoSegmentedControl` as an input
372-
* `FormBuilderSignaturePad` - Field with drawing pad on which user can doodle
373249
* `FormBuilderSlider` - For selection of a numerical value on a slider
374250
* `FormBuilderSwitch` - On/Off switch field
375251
* `FormBuilderTextField` - A Material Design text field input.
376-
* `FormBuilderTouchSpin` - Selection of a number by tapping on a plus or minus icon
377-
* `FormBuilderTypeAhead` - Auto-completes user input from a list of items
378252

379253
In order to create an input field in the form, along with the label, and any applicable validation, there are several attributes that are supported by all types of inputs namely:
380254

example/lib/code_page.dart

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ class CodePage extends StatefulWidget {
77
final String sourceFilePath;
88

99
const CodePage({
10-
Key key,
11-
@required this.title,
12-
@required this.child,
13-
@required this.sourceFilePath,
10+
Key? key,
11+
required this.title,
12+
required this.child,
13+
required this.sourceFilePath,
1414
}) : super(key: key);
1515

1616
@override
@@ -21,7 +21,10 @@ class _CodePageState extends State<CodePage> {
2121
@override
2222
Widget build(BuildContext context) {
2323
return Scaffold(
24-
appBar: AppBar(title: Text(widget.title), elevation: 0),
24+
appBar: AppBar(
25+
title: Text(widget.title),
26+
elevation: 0,
27+
),
2528
/*body: WidgetWithCodeView(
2629
child: widget.child,
2730
sourceFilePath: widget.sourceFilePath,
@@ -33,3 +36,4 @@ class _CodePageState extends State<CodePage> {
3336
);
3437
}
3538
}
39+

example/lib/home_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class HomePage extends StatelessWidget {
1818
title: const Text('Complete Form'),
1919
trailing: const Icon(CupertinoIcons.right_chevron),
2020
onTap: () {
21-
return Navigator.of(context).push(
21+
Navigator.of(context).push(
2222
MaterialPageRoute(
2323
builder: (context) {
2424
return CodePage(
@@ -36,7 +36,7 @@ class HomePage extends StatelessWidget {
3636
title: const Text('Signup Form'),
3737
trailing: const Icon(CupertinoIcons.right_chevron),
3838
onTap: () {
39-
return Navigator.of(context).push(
39+
Navigator.of(context).push(
4040
MaterialPageRoute(
4141
builder: (context) {
4242
return CodePage(

0 commit comments

Comments
 (0)