Browse Source

Merge pull request #115 from CaiJingLong/rollback-photo-manager-0.5.0

Rollback photo manager 0.5.0
Caijinglong 4 years ago
parent
commit
1455ea92fd
No account linked to committer's email address

+ 4
- 0
CHANGELOG.md View File

1
 # CHANGELOG
1
 # CHANGELOG
2
 
2
 
3
+## 0.5.0-dev.1
4
+
5
+- Rollback photo_manager
6
+
3
 ## 0.4.8
7
 ## 0.4.8
4
 
8
 
5
 - Rollback photo_manager
9
 - Rollback photo_manager

+ 58
- 34
example/ios/Podfile View File

4
 # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
4
 # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5
 ENV['COCOAPODS_DISABLE_STATS'] = 'true'
5
 ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6
 
6
 
7
+project 'Runner', {
8
+  'Debug' => :debug,
9
+  'Profile' => :release,
10
+  'Release' => :release,
11
+}
12
+
7
 def parse_KV_file(file, separator='=')
13
 def parse_KV_file(file, separator='=')
8
   file_abs_path = File.expand_path(file)
14
   file_abs_path = File.expand_path(file)
9
   if !File.exists? file_abs_path
15
   if !File.exists? file_abs_path
10
     return [];
16
     return [];
11
   end
17
   end
12
-  pods_ary = []
18
+  generated_key_values = {}
13
   skip_line_start_symbols = ["#", "/"]
19
   skip_line_start_symbols = ["#", "/"]
14
-  File.foreach(file_abs_path) { |line|
15
-      next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
16
-      plugin = line.split(pattern=separator)
17
-      if plugin.length == 2
18
-        podname = plugin[0].strip()
19
-        path = plugin[1].strip()
20
-        podpath = File.expand_path("#{path}", file_abs_path)
21
-        pods_ary.push({:name => podname, :path => podpath});
22
-      else
23
-        puts "Invalid plugin specification: #{line}"
24
-      end
25
-  }
26
-  return pods_ary
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
27
 end
33
 end
28
 
34
 
29
 target 'Runner' do
35
 target 'Runner' do
30
-  # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
31
-  # referring to absolute paths on developers' machines.
32
-  system('rm -rf .symlinks')
33
-  system('mkdir -p .symlinks/plugins')
36
+  # Flutter Pod
34
 
37
 
35
-  # Flutter Pods
36
-  generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
37
-  if generated_xcode_build_settings.empty?
38
-    puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
39
-  end
40
-  generated_xcode_build_settings.map { |p|
41
-    if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
42
-      symlink = File.join('.symlinks', 'flutter')
43
-      File.symlink(File.dirname(p[:path]), symlink)
44
-      pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
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"
45
     end
49
     end
46
-  }
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'
47
 
63
 
48
   # Plugin Pods
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')
49
   plugin_pods = parse_KV_file('../.flutter-plugins')
70
   plugin_pods = parse_KV_file('../.flutter-plugins')
50
-  plugin_pods.map { |p|
51
-    symlink = File.join('.symlinks', 'plugins', p[:name])
52
-    File.symlink(p[:path], symlink)
53
-    pod p[:name], :path => File.join(symlink, 'ios')
54
-  }
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
55
 end
76
 end
56
 
77
 
78
+# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
79
+install! 'cocoapods', :disable_input_output_paths => true
80
+
57
 post_install do |installer|
81
 post_install do |installer|
58
   installer.pods_project.targets.each do |target|
82
   installer.pods_project.targets.each do |target|
59
     target.build_configurations.each do |config|
83
     target.build_configurations.each do |config|

+ 13
- 11
example/ios/Runner.xcodeproj/project.pbxproj View File

40
 /* Begin PBXFileReference section */
40
 /* Begin PBXFileReference section */
41
 		1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
41
 		1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
42
 		1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
42
 		1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
43
+		223FFDA7243467D600A654DC /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
44
+		223FFDA8243467D600A654DC /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = "<group>"; };
43
 		3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
45
 		3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
44
 		3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
46
 		3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
45
 		7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
47
 		7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
48
 		9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
50
 		9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
49
 		9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
51
 		9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
50
 		9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
52
 		9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
51
-		97C146EE1CF9000F007C117D /* photo_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = photo_example.app; sourceTree = BUILT_PRODUCTS_DIR; };
53
+		97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
52
 		97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
54
 		97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
53
 		97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
55
 		97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
54
 		97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
56
 		97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
109
 		97C146EF1CF9000F007C117D /* Products */ = {
111
 		97C146EF1CF9000F007C117D /* Products */ = {
110
 			isa = PBXGroup;
112
 			isa = PBXGroup;
111
 			children = (
113
 			children = (
112
-				97C146EE1CF9000F007C117D /* photo_example.app */,
114
+				97C146EE1CF9000F007C117D /* Runner.app */,
113
 			);
115
 			);
114
 			name = Products;
116
 			name = Products;
115
 			sourceTree = "<group>";
117
 			sourceTree = "<group>";
168
 			);
170
 			);
169
 			name = Runner;
171
 			name = Runner;
170
 			productName = Runner;
172
 			productName = Runner;
171
-			productReference = 97C146EE1CF9000F007C117D /* photo_example.app */;
173
+			productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
172
 			productType = "com.apple.product-type.application";
174
 			productType = "com.apple.product-type.application";
173
 		};
175
 		};
174
 /* End PBXNativeTarget section */
176
 /* End PBXNativeTarget section */
182
 				TargetAttributes = {
184
 				TargetAttributes = {
183
 					97C146ED1CF9000F007C117D = {
185
 					97C146ED1CF9000F007C117D = {
184
 						CreatedOnToolsVersion = 7.3.1;
186
 						CreatedOnToolsVersion = 7.3.1;
185
-						DevelopmentTeam = 344756CAN4;
187
+						DevelopmentTeam = S5GU4EMC47;
186
 					};
188
 					};
187
 				};
189
 				};
188
 			};
190
 			};
194
 				English,
196
 				English,
195
 				en,
197
 				en,
196
 				Base,
198
 				Base,
199
+				"zh-Hans",
197
 			);
200
 			);
198
 			mainGroup = 97C146E51CF9000F007C117D;
201
 			mainGroup = 97C146E51CF9000F007C117D;
199
 			productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
202
 			productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
227
 			files = (
230
 			files = (
228
 			);
231
 			);
229
 			inputPaths = (
232
 			inputPaths = (
230
-				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
231
-				"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
232
 			);
233
 			);
233
 			name = "[CP] Embed Pods Frameworks";
234
 			name = "[CP] Embed Pods Frameworks";
234
 			outputPaths = (
235
 			outputPaths = (
235
-				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
236
 			);
236
 			);
237
 			runOnlyForDeploymentPostprocessing = 0;
237
 			runOnlyForDeploymentPostprocessing = 0;
238
 			shellPath = /bin/sh;
238
 			shellPath = /bin/sh;
309
 			isa = PBXVariantGroup;
309
 			isa = PBXVariantGroup;
310
 			children = (
310
 			children = (
311
 				97C146FB1CF9000F007C117D /* Base */,
311
 				97C146FB1CF9000F007C117D /* Base */,
312
+				223FFDA7243467D600A654DC /* zh-Hans */,
312
 			);
313
 			);
313
 			name = Main.storyboard;
314
 			name = Main.storyboard;
314
 			sourceTree = "<group>";
315
 			sourceTree = "<group>";
317
 			isa = PBXVariantGroup;
318
 			isa = PBXVariantGroup;
318
 			children = (
319
 			children = (
319
 				97C147001CF9000F007C117D /* Base */,
320
 				97C147001CF9000F007C117D /* Base */,
321
+				223FFDA8243467D600A654DC /* zh-Hans */,
320
 			);
322
 			);
321
 			name = LaunchScreen.storyboard;
323
 			name = LaunchScreen.storyboard;
322
 			sourceTree = "<group>";
324
 			sourceTree = "<group>";
432
 			buildSettings = {
434
 			buildSettings = {
433
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
435
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
434
 				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
436
 				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
435
-				DEVELOPMENT_TEAM = 344756CAN4;
437
+				DEVELOPMENT_TEAM = S5GU4EMC47;
436
 				ENABLE_BITCODE = NO;
438
 				ENABLE_BITCODE = NO;
437
 				FRAMEWORK_SEARCH_PATHS = (
439
 				FRAMEWORK_SEARCH_PATHS = (
438
 					"$(inherited)",
440
 					"$(inherited)",
445
 					"$(PROJECT_DIR)/Flutter",
447
 					"$(PROJECT_DIR)/Flutter",
446
 				);
448
 				);
447
 				PRODUCT_BUNDLE_IDENTIFIER = top.kikt.photo.manager;
449
 				PRODUCT_BUNDLE_IDENTIFIER = top.kikt.photo.manager;
448
-				PRODUCT_NAME = photo_example;
450
+				PRODUCT_NAME = Runner;
449
 				VERSIONING_SYSTEM = "apple-generic";
451
 				VERSIONING_SYSTEM = "apple-generic";
450
 			};
452
 			};
451
 			name = Debug;
453
 			name = Debug;
456
 			buildSettings = {
458
 			buildSettings = {
457
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
459
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
458
 				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
460
 				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
459
-				DEVELOPMENT_TEAM = 344756CAN4;
461
+				DEVELOPMENT_TEAM = S5GU4EMC47;
460
 				ENABLE_BITCODE = NO;
462
 				ENABLE_BITCODE = NO;
461
 				FRAMEWORK_SEARCH_PATHS = (
463
 				FRAMEWORK_SEARCH_PATHS = (
462
 					"$(inherited)",
464
 					"$(inherited)",
469
 					"$(PROJECT_DIR)/Flutter",
471
 					"$(PROJECT_DIR)/Flutter",
470
 				);
472
 				);
471
 				PRODUCT_BUNDLE_IDENTIFIER = top.kikt.photo.manager;
473
 				PRODUCT_BUNDLE_IDENTIFIER = top.kikt.photo.manager;
472
-				PRODUCT_NAME = photo_example;
474
+				PRODUCT_NAME = Runner;
473
 				VERSIONING_SYSTEM = "apple-generic";
475
 				VERSIONING_SYSTEM = "apple-generic";
474
 			};
476
 			};
475
 			name = Release;
477
 			name = Release;

+ 2
- 8
example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme View File

26
       buildConfiguration = "Debug"
26
       buildConfiguration = "Debug"
27
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
27
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
28
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
-      language = ""
30
       shouldUseLaunchSchemeArgsEnv = "YES">
29
       shouldUseLaunchSchemeArgsEnv = "YES">
31
-      <Testables>
32
-      </Testables>
33
       <MacroExpansion>
30
       <MacroExpansion>
34
          <BuildableReference
31
          <BuildableReference
35
             BuildableIdentifier = "primary"
32
             BuildableIdentifier = "primary"
39
             ReferencedContainer = "container:Runner.xcodeproj">
36
             ReferencedContainer = "container:Runner.xcodeproj">
40
          </BuildableReference>
37
          </BuildableReference>
41
       </MacroExpansion>
38
       </MacroExpansion>
42
-      <AdditionalOptions>
43
-      </AdditionalOptions>
39
+      <Testables>
40
+      </Testables>
44
    </TestAction>
41
    </TestAction>
45
    <LaunchAction
42
    <LaunchAction
46
       buildConfiguration = "Debug"
43
       buildConfiguration = "Debug"
47
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
44
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
48
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
45
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
49
-      language = ""
50
       launchStyle = "0"
46
       launchStyle = "0"
51
       useCustomWorkingDirectory = "NO"
47
       useCustomWorkingDirectory = "NO"
52
       ignoresPersistentStateOnLaunch = "NO"
48
       ignoresPersistentStateOnLaunch = "NO"
63
             ReferencedContainer = "container:Runner.xcodeproj">
59
             ReferencedContainer = "container:Runner.xcodeproj">
64
          </BuildableReference>
60
          </BuildableReference>
65
       </BuildableProductRunnable>
61
       </BuildableProductRunnable>
66
-      <AdditionalOptions>
67
-      </AdditionalOptions>
68
    </LaunchAction>
62
    </LaunchAction>
69
    <ProfileAction
63
    <ProfileAction
70
       buildConfiguration = "Release"
64
       buildConfiguration = "Release"

+ 1
- 1
example/ios/Runner/Info.plist View File

11
 	<key>CFBundleInfoDictionaryVersion</key>
11
 	<key>CFBundleInfoDictionaryVersion</key>
12
 	<string>6.0</string>
12
 	<string>6.0</string>
13
 	<key>CFBundleName</key>
13
 	<key>CFBundleName</key>
14
-	<string>example</string>
14
+	<string>PhotoExample</string>
15
 	<key>CFBundlePackageType</key>
15
 	<key>CFBundlePackageType</key>
16
 	<string>APPL</string>
16
 	<string>APPL</string>
17
 	<key>CFBundleShortVersionString</key>
17
 	<key>CFBundleShortVersionString</key>

+ 1
- 0
example/ios/Runner/zh-Hans.lproj/LaunchScreen.strings View File

1
+

+ 1
- 0
example/ios/Runner/zh-Hans.lproj/Main.strings View File

1
+

+ 2
- 1
example/lib/main.dart View File

114
   }
114
   }
115
 
115
 
116
   void _testPhotoListParams() async {
116
   void _testPhotoListParams() async {
117
-    var assetPathList = await PhotoManager.getImageAsset();
117
+    var assetPathList =
118
+        await PhotoManager.getAssetPathList(type: RequestType.image);
118
     _pickAsset(PickType.all, pathList: assetPathList);
119
     _pickAsset(PickType.all, pathList: assetPathList);
119
   }
120
   }
120
 
121
 

+ 1
- 0
lib/src/provider/config_provider.dart View File

4
 import 'package:photo/src/provider/i18n_provider.dart';
4
 import 'package:photo/src/provider/i18n_provider.dart';
5
 import 'package:photo_manager/photo_manager.dart';
5
 import 'package:photo_manager/photo_manager.dart';
6
 
6
 
7
+// ignore_for_file: deprecated_member_use
7
 class PhotoPickerProvider extends InheritedWidget {
8
 class PhotoPickerProvider extends InheritedWidget {
8
   final Options options;
9
   final Options options;
9
   final I18nProvider provider;
10
   final I18nProvider provider;

+ 6
- 5
lib/src/ui/page/photo_main_page.dart View File

214
     List<AssetPathEntity> pathList;
214
     List<AssetPathEntity> pathList;
215
     switch (options.pickType) {
215
     switch (options.pickType) {
216
       case PickType.onlyImage:
216
       case PickType.onlyImage:
217
-        pathList = await PhotoManager.getImageAsset();
217
+        pathList = await PhotoManager.getAssetPathList(type: RequestType.image);
218
         break;
218
         break;
219
       case PickType.onlyVideo:
219
       case PickType.onlyVideo:
220
-        pathList = await PhotoManager.getVideoAsset();
220
+        pathList = await PhotoManager.getAssetPathList(type: RequestType.image);
221
         break;
221
         break;
222
       default:
222
       default:
223
-        pathList = await PhotoManager.getAssetPathList();
223
+        pathList = await PhotoManager.getAssetPathList(
224
+            type: RequestType.image | RequestType.video);
224
     }
225
     }
225
 
226
 
226
     _onRefreshAssetPathList(pathList);
227
     _onRefreshAssetPathList(pathList);
502
     List<AssetPathEntity> pathList;
503
     List<AssetPathEntity> pathList;
503
     switch (options.pickType) {
504
     switch (options.pickType) {
504
       case PickType.onlyImage:
505
       case PickType.onlyImage:
505
-        pathList = await PhotoManager.getImageAsset();
506
+        pathList = await PhotoManager.getAssetPathList(type: RequestType.image);
506
         break;
507
         break;
507
       case PickType.onlyVideo:
508
       case PickType.onlyVideo:
508
-        pathList = await PhotoManager.getVideoAsset();
509
+        pathList = await PhotoManager.getAssetPathList(type: RequestType.image);
509
         break;
510
         break;
510
       default:
511
       default:
511
         pathList = await PhotoManager.getAssetPathList();
512
         pathList = await PhotoManager.getAssetPathList();

+ 26
- 26
pubspec.lock View File

5
     dependency: transitive
5
     dependency: transitive
6
     description:
6
     description:
7
       name: archive
7
       name: archive
8
-      url: "https://pub.flutter-io.cn"
8
+      url: "https://pub.dartlang.org"
9
     source: hosted
9
     source: hosted
10
     version: "2.0.11"
10
     version: "2.0.11"
11
   args:
11
   args:
12
     dependency: transitive
12
     dependency: transitive
13
     description:
13
     description:
14
       name: args
14
       name: args
15
-      url: "https://pub.flutter-io.cn"
15
+      url: "https://pub.dartlang.org"
16
     source: hosted
16
     source: hosted
17
     version: "1.5.2"
17
     version: "1.5.2"
18
   async:
18
   async:
19
     dependency: transitive
19
     dependency: transitive
20
     description:
20
     description:
21
       name: async
21
       name: async
22
-      url: "https://pub.flutter-io.cn"
22
+      url: "https://pub.dartlang.org"
23
     source: hosted
23
     source: hosted
24
     version: "2.4.0"
24
     version: "2.4.0"
25
   boolean_selector:
25
   boolean_selector:
26
     dependency: transitive
26
     dependency: transitive
27
     description:
27
     description:
28
       name: boolean_selector
28
       name: boolean_selector
29
-      url: "https://pub.flutter-io.cn"
29
+      url: "https://pub.dartlang.org"
30
     source: hosted
30
     source: hosted
31
     version: "1.0.5"
31
     version: "1.0.5"
32
   charcode:
32
   charcode:
33
     dependency: transitive
33
     dependency: transitive
34
     description:
34
     description:
35
       name: charcode
35
       name: charcode
36
-      url: "https://pub.flutter-io.cn"
36
+      url: "https://pub.dartlang.org"
37
     source: hosted
37
     source: hosted
38
     version: "1.1.2"
38
     version: "1.1.2"
39
   collection:
39
   collection:
40
     dependency: transitive
40
     dependency: transitive
41
     description:
41
     description:
42
       name: collection
42
       name: collection
43
-      url: "https://pub.flutter-io.cn"
43
+      url: "https://pub.dartlang.org"
44
     source: hosted
44
     source: hosted
45
     version: "1.14.11"
45
     version: "1.14.11"
46
   convert:
46
   convert:
47
     dependency: transitive
47
     dependency: transitive
48
     description:
48
     description:
49
       name: convert
49
       name: convert
50
-      url: "https://pub.flutter-io.cn"
50
+      url: "https://pub.dartlang.org"
51
     source: hosted
51
     source: hosted
52
     version: "2.1.1"
52
     version: "2.1.1"
53
   crypto:
53
   crypto:
54
     dependency: transitive
54
     dependency: transitive
55
     description:
55
     description:
56
       name: crypto
56
       name: crypto
57
-      url: "https://pub.flutter-io.cn"
57
+      url: "https://pub.dartlang.org"
58
     source: hosted
58
     source: hosted
59
     version: "2.1.3"
59
     version: "2.1.3"
60
   flutter:
60
   flutter:
71
     dependency: transitive
71
     dependency: transitive
72
     description:
72
     description:
73
       name: image
73
       name: image
74
-      url: "https://pub.flutter-io.cn"
74
+      url: "https://pub.dartlang.org"
75
     source: hosted
75
     source: hosted
76
     version: "2.1.4"
76
     version: "2.1.4"
77
   matcher:
77
   matcher:
78
     dependency: transitive
78
     dependency: transitive
79
     description:
79
     description:
80
       name: matcher
80
       name: matcher
81
-      url: "https://pub.flutter-io.cn"
81
+      url: "https://pub.dartlang.org"
82
     source: hosted
82
     source: hosted
83
     version: "0.12.6"
83
     version: "0.12.6"
84
   meta:
84
   meta:
85
     dependency: transitive
85
     dependency: transitive
86
     description:
86
     description:
87
       name: meta
87
       name: meta
88
-      url: "https://pub.flutter-io.cn"
88
+      url: "https://pub.dartlang.org"
89
     source: hosted
89
     source: hosted
90
     version: "1.1.8"
90
     version: "1.1.8"
91
   path:
91
   path:
92
     dependency: transitive
92
     dependency: transitive
93
     description:
93
     description:
94
       name: path
94
       name: path
95
-      url: "https://pub.flutter-io.cn"
95
+      url: "https://pub.dartlang.org"
96
     source: hosted
96
     source: hosted
97
     version: "1.6.4"
97
     version: "1.6.4"
98
   pedantic:
98
   pedantic:
99
     dependency: transitive
99
     dependency: transitive
100
     description:
100
     description:
101
       name: pedantic
101
       name: pedantic
102
-      url: "https://pub.flutter-io.cn"
102
+      url: "https://pub.dartlang.org"
103
     source: hosted
103
     source: hosted
104
     version: "1.8.0+1"
104
     version: "1.8.0+1"
105
   petitparser:
105
   petitparser:
106
     dependency: transitive
106
     dependency: transitive
107
     description:
107
     description:
108
       name: petitparser
108
       name: petitparser
109
-      url: "https://pub.flutter-io.cn"
109
+      url: "https://pub.dartlang.org"
110
     source: hosted
110
     source: hosted
111
     version: "2.4.0"
111
     version: "2.4.0"
112
   photo_manager:
112
   photo_manager:
113
     dependency: "direct main"
113
     dependency: "direct main"
114
     description:
114
     description:
115
       name: photo_manager
115
       name: photo_manager
116
-      url: "https://pub.flutter-io.cn"
116
+      url: "https://pub.dartlang.org"
117
     source: hosted
117
     source: hosted
118
-    version: "0.4.8"
118
+    version: "0.5.1-dev.2"
119
   quiver:
119
   quiver:
120
     dependency: transitive
120
     dependency: transitive
121
     description:
121
     description:
122
       name: quiver
122
       name: quiver
123
-      url: "https://pub.flutter-io.cn"
123
+      url: "https://pub.dartlang.org"
124
     source: hosted
124
     source: hosted
125
     version: "2.0.5"
125
     version: "2.0.5"
126
   sky_engine:
126
   sky_engine:
132
     dependency: transitive
132
     dependency: transitive
133
     description:
133
     description:
134
       name: source_span
134
       name: source_span
135
-      url: "https://pub.flutter-io.cn"
135
+      url: "https://pub.dartlang.org"
136
     source: hosted
136
     source: hosted
137
     version: "1.5.5"
137
     version: "1.5.5"
138
   stack_trace:
138
   stack_trace:
139
     dependency: transitive
139
     dependency: transitive
140
     description:
140
     description:
141
       name: stack_trace
141
       name: stack_trace
142
-      url: "https://pub.flutter-io.cn"
142
+      url: "https://pub.dartlang.org"
143
     source: hosted
143
     source: hosted
144
     version: "1.9.3"
144
     version: "1.9.3"
145
   stream_channel:
145
   stream_channel:
146
     dependency: transitive
146
     dependency: transitive
147
     description:
147
     description:
148
       name: stream_channel
148
       name: stream_channel
149
-      url: "https://pub.flutter-io.cn"
149
+      url: "https://pub.dartlang.org"
150
     source: hosted
150
     source: hosted
151
     version: "2.0.0"
151
     version: "2.0.0"
152
   string_scanner:
152
   string_scanner:
153
     dependency: transitive
153
     dependency: transitive
154
     description:
154
     description:
155
       name: string_scanner
155
       name: string_scanner
156
-      url: "https://pub.flutter-io.cn"
156
+      url: "https://pub.dartlang.org"
157
     source: hosted
157
     source: hosted
158
     version: "1.0.5"
158
     version: "1.0.5"
159
   term_glyph:
159
   term_glyph:
160
     dependency: transitive
160
     dependency: transitive
161
     description:
161
     description:
162
       name: term_glyph
162
       name: term_glyph
163
-      url: "https://pub.flutter-io.cn"
163
+      url: "https://pub.dartlang.org"
164
     source: hosted
164
     source: hosted
165
     version: "1.1.0"
165
     version: "1.1.0"
166
   test_api:
166
   test_api:
167
     dependency: transitive
167
     dependency: transitive
168
     description:
168
     description:
169
       name: test_api
169
       name: test_api
170
-      url: "https://pub.flutter-io.cn"
170
+      url: "https://pub.dartlang.org"
171
     source: hosted
171
     source: hosted
172
     version: "0.2.11"
172
     version: "0.2.11"
173
   typed_data:
173
   typed_data:
174
     dependency: transitive
174
     dependency: transitive
175
     description:
175
     description:
176
       name: typed_data
176
       name: typed_data
177
-      url: "https://pub.flutter-io.cn"
177
+      url: "https://pub.dartlang.org"
178
     source: hosted
178
     source: hosted
179
     version: "1.1.6"
179
     version: "1.1.6"
180
   vector_math:
180
   vector_math:
181
     dependency: transitive
181
     dependency: transitive
182
     description:
182
     description:
183
       name: vector_math
183
       name: vector_math
184
-      url: "https://pub.flutter-io.cn"
184
+      url: "https://pub.dartlang.org"
185
     source: hosted
185
     source: hosted
186
     version: "2.0.8"
186
     version: "2.0.8"
187
   xml:
187
   xml:
188
     dependency: transitive
188
     dependency: transitive
189
     description:
189
     description:
190
       name: xml
190
       name: xml
191
-      url: "https://pub.flutter-io.cn"
191
+      url: "https://pub.dartlang.org"
192
     source: hosted
192
     source: hosted
193
     version: "3.5.0"
193
     version: "3.5.0"
194
 sdks:
194
 sdks:

+ 2
- 2
pubspec.yaml View File

1
 name: photo
1
 name: photo
2
 description: image picker, multi picker support video/icloud asset, use flutter as ui, if you want to build custom ui, you just use photo_manager.
2
 description: image picker, multi picker support video/icloud asset, use flutter as ui, if you want to build custom ui, you just use photo_manager.
3
-version: 0.4.8
3
+version: 0.5.0-dev.1
4
 author: caijinglong<cjl_spy@163.com>
4
 author: caijinglong<cjl_spy@163.com>
5
 homepage: https://github.com/CaiJingLong/flutter_photo
5
 homepage: https://github.com/CaiJingLong/flutter_photo
6
 
6
 
11
   flutter:
11
   flutter:
12
     sdk: flutter
12
     sdk: flutter
13
 
13
 
14
-  photo_manager: ^0.4.8
14
+  photo_manager: ^0.5.1-dev.2
15
   # photo_manager:
15
   # photo_manager:
16
   #   git:
16
   #   git:
17
   #     url: https://github.com/CaiJingLong/flutter_photo_manager.git
17
   #     url: https://github.com/CaiJingLong/flutter_photo_manager.git