Skip to content

Commit 2929f0c

Browse files
committed
update v2.2.0
1 parent 28c3f3a commit 2929f0c

14 files changed

+339
-80
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [2.2.0] - 2020.11.19
2+
3+
* add init method
4+
15
## [2.1.3] - 2020.11.13
26

37
* fixed [#64](https://github.com/huangjianke/flutter_easyloading/issues/64)

README-zh_CN.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
```yaml
1818
dependencies:
19-
flutter_easyloading: ^2.1.3
19+
flutter_easyloading: ^2.2.0
2020
```
2121
2222
## 导入
@@ -39,10 +39,7 @@ class MyApp extends StatelessWidget {
3939
primarySwatch: Colors.blue,
4040
),
4141
home: MyHomePage(title: 'Flutter EasyLoading'),
42-
builder: (BuildContext context, Widget child) {
43-
/// 确保 loading 组件能覆盖在其他组件之上.
44-
return FlutterEasyLoading(child: child);
45-
},
42+
builder: EasyLoading.init(),
4643
);
4744
}
4845
}

README.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Add this to your package's `pubspec.yaml` file:
1616

1717
```yaml
1818
dependencies:
19-
flutter_easyloading: ^2.1.3
19+
flutter_easyloading: ^2.2.0
2020
```
2121
2222
## Import
@@ -40,10 +40,7 @@ class MyApp extends StatelessWidget {
4040
primarySwatch: Colors.blue,
4141
),
4242
home: MyHomePage(title: 'Flutter EasyLoading'),
43-
builder: (BuildContext context, Widget child) {
44-
/// make sure that loading can be displayed in front of all other widgets
45-
return FlutterEasyLoading(child: child);
46-
},
43+
builder: EasyLoading.init(),
4744
);
4845
}
4946
}

example/ios/Flutter/Debug.xcconfig

+1
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

+1
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

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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+
generated_key_values = {}
19+
skip_line_start_symbols = ["#", "/"]
20+
File.foreach(file_abs_path) do |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+
generated_key_values[podname] = podpath
28+
else
29+
puts "Invalid plugin specification: #{line}"
30+
end
31+
end
32+
generated_key_values
33+
end
34+
35+
target 'Runner' do
36+
# Flutter Pod
37+
38+
copied_flutter_dir = File.join(__dir__, 'Flutter')
39+
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
40+
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
41+
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
42+
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
43+
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
44+
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
45+
46+
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
47+
unless File.exist?(generated_xcode_build_settings_path)
48+
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
49+
end
50+
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
51+
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
52+
53+
unless File.exist?(copied_framework_path)
54+
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
55+
end
56+
unless File.exist?(copied_podspec_path)
57+
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
58+
end
59+
end
60+
61+
# Keep pod path relative so it can be checked into Podfile.lock.
62+
pod 'Flutter', :path => 'Flutter'
63+
64+
# Plugin Pods
65+
66+
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
67+
# referring to absolute paths on developers' machines.
68+
system('rm -rf .symlinks')
69+
system('mkdir -p .symlinks/plugins')
70+
plugin_pods = parse_KV_file('../.flutter-plugins')
71+
plugin_pods.each do |name, path|
72+
symlink = File.join('.symlinks', 'plugins', name)
73+
File.symlink(path, symlink)
74+
pod name, :path => File.join(symlink, 'ios')
75+
end
76+
end
77+
78+
post_install do |installer|
79+
installer.pods_project.targets.each do |target|
80+
target.build_configurations.each do |config|
81+
config.build_settings['ENABLE_BITCODE'] = 'NO'
82+
end
83+
end
84+
end

example/ios/Podfile.lock

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
PODS:
2+
- Flutter (1.0.0)
3+
- flutter_boost (0.0.2):
4+
- Flutter
5+
6+
DEPENDENCIES:
7+
- Flutter (from `Flutter`)
8+
- flutter_boost (from `.symlinks/plugins/flutter_boost/ios`)
9+
10+
EXTERNAL SOURCES:
11+
Flutter:
12+
:path: Flutter
13+
flutter_boost:
14+
:path: ".symlinks/plugins/flutter_boost/ios"
15+
16+
SPEC CHECKSUMS:
17+
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
18+
flutter_boost: a7cfa776b75329d5e7d101d0cd33e75042bcde69
19+
20+
PODFILE CHECKSUM: f32fb4e7c14f8b3ca19a369d7be425dd9241af27
21+
22+
COCOAPODS: 1.9.1

example/ios/Runner.xcodeproj/project.pbxproj

+69
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1515
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1616
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
17+
F47B725BE0C467F32ECFA7FC /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DDEA500AC0830320B79B906A /* libPods-Runner.a */; };
1718
/* End PBXBuildFile section */
1819

1920
/* Begin PBXCopyFilesBuildPhase section */
@@ -30,8 +31,10 @@
3031
/* End PBXCopyFilesBuildPhase section */
3132

3233
/* Begin PBXFileReference section */
34+
0B601FB0F114EFA6087C37D7 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
3335
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
3436
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
37+
2B155E4FBF928C230910A7DF /* 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>"; };
3538
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3639
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
3740
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
@@ -44,13 +47,16 @@
4447
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4548
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4649
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
50+
99E0808DE98ACDC69DEFD276 /* 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>"; };
51+
DDEA500AC0830320B79B906A /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4752
/* End PBXFileReference section */
4853

4954
/* Begin PBXFrameworksBuildPhase section */
5055
97C146EB1CF9000F007C117D /* Frameworks */ = {
5156
isa = PBXFrameworksBuildPhase;
5257
buildActionMask = 2147483647;
5358
files = (
59+
F47B725BE0C467F32ECFA7FC /* libPods-Runner.a in Frameworks */,
5460
);
5561
runOnlyForDeploymentPostprocessing = 0;
5662
};
@@ -74,6 +80,8 @@
7480
9740EEB11CF90186004384FC /* Flutter */,
7581
97C146F01CF9000F007C117D /* Runner */,
7682
97C146EF1CF9000F007C117D /* Products */,
83+
C1E66B1C65A3711BC08D51DB /* Pods */,
84+
A034BD10CCE9E1D328001624 /* Frameworks */,
7785
);
7886
sourceTree = "<group>";
7987
};
@@ -109,19 +117,40 @@
109117
name = "Supporting Files";
110118
sourceTree = "<group>";
111119
};
120+
A034BD10CCE9E1D328001624 /* Frameworks */ = {
121+
isa = PBXGroup;
122+
children = (
123+
DDEA500AC0830320B79B906A /* libPods-Runner.a */,
124+
);
125+
name = Frameworks;
126+
sourceTree = "<group>";
127+
};
128+
C1E66B1C65A3711BC08D51DB /* Pods */ = {
129+
isa = PBXGroup;
130+
children = (
131+
99E0808DE98ACDC69DEFD276 /* Pods-Runner.debug.xcconfig */,
132+
2B155E4FBF928C230910A7DF /* Pods-Runner.release.xcconfig */,
133+
0B601FB0F114EFA6087C37D7 /* Pods-Runner.profile.xcconfig */,
134+
);
135+
name = Pods;
136+
path = Pods;
137+
sourceTree = "<group>";
138+
};
112139
/* End PBXGroup section */
113140

114141
/* Begin PBXNativeTarget section */
115142
97C146ED1CF9000F007C117D /* Runner */ = {
116143
isa = PBXNativeTarget;
117144
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
118145
buildPhases = (
146+
CF5A5CE440F54A061303EA05 /* [CP] Check Pods Manifest.lock */,
119147
9740EEB61CF901F6004384FC /* Run Script */,
120148
97C146EA1CF9000F007C117D /* Sources */,
121149
97C146EB1CF9000F007C117D /* Frameworks */,
122150
97C146EC1CF9000F007C117D /* Resources */,
123151
9705A1C41CF9048500538489 /* Embed Frameworks */,
124152
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
153+
33874F32E57E35432E8B60A1 /* [CP] Embed Pods Frameworks */,
125154
);
126155
buildRules = (
127156
);
@@ -180,6 +209,24 @@
180209
/* End PBXResourcesBuildPhase section */
181210

182211
/* Begin PBXShellScriptBuildPhase section */
212+
33874F32E57E35432E8B60A1 /* [CP] Embed Pods Frameworks */ = {
213+
isa = PBXShellScriptBuildPhase;
214+
buildActionMask = 2147483647;
215+
files = (
216+
);
217+
inputPaths = (
218+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
219+
"${PODS_ROOT}/../Flutter/Flutter.framework",
220+
);
221+
name = "[CP] Embed Pods Frameworks";
222+
outputPaths = (
223+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
224+
);
225+
runOnlyForDeploymentPostprocessing = 0;
226+
shellPath = /bin/sh;
227+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
228+
showEnvVarsInLog = 0;
229+
};
183230
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
184231
isa = PBXShellScriptBuildPhase;
185232
buildActionMask = 2147483647;
@@ -208,6 +255,28 @@
208255
shellPath = /bin/sh;
209256
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
210257
};
258+
CF5A5CE440F54A061303EA05 /* [CP] Check Pods Manifest.lock */ = {
259+
isa = PBXShellScriptBuildPhase;
260+
buildActionMask = 2147483647;
261+
files = (
262+
);
263+
inputFileListPaths = (
264+
);
265+
inputPaths = (
266+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
267+
"${PODS_ROOT}/Manifest.lock",
268+
);
269+
name = "[CP] Check Pods Manifest.lock";
270+
outputFileListPaths = (
271+
);
272+
outputPaths = (
273+
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
274+
);
275+
runOnlyForDeploymentPostprocessing = 0;
276+
shellPath = /bin/sh;
277+
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";
278+
showEnvVarsInLog = 0;
279+
};
211280
/* End PBXShellScriptBuildPhase section */
212281

213282
/* Begin PBXSourcesBuildPhase section */

example/ios/Runner.xcworkspace/contents.xcworkspacedata

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/lib/main.dart

+1-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ class MyApp extends StatelessWidget {
4040
primarySwatch: Colors.blue,
4141
),
4242
home: MyHomePage(title: 'Flutter EasyLoading'),
43-
builder: (BuildContext context, Widget child) {
44-
/// make sure that loading can be displayed in front of all other widgets
45-
return FlutterEasyLoading(child: child);
46-
},
43+
builder: EasyLoading.init(),
4744
);
4845
}
4946
}

0 commit comments

Comments
 (0)