Commit 6244d479 authored by 林生雨's avatar 林生雨

commit

parent 47b85639
...@@ -5,7 +5,11 @@ ...@@ -5,7 +5,11 @@
<option name="TOOL_WINDOW_CONFIGURED_FILTER" value="Show only selected application" /> <option name="TOOL_WINDOW_CONFIGURED_FILTER" value="Show only selected application" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="$ENABLE_FLUTTER_DESKTOP$" id="5be6bbb5-7d6e-4540-a24f-d2b3bf78b3ba" name="Default Changelist" comment="" /> <list default="$ENABLE_FLUTTER_DESKTOP$" id="5be6bbb5-7d6e-4540-a24f-d2b3bf78b3ba" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/.dart_tool/" /> <ignored path="$PROJECT_DIR$/.dart_tool/" />
<ignored path="$PROJECT_DIR$/.idea/" /> <ignored path="$PROJECT_DIR$/.idea/" />
<ignored path="$PROJECT_DIR$/.pub/" /> <ignored path="$PROJECT_DIR$/.pub/" />
...@@ -263,7 +267,7 @@ ...@@ -263,7 +267,7 @@
<servers /> <servers />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="3" y="23" width="1440" height="812" extended-state="6" /> <frame x="0" y="26" width="1440" height="812" extended-state="6" />
<layout> <layout>
<window_info content_ui="combo" id="Project" order="0" visible="$ENABLE_FLUTTER_DESKTOP$" weight="0.19742489" /> <window_info content_ui="combo" id="Project" order="0" visible="$ENABLE_FLUTTER_DESKTOP$" weight="0.19742489" />
<window_info id="Captures" order="1" side_tool="$ENABLE_FLUTTER_DESKTOP$" /> <window_info id="Captures" order="1" side_tool="$ENABLE_FLUTTER_DESKTOP$" />
...@@ -280,7 +284,7 @@ ...@@ -280,7 +284,7 @@
<window_info anchor="bottom" id="Android Profiler" order="3" show_stripe_button="false" /> <window_info anchor="bottom" id="Android Profiler" order="3" show_stripe_button="false" />
<window_info anchor="bottom" id="Logcat" order="4" weight="0.20166898" /> <window_info anchor="bottom" id="Logcat" order="4" weight="0.20166898" />
<window_info anchor="bottom" id="Debug" order="5" weight="0.32962447" /> <window_info anchor="bottom" id="Debug" order="5" weight="0.32962447" />
<window_info active="$ENABLE_FLUTTER_DESKTOP$" anchor="bottom" id="Terminal" order="6" visible="$ENABLE_FLUTTER_DESKTOP$" weight="0.28194445" /> <window_info active="$ENABLE_FLUTTER_DESKTOP$" anchor="bottom" id="Terminal" order="6" visible="$ENABLE_FLUTTER_DESKTOP$" weight="0.32777777" />
<window_info anchor="bottom" id="Event Log" order="7" side_tool="$ENABLE_FLUTTER_DESKTOP$" /> <window_info anchor="bottom" id="Event Log" order="7" side_tool="$ENABLE_FLUTTER_DESKTOP$" />
<window_info anchor="bottom" id="Flutter Performance" order="8" side_tool="$ENABLE_FLUTTER_DESKTOP$" /> <window_info anchor="bottom" id="Flutter Performance" order="8" side_tool="$ENABLE_FLUTTER_DESKTOP$" />
<window_info anchor="bottom" id="Version Control" order="9" /> <window_info anchor="bottom" id="Version Control" order="9" />
......
...@@ -262,7 +262,7 @@ NSString *cacheDirectory; ...@@ -262,7 +262,7 @@ NSString *cacheDirectory;
imageRequestOption.version=PHImageRequestOptionsVersionUnadjusted; imageRequestOption.version=PHImageRequestOptionsVersionUnadjusted;
NSString *tempPathBefore = NSTemporaryDirectory(); NSString *tempPathBefore = NSTemporaryDirectory();
NSFileManager *manager = [NSFileManager defaultManager]; NSFileManager *manager = [NSFileManager defaultManager];
NSString *tempPath = [tempPathBefore stringByAppendingPathComponent:@"10101"]; NSString *tempPath = [tempPathBefore stringByAppendingPathComponent:@"REALPATH"];
[manager createDirectoryAtPath:tempPath withIntermediateDirectories:YES attributes:nil error:nil]; [manager createDirectoryAtPath:tempPath withIntermediateDirectories:YES attributes:nil error:nil];
NSFileManager *fileManager = [NSFileManager defaultManager]; NSFileManager *fileManager = [NSFileManager defaultManager];
for (int i=0; i<path.count; i++) { for (int i=0; i<path.count; i++) {
...@@ -492,12 +492,19 @@ NSString *cacheDirectory; ...@@ -492,12 +492,19 @@ NSString *cacheDirectory;
[self.finalMap[@"IsGengmeiAlbumAllImages"] insertObject:dict atIndex:0]; [self.finalMap[@"IsGengmeiAlbumAllImages"] insertObject:dict atIndex:0];
[self.takePhotoMap setObject:realPath forKey:path]; [self.takePhotoMap setObject:realPath forKey:path];
[[ResultManager sharedSingleton] resultSuccess:[NSNumber numberWithLong:resultTemp] :@YES]; [[ResultManager sharedSingleton] resultSuccess:[NSNumber numberWithLong:resultTemp] :@YES];
}else{ }else if([@"clear_data" isEqualToString:call.method]){
long resultTemp=self.resultKey;
NSString *tempPathBefore = NSTemporaryDirectory();
NSString *tempPath = [tempPathBefore stringByAppendingPathComponent:@"REALPATH"];
[self removeAllFilesAtPath:tempPath];
[[ResultManager sharedSingleton] resultSuccess:[NSNumber numberWithLong:resultTemp] :@YES];
}
else{
result(FlutterMethodNotImplemented); result(FlutterMethodNotImplemented);
} }
} }
+ (BOOL)removeAllFilesAtPath:(NSString *)path { - (BOOL)removeAllFilesAtPath:(NSString *)path {
NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtPath:path]; NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtPath:path];
BOOL result = YES; BOOL result = YES;
......
...@@ -61,6 +61,10 @@ class ScanImagePlugn { ...@@ -61,6 +61,10 @@ class ScanImagePlugn {
return await channel.invokeMethod("quit_page"); return await channel.invokeMethod("quit_page");
} }
static Future<bool> clearCache(MethodChannel channel) async {
return await channel.invokeMethod("clear_data");
}
static Future<List> ios_album_path( static Future<List> ios_album_path(
MethodChannel channel, List<String> path) async { MethodChannel channel, List<String> path) async {
return await channel.invokeMethod("IOS_IMAGE_BY_PATH", path); return await channel.invokeMethod("IOS_IMAGE_BY_PATH", path);
......
...@@ -35,6 +35,10 @@ class GengmeiFlutterPlugin { ...@@ -35,6 +35,10 @@ class GengmeiFlutterPlugin {
return await ScanImagePlugn.previewImage(_channel, path); return await ScanImagePlugn.previewImage(_channel, path);
} }
static Future<bool> clearCache() async {
return await ScanImagePlugn.clearCache(_channel);
}
static Future<bool> playAlbumVideo(String path) async { static Future<bool> playAlbumVideo(String path) async {
return await ScanImagePlugn.playAlbumVideo(_channel, path); return await ScanImagePlugn.playAlbumVideo(_channel, path);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment