Skip to content

Commit 59780c2

Browse files
committed
Upgraded flutter_typeahead from v0.5.1 -> v1.2.1
1 parent d20c9d0 commit 59780c2

File tree

10 files changed

+317
-329
lines changed

10 files changed

+317
-329
lines changed

.idea/libraries/Dart_Packages.xml

Lines changed: 10 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/Flutter_Plugins.xml

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 188 additions & 320 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

example/ios/Flutter/Debug.xcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
12
#include "Generated.xcconfig"

example/ios/Flutter/Release.xcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
12
#include "Generated.xcconfig"

example/ios/Podfile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Uncomment this line to define a global platform for your project
2+
# platform :ios, '9.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 parse_KV_file(file, separator='=')
14+
file_abs_path = File.expand_path(file)
15+
if !File.exists? file_abs_path
16+
return [];
17+
end
18+
pods_ary = []
19+
skip_line_start_symbols = ["#", "/"]
20+
File.foreach(file_abs_path) { |line|
21+
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
22+
plugin = line.split(pattern=separator)
23+
if plugin.length == 2
24+
podname = plugin[0].strip()
25+
path = plugin[1].strip()
26+
podpath = File.expand_path("#{path}", file_abs_path)
27+
pods_ary.push({:name => podname, :path => podpath});
28+
else
29+
puts "Invalid plugin specification: #{line}"
30+
end
31+
}
32+
return pods_ary
33+
end
34+
35+
target 'Runner' do
36+
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
37+
# referring to absolute paths on developers' machines.
38+
system('rm -rf .symlinks')
39+
system('mkdir -p .symlinks/plugins')
40+
41+
# Flutter Pods
42+
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
43+
if generated_xcode_build_settings.empty?
44+
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
45+
end
46+
generated_xcode_build_settings.map { |p|
47+
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
48+
symlink = File.join('.symlinks', 'flutter')
49+
File.symlink(File.dirname(p[:path]), symlink)
50+
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
51+
end
52+
}
53+
54+
# Plugin Pods
55+
plugin_pods = parse_KV_file('../.flutter-plugins')
56+
plugin_pods.map { |p|
57+
symlink = File.join('.symlinks', 'plugins', p[:name])
58+
File.symlink(p[:path], symlink)
59+
pod p[:name], :path => File.join(symlink, 'ios')
60+
}
61+
end
62+
63+
post_install do |installer|
64+
installer.pods_project.targets.each do |target|
65+
target.build_configurations.each do |config|
66+
config.build_settings['ENABLE_BITCODE'] = 'NO'
67+
end
68+
end
69+
end

lib/src/form_builder_input.dart

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'package:flutter/material.dart';
2-
import 'package:flutter_typeahead/flutter_typeahead.dart';
32
import 'package:flutter_chips_input/flutter_chips_input.dart';
3+
import 'package:flutter_typeahead/flutter_typeahead.dart';
44

55
import './form_builder_input_option.dart';
66

@@ -55,6 +55,24 @@ class FormBuilderInput {
5555
ChipsBuilder suggestionBuilder;
5656
ChipsBuilder chipBuilder;
5757

58+
//Inputs for typeahead
59+
bool getImmediateSuggestions;
60+
ErrorBuilder errorBuilder;
61+
WidgetBuilder noItemsFoundBuilder;
62+
WidgetBuilder loadingBuilder;
63+
Duration debounceDuration;
64+
SuggestionsBoxDecoration suggestionsBoxDecoration;
65+
double suggestionsBoxVerticalOffset;
66+
AnimationTransitionBuilder transitionBuilder;
67+
Duration animationDuration;
68+
double animationStart;
69+
AxisDirection direction;
70+
bool hideOnLoading;
71+
bool hideOnEmpty;
72+
bool hideOnError;
73+
bool hideSuggestionsOnKeyboardHide;
74+
bool keepSuggestionsOnLoading;
75+
5876
FormBuilderInput.textField({
5977
@required this.label,
6078
@required this.type,
@@ -95,6 +113,22 @@ class FormBuilderInput {
95113
this.value,
96114
this.require = false,
97115
this.validator,
116+
this.getImmediateSuggestions,
117+
this.errorBuilder,
118+
this.noItemsFoundBuilder,
119+
this.loadingBuilder,
120+
this.debounceDuration,
121+
this.suggestionsBoxDecoration,
122+
this.suggestionsBoxVerticalOffset,
123+
this.transitionBuilder,
124+
this.animationDuration,
125+
this.animationStart,
126+
this.direction,
127+
this.hideOnLoading,
128+
this.hideOnEmpty,
129+
this.hideOnError,
130+
this.hideSuggestionsOnKeyboardHide,
131+
this.keepSuggestionsOnLoading,
98132
}) {
99133
type = FormBuilderInput.TYPE_TYPE_AHEAD;
100134
}

pubspec.lock

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,21 @@ packages:
5959
name: flutter_typeahead
6060
url: "https://pub.dartlang.org"
6161
source: hosted
62-
version: "0.5.2"
62+
version: "1.2.1"
6363
intl:
6464
dependency: "direct main"
6565
description:
6666
name: intl
6767
url: "https://pub.dartlang.org"
6868
source: hosted
6969
version: "0.15.7"
70+
keyboard_visibility:
71+
dependency: transitive
72+
description:
73+
name: keyboard_visibility
74+
url: "https://pub.dartlang.org"
75+
source: hosted
76+
version: "0.5.2"
7077
matcher:
7178
dependency: transitive
7279
description:
@@ -172,4 +179,4 @@ packages:
172179
version: "2.0.8"
173180
sdks:
174181
dart: ">=2.1.0 <3.0.0"
175-
flutter: ">=0.1.2 <2.0.0"
182+
flutter: ">=0.1.4 <2.0.0"

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies:
1111
flutter:
1212
sdk: flutter
1313

14-
flutter_typeahead: ^0.5.1
14+
flutter_typeahead: ^1.2.1
1515
intl: ^0.15.7
1616
sy_flutter_widgets: ^0.1.4
1717
flutter_chips_input: ^1.1.0

0 commit comments

Comments
 (0)