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
0c3a83b7
Commit
0c3a83b7
authored
Oct 31, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
00b2ed0f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
232 additions
and
234 deletions
+232
-234
workspace.xml
.idea/workspace.xml
+83
-82
AlbumModel.dart
example/lib/AlbumModel/page/album/AlbumModel.dart
+48
-36
GengmeiFlutterPlugin.m
ios/Classes/GengmeiFlutterPlugin.m
+81
-101
ScanImagePlugn.dart
lib/ScanImagePlugn.dart
+20
-15
No files found.
.idea/workspace.xml
View file @
0c3a83b7
...
@@ -8,6 +8,11 @@
...
@@ -8,6 +8,11 @@
<list
default=
"true"
id=
"5be6bbb5-7d6e-4540-a24f-d2b3bf78b3ba"
name=
"Default Changelist"
comment=
""
>
<list
default=
"true"
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$/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$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/lib/AlbumModel/page/album/AlbumModel.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/lib/AlbumModel/page/album/AlbumModel.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/ios/Classes/GengmeiFlutterPlugin.m"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/ios/Classes/GengmeiFlutterPlugin.m"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/lib/ScanImagePlugn.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/lib/ScanImagePlugn.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/"
/>
...
@@ -27,11 +32,11 @@
...
@@ -27,11 +32,11 @@
<component
name=
"ExecutionTargetManager"
SELECTED_TARGET=
"AKC0218316000622"
/>
<component
name=
"ExecutionTargetManager"
SELECTED_TARGET=
"AKC0218316000622"
/>
<component
name=
"FileEditorManager"
>
<component
name=
"FileEditorManager"
>
<leaf
SIDE_TABS_SIZE_LIMIT_KEY=
"300"
>
<leaf
SIDE_TABS_SIZE_LIMIT_KEY=
"300"
>
<file
pinned=
"false"
current-in-tab=
"
tru
e"
>
<file
pinned=
"false"
current-in-tab=
"
fals
e"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
-1495
"
>
<state
relative-caret-position=
"
263
"
>
<caret
line=
"
231"
column=
"11"
selection-start-line=
"231"
selection-start-column=
"11"
selection-end-line=
"231"
selection-end-column=
"11
"
/>
<caret
line=
"
101"
column=
"16"
lean-forward=
"true"
selection-start-line=
"101"
selection-start-column=
"16"
selection-end-line=
"101"
selection-end-column=
"16
"
/>
<folding>
<folding>
<element
signature=
"e#46#66#0"
expanded=
"true"
/>
<element
signature=
"e#46#66#0"
expanded=
"true"
/>
</folding>
</folding>
...
@@ -40,34 +45,34 @@
...
@@ -40,34 +45,34 @@
</entry>
</entry>
</file>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/
main
.dart"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/
AlbumModel/page/album/AlbumPage
.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
3036
"
>
<state
relative-caret-position=
"
190
"
>
<caret
line=
"1
44"
column=
"53"
selection-start-line=
"144"
selection-start-column=
"53"
selection-end-line=
"144"
selection-end-column=
"53
"
/>
<caret
line=
"1
5"
column=
"2"
selection-start-line=
"15"
selection-start-column=
"2"
selection-end-line=
"15"
selection-end-column=
"2
"
/>
<folding>
<folding>
<element
signature=
"e#
0#17
#0"
expanded=
"true"
/>
<element
signature=
"e#
45#62
#0"
expanded=
"true"
/>
</folding>
</folding>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
</file>
</file>
<file
pinned=
"false"
current-in-tab=
"
fals
e"
>
<file
pinned=
"false"
current-in-tab=
"
tru
e"
>
<entry
file=
"file://$PROJECT_DIR$/
example/lib/AlbumModel/page/album/AlbumPage
.dart"
>
<entry
file=
"file://$PROJECT_DIR$/
lib/ScanImagePlugn
.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
132
"
>
<state
relative-caret-position=
"
217
"
>
<caret
line=
"
15"
column=
"2"
selection-start-line=
"15"
selection-start-column=
"2"
selection-end-line=
"15"
selection-end-column=
"2
"
/>
<caret
line=
"
29"
selection-start-line=
"29"
selection-end-line=
"29
"
/>
<folding>
<folding>
<element
signature=
"e#45#
62
#0"
expanded=
"true"
/>
<element
signature=
"e#45#
86
#0"
expanded=
"true"
/>
</folding>
</folding>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
</file>
</file>
<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://$
USER_HOME$/Downloads/flutter/packages/flutter/lib/src/services/platform_channel
.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
836
"
>
<state
relative-caret-position=
"
121
"
>
<caret
line=
"
41"
column=
"1"
selection-start-line=
"41"
selection-start-column=
"1"
selection-end-line=
"41"
selection-end-column=
"1
"
/>
<caret
line=
"
342"
column=
"20"
selection-start-line=
"342"
selection-start-column=
"20"
selection-end-line=
"342"
selection-end-column=
"20
"
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
...
@@ -87,8 +92,8 @@
...
@@ -87,8 +92,8 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/repository/AlbumRepository.dart"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/repository/AlbumRepository.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
770
"
>
<state
relative-caret-position=
"
207
"
>
<caret
line=
"
40"
column=
"23"
selection-start-line=
"40"
selection-start-column=
"23"
selection-end-line=
"40"
selection-end-column=
"2
3"
/>
<caret
line=
"
23"
column=
"43"
selection-start-line=
"23"
selection-start-column=
"30"
selection-end-line=
"23"
selection-end-column=
"4
3"
/>
<folding>
<folding>
<element
signature=
"e#46#106#0"
expanded=
"true"
/>
<element
signature=
"e#46#106#0"
expanded=
"true"
/>
</folding>
</folding>
...
@@ -108,8 +113,8 @@
...
@@ -108,8 +113,8 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"11
35
2"
>
<state
relative-caret-position=
"11
57
2"
>
<caret
line=
"5
36"
column=
"22"
selection-start-line=
"536"
selection-start-column=
"22"
selection-end-line=
"536
"
selection-end-column=
"22"
/>
<caret
line=
"5
48"
column=
"22"
selection-start-line=
"548"
selection-start-column=
"22"
selection-end-line=
"548
"
selection-end-column=
"22"
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
...
@@ -154,6 +159,9 @@
...
@@ -154,6 +159,9 @@
<find>
onE
</find>
<find>
onE
</find>
<find>
DATTTTTT
</find>
<find>
DATTTTTT
</find>
<find>
realPath
</find>
<find>
realPath
</find>
<find>
_dirList
</find>
<find>
_onEvent
</find>
<find>
paseAlbum
</find>
</findStrings>
</findStrings>
</component>
</component>
<component
name=
"Git.Settings"
>
<component
name=
"Git.Settings"
>
...
@@ -180,16 +188,15 @@
...
@@ -180,16 +188,15 @@
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/repository/AlbumRepository.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/repository/AlbumRepository.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
/>
<option
value=
"$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
/>
<option
value=
"$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
/>
<option
value=
"$PROJECT_DIR$/lib/ScanImagePlugn.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
/>
<option
value=
"$PROJECT_DIR$/lib/ScanImagePlugn.dart"
/>
</list>
</list>
</option>
</option>
</component>
</component>
<component
name=
"ProjectFrameBounds"
extendedState=
"6"
>
<component
name=
"ProjectFrameBounds"
extendedState=
"6"
>
<option
name=
"x"
value=
"500"
/>
<option
name=
"y"
value=
"35"
/>
<option
name=
"y"
value=
"-1080"
/>
<option
name=
"width"
value=
"1440"
/>
<option
name=
"width"
value=
"1920"
/>
<option
name=
"height"
value=
"811"
/>
<option
name=
"height"
value=
"1080"
/>
</component>
</component>
<component
name=
"ProjectLevelVcsManager"
settingsEditedManually=
"true"
/>
<component
name=
"ProjectLevelVcsManager"
settingsEditedManually=
"true"
/>
<component
name=
"ProjectView"
>
<component
name=
"ProjectView"
>
...
@@ -296,9 +303,10 @@
...
@@ -296,9 +303,10 @@
<servers
/>
<servers
/>
</component>
</component>
<component
name=
"ToolWindowManager"
>
<component
name=
"ToolWindowManager"
>
<frame
x=
"-41"
y=
"-1080"
width=
"1920"
height=
"1080"
extended-state=
"6"
/>
<frame
x=
"9"
y=
"23"
width=
"1440"
height=
"811"
extended-state=
"6"
/>
<editor
active=
"true"
/>
<layout>
<layout>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.14696486
"
/>
<window_info
active=
"true"
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.19742489
"
/>
<window_info
id=
"Captures"
order=
"1"
side_tool=
"true"
/>
<window_info
id=
"Captures"
order=
"1"
side_tool=
"true"
/>
<window_info
id=
"Structure"
order=
"2"
side_tool=
"true"
/>
<window_info
id=
"Structure"
order=
"2"
side_tool=
"true"
/>
<window_info
id=
"Image Layers"
order=
"3"
/>
<window_info
id=
"Image Layers"
order=
"3"
/>
...
@@ -308,12 +316,12 @@
...
@@ -308,12 +316,12 @@
<window_info
id=
"Capture Tool"
order=
"7"
/>
<window_info
id=
"Capture Tool"
order=
"7"
/>
<window_info
id=
"Favorites"
order=
"8"
side_tool=
"true"
/>
<window_info
id=
"Favorites"
order=
"8"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Dart Analysis"
order=
"0"
weight=
"0.32963988"
/>
<window_info
anchor=
"bottom"
id=
"Dart Analysis"
order=
"0"
weight=
"0.32963988"
/>
<window_info
anchor=
"bottom"
id=
"Run"
order=
"1"
weight=
"0.375
"
/>
<window_info
anchor=
"bottom"
id=
"Run"
order=
"1"
visible=
"true"
weight=
"0.37413073
"
/>
<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.
5479833
"
/>
<window_info
anchor=
"bottom"
id=
"Logcat"
order=
"4"
weight=
"0.
4534075
"
/>
<window_info
anchor=
"bottom"
id=
"Debug"
order=
"5"
/>
<window_info
anchor=
"bottom"
id=
"Debug"
order=
"5"
/>
<window_info
a
ctive=
"true"
anchor=
"bottom"
id=
"Terminal"
order=
"6"
visible=
"true"
weight=
"0.27327934
"
/>
<window_info
a
nchor=
"bottom"
id=
"Terminal"
order=
"6"
weight=
"0.44534412
"
/>
<window_info
anchor=
"bottom"
id=
"Event Log"
order=
"7"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Event Log"
order=
"7"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Flutter Performance"
order=
"8"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Flutter Performance"
order=
"8"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Version Control"
order=
"9"
/>
<window_info
anchor=
"bottom"
id=
"Version Control"
order=
"9"
/>
...
@@ -328,17 +336,6 @@
...
@@ -328,17 +336,6 @@
<window_info
anchor=
"right"
id=
"Preview"
order=
"7"
/>
<window_info
anchor=
"right"
id=
"Preview"
order=
"7"
/>
</layout>
</layout>
</component>
</component>
<component
name=
"XDebuggerManager"
>
<breakpoint-manager>
<breakpoints>
<line-breakpoint
enabled=
"true"
type=
"Dart"
>
<url>
file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart
</url>
<line>
74
</line>
<option
name=
"timeStamp"
value=
"1"
/>
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
<component
name=
"editorHistoryManager"
>
<component
name=
"editorHistoryManager"
>
<entry
file=
"file://$PROJECT_DIR$/test/gengmei_flutter_plugin_test.dart"
/>
<entry
file=
"file://$PROJECT_DIR$/test/gengmei_flutter_plugin_test.dart"
/>
<entry
file=
"file://$USER_HOME$/Downloads/flutter/packages/flutter/lib/src/services/message_codecs.dart"
>
<entry
file=
"file://$USER_HOME$/Downloads/flutter/packages/flutter/lib/src/services/message_codecs.dart"
>
...
@@ -493,13 +490,6 @@
...
@@ -493,13 +490,6 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$USER_HOME$/Downloads/flutter/packages/flutter/lib/src/services/platform_channel.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"6534"
>
<caret
line=
"306"
column=
"12"
selection-start-line=
"306"
selection-start-column=
"12"
selection-end-line=
"306"
selection-end-column=
"12"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/Image/AlbumItem.h"
>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/Image/AlbumItem.h"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
</entry>
...
@@ -527,16 +517,6 @@
...
@@ -527,16 +517,6 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-1495"
>
<caret
line=
"231"
column=
"11"
selection-start-line=
"231"
selection-start-column=
"11"
selection-end-line=
"231"
selection-end-column=
"11"
/>
<folding>
<element
signature=
"e#46#66#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/lib/main.dart"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/main.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"3036"
>
<state
relative-caret-position=
"3036"
>
...
@@ -547,62 +527,82 @@
...
@@ -547,62 +527,82 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/
example/lib/AlbumModel/page/album/AlbumPage
.dart"
>
<entry
file=
"file://$PROJECT_DIR$/
lib/gengmei_flutter_plugin
.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
132
"
>
<state
relative-caret-position=
"
440
"
>
<caret
line=
"
15"
column=
"2"
selection-start-line=
"15"
selection-start-column=
"2"
selection-end-line=
"15"
selection-end-column=
"2
"
/>
<caret
line=
"
26"
column=
"41"
selection-start-line=
"26"
selection-start-column=
"41"
selection-end-line=
"26"
selection-end-column=
"41
"
/>
<folding>
<folding>
<element
signature=
"e#
45#62
#0"
expanded=
"true"
/>
<element
signature=
"e#
0#20
#0"
expanded=
"true"
/>
</folding>
</folding>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/S
canImagePlug
n.dart"
>
<entry
file=
"file://$PROJECT_DIR$/lib/S
haredPlugi
n.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
836
"
>
<state
relative-caret-position=
"
330
"
>
<caret
line=
"
41"
column=
"1"
selection-start-line=
"41"
selection-start-column=
"1"
selection-end-line=
"41"
selection-end-column=
"1
"
/>
<caret
line=
"
18"
column=
"39"
selection-start-line=
"18"
selection-start-column=
"28"
selection-end-line=
"18"
selection-end-column=
"39
"
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/
lib/gengmei_flutter_plugin.dart
"
>
<entry
file=
"file://$PROJECT_DIR$/
ios/Classes/GengmeiFlutterPlugin.m
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"440"
>
<state
relative-caret-position=
"11572"
>
<caret
line=
"26"
column=
"41"
selection-start-line=
"26"
selection-start-column=
"41"
selection-end-line=
"26"
selection-end-column=
"41"
/>
<caret
line=
"548"
column=
"22"
selection-start-line=
"548"
selection-start-column=
"22"
selection-end-line=
"548"
selection-end-column=
"22"
/>
<folding>
<element
signature=
"e#0#20#0"
expanded=
"true"
/>
</folding>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/Image/ResultManager.h"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/Image/ResultManager.m"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/repository/AlbumRepository.dart"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/repository/AlbumRepository.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
770
"
>
<state
relative-caret-position=
"
207
"
>
<caret
line=
"
40"
column=
"23"
selection-start-line=
"40"
selection-start-column=
"23"
selection-end-line=
"40"
selection-end-column=
"2
3"
/>
<caret
line=
"
23"
column=
"43"
selection-start-line=
"23"
selection-start-column=
"30"
selection-end-line=
"23"
selection-end-column=
"4
3"
/>
<folding>
<folding>
<element
signature=
"e#46#106#0"
expanded=
"true"
/>
<element
signature=
"e#46#106#0"
expanded=
"true"
/>
</folding>
</folding>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$
PROJECT_DIR$/lib/SharedPlugin
.dart"
>
<entry
file=
"file://$
USER_HOME$/Downloads/flutter/packages/flutter/lib/src/services/platform_channel
.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
330
"
>
<state
relative-caret-position=
"
121
"
>
<caret
line=
"
18"
column=
"39"
selection-start-line=
"18"
selection-start-column=
"28"
selection-end-line=
"18"
selection-end-column=
"39
"
/>
<caret
line=
"
342"
column=
"20"
selection-start-line=
"342"
selection-start-column=
"20"
selection-end-line=
"342"
selection-end-column=
"20
"
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/
ios/Classes/GengmeiFlutterPlugin.m
"
>
<entry
file=
"file://$PROJECT_DIR$/
example/lib/AlbumModel/page/album/AlbumPage.dart
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"11352"
>
<state
relative-caret-position=
"190"
>
<caret
line=
"536"
column=
"22"
selection-start-line=
"536"
selection-start-column=
"22"
selection-end-line=
"536"
selection-end-column=
"22"
/>
<caret
line=
"15"
column=
"2"
selection-start-line=
"15"
selection-start-column=
"2"
selection-end-line=
"15"
selection-end-column=
"2"
/>
<folding>
<element
signature=
"e#45#62#0"
expanded=
"true"
/>
</folding>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/Image/ResultManager.h"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"263"
>
<caret
line=
"101"
column=
"16"
lean-forward=
"true"
selection-start-line=
"101"
selection-start-column=
"16"
selection-end-line=
"101"
selection-end-column=
"16"
/>
<folding>
<element
signature=
"e#46#66#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/Image/ResultManager.m"
>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"217"
>
<caret
line=
"29"
selection-start-line=
"29"
selection-end-line=
"29"
/>
<folding>
<element
signature=
"e#45#86#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
</entry>
</component>
</component>
</project>
</project>
\ No newline at end of file
example/lib/AlbumModel/page/album/AlbumModel.dart
View file @
0c3a83b7
...
@@ -7,6 +7,7 @@ import 'dart:async';
...
@@ -7,6 +7,7 @@ import 'dart:async';
import
'dart:io'
;
import
'dart:io'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:gengmei_flutter_plugin/ScanImagePlugn.dart'
;
import
'package:gengmei_flutter_plugin/ScanImagePlugn.dart'
;
import
'package:gengmei_flutter_plugin/gengmei_flutter_plugin.dart'
;
import
'package:gengmei_flutter_plugin/gengmei_flutter_plugin.dart'
;
import
'package:gengmei_flutter_plugin_example/AlbumModel/LiveData.dart'
;
import
'package:gengmei_flutter_plugin_example/AlbumModel/LiveData.dart'
;
...
@@ -16,6 +17,26 @@ import 'package:gengmei_flutter_plugin_example/AlbumModel/repository/AlbumReposi
...
@@ -16,6 +17,26 @@ import 'package:gengmei_flutter_plugin_example/AlbumModel/repository/AlbumReposi
const
String
MainDir
=
"IsGengmeiAlbumAllImages"
;
const
String
MainDir
=
"IsGengmeiAlbumAllImages"
;
const
String
MainDirExplain
=
"全部相片"
;
const
String
MainDirExplain
=
"全部相片"
;
Map
<
String
,
List
<
ScanImageItem
>>
paseAlbum
(
Object
event
)
{
var
map
=
Map
<
String
,
List
<
dynamic
>>.
from
(
event
);
var
newMap
=
Map
<
String
,
List
<
ScanImageItem
>>();
map
.
forEach
((
k
,
v
)
{
var
list
=
List
<
Map
>.
from
(
v
);
var
scanList
=
List
<
ScanImageItem
>();
list
.
forEach
((
listMap
)
{
var
map2
=
Map
<
String
,
dynamic
>.
from
(
listMap
);
ScanImageItem
item
=
new
ScanImageItem
();
item
.
path
=
map2
[
"path"
];
item
.
isVideo
=
map2
[
"isVideo"
]
==
"T"
?
true
:
false
;
item
.
during
=
map2
[
"during"
]
??
"0"
;
scanList
.
add
(
item
);
});
newMap
[
k
]
=
scanList
;
});
return
newMap
;
}
class
AlbumModel
{
class
AlbumModel
{
LiveData
<
List
<
ScanImageItem
>>
albumLive
=
LiveData
();
LiveData
<
List
<
ScanImageItem
>>
albumLive
=
LiveData
();
LiveData
<
List
<
DirBean
>>
dirLive
=
LiveData
();
LiveData
<
List
<
DirBean
>>
dirLive
=
LiveData
();
...
@@ -55,39 +76,29 @@ class AlbumModel {
...
@@ -55,39 +76,29 @@ class AlbumModel {
}
}
void
_onEvent
(
Object
event
)
{
void
_onEvent
(
Object
event
)
{
var
map
=
(
event
as
Map
);
// var map = (event as Map);
if
(
_mainValue
==
null
||
_mainValue
.
length
==
0
)
{
// if (_mainValue == null || _mainValue.length == 0) {
_mainValue
=
map
;
// _mainValue = map;
}
else
{
// } else {
_mainValue
.
forEach
((
k
,
itemList
)
{
// _mainValue.forEach((k, itemList) {
var
key
=
map
[
k
];
// var key = map[k];
if
(
key
!=
null
)
{
// if (key != null) {
for
(
int
i
=
0
;
i
<
itemList
.
length
;
i
++)
{
// for (int i = 0; i < itemList.length; i++) {
if
(
key
[
i
]
==
null
)
{
// if (key[i] == null) {
continue
;
// continue;
}
// }
itemList
[
i
].
path
=
key
[
i
][
"path"
];
// itemList[i].path = key[i]["path"];
itemList
[
i
].
realPath
=
key
[
i
][
"realPath"
];
// itemList[i].realPath = key[i]["realPath"];
}
// }
}
// }
});
}
// var map = Map<String, List<dynamic>>.from(event);
//
// var newMap = Map<String, List<ScanImageItem>>();
// map.forEach((k, v) {
// var key = newMap["k"];
// if(key==null){
// newMap["k"]=new List<ScanImageItem>();
// }
// v.forEach((value){
// ScanImageItem item=new ScanImageItem();
// item.path=value["path"];
// item.isVideo=value["isVideo"]=="T"?true:false;
// item.during = value["during"] ?? "0";
// newMap["k"].add(item);
// });
// });
// });
// }
compute
(
paseAlbum
,
event
).
then
((
value
){
_mainValue
=
value
;
albumLive
.
notifyView
(
_mainValue
[
_nowDirName
]);
});
// _mainValue=newMap;
// _mainValue=newMap;
// var list = map[_nowDirName];
// var list = map[_nowDirName];
// _mainValue.forEach((k, itemList) {
// _mainValue.forEach((k, itemList) {
...
@@ -119,7 +130,7 @@ class AlbumModel {
...
@@ -119,7 +130,7 @@ class AlbumModel {
// }
// }
// }
// }
// print("EVENTTTT !! ${tempList.length} ${tempList}");
// print("EVENTTTT !! ${tempList.length} ${tempList}");
albumLive
.
notifyView
(
_mainValue
[
_nowDirName
]);
}
}
void
_onError
(
Object
error
)
{
void
_onError
(
Object
error
)
{
...
@@ -132,7 +143,8 @@ class AlbumModel {
...
@@ -132,7 +143,8 @@ class AlbumModel {
.
receiveBroadcastStream
()
.
receiveBroadcastStream
()
.
listen
(
_onEvent
,
onError:
_onError
);
.
listen
(
_onEvent
,
onError:
_onError
);
// }
// }
AlbumRepository
.
getInstance
().
scanPhoneImg
().
listen
((
value
)
{
AlbumRepository
.
getInstance
().
scanPhoneImg
()
.
listen
((
value
)
{
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
_mainValue
=
value
;
_mainValue
=
value
;
value
.
forEach
((
key
,
eachValue
)
{
value
.
forEach
((
key
,
eachValue
)
{
...
@@ -234,7 +246,6 @@ class AlbumModel {
...
@@ -234,7 +246,6 @@ class AlbumModel {
}
}
}
}
void
iosAlbum
(
List
<
String
>
list
,
BuildContext
context
,
Function
fun
)
{
void
iosAlbum
(
List
<
String
>
list
,
BuildContext
context
,
Function
fun
)
{
GengmeiFlutterPlugin
.
ios_album_path
(
list
).
then
((
value
)
{
GengmeiFlutterPlugin
.
ios_album_path
(
list
).
then
((
value
)
{
fun
(
value
);
fun
(
value
);
...
@@ -254,7 +265,8 @@ class AlbumModel {
...
@@ -254,7 +265,8 @@ class AlbumModel {
}
else
{
}
else
{
print
(
data
);
print
(
data
);
ScanImageItem
item
=
new
ScanImageItem
();
ScanImageItem
item
=
new
ScanImageItem
();
item
.
realPath
=
data
[
"realPath"
]==
null
?
null
:
data
[
"realPath"
]
as
String
;
item
.
realPath
=
data
[
"realPath"
]
==
null
?
null
:
data
[
"realPath"
]
as
String
;
item
.
path
=
data
[
"path"
]
as
String
;
item
.
path
=
data
[
"path"
]
as
String
;
item
.
isVideo
=
false
;
item
.
isVideo
=
false
;
String
foldName
=
data
[
"folderName"
]
as
String
;
String
foldName
=
data
[
"folderName"
]
as
String
;
...
...
ios/Classes/GengmeiFlutterPlugin.m
View file @
0c3a83b7
...
@@ -13,8 +13,9 @@
...
@@ -13,8 +13,9 @@
@property
(
nonatomic
)
long
resultKey
;
@property
(
nonatomic
)
long
resultKey
;
@property
(
nonatomic
)
long
nativeCameraKey
;
@property
(
nonatomic
)
long
nativeCameraKey
;
@property
(
strong
,
atomic
)
NSMutableDictionary
<
NSString
*
,
NSMutableArray
<
NSMutableDictionary
<
NSString
*
,
NSObject
*>*>*>*
finalMap
;
@property
(
strong
,
atomic
)
NSMutableDictionary
<
NSString
*
,
NSMutableArray
<
NSMutableDictionary
<
NSString
*
,
NSObject
*>*>*>*
finalMap
;
@property
(
strong
,
atomic
)
NSMutableDictionary
<
NSString
*
,
NSMutableArray
<
NSMutableDictionary
<
NSString
*
,
NSObject
*>*>*>*
finalMapTemp
;
@property
(
nonatomic
,
strong
)
UIImagePickerController
*
imagePicker
;
@property
(
nonatomic
,
strong
)
UIImagePickerController
*
imagePicker
;
@property
(
atomic
)
Boolean
quitPage
;
@property
(
non
atomic
)
Boolean
quitPage
;
@property
(
atomic
)
Boolean
execdTask
;
@property
(
atomic
)
Boolean
execdTask
;
@property
(
atomic
)
Boolean
copyScareImgOk
;
@property
(
atomic
)
Boolean
copyScareImgOk
;
@property
(
atomic
)
Boolean
finishScanImg
;
@property
(
atomic
)
Boolean
finishScanImg
;
...
@@ -44,7 +45,8 @@ NSString *cacheDirectory;
...
@@ -44,7 +45,8 @@ NSString *cacheDirectory;
[
registrar
addMethodCallDelegate
:
instance
channel
:
channel
];
[
registrar
addMethodCallDelegate
:
instance
channel
:
channel
];
assetCollectionList
=
[
NSMutableArray
array
];
assetCollectionList
=
[
NSMutableArray
array
];
viewController
=
[
UIApplication
sharedApplication
].
delegate
.
window
.
rootViewController
;
viewController
=
[
UIApplication
sharedApplication
].
delegate
.
window
.
rootViewController
;
queue
=
dispatch_queue_create
(
"com.gengmei_flutter_plugin"
,
DISPATCH_QUEUE_CONCURRENT
);
// queue = dispatch_queue_create("com.gengmei_flutter_plugin", DISPATCH_QUEUE_CONCURRENT);
queue
=
dispatch_queue_create
(
"com.gengmei_flutter_plugin"
,
DISPATCH_QUEUE_SERIAL
);
FlutterEventChannel
*
chargingChannel
=
[
FlutterEventChannel
FlutterEventChannel
*
chargingChannel
=
[
FlutterEventChannel
eventChannelWithName
:
@"gengmei_flutter_plugin_event"
eventChannelWithName
:
@"gengmei_flutter_plugin_event"
binaryMessenger
:[
registrar
messenger
]];
binaryMessenger
:[
registrar
messenger
]];
...
@@ -295,12 +297,14 @@ NSString *cacheDirectory;
...
@@ -295,12 +297,14 @@ NSString *cacheDirectory;
}
}
CGSize
temp
=
CGSizeMake
(
picWidth
*
tempScareSize
,
picHeight
*
tempScareSize
);
CGSize
temp
=
CGSizeMake
(
picWidth
*
tempScareSize
,
picHeight
*
tempScareSize
);
[[
PHImageManager
defaultManager
]
requestImageForAsset
:
assets
targetSize
:
temp
contentMode
:
PHImageContentModeDefault
options
:
imageRequestOption
resultHandler
:^
(
UIImage
*
_Nullable
res
,
NSDictionary
*
_Nullable
info
)
{
[[
PHImageManager
defaultManager
]
requestImageDataForAsset
:
assets
options
:
imageRequestOption
resultHandler
:^
(
NSData
*
_Nullable
imageData
,
NSString
*
_Nullable
dataUTI
,
UIImageOrientation
orientation
,
NSDictionary
*
_Nullable
info
)
{
// [[PHImageManager defaultManager] requestImageForAsset:assets targetSize:temp contentMode:PHImageContentModeDefault options:imageRequestOption resultHandler:^(UIImage * _Nullable res, NSDictionary * _Nullable info) {
@autoreleasepool
{
@autoreleasepool
{
UIImage
*
res
=
[
UIImage
imageWithData
:
imageData
];
NSData
*
data
=
UIImageJPEGRepresentation
(
res
,
0
.
8
)
;
NSData
*
data
=
UIImageJPEGRepresentation
(
res
,
0
.
8
)
;
[
data
writeToFile
:
tempTake
atomically
:
YES
];
[
data
writeToFile
:
tempTake
atomically
:
YES
];
data
=
nil
;
res
=
nil
;
res
=
nil
;
data
=
nil
;
}
}
NSMutableDictionary
*
dict
=
[[
NSMutableDictionary
alloc
]
init
];
NSMutableDictionary
*
dict
=
[[
NSMutableDictionary
alloc
]
init
];
[
dict
setObject
:
path
[
i
]
forKey
:
@"path"
];
[
dict
setObject
:
path
[
i
]
forKey
:
@"path"
];
...
@@ -433,6 +437,9 @@ NSString *cacheDirectory;
...
@@ -433,6 +437,9 @@ NSString *cacheDirectory;
if
(
self
.
finalMap
==
nil
)
{
if
(
self
.
finalMap
==
nil
)
{
self
.
finalMap
=
[
NSMutableDictionary
dictionary
];
self
.
finalMap
=
[
NSMutableDictionary
dictionary
];
}
}
if
(
self
.
finalMapTemp
==
nil
){
self
.
finalMapTemp
=
[
NSMutableDictionary
dictionary
];
}
if
(
self
.
scanMap
==
nil
){
if
(
self
.
scanMap
==
nil
){
self
.
scanMap
=
[
NSMutableDictionary
dictionary
];
self
.
scanMap
=
[
NSMutableDictionary
dictionary
];
}
}
...
@@ -444,6 +451,7 @@ NSString *cacheDirectory;
...
@@ -444,6 +451,7 @@ NSString *cacheDirectory;
}
}
[
self
.
channelList
removeAllObjects
];
[
self
.
channelList
removeAllObjects
];
[
self
.
finalMap
removeAllObjects
];
[
self
.
finalMap
removeAllObjects
];
[
self
.
finalMapTemp
removeAllObjects
];
[
self
.
scanMap
removeAllObjects
];
[
self
.
scanMap
removeAllObjects
];
[
self
.
takePhotoMap
removeAllObjects
];
[
self
.
takePhotoMap
removeAllObjects
];
self
.
nowSize
=
0
;
self
.
nowSize
=
0
;
...
@@ -529,6 +537,10 @@ NSString *cacheDirectory;
...
@@ -529,6 +537,10 @@ NSString *cacheDirectory;
if
(
arr
==
nil
)
{
if
(
arr
==
nil
)
{
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
=
[
NSMutableArray
array
];
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
=
[
NSMutableArray
array
];
}
}
NSMutableArray
*
arrTemp
=
self
.
finalMapTemp
[
@"IsGengmeiAlbumAllImages"
];
if
(
arrTemp
==
nil
){
self
.
finalMapTemp
[
@"IsGengmeiAlbumAllImages"
]
=
[
NSMutableArray
array
];
}
}
}
-
(
void
)
upImgs
{
-
(
void
)
upImgs
{
...
@@ -539,13 +551,64 @@ NSString *cacheDirectory;
...
@@ -539,13 +551,64 @@ NSString *cacheDirectory;
});
});
}
}
-
(
void
)
reslutImg
:
(
long
)
resultId
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
if
(
!
self
.
quitPage
){
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultId
]
:
self
.
finalMapTemp
];
}
});
}
-
(
void
)
saveItemAndUpload
:
(
NSMutableDictionary
*
)
queryItemDict
:
(
PHAsset
*
)
assets
:
(
NSString
*
)
tmpPath
:
(
NSString
*
)
docName
:
(
long
)
resultId
{
NSLog
(
@"RUNNING THREAD %@"
,[
NSThread
currentThread
]);
// @synchronized (self) {
self
.
nowSize
++
;
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
if
(
arr
==
nil
)
{
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
else
{
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
if
(
self
.
needSize
>
150
){
if
(
self
.
nowSize
<=
151
){
NSMutableArray
*
arr
=
self
.
finalMapTemp
[
docName
];
if
(
arr
==
nil
)
{
self
.
finalMapTemp
[
docName
]
=
[
NSMutableArray
array
];
[
self
.
finalMapTemp
[
docName
]
addObject
:
queryItemDict
];
}
else
{
[
self
.
finalMapTemp
[
docName
]
addObject
:
queryItemDict
];
}
[
self
.
finalMapTemp
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
}
if
(
self
.
nowSize
==
151
){
[
self
reslutImg
:
resultId
];
}
else
if
(
self
.
nowSize
==
self
.
needSize
){
self
.
finishScanImg
=
true
;
[
self
upImgs
];
}
}
else
{
if
(
self
.
nowSize
==
self
.
needSize
)
{
self
.
finishScanImg
=
true
;
[
self
reslutImg
:
resultId
];
self
.
finalMap
=
[
self
.
finalMapTemp
mutableCopy
];
}
}
// }
}
-
(
void
)
copyImg
:
(
long
)
resultId
{
-
(
void
)
copyImg
:
(
long
)
resultId
{
// self.copySize=0;
NSLog
(
@"START THREAD %@"
,[
NSThread
currentThread
]);
self
.
copySize
=
0
;
self
.
nowSize
=
0
;
self
.
nowSize
=
0
;
PHImageRequestOptions
*
imageRequestOption
=
[[
PHImageRequestOptions
alloc
]
init
];
PHImageRequestOptions
*
imageRequestOption
=
[[
PHImageRequestOptions
alloc
]
init
];
imageRequestOption
.
synchronous
=
NO
;
imageRequestOption
.
synchronous
=
NO
;
imageRequestOption
.
networkAccessAllowed
=
YES
;
imageRequestOption
.
networkAccessAllowed
=
YES
;
imageRequestOption
.
deliveryMode
=
PHImageRequestOptionsDeliveryModeHighQualityFormat
;
imageRequestOption
.
deliveryMode
=
PHImageRequestOptionsDeliveryModeHighQualityFormat
;
//PHImageRequestOptionsDeliveryModeHighQualityFormat。//PHImageRequestOptionsDeliveryModeFastFormat
//PHImageRequestOptionsDeliveryModeHighQualityFormat。//PHImageRequestOptionsDeliveryModeFastFormat
// imageRequestOption.deliveryMode=PHImageRequestOptionsDeliveryModeFastFormat;
// imageRequestOption.deliveryMode=PHImageRequestOptionsDeliveryModeFastFormat;
imageRequestOption
.
resizeMode
=
PHImageRequestOptionsResizeModeFast
;
imageRequestOption
.
resizeMode
=
PHImageRequestOptionsResizeModeFast
;
...
@@ -559,9 +622,6 @@ NSString *cacheDirectory;
...
@@ -559,9 +622,6 @@ NSString *cacheDirectory;
AlbumItem
*
item
=
assetCollectionList
[
j
];
AlbumItem
*
item
=
assetCollectionList
[
j
];
PHFetchResult
<
PHAsset
*>
*
assetResult
=
[
item
assets
];
PHFetchResult
<
PHAsset
*>
*
assetResult
=
[
item
assets
];
for
(
int
i
=
0
;
i
<
[
assetResult
count
];
i
++
)
{
for
(
int
i
=
0
;
i
<
[
assetResult
count
];
i
++
)
{
if
(
self
.
quitPage
){
return
;
}
__block
NSString
*
docName
=
[
item
collectionTitle
];
__block
NSString
*
docName
=
[
item
collectionTitle
];
PHAsset
*
assets
=
[
assetResult
objectAtIndex
:
i
];
PHAsset
*
assets
=
[
assetResult
objectAtIndex
:
i
];
__block
NSString
*
imgName
=
[
assets
valueForKey
:
@"filename"
];
__block
NSString
*
imgName
=
[
assets
valueForKey
:
@"filename"
];
...
@@ -574,27 +634,14 @@ NSString *cacheDirectory;
...
@@ -574,27 +634,14 @@ NSString *cacheDirectory;
if
(
assets
.
mediaType
==
PHAssetMediaTypeVideo
){
if
(
assets
.
mediaType
==
PHAssetMediaTypeVideo
){
if
([
fileManager
fileExistsAtPath
:
tmpPath
]
==
YES
){
if
([
fileManager
fileExistsAtPath
:
tmpPath
]
==
YES
){
[[
PHImageManager
defaultManager
]
requestAVAssetForVideo
:
assets
options
:
options
resultHandler
:^
(
AVAsset
*
_Nullable
asset
,
AVAudioMix
*
_Nullable
audioMix
,
NSDictionary
*
_Nullable
info
)
{
[[
PHImageManager
defaultManager
]
requestAVAssetForVideo
:
assets
options
:
options
resultHandler
:^
(
AVAsset
*
_Nullable
asset
,
AVAudioMix
*
_Nullable
audioMix
,
NSDictionary
*
_Nullable
info
)
{
AVURLAsset
*
urlAsset
=
(
AVURLAsset
*
)
asset
;
dispatch_async
(
queue
,
^
{
NSMutableDictionary
*
queryItemDict
=
[
NSMutableDictionary
dictionary
];
AVURLAsset
*
urlAsset
=
(
AVURLAsset
*
)
asset
;
[
queryItemDict
setObject
:[
self
getVideoDuring
:
urlAsset
.
duration
]
forKey
:
@"during"
];
NSMutableDictionary
*
queryItemDict
=
[
NSMutableDictionary
dictionary
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:[
self
getVideoDuring
:
urlAsset
.
duration
]
forKey
:
@"during"
];
[
queryItemDict
setObject
:
@"T"
forKey
:
@"isVideo"
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
@synchronized
(
self
)
{
[
queryItemDict
setObject
:
@"T"
forKey
:
@"isVideo"
];
self
.
nowSize
++
;
[
self
saveItemAndUpload
:
queryItemDict
:
assets
:
tmpPath
:
docName
:
resultId
];
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
});
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
if
(
arr
==
nil
)
{
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
else
{
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
}
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
if
(
self
.
nowSize
==
self
.
needSize
)
{
[
self
resultImgs
:
resultId
];
}
}];
}];
}
else
{
}
else
{
int
picWidth
=
[
assets
pixelWidth
];
int
picWidth
=
[
assets
pixelWidth
];
...
@@ -623,22 +670,7 @@ NSString *cacheDirectory;
...
@@ -623,22 +670,7 @@ NSString *cacheDirectory;
[
queryItemDict
setObject
:[
self
getVideoDuring
:
urlAsset
.
duration
]
forKey
:
@"during"
];
[
queryItemDict
setObject
:[
self
getVideoDuring
:
urlAsset
.
duration
]
forKey
:
@"during"
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
@"T"
forKey
:
@"isVideo"
];
[
queryItemDict
setObject
:
@"T"
forKey
:
@"isVideo"
];
@synchronized
(
self
)
{
[
self
saveItemAndUpload
:
queryItemDict
:
assets
:
tmpPath
:
docName
:
resultId
];
self
.
nowSize
++
;
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
if
(
arr
==
nil
)
{
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
else
{
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
if
(
self
.
nowSize
==
self
.
needSize
)
{
[
self
resultImgs
:
resultId
];
}
}
}];
}];
}];
}];
}
}
...
@@ -648,22 +680,7 @@ NSString *cacheDirectory;
...
@@ -648,22 +680,7 @@ NSString *cacheDirectory;
NSMutableDictionary
*
queryItemDict
=
[
NSMutableDictionary
dictionary
];
NSMutableDictionary
*
queryItemDict
=
[
NSMutableDictionary
dictionary
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
@"F"
forKey
:
@"isVideo"
];
[
queryItemDict
setObject
:
@"F"
forKey
:
@"isVideo"
];
@synchronized
(
self
)
{
[
self
saveItemAndUpload
:
queryItemDict
:
assets
:
tmpPath
:
docName
:
resultId
];
self
.
nowSize
++
;
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
if
(
arr
==
nil
)
{
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
else
{
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
if
(
self
.
nowSize
==
self
.
needSize
)
{
[
self
resultImgs
:
resultId
];
}
}
}
else
{
}
else
{
int
picWidth
=
[
assets
pixelWidth
];
int
picWidth
=
[
assets
pixelWidth
];
int
picHeight
=
[
assets
pixelHeight
];
int
picHeight
=
[
assets
pixelHeight
];
...
@@ -688,23 +705,8 @@ NSString *cacheDirectory;
...
@@ -688,23 +705,8 @@ NSString *cacheDirectory;
NSMutableDictionary
*
queryItemDict
=
[
NSMutableDictionary
dictionary
];
NSMutableDictionary
*
queryItemDict
=
[
NSMutableDictionary
dictionary
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
@"F"
forKey
:
@"isVideo"
];
[
queryItemDict
setObject
:
@"F"
forKey
:
@"isVideo"
];
// self.copySize++;
// self.copySize++;
@synchronized
(
self
)
{
[
self
saveItemAndUpload
:
queryItemDict
:
assets
:
tmpPath
:
docName
:
resultId
];
self
.
nowSize
++
;
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
if
(
arr
==
nil
)
{
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
else
{
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
if
(
self
.
nowSize
==
self
.
needSize
)
{
[
self
resultImgs
:
resultId
];
}
}
}];
}];
}
}
}
}
...
@@ -835,28 +837,6 @@ NSString *cacheDirectory;
...
@@ -835,28 +837,6 @@ NSString *cacheDirectory;
// }
// }
//}
//}
-
(
void
)
resultImgs
:
(
long
)
resultId
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
self
.
finishScanImg
=
true
;
if
(
!
self
.
quitPage
){
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultId
]
:
self
.
finalMap
];
// dispatch_async(queue, ^{
// [self execRealImg:resultId];
// });
}
});
}
-
(
void
)
reslutImg
:
(
long
)
resultId
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
if
(
!
self
.
quitPage
){
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultId
]
:
self
.
finalMap
];
}
});
}
//-(void)searchPath:(NSString*)finalRealPath :(NSString*)tmpPath :(NSString*)docName{
//-(void)searchPath:(NSString*)finalRealPath :(NSString*)tmpPath :(NSString*)docName{
// NSMutableArray<NSMutableDictionary<NSString*,NSObject*>*>* array=self.finalMap[docName];
// NSMutableArray<NSMutableDictionary<NSString*,NSObject*>*>* array=self.finalMap[docName];
...
...
lib/ScanImagePlugn.dart
View file @
0c3a83b7
...
@@ -2,27 +2,32 @@
...
@@ -2,27 +2,32 @@
* @author lsy
* @author lsy
* @date 2019-09-09
* @date 2019-09-09
**/
**/
import
'package:flutter/foundation.dart'
;
import
'package:flutter/src/services/platform_channel.dart'
;
import
'package:flutter/src/services/platform_channel.dart'
;
Map
<
String
,
List
<
ScanImageItem
>>
changData
(
Map
images
)
{
Map
<
String
,
List
<
ScanImageItem
>>
newMap
=
new
Map
();
images
.
forEach
((
k
,
v
)
{
List
<
ScanImageItem
>
tempList
=
new
List
();
for
(
var
item
in
v
)
{
ScanImageItem
scanImageItem
=
new
ScanImageItem
();
scanImageItem
.
path
=
item
[
"path"
]
??
""
;
scanImageItem
.
size
=
item
[
"size"
]
??
0
;
scanImageItem
.
realPath
=
item
[
"realPath"
]
??
""
;
scanImageItem
.
isVideo
=
item
[
"isVideo"
]
==
"T"
?
true
:
false
;
scanImageItem
.
during
=
item
[
"during"
]
??
"0"
;
tempList
.
add
(
scanImageItem
);
}
newMap
.
putIfAbsent
(
k
,
()
=>
tempList
);
});
return
newMap
;
}
class
ScanImagePlugn
{
class
ScanImagePlugn
{
static
Future
<
Map
<
String
,
List
<
ScanImageItem
>>>
scanImages
(
static
Future
<
Map
<
String
,
List
<
ScanImageItem
>>>
scanImages
(
MethodChannel
channel
)
async
{
MethodChannel
channel
)
async
{
var
images
=
await
channel
.
invokeMapMethod
(
"scan_image_picker"
);
var
images
=
await
channel
.
invokeMapMethod
(
"scan_image_picker"
);
Map
<
String
,
List
<
ScanImageItem
>>
newMap
=
new
Map
();
return
Future
.
value
(
compute
(
changData
,
images
));
images
.
forEach
((
k
,
v
)
{
List
<
ScanImageItem
>
tempList
=
new
List
();
for
(
var
item
in
v
)
{
ScanImageItem
scanImageItem
=
new
ScanImageItem
();
scanImageItem
.
path
=
item
[
"path"
]
??
""
;
scanImageItem
.
size
=
item
[
"size"
]
??
0
;
scanImageItem
.
realPath
=
item
[
"realPath"
]
??
""
;
scanImageItem
.
isVideo
=
item
[
"isVideo"
]
==
"T"
?
true
:
false
;
scanImageItem
.
during
=
item
[
"during"
]
??
"0"
;
tempList
.
add
(
scanImageItem
);
}
newMap
.
putIfAbsent
(
k
,
()
=>
tempList
);
});
return
newMap
;
}
}
static
Future
<
Map
>
nativeCamera
(
static
Future
<
Map
>
nativeCamera
(
...
...
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