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
11f928f7
Commit
11f928f7
authored
Sep 29, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
5d3d676a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
286 additions
and
86 deletions
+286
-86
workspace.xml
.idea/workspace.xml
+87
-51
build_file_checksums.ser
android/.idea/caches/build_file_checksums.ser
+0
-0
GengmeiFlutterPlugin.m
ios/Classes/GengmeiFlutterPlugin.m
+199
-35
No files found.
.idea/workspace.xml
View file @
11f928f7
...
@@ -7,7 +7,9 @@
...
@@ -7,7 +7,9 @@
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<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$/android/.idea/caches/build_file_checksums.ser"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/android/.idea/caches/build_file_checksums.ser"
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/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$/ios/Classes/GengmeiFlutterPlugin.m"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
afterDir=
"false"
/>
</list>
</list>
<ignored
path=
"$PROJECT_DIR$/.dart_tool/"
/>
<ignored
path=
"$PROJECT_DIR$/.dart_tool/"
/>
...
@@ -28,9 +30,13 @@
...
@@ -28,9 +30,13 @@
<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=
"false"
>
<file
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/example/android/app/app.iml"
>
<entry
file=
"file://$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"611"
>
<caret
line=
"238"
column=
"5"
lean-forward=
"true"
selection-start-line=
"238"
selection-start-column=
"5"
selection-end-line=
"238"
selection-end-column=
"5"
/>
</state>
</provider>
</entry>
</entry>
</file>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<file
pinned=
"false"
current-in-tab=
"false"
>
...
@@ -62,34 +68,41 @@
...
@@ -62,34 +68,41 @@
</provider>
</provider>
</entry>
</entry>
</file>
</file>
<file
pinned=
"false"
current-in-tab=
"
tru
e"
>
<file
pinned=
"false"
current-in-tab=
"
fals
e"
>
<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=
"2
45
"
>
<state
relative-caret-position=
"2
67
"
>
<caret
line=
"1
3"
column=
"4"
selection-start-line=
"13"
selection-start-column=
"4"
selection-end-line=
"13
"
selection-end-column=
"4"
/>
<caret
line=
"1
4"
column=
"4"
selection-start-line=
"14"
selection-start-column=
"4"
selection-end-line=
"14
"
selection-end-column=
"4"
/>
</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$/.packages"
>
<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=
"308"
>
<caret
line=
"17"
column=
"47"
selection-start-line=
"17"
selection-start-column=
"39"
selection-end-line=
"17"
selection-end-column=
"47"
/>
</state>
</provider>
</entry>
</entry>
</file>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/
android/src/main/AndroidManifest.xml
"
>
<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=
"264"
>
<state
relative-caret-position=
"330"
>
<caret
line=
"12"
column=
"11"
selection-start-line=
"12"
selection-start-column=
"11"
selection-end-line=
"12"
selection-end-column=
"11"
/>
<caret
line=
"15"
column=
"47"
selection-start-line=
"15"
selection-start-column=
"47"
selection-end-line=
"15"
selection-end-column=
"47"
/>
<folding>
<element
signature=
"e#0#20#0"
expanded=
"true"
/>
</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$/
pubspec.yaml
"
>
<entry
file=
"file://$PROJECT_DIR$/
lib/SharedPlugin.dart
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
4
4"
>
<state
relative-caret-position=
"
118
4"
>
<caret
line=
"
2"
column=
"9"
selection-start-line=
"2"
selection-start-column=
"9"
selection-end-line=
"2"
selection-end-column=
"16
"
/>
<caret
line=
"
76"
column=
"75"
selection-start-line=
"76"
selection-start-column=
"75"
selection-end-line=
"76"
selection-end-column=
"75
"
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
...
@@ -143,8 +156,8 @@
...
@@ -143,8 +156,8 @@
</list>
</list>
</option>
</option>
</component>
</component>
<component
name=
"ProjectFrameBounds"
>
<component
name=
"ProjectFrameBounds"
extendedState=
"6"
>
<option
name=
"x"
value=
"
523
"
/>
<option
name=
"x"
value=
"
329
"
/>
<option
name=
"y"
value=
"-1080"
/>
<option
name=
"y"
value=
"-1080"
/>
<option
name=
"width"
value=
"1920"
/>
<option
name=
"width"
value=
"1920"
/>
<option
name=
"height"
value=
"1080"
/>
<option
name=
"height"
value=
"1080"
/>
...
@@ -162,6 +175,24 @@
...
@@ -162,6 +175,24 @@
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
</path>
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"android"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"android"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"main"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"android"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"main"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
...
@@ -180,6 +211,11 @@
...
@@ -180,6 +211,11 @@
<item
name=
"Classes"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"Classes"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"Image"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"Image"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
</path>
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"lib"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
</expand>
</expand>
<select
/>
<select
/>
</subPane>
</subPane>
...
@@ -232,7 +268,7 @@
...
@@ -232,7 +268,7 @@
<servers
/>
<servers
/>
</component>
</component>
<component
name=
"ToolWindowManager"
>
<component
name=
"ToolWindowManager"
>
<frame
x=
"
523"
y=
"-1080"
width=
"1920"
height=
"1080"
extended-state=
"0
"
/>
<frame
x=
"
-41"
y=
"-1080"
width=
"1920"
height=
"1080"
extended-state=
"6
"
/>
<layout>
<layout>
<window_info
active=
"true"
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.16986156"
/>
<window_info
active=
"true"
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.16986156"
/>
<window_info
id=
"Captures"
order=
"1"
side_tool=
"true"
/>
<window_info
id=
"Captures"
order=
"1"
side_tool=
"true"
/>
...
@@ -253,7 +289,7 @@
...
@@ -253,7 +289,7 @@
<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"
/>
<window_info
anchor=
"bottom"
id=
"Messages"
order=
"10"
visible=
"true"
weight=
"0.3451417"
/>
<window_info
anchor=
"bottom"
id=
"Messages"
order=
"10"
weight=
"0.3451417"
/>
<window_info
anchor=
"right"
id=
"Device File Explorer"
order=
"0"
side_tool=
"true"
weight=
"0.32960597"
/>
<window_info
anchor=
"right"
id=
"Device File Explorer"
order=
"0"
side_tool=
"true"
weight=
"0.32960597"
/>
<window_info
anchor=
"right"
id=
"Capture Analysis"
order=
"1"
/>
<window_info
anchor=
"right"
id=
"Capture Analysis"
order=
"1"
/>
<window_info
anchor=
"right"
id=
"Theme Preview"
order=
"2"
/>
<window_info
anchor=
"right"
id=
"Theme Preview"
order=
"2"
/>
...
@@ -265,13 +301,6 @@
...
@@ -265,13 +301,6 @@
</layout>
</layout>
</component>
</component>
<component
name=
"editorHistoryManager"
>
<component
name=
"editorHistoryManager"
>
<entry
file=
"file://$USER_HOME$/Downloads/flutter/bin/cache/pkg/sky_engine/lib/io/file_system_entity.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-125"
>
<caret
line=
"256"
column=
"31"
selection-start-line=
"256"
selection-start-column=
"15"
selection-end-line=
"256"
selection-end-column=
"31"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$USER_HOME$/Downloads/flutter/bin/cache/pkg/sky_engine/lib/io/directory.dart"
>
<entry
file=
"file://$USER_HOME$/Downloads/flutter/bin/cache/pkg/sky_engine/lib/io/directory.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"265"
>
<state
relative-caret-position=
"265"
>
...
@@ -357,13 +386,6 @@
...
@@ -357,13 +386,6 @@
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/LiveData.dart"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/LiveData.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"858"
>
<caret
line=
"42"
selection-start-line=
"42"
selection-end-line=
"42"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/bean/DirBean.dart"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/bean/DirBean.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
</entry>
...
@@ -378,16 +400,6 @@
...
@@ -378,16 +400,6 @@
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/android/src/main/kotlin/com/example/gengmei_flutter_plugin/sharedPrefernces/SharedManager.kt"
/>
<entry
file=
"file://$PROJECT_DIR$/android/src/main/kotlin/com/example/gengmei_flutter_plugin/sharedPrefernces/SharedManager.kt"
/>
<entry
file=
"file://$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"880"
>
<caret
line=
"46"
column=
"41"
selection-start-line=
"46"
selection-start-column=
"41"
selection-end-line=
"46"
selection-end-column=
"41"
/>
<folding>
<element
signature=
"e#0#20#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<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=
"4158"
>
<state
relative-caret-position=
"4158"
>
...
@@ -419,13 +431,6 @@
...
@@ -419,13 +431,6 @@
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/A.dart"
/>
<entry
file=
"file://$PROJECT_DIR$/lib/A.dart"
/>
<entry
file=
"file://$PROJECT_DIR$/lib/SharedPlugin.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"1606"
>
<caret
line=
"76"
column=
"75"
selection-start-line=
"76"
selection-start-column=
"75"
selection-end-line=
"76"
selection-end-column=
"75"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/a"
/>
<entry
file=
"file://$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/a"
/>
<entry
file=
"file://$PROJECT_DIR$/android/build.gradle"
>
<entry
file=
"file://$PROJECT_DIR$/android/build.gradle"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
...
@@ -502,8 +507,39 @@
...
@@ -502,8 +507,39 @@
</entry>
</entry>
<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=
"245"
>
<state
relative-caret-position=
"267"
>
<caret
line=
"13"
column=
"4"
selection-start-line=
"13"
selection-start-column=
"4"
selection-end-line=
"13"
selection-end-column=
"4"
/>
<caret
line=
"14"
column=
"4"
selection-start-line=
"14"
selection-start-column=
"4"
selection-end-line=
"14"
selection-end-column=
"4"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"308"
>
<caret
line=
"17"
column=
"47"
selection-start-line=
"17"
selection-start-column=
"39"
selection-end-line=
"17"
selection-end-column=
"47"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/SharedPlugin.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"1184"
>
<caret
line=
"76"
column=
"75"
selection-start-line=
"76"
selection-start-column=
"75"
selection-end-line=
"76"
selection-end-column=
"75"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"330"
>
<caret
line=
"15"
column=
"47"
selection-start-line=
"15"
selection-start-column=
"47"
selection-end-line=
"15"
selection-end-column=
"47"
/>
<folding>
<element
signature=
"e#0#20#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"611"
>
<caret
line=
"238"
column=
"5"
lean-forward=
"true"
selection-start-line=
"238"
selection-start-column=
"5"
selection-end-line=
"238"
selection-end-column=
"5"
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
...
...
android/.idea/caches/build_file_checksums.ser
View file @
11f928f7
No preview for this file type
ios/Classes/GengmeiFlutterPlugin.m
View file @
11f928f7
...
@@ -4,10 +4,11 @@
...
@@ -4,10 +4,11 @@
#import "Image/AlbumItem.h"
#import "Image/AlbumItem.h"
#import "ResultManager.h"
#import "ResultManager.h"
@interface
GengmeiFlutterPlugin
()
<
UIActionSheetDelegate
,
UIImagePickerControllerDelegate
,
UINavigationControllerDelegate
>
//一定要声明这三个协议,缺一不可
@interface
GengmeiFlutterPlugin
()
<
UIActionSheetDelegate
,
UIImagePickerControllerDelegate
,
UINavigationControllerDelegate
,
FlutterStreamHandler
>
//一定要声明这三个协议,缺一不可
//@property(nonatomic)FlutterResult result;
//@property(nonatomic)FlutterResult result;
@property
(
atomic
)
int
needSize
;
@property
(
atomic
)
int
needSize
;
@property
(
nonatomic
)
int
nowSize
;
@property
(
nonatomic
)
int
nowSize
;
@property
(
nonatomic
)
int
tempSize
;
@property
(
nonatomic
)
long
resultKey
;
@property
(
nonatomic
)
long
resultKey
;
@property
(
nonatomic
)
long
nativeCameraKey
;
@property
(
nonatomic
)
long
nativeCameraKey
;
@property
(
strong
,
nonatomic
)
NSMutableDictionary
<
NSString
*
,
NSMutableArray
<
NSMutableDictionary
<
NSString
*
,
NSObject
*>*>*>*
finalMap
;
@property
(
strong
,
nonatomic
)
NSMutableDictionary
<
NSString
*
,
NSMutableArray
<
NSMutableDictionary
<
NSString
*
,
NSObject
*>*>*>*
finalMap
;
...
@@ -16,11 +17,13 @@
...
@@ -16,11 +17,13 @@
@property
(
atomic
)
Boolean
execdTask
;
@property
(
atomic
)
Boolean
execdTask
;
@end
@end
@implementation
GengmeiFlutterPlugin
@implementation
GengmeiFlutterPlugin
{}
NSMutableArray
<
AlbumItem
*>
*
assetCollectionList
;
NSMutableArray
<
AlbumItem
*>
*
assetCollectionList
;
UIViewController
*
viewController
;
UIViewController
*
viewController
;
dispatch_queue_t
queue
;
dispatch_queue_t
queue
;
NSObject
<
FlutterPluginRegistrar
>*
resign
;
+
(
void
)
registerWithRegistrar
:(
NSObject
<
FlutterPluginRegistrar
>*
)
registrar
{
+
(
void
)
registerWithRegistrar
:(
NSObject
<
FlutterPluginRegistrar
>*
)
registrar
{
resign
=
registrar
;
FlutterMethodChannel
*
channel
=
[
FlutterMethodChannel
FlutterMethodChannel
*
channel
=
[
FlutterMethodChannel
methodChannelWithName
:
@"gengmei_flutter_plugin"
methodChannelWithName
:
@"gengmei_flutter_plugin"
binaryMessenger
:[
registrar
messenger
]];
binaryMessenger
:[
registrar
messenger
]];
...
@@ -29,8 +32,26 @@ dispatch_queue_t queue;
...
@@ -29,8 +32,26 @@ dispatch_queue_t queue;
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
);
FlutterEventChannel
*
chargingChannel
=
[
FlutterEventChannel
eventChannelWithName
:
@"gengmei_flutter_plugin_event"
binaryMessenger
:[
resign
messenger
]];
[
chargingChannel
setStreamHandler
:
instance
];
}
}
-
(
instancetype
)
init
{
self
=
[
super
init
];
if
(
self
)
{
NSLog
(
@"INITT"
);
FlutterEventChannel
*
chargingChannel
=
[
FlutterEventChannel
eventChannelWithName
:
@"gengmei_flutter_plugin_event"
binaryMessenger
:[
resign
messenger
]];
[
chargingChannel
setStreamHandler
:
self
];
}
return
self
;
}
-
(
void
)
handleMethodCall
:
(
FlutterMethodCall
*
)
call
result
:
(
FlutterResult
)
result
{
-
(
void
)
handleMethodCall
:
(
FlutterMethodCall
*
)
call
result
:
(
FlutterResult
)
result
{
self
.
resultKey
++
;
self
.
resultKey
++
;
[[
ResultManager
sharedSingleton
]
addResult
:[
NSNumber
numberWithLong
:
self
.
resultKey
]
:
result
];
[[
ResultManager
sharedSingleton
]
addResult
:[
NSNumber
numberWithLong
:
self
.
resultKey
]
:
result
];
...
@@ -314,17 +335,20 @@ dispatch_queue_t queue;
...
@@ -314,17 +335,20 @@ dispatch_queue_t queue;
for
(
int
i
=
0
;
i
<
[
assetResult
count
];
i
++
)
{
for
(
int
i
=
0
;
i
<
[
assetResult
count
];
i
++
)
{
__block
NSString
*
docName
=
[
item
collectionTitle
];
__block
NSString
*
docName
=
[
item
collectionTitle
];
PHAsset
*
assets
=
[
assetResult
objectAtIndex
:
i
];
PHAsset
*
assets
=
[
assetResult
objectAtIndex
:
i
];
NSString
*
imgName
=
[
assets
valueForKey
:
@"filename"
];
__block
NSString
*
imgName
=
[
assets
valueForKey
:
@"filename"
];
NSString
*
imgRealName
=
[
NSString
stringWithFormat
:
@"%@_REAL"
,
imgName
];
if
(
imgName
==
nil
)
{
if
(
imgName
==
nil
)
{
NSLog
(
@"NEWWWW!!!!! image name is Null!!! "
);
NSLog
(
@"NEWWWW!!!!! image name is Null!!! "
);
NSString
*
timeSp
=
[
NSString
stringWithFormat
:
@"%ld"
,
(
long
)([[
NSDate
date
]
timeIntervalSince1970
]
*
100000
)];
NSString
*
timeSp
=
[
NSString
stringWithFormat
:
@"%ld"
,
(
long
)([[
NSDate
date
]
timeIntervalSince1970
]
*
100000
)];
imgName
=
[
NSString
stringWithFormat
:
@"IMG_%"
,
timeSp
];
imgName
=
[
NSString
stringWithFormat
:
@"IMG_%@"
,
timeSp
];
imgRealName
=
[
NSString
stringWithFormat
:
@"REAL_PATH_IMG_%@"
,
timeSp
];
}
}
__block
NSString
*
tmpPath
=
[
cacheDirectory
stringByAppendingPathComponent
:
imgName
];
__block
NSString
*
tmpPath
=
[
cacheDirectory
stringByAppendingPathComponent
:
imgName
];
if
([
fileManager
fileExistsAtPath
:
tmpPath
]
==
YES
){
__block
NSString
*
realPath
=
[
cacheDirectory
stringByAppendingPathComponent
:
imgRealName
];
if
([
fileManager
fileExistsAtPath
:
tmpPath
]
==
YES
&&
[
fileManager
fileExistsAtPath
:
realPath
]
&&
false
){
self
.
nowSize
++
;
self
.
nowSize
++
;
NSMutableDictionary
*
queryItemDict
=
[
NSMutableDictionary
dictionary
];
NSMutableDictionary
*
queryItemDict
=
[
NSMutableDictionary
dictionary
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"
p
ath"
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"
realP
ath"
];
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
if
(
arr
==
nil
)
{
if
(
arr
==
nil
)
{
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
...
@@ -339,52 +363,178 @@ dispatch_queue_t queue;
...
@@ -339,52 +363,178 @@ dispatch_queue_t queue;
}
else
{
}
else
{
NSLog
(
@"file NOT EXIT !! "
);
NSLog
(
@"file NOT EXIT !! "
);
PHImageRequestOptions
*
imageRequestOption
=
[[
PHImageRequestOptions
alloc
]
init
];
PHImageRequestOptions
*
imageRequestOption
=
[[
PHImageRequestOptions
alloc
]
init
];
imageRequestOption
.
synchronous
=
YES
;
imageRequestOption
.
synchronous
=
NO
;
int
picWidth
=
[
assets
pixelWidth
];
int
picWidth
=
[
assets
pixelWidth
];
int
picHeight
=
[
assets
pixelHeight
];
int
picHeight
=
[
assets
pixelHeight
];
float
scareSize
=
1
;
// NSLog(@"WIDTH %d %d",picWidth,picHeight);
scareSize
=
340
.
0
/
picWidth
;
// float scareSize=1;
NSLog
(
@"SCARESIZE %d"
,
picWidth
);
float
scareSize
=
1080
.
0
/
picWidth
;
// NSLog(@"SCARESIZE %d",picWidth);
CGSize
size
=
CGSizeMake
(
picWidth
*
scareSize
,
picHeight
*
scareSize
);
CGSize
size
=
CGSizeMake
(
picWidth
*
scareSize
,
picHeight
*
scareSize
);
float
tempScareSize
=
320
.
0
/
picWidth
;
CGSize
temp
=
CGSizeMake
(
picWidth
*
tempScareSize
,
picHeight
*
tempScareSize
);
imageRequestOption
.
networkAccessAllowed
=
YES
;
imageRequestOption
.
networkAccessAllowed
=
YES
;
imageRequestOption
.
deliveryMode
=
PHImageRequestOptionsDeliveryModeHighQualityFormat
;
// imageRequestOption.deliveryMode=PHImageRequestOptionsDeliveryModeHighQualityFormat;
imageRequestOption
.
resizeMode
=
PHImageRequestOptionsResizeModeFast
;
//PHImageManagerMaximumSize
PHImageRequestOptions
*
scareOpt
=
[[
PHImageRequestOptions
alloc
]
init
];
scareOpt
.
networkAccessAllowed
=
YES
;
scareOpt
.
deliveryMode
=
PHImageRequestOptionsDeliveryModeFastFormat
;
scareOpt
.
synchronous
=
NO
;
scareOpt
.
resizeMode
=
PHImageRequestOptionsResizeModeFast
;
scareOpt
.
version
=
PHImageRequestOptionsVersionUnadjusted
;
[[
PHImageManager
defaultManager
]
requestImageForAsset
:
assets
targetSize
:
size
contentMode
:
PHImageContentModeDefault
options
:
imageRequestOption
resultHandler
:^
(
UIImage
*
_Nullable
result
,
NSDictionary
*
_Nullable
info
)
{
[[
PHImageManager
defaultManager
]
requestImageForAsset
:
assets
targetSize
:
size
contentMode
:
PHImageContentModeDefault
options
:
imageRequestOption
resultHandler
:^
(
UIImage
*
_Nullable
result
,
NSDictionary
*
_Nullable
info
)
{
// NSLog(@"INITTT___))))00000 %d %d %@",i,[assetResult count],info);
// NSLog(@"INITTT___))))00000 %d %d %@",i,[assetResult count],info);
// NSURL * url = [info objectForKey:@"PHImageFileURLKey"];
// NSURL * url = [info objectForKey:@"PHImageFileURLKey"];
// UIImage *getImage = [UIImage imageWithContentsOfFile:file];
// UIImage *getImage = [UIImage imageWithContentsOfFile:file];
NSData
*
data
;
// UIImageJPEGRepresentation(result,1)
if
(
UIImagePNGRepresentation
(
result
)
==
nil
){
[
UIImageJPEGRepresentation
(
result
,
1
)
writeToFile
:
realPath
atomically
:
YES
];
data
=
UIImageJPEGRepresentation
(
result
,
1
);
[
UIImageJPEGRepresentation
([
self
image
:
result
byScalingToSize
:
temp
],
0
.
8
)
writeToFile
:
realPath
atomically
:
YES
];
}
else
{
NSMutableDictionary
*
queryItemDict
=
[
NSMutableDictionary
dictionary
];
data
=
UIImagePNGRepresentation
(
result
);
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
imgName
forKey
:
@"name"
];
[
queryItemDict
setObject
:
realPath
forKey
:
@"realPath"
];
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
self
.
nowSize
++
;
if
(
arr
==
nil
)
{
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
else
{
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
}
if
([[
NSFileManager
defaultManager
]
createFileAtPath
:
tmpPath
contents
:
data
attributes
:
nil
])
{
NSLog
(
@"result %@"
,
tmpPath
);
self
.
nowSize
++
;
NSMutableDictionary
*
queryItemDict
=
[
NSMutableDictionary
dictionary
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
if
(
arr
==
nil
)
{
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
else
{
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
NSLog
(
@"SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
NSLog
(
@"SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
if
(
self
.
nowSize
==
self
.
needSize
)
{
if
(
self
.
nowSize
==
self
.
needSize
)
{
[
self
resultImgs
:
resultId
];
[
self
resultImgs
:
resultId
];
}
}
else
{
NSLog
(
@"ERRORRRR "
);
self
.
needSize
--
;
}
}
// CFAbsoluteTime startTime =CFAbsoluteTimeGetCurrent();
// NSData * data=UIImageJPEGRepresentation(result,0.8);
// if(data==nil){
// NSLog(@"DATAISNULL");
// data=UIImagePNGRepresentation(result);
// }
// [data writeToFile:realPath atomically:YES];
// CFAbsoluteTime linkTime = (CFAbsoluteTimeGetCurrent() - startTime);
// NSLog(@"Linked in %f ms", linkTime *1000.0);
// UIImage * scareData=[self image:result byScalingToSize:size];
// [data writeToFile:realPath atomically:YES];
//
// if ([[NSFileManager defaultManager] createFileAtPath:realPath contents:data attributes:nil]){
//
// }
// UIImage * scareData=[self image:result byScalingToSize:size];
// NSData *data;
// if (UIImagePNGRepresentation(scareData) == nil){
// data = UIImageJPEGRepresentation(scareData, 1);
// } else {
// data = UIImagePNGRepresentation(scareData);
// }
// if ([[NSFileManager defaultManager] createFileAtPath:realPath contents:data attributes:nil]) {
// if ([[NSFileManager defaultManager] createFileAtPath:tmpPath contents:scareData attributes:nil]) {
// NSLog(@"result %@",tmpPath);
// self.nowSize++;
// NSMutableDictionary* queryItemDict = [NSMutableDictionary dictionary];
// [queryItemDict setObject:tmpPath forKey:@"path"];
// [queryItemDict setObject:realPath forKey:@"realPath"];
// NSMutableArray * arr=self.finalMap[docName];
// if (arr==nil) {
// self.finalMap[docName]=[NSMutableArray array];
// [self.finalMap[docName] addObject:queryItemDict];
// }else{
// [self.finalMap[docName] addObject:queryItemDict];
// }
// NSLog(@"SIZEEE %d %d ",self.nowSize,self.needSize);
// if (self.nowSize==self.needSize) {
// [self resultImgs:resultId];
// }
// }else{
// NSLog(@"ERRORRRR ");
// self.needSize--;
// }
// } else {
// NSLog(@"ERRORRRR ");
// self.needSize--;
// }
}];
}];
}
}
}
}
}
}
}
}
-
(
UIImage
*
)
image
:
(
UIImage
*
)
image
byScalingToSize
:
(
CGSize
)
targetSize
{
UIImage
*
sourceImage
=
image
;
UIImage
*
newImage
=
nil
;
UIGraphicsBeginImageContext
(
targetSize
);
CGRect
thumbnailRect
=
CGRectZero
;
thumbnailRect
.
origin
=
CGPointZero
;
thumbnailRect
.
size
.
width
=
targetSize
.
width
;
thumbnailRect
.
size
.
height
=
targetSize
.
height
;
[
sourceImage
drawInRect
:
thumbnailRect
];
newImage
=
UIGraphicsGetImageFromCurrentImageContext
();
UIGraphicsEndImageContext
();
return
newImage
;
}
-
(
NSData
*
)
compressWithLengthLimit
:
(
UIImage
*
)
img
max
:
(
NSUInteger
)
maxLength
{
// Compress by quality
CGFloat
compression
=
1
;
NSData
*
data
=
UIImageJPEGRepresentation
(
img
,
compression
);
//NSLog(@"Before compressing quality, image size = %ld KB",data.length/1024);
if
(
data
.
length
<
maxLength
)
return
data
;
CGFloat
max
=
1
;
CGFloat
min
=
0
;
for
(
int
i
=
0
;
i
<
6
;
++
i
)
{
compression
=
(
max
+
min
)
/
2
;
data
=
UIImageJPEGRepresentation
(
img
,
compression
);
//NSLog(@"Compression = %.1f", compression);
//NSLog(@"In compressing quality loop, image size = %ld KB", data.length / 1024);
if
(
data
.
length
<
maxLength
*
0
.
9
)
{
min
=
compression
;
}
else
if
(
data
.
length
>
maxLength
)
{
max
=
compression
;
}
else
{
break
;
}
}
//NSLog(@"After compressing quality, image size = %ld KB", data.length / 1024);
if
(
data
.
length
<
maxLength
)
return
data
;
UIImage
*
resultImage
=
[
UIImage
imageWithData
:
data
];
// Compress by size
NSUInteger
lastDataLength
=
0
;
while
(
data
.
length
>
maxLength
&&
data
.
length
!=
lastDataLength
)
{
lastDataLength
=
data
.
length
;
CGFloat
ratio
=
(
CGFloat
)
maxLength
/
data
.
length
;
//NSLog(@"Ratio = %.1f", ratio);
CGSize
size
=
CGSizeMake
((
NSUInteger
)(
resultImage
.
size
.
width
*
sqrtf
(
ratio
)),
(
NSUInteger
)(
resultImage
.
size
.
height
*
sqrtf
(
ratio
)));
// Use NSUInteger to prevent white blank
UIGraphicsBeginImageContext
(
size
);
[
resultImage
drawInRect
:
CGRectMake
(
0
,
0
,
size
.
width
,
size
.
height
)];
resultImage
=
UIGraphicsGetImageFromCurrentImageContext
();
UIGraphicsEndImageContext
();
data
=
UIImageJPEGRepresentation
(
resultImage
,
compression
);
//NSLog(@"In compressing size loop, image size = %ld KB", data.length / 1024);
}
//NSLog(@"After compressing size loop, image size = %ld KB", data.length / 1024);
return
data
;
}
-
(
NSMutableDictionary
*
)
useToFetchCollection
{
-
(
NSMutableDictionary
*
)
useToFetchCollection
{
NSMutableDictionary
*
queryItemDict
=
[
NSMutableDictionary
dictionary
];
NSMutableDictionary
*
queryItemDict
=
[
NSMutableDictionary
dictionary
];
PHFetchResult
<
PHAssetCollection
*>
*
collectionResult
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeMoment
subtype
:
PHAssetCollectionSubtypeSmartAlbumFavorites
options
:
nil
];
PHFetchResult
<
PHAssetCollection
*>
*
collectionResult
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeMoment
subtype
:
PHAssetCollectionSubtypeSmartAlbumFavorites
options
:
nil
];
...
@@ -464,4 +614,18 @@ dispatch_queue_t queue;
...
@@ -464,4 +614,18 @@ dispatch_queue_t queue;
}
}
}
}
FlutterEventSink
_eventSink
;
-
(
FlutterError
*
)
onListenWithArguments
:(
id
)
arguments
eventSink
:(
FlutterEventSink
)
eventSink
{
NSLog
(
@"QWEQWEQEW"
);
_eventSink
=
eventSink
;
return
nil
;
}
-
(
FlutterError
*
)
onCancelWithArguments
:(
id
)
arguments
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
_eventSink
=
nil
;
NSLog
(
@"QWEQWEQEW"
);
return
nil
;
}
@end
@end
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