Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
flutter_plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林生雨
flutter_plugin
Commits
f4c17948
Commit
f4c17948
authored
Dec 30, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
co
parent
9363f117
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
34 deletions
+56
-34
workspace.xml
.idea/workspace.xml
+30
-27
GengmeiFlutterPlugin.kt
...om/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt
+8
-1
ImageRespository.kt
...flutter_plugin/ImagePlugin/repository/ImageRespository.kt
+3
-3
GengmeiFlutterPlugin.m
ios/Classes/GengmeiFlutterPlugin.m
+7
-3
ScanImagePlugn.dart
lib/ScanImagePlugn.dart
+4
-0
gengmei_flutter_plugin.dart
lib/gengmei_flutter_plugin.dart
+4
-0
No files found.
.idea/workspace.xml
View file @
f4c17948
...
@@ -7,7 +7,11 @@
...
@@ -7,7 +7,11 @@
<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$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/android/src/main/kotlin/com/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/android/src/main/kotlin/com/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/android/src/main/kotlin/com/example/gengmei_flutter_plugin/ImagePlugin/repository/ImageRespository.kt"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/android/src/main/kotlin/com/example/gengmei_flutter_plugin/ImagePlugin/repository/ImageRespository.kt"
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$/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$/lib/ScanImagePlugn.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/lib/ScanImagePlugn.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
afterDir=
"false"
/>
</list>
</list>
<ignored
path=
"$PROJECT_DIR$/.dart_tool/"
/>
<ignored
path=
"$PROJECT_DIR$/.dart_tool/"
/>
<ignored
path=
"$PROJECT_DIR$/.idea/"
/>
<ignored
path=
"$PROJECT_DIR$/.idea/"
/>
...
@@ -30,8 +34,8 @@
...
@@ -30,8 +34,8 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<provider
selected=
"$ENABLE_FLUTTER_DESKTOP$"
editor-type-id=
"text-editor"
>
<provider
selected=
"$ENABLE_FLUTTER_DESKTOP$"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
305
"
>
<state
relative-caret-position=
"
417
"
>
<caret
line=
"6
3"
column=
"32"
selection-start-line=
"63"
selection-start-column=
"22"
selection-end-line=
"63"
selection-end-column=
"32
"
/>
<caret
line=
"6
7"
column=
"36"
selection-start-line=
"67"
selection-start-column=
"22"
selection-end-line=
"67"
selection-end-column=
"36
"
/>
<folding>
<folding>
<element
signature=
"e#45#86#0"
expanded=
"$ENABLE_FLUTTER_DESKTOP$"
/>
<element
signature=
"e#45#86#0"
expanded=
"$ENABLE_FLUTTER_DESKTOP$"
/>
</folding>
</folding>
...
@@ -101,8 +105,8 @@
...
@@ -101,8 +105,8 @@
<file
pinned=
"false"
current-in-tab=
"$ENABLE_FLUTTER_DESKTOP$"
>
<file
pinned=
"false"
current-in-tab=
"$ENABLE_FLUTTER_DESKTOP$"
>
<entry
file=
"file://$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
>
<entry
file=
"file://$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
>
<provider
selected=
"$ENABLE_FLUTTER_DESKTOP$"
editor-type-id=
"text-editor"
>
<provider
selected=
"$ENABLE_FLUTTER_DESKTOP$"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
-1084
"
>
<state
relative-caret-position=
"
462
"
>
<caret
line=
"
36"
selection-start-line=
"36"
selection-end-line=
"36
"
/>
<caret
line=
"
56"
column=
"63"
selection-start-line=
"56"
selection-start-column=
"63"
selection-end-line=
"56"
selection-end-column=
"63
"
/>
<folding>
<folding>
<element
signature=
"e#0#20#0"
expanded=
"$ENABLE_FLUTTER_DESKTOP$"
/>
<element
signature=
"e#0#20#0"
expanded=
"$ENABLE_FLUTTER_DESKTOP$"
/>
</folding>
</folding>
...
@@ -194,11 +198,11 @@
...
@@ -194,11 +198,11 @@
</list>
</list>
</option>
</option>
</component>
</component>
<component
name=
"ProjectFrameBounds"
extendedState=
"6"
>
<component
name=
"ProjectFrameBounds"
>
<option
name=
"x"
value=
"26
6
"
/>
<option
name=
"x"
value=
"26"
/>
<option
name=
"y"
value=
"
93
"
/>
<option
name=
"y"
value=
"
184
"
/>
<option
name=
"width"
value=
"1440"
/>
<option
name=
"width"
value=
"1440"
/>
<option
name=
"height"
value=
"8
1
1"
/>
<option
name=
"height"
value=
"8
2
1"
/>
</component>
</component>
<component
name=
"ProjectLevelVcsManager"
settingsEditedManually=
"$ENABLE_FLUTTER_DESKTOP$"
/>
<component
name=
"ProjectLevelVcsManager"
settingsEditedManually=
"$ENABLE_FLUTTER_DESKTOP$"
/>
<component
name=
"ProjectView"
>
<component
name=
"ProjectView"
>
...
@@ -206,6 +210,9 @@
...
@@ -206,6 +210,9 @@
<foldersAlwaysOnTop
value=
"$ENABLE_FLUTTER_DESKTOP$"
/>
<foldersAlwaysOnTop
value=
"$ENABLE_FLUTTER_DESKTOP$"
/>
</navigator>
</navigator>
<panes>
<panes>
<pane
id=
"AndroidView"
/>
<pane
id=
"Scope"
/>
<pane
id=
"PackagesPane"
/>
<pane
id=
"ProjectPane"
>
<pane
id=
"ProjectPane"
>
<subPane>
<subPane>
<expand>
<expand>
...
@@ -222,9 +229,6 @@
...
@@ -222,9 +229,6 @@
<select
/>
<select
/>
</subPane>
</subPane>
</pane>
</pane>
<pane
id=
"AndroidView"
/>
<pane
id=
"Scope"
/>
<pane
id=
"PackagesPane"
/>
</panes>
</panes>
</component>
</component>
<component
name=
"PropertiesComponent"
>
<component
name=
"PropertiesComponent"
>
...
@@ -271,10 +275,9 @@
...
@@ -271,10 +275,9 @@
<servers
/>
<servers
/>
</component>
</component>
<component
name=
"ToolWindowManager"
>
<component
name=
"ToolWindowManager"
>
<frame
x=
"0"
y=
"26"
width=
"1440"
height=
"812"
extended-state=
"6"
/>
<frame
x=
"67"
y=
"23"
width=
"1440"
height=
"821"
extended-state=
"0"
/>
<editor
active=
"$ENABLE_FLUTTER_DESKTOP$"
/>
<layout>
<layout>
<window_info
active=
"$ENABLE_FLUTTER_DESKTOP$"
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$"
/>
<window_info
id=
"Structure"
order=
"2"
side_tool=
"$ENABLE_FLUTTER_DESKTOP$"
/>
<window_info
id=
"Structure"
order=
"2"
side_tool=
"$ENABLE_FLUTTER_DESKTOP$"
/>
<window_info
id=
"Image Layers"
order=
"3"
/>
<window_info
id=
"Image Layers"
order=
"3"
/>
...
@@ -287,9 +290,9 @@
...
@@ -287,9 +290,9 @@
<window_info
anchor=
"bottom"
id=
"Run"
order=
"1"
weight=
"0.4993046"
/>
<window_info
anchor=
"bottom"
id=
"Run"
order=
"1"
weight=
"0.4993046"
/>
<window_info
anchor=
"bottom"
id=
"TODO"
order=
"2"
/>
<window_info
anchor=
"bottom"
id=
"TODO"
order=
"2"
/>
<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.2016
6898
"
/>
<window_info
anchor=
"bottom"
id=
"Logcat"
order=
"4"
weight=
"0.2016
4609
"
/>
<window_info
anchor=
"bottom"
id=
"Debug"
order=
"5"
weight=
"0.32962447"
/>
<window_info
anchor=
"bottom"
id=
"Debug"
order=
"5"
weight=
"0.32962447"
/>
<window_info
a
nchor=
"bottom"
id=
"Terminal"
order=
"6"
visible=
"$ENABLE_FLUTTER_DESKTOP$"
weight=
"0.32777777
"
/>
<window_info
a
ctive=
"$ENABLE_FLUTTER_DESKTOP$"
anchor=
"bottom"
id=
"Terminal"
order=
"6"
visible=
"$ENABLE_FLUTTER_DESKTOP$"
weight=
"0.32647464
"
/>
<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"
/>
...
@@ -541,6 +544,13 @@
...
@@ -541,6 +544,13 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/SharedPlugin.dart"
>
<provider
selected=
"$ENABLE_FLUTTER_DESKTOP$"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"308"
>
<caret
line=
"17"
selection-start-line=
"17"
selection-end-line=
"17"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/android/build.gradle"
>
<entry
file=
"file://$PROJECT_DIR$/android/build.gradle"
>
<provider
selected=
"$ENABLE_FLUTTER_DESKTOP$"
editor-type-id=
"text-editor"
>
<provider
selected=
"$ENABLE_FLUTTER_DESKTOP$"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"110"
>
<state
relative-caret-position=
"110"
>
...
@@ -589,17 +599,10 @@
...
@@ -589,17 +599,10 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/SharedPlugin.dart"
>
<provider
selected=
"$ENABLE_FLUTTER_DESKTOP$"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"308"
>
<caret
line=
"17"
selection-start-line=
"17"
selection-end-line=
"17"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<provider
selected=
"$ENABLE_FLUTTER_DESKTOP$"
editor-type-id=
"text-editor"
>
<provider
selected=
"$ENABLE_FLUTTER_DESKTOP$"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
305
"
>
<state
relative-caret-position=
"
417
"
>
<caret
line=
"6
3"
column=
"32"
selection-start-line=
"63"
selection-start-column=
"22"
selection-end-line=
"63"
selection-end-column=
"32
"
/>
<caret
line=
"6
7"
column=
"36"
selection-start-line=
"67"
selection-start-column=
"22"
selection-end-line=
"67"
selection-end-column=
"36
"
/>
<folding>
<folding>
<element
signature=
"e#45#86#0"
expanded=
"$ENABLE_FLUTTER_DESKTOP$"
/>
<element
signature=
"e#45#86#0"
expanded=
"$ENABLE_FLUTTER_DESKTOP$"
/>
</folding>
</folding>
...
@@ -608,8 +611,8 @@
...
@@ -608,8 +611,8 @@
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
>
<entry
file=
"file://$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
>
<provider
selected=
"$ENABLE_FLUTTER_DESKTOP$"
editor-type-id=
"text-editor"
>
<provider
selected=
"$ENABLE_FLUTTER_DESKTOP$"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
-1084
"
>
<state
relative-caret-position=
"
462
"
>
<caret
line=
"
36"
selection-start-line=
"36"
selection-end-line=
"36
"
/>
<caret
line=
"
56"
column=
"63"
selection-start-line=
"56"
selection-start-column=
"63"
selection-end-line=
"56"
selection-end-column=
"63
"
/>
<folding>
<folding>
<element
signature=
"e#0#20#0"
expanded=
"$ENABLE_FLUTTER_DESKTOP$"
/>
<element
signature=
"e#0#20#0"
expanded=
"$ENABLE_FLUTTER_DESKTOP$"
/>
</folding>
</folding>
...
...
android/src/main/kotlin/com/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt
View file @
f4c17948
...
@@ -41,6 +41,7 @@ class GengmeiFlutterPlugin : MethodCallHandler {
...
@@ -41,6 +41,7 @@ class GengmeiFlutterPlugin : MethodCallHandler {
var
resultKey
=
0L
var
resultKey
=
0L
var
isAdded
=
false
;
var
isAdded
=
false
;
private
var
record
:
HashMap
<
String
,
ArrayList
<
HashMap
<
String
,
Any
>>>?
=
null
;
private
var
record
:
HashMap
<
String
,
ArrayList
<
HashMap
<
String
,
Any
>>>?
=
null
;
var
albumNeedCache
=
false
;
var
isTaskingExectured
:
Boolean
=
false
;
var
isTaskingExectured
:
Boolean
=
false
;
@Volatile
@Volatile
...
@@ -70,6 +71,7 @@ class GengmeiFlutterPlugin : MethodCallHandler {
...
@@ -70,6 +71,7 @@ class GengmeiFlutterPlugin : MethodCallHandler {
const
val
GET_STRINGLIST_SHARED
=
"GET_STRINGLIST_SHARED"
const
val
GET_STRINGLIST_SHARED
=
"GET_STRINGLIST_SHARED"
const
val
ALBUM_PLAY_VIDEO
=
"play_album_video"
const
val
ALBUM_PLAY_VIDEO
=
"play_album_video"
const
val
PREVIEW_IMAGE
=
"PREVIEW_IMAGE"
const
val
PREVIEW_IMAGE
=
"PREVIEW_IMAGE"
const
val
ALBUM_NEED_CACHE
=
"ALBUM_NEED_CACHE"
const
val
CLEAR_SHARE
=
"CLEAR_SHARE"
const
val
CLEAR_SHARE
=
"CLEAR_SHARE"
const
val
PREMISSION
=
10090
const
val
PREMISSION
=
10090
...
@@ -345,6 +347,11 @@ class GengmeiFlutterPlugin : MethodCallHandler {
...
@@ -345,6 +347,11 @@ class GengmeiFlutterPlugin : MethodCallHandler {
resign
.
startActivity
(
intent
)
resign
.
startActivity
(
intent
)
}
}
}
}
ALBUM_NEED_CACHE
->
{
val
result
=
resultKey
;
albumNeedCache
=
call
.
arguments
as
Boolean
ResultManager
.
getInstance
().
resultSuccess
(
result
,
true
)
}
PREVIEW_IMAGE
->
{
PREVIEW_IMAGE
->
{
val
result
=
resultKey
;
val
result
=
resultKey
;
val
path
=
call
.
arguments
as
String
?
val
path
=
call
.
arguments
as
String
?
...
@@ -370,7 +377,7 @@ class GengmeiFlutterPlugin : MethodCallHandler {
...
@@ -370,7 +377,7 @@ class GengmeiFlutterPlugin : MethodCallHandler {
fun
ScanImage
(
resultKey
:
Long
)
{
fun
ScanImage
(
resultKey
:
Long
)
{
quit_page
=
false
;
quit_page
=
false
;
ImageRespository
.
getInstance
().
scanPhoneImage
(
resign
).
subscribe
(
ImageRespository
.
getInstance
().
scanPhoneImage
(
resign
,
albumNeedCache
).
subscribe
(
{
{
record
=
it
record
=
it
if
(!
quit_page
)
{
if
(!
quit_page
)
{
...
...
android/src/main/kotlin/com/example/gengmei_flutter_plugin/ImagePlugin/repository/ImageRespository.kt
View file @
f4c17948
...
@@ -50,12 +50,12 @@ class ImageRespository {
...
@@ -50,12 +50,12 @@ class ImageRespository {
//: HashMap<String, ArrayList<HashMap<String, Any>>>
//: HashMap<String, ArrayList<HashMap<String, Any>>>
fun
scanPhoneImage
(
context
:
Context
):
Observable
<
HashMap
<
String
,
ArrayList
<
HashMap
<
String
,
Any
>>>>
{
fun
scanPhoneImage
(
context
:
Context
,
needCache
:
Boolean
):
Observable
<
HashMap
<
String
,
ArrayList
<
HashMap
<
String
,
Any
>>>>
{
val
file
=
File
(
fileDir
);
val
file
=
File
(
fileDir
);
if
(!
file
.
exists
())
{
if
(!
file
.
exists
())
{
file
.
mkdirs
();
file
.
mkdirs
();
}
}
if
(!
recordImageListMap
.
isEmpty
()
&&
finishOneTask
)
{
if
(!
recordImageListMap
.
isEmpty
()
&&
finishOneTask
&&
needCache
)
{
return
Observable
.
just
(
return
Observable
.
just
(
toMap
(
context
,
recordImageListMap
))
toMap
(
context
,
recordImageListMap
))
.
subscribeOn
(
Schedulers
.
computation
()).
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribeOn
(
Schedulers
.
computation
()).
observeOn
(
AndroidSchedulers
.
mainThread
())
...
@@ -145,7 +145,7 @@ class ImageRespository {
...
@@ -145,7 +145,7 @@ class ImageRespository {
}
}
}
}
}
else
{
}
else
{
Log
.
e
(
"lsy"
,
" !!!! ${realPath} ${getFileName(realPath)==
null}"
)
Log
.
e
(
"lsy"
,
" !!!! ${realPath} ${getFileName(realPath) ==
null}"
)
val
tempFilePngString
=
fileDir
+
"/"
+
getFileName
(
realPath
)
!!
+
".png"
;
val
tempFilePngString
=
fileDir
+
"/"
+
getFileName
(
realPath
)
!!
+
".png"
;
val
tempFilePngExists
=
File
(
tempFilePngString
).
exists
()
val
tempFilePngExists
=
File
(
tempFilePngString
).
exists
()
if
(
tempFilePngExists
)
{
if
(
tempFilePngExists
)
{
...
...
ios/Classes/GengmeiFlutterPlugin.m
View file @
f4c17948
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
@property
(
atomic
,
strong
)
NSMutableArray
<
NSMutableDictionary
*>*
channelList
;
@property
(
atomic
,
strong
)
NSMutableArray
<
NSMutableDictionary
*>*
channelList
;
@property
(
atomic
)
int
channelSize
;
@property
(
atomic
)
int
channelSize
;
@property
(
atomic
)
int
channelAllSize
;
@property
(
atomic
)
int
channelAllSize
;
@property
(
nonatomic
)
bool
needAlbumCache
;
@end
@end
@implementation
GengmeiFlutterPlugin
@implementation
GengmeiFlutterPlugin
...
@@ -495,8 +496,11 @@ NSString *cacheDirectory;
...
@@ -495,8 +496,11 @@ NSString *cacheDirectory;
NSString
*
tempPath
=
[
tempPathBefore
stringByAppendingPathComponent
:
@"REALPATH"
];
NSString
*
tempPath
=
[
tempPathBefore
stringByAppendingPathComponent
:
@"REALPATH"
];
[
self
removeAllFilesAtPath
:
tempPath
];
[
self
removeAllFilesAtPath
:
tempPath
];
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultTemp
]
:
@YES
];
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultTemp
]
:
@YES
];
}
}
else
if
([
@"ALBUM_NEED_CACHE"
isEqualToString
:
call
.
method
]){
else
{
long
resultTemp
=
self
.
resultKey
;
self
.
needAlbumCache
=
call
.
arguments
;
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultTemp
]
:
@YES
];
}
else
{
result
(
FlutterMethodNotImplemented
);
result
(
FlutterMethodNotImplemented
);
}
}
}
}
...
@@ -631,7 +635,7 @@ NSString *cacheDirectory;
...
@@ -631,7 +635,7 @@ NSString *cacheDirectory;
CFAbsoluteTime
startTime
;
CFAbsoluteTime
startTime
;
-
(
void
)
scanPhone
:(
long
)
resultId
{
-
(
void
)
scanPhone
:(
long
)
resultId
{
self
.
quitPage
=
false
;
self
.
quitPage
=
false
;
if
(
self
.
finishScanImg
)
{
if
(
self
.
finishScanImg
&&
self
.
needAlbumCache
!=
nil
&&
self
.
needAlbumCache
)
{
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultId
]
:
self
.
finalMap
];
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultId
]
:
self
.
finalMap
];
return
;
return
;
}
}
...
...
lib/ScanImagePlugn.dart
View file @
f4c17948
...
@@ -65,6 +65,10 @@ class ScanImagePlugn {
...
@@ -65,6 +65,10 @@ class ScanImagePlugn {
return
await
channel
.
invokeMethod
(
"clear_data"
);
return
await
channel
.
invokeMethod
(
"clear_data"
);
}
}
static
Future
<
bool
>
albumNeedCache
(
MethodChannel
channel
,
bool
need
)
async
{
return
await
channel
.
invokeMethod
(
"ALBUM_NEED_CACHE"
,
need
);
}
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
);
...
...
lib/gengmei_flutter_plugin.dart
View file @
f4c17948
...
@@ -53,6 +53,10 @@ class GengmeiFlutterPlugin {
...
@@ -53,6 +53,10 @@ class GengmeiFlutterPlugin {
return
await
ScanImagePlugn
.
quitPage
(
_channel
);
return
await
ScanImagePlugn
.
quitPage
(
_channel
);
}
}
static
Future
<
bool
>
albumNeedCache
(
bool
need
)
async
{
return
await
ScanImagePlugn
.
albumNeedCache
(
_channel
,
need
);
}
static
Future
<
int
>
getInt
(
String
key
,
int
value
)
async
{
static
Future
<
int
>
getInt
(
String
key
,
int
value
)
async
{
return
await
SharedPlugin
.
getInt
(
key
,
value
,
_channel
);
return
await
SharedPlugin
.
getInt
(
key
,
value
,
_channel
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment