Skip to content

Commit ed0666f

Browse files
committed
Merge branch 'minor_fixes' into input_chips
# Conflicts: # .idea/workspace.xml # example/lib/main.dart
2 parents 54d9049 + 43f797f commit ed0666f

File tree

6 files changed

+157
-187
lines changed

6 files changed

+157
-187
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

example/ios/Runner/Base.lproj/Main.storyboard

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
3+
<device id="retina4_7" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
36
<dependencies>
47
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
9+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
610
</dependencies>
711
<scenes>
812
<!--Flutter View Controller-->
@@ -14,9 +18,9 @@
1418
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
1519
</layoutGuides>
1620
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
17-
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
21+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
1822
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19-
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
23+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2024
</view>
2125
</viewController>
2226
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>

example/lib/main.dart

Lines changed: 53 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,6 @@ class MyApp extends StatelessWidget {
1616
}
1717
}
1818

19-
class AppProfile {
20-
final String name;
21-
final String email;
22-
final String imageUrl;
23-
24-
const AppProfile(this.name, this.email, this.imageUrl);
25-
26-
@override
27-
bool operator ==(Object other) =>
28-
identical(this, other) ||
29-
other is AppProfile &&
30-
runtimeType == other.runtimeType &&
31-
name == other.name;
32-
33-
@override
34-
int get hashCode => name.hashCode;
35-
36-
@override
37-
String toString() {
38-
return name;
39-
}
40-
}
41-
4219
class MyHomePage extends StatelessWidget {
4320
@override
4421
Widget build(BuildContext context) {
@@ -69,6 +46,9 @@ class MyHomePage extends StatelessWidget {
6946
'https://upload.wikimedia.org/wikipedia/commons/7/7c/Profile_avatar_placeholder_large.png'),
7047
];
7148

49+
const allCountries = ["Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvinas)", "Faroe Islands", "Fiji", "Finland", "France", "France Metropolitan", "French Guiana", "French Polynesia", "French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard and Mc Donald Islands", "Holy See (Vatican City State)", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran (Islamic Republic of)", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", "Kyrgyzstan", "Lao, People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia, The Former Yugoslav Republic of", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia, Federated States of", "Moldova, Republic of", "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Seychelles", "Sierra Leone", "Singapore", "Slovakia (Slovak Republic)", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "Spain", "Sri Lanka", "St. Helena", "St. Pierre and Miquelon", "Sudan", "Suriname", "Svalbard and Jan Mayen Islands", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan, Province of China", "Tajikistan", "Tanzania, United Republic of", "Thailand", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Virgin Islands (British)", "Virgin Islands (U.S.)", "Wallis and Futuna Islands", "Western Sahara", "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"];
50+
51+
7252
return Scaffold(
7353
appBar: AppBar(
7454
title: Text('Flutter FormBuilder Example'),
@@ -119,6 +99,25 @@ class MyHomePage extends StatelessWidget {
11999
);
120100
},
121101
),
102+
FormBuilderInput.typeAhead(
103+
label: 'Country',
104+
attribute: 'country',
105+
require: true,
106+
itemBuilder: (context, country) {
107+
return ListTile(
108+
title: Text(country),
109+
);
110+
},
111+
suggestionsCallback: (query) {
112+
if (query.length != 0) {
113+
return allCountries.where((country) {
114+
return country.toLowerCase().contains(query.toLowerCase());
115+
}).toList(growable: false);
116+
} else {
117+
return allCountries;
118+
}
119+
},
120+
),
122121
FormBuilderInput.textField(
123122
type: FormBuilderInput.TYPE_TEXT,
124123
attribute: "name",
@@ -193,15 +192,11 @@ class MyHomePage extends StatelessWidget {
193192
label: "My Best Language",
194193
attribute: "best_language",
195194
require: true,
196-
options: [
197-
FormBuilderInputOption(value: "Dart"),
198-
FormBuilderInputOption(value: "Kotlin"),
199-
FormBuilderInputOption(value: "Java"),
200-
FormBuilderInputOption(value: "Swift"),
201-
FormBuilderInputOption(value: "Objective-C"),
202-
],
195+
options: ["Dart", "Kotlin", "Java", "Swift", "Objective-C"]
196+
.map((lang) => FormBuilderInputOption(value: lang))
197+
.toList(growable: false),
203198
),
204-
/*FormBuilderInput.checkbox(
199+
FormBuilderInput.checkbox(
205200
label: "I accept the terms and conditions",
206201
attribute: "accept_terms",
207202
hint:
@@ -246,39 +241,10 @@ class MyHomePage extends StatelessWidget {
246241
label: "Movie Rating (Archer)",
247242
attribute: "movie_rating",
248243
require: true,
249-
options: [
250-
FormBuilderInputOption(
251-
value: 1,
252-
),
253-
FormBuilderInputOption(
254-
value: 2,
255-
),
256-
FormBuilderInputOption(
257-
value: 3,
258-
),
259-
FormBuilderInputOption(
260-
value: 4,
261-
),
262-
FormBuilderInputOption(
263-
value: 5,
264-
),
265-
FormBuilderInputOption(
266-
value: 6,
267-
),
268-
FormBuilderInputOption(
269-
value: 7,
270-
),
271-
FormBuilderInputOption(
272-
value: 8,
273-
),
274-
FormBuilderInputOption(
275-
value: 9,
276-
),
277-
FormBuilderInputOption(
278-
value: 10,
279-
),
280-
],
281-
),*/
244+
options: List.generate(5, (i) => i + 1)
245+
.map((number) => FormBuilderInputOption(value: number))
246+
.toList(),
247+
),
282248
],
283249
onChanged: () {
284250
print("Form value changed");
@@ -295,3 +261,26 @@ class MyHomePage extends StatelessWidget {
295261
);
296262
}
297263
}
264+
265+
class AppProfile {
266+
final String name;
267+
final String email;
268+
final String imageUrl;
269+
270+
const AppProfile(this.name, this.email, this.imageUrl);
271+
272+
@override
273+
bool operator ==(Object other) =>
274+
identical(this, other) ||
275+
other is AppProfile &&
276+
runtimeType == other.runtimeType &&
277+
name == other.name;
278+
279+
@override
280+
int get hashCode => name.hashCode;
281+
282+
@override
283+
String toString() {
284+
return name;
285+
}
286+
}

lib/flutter_form_builder.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ export './src/chips_input.dart';
44
export './src/form_builder.dart';
55
export './src/form_builder_input.dart';
66
export './src/form_builder_input_option.dart';
7-
export './src/form_builder_type_ahead.dart';

0 commit comments

Comments
 (0)