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
119c7c10
Commit
119c7c10
authored
Jan 08, 2020
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
8ff33dab
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
0 deletions
+67
-0
workspace.xml
.idea/workspace.xml
+0
-0
GengmeiFlutterPlugin.m
ios/Classes/GengmeiFlutterPlugin.m
+51
-0
ScanImagePlugn.dart
lib/ScanImagePlugn.dart
+8
-0
gengmei_flutter_plugin.dart
lib/gengmei_flutter_plugin.dart
+8
-0
No files found.
.idea/workspace.xml
View file @
119c7c10
This diff is collapsed.
Click to expand it.
ios/Classes/GengmeiFlutterPlugin.m
View file @
119c7c10
...
@@ -508,7 +508,58 @@ NSString *cacheDirectory;
...
@@ -508,7 +508,58 @@ NSString *cacheDirectory;
NSLog
(
@"NEED CA<<<<>>>>><<>>"
);
NSLog
(
@"NEED CA<<<<>>>>><<>>"
);
}
}
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultTemp
]
:
@YES
];
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultTemp
]
:
@YES
];
}
else
if
([
@"GET_IOS_IMAGE_DATA"
isEqualToString
:
call
.
method
]){
NSString
*
path
=
call
.
arguments
;
long
resultTemp
=
self
.
resultKey
;
if
(
path
!=
nil
){
if
([[
self
.
scanMap
allKeys
]
containsObject
:
path
]){
PHAsset
*
assets
=
self
.
scanMap
[
path
];
PHImageRequestOptions
*
imageRequestOption
=
[[
PHImageRequestOptions
alloc
]
init
];
imageRequestOption
.
synchronous
=
NO
;
imageRequestOption
.
networkAccessAllowed
=
YES
;
imageRequestOption
.
deliveryMode
=
PHImageRequestOptionsDeliveryModeHighQualityFormat
;
imageRequestOption
.
resizeMode
=
PHImageRequestOptionsResizeModeFast
;
imageRequestOption
.
version
=
PHImageRequestOptionsVersionUnadjusted
;
[[
PHImageManager
defaultManager
]
requestImageDataForAsset
:
assets
options
:
imageRequestOption
resultHandler
:^
(
NSData
*
_Nullable
imageData
,
NSString
*
_Nullable
dataUTI
,
UIImageOrientation
orientation
,
NSDictionary
*
_Nullable
info
)
{
@autoreleasepool
{
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultTemp
]
:
imageData
];
}
}];
}
else
if
([[
self
.
takePhotoMap
allKeys
]
containsObject
:
path
]){
@autoreleasepool
{
NSString
*
realPath
=
self
.
takePhotoMap
[
path
];
NSData
*
data
=
[
NSData
dataWithContentsOfFile
:
realPath
];
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultTemp
]
:
data
];
}
}
else
{
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultTemp
]
:
nil
];
}
}
else
{
}
else
{
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultTemp
]
:
nil
];
}
}
else
if
([
@"GET_IOS_IMAGE_DATA"
isEqualToString
:
call
.
method
]){
NSString
*
path
=
call
.
arguments
;
long
resultTemp
=
self
.
resultKey
;
if
(
path
!=
nil
){
if
([[
self
.
scanMap
allKeys
]
containsObject
:
path
]){
PHAsset
*
assets
=
self
.
scanMap
[
path
];
PHVideoRequestOptions
*
options
=
[[
PHVideoRequestOptions
alloc
]
init
];
options
.
version
=
PHImageRequestOptionsVersionCurrent
;
options
.
networkAccessAllowed
=
true
;
options
.
deliveryMode
=
PHVideoRequestOptionsDeliveryModeAutomatic
;
[[
PHImageManager
defaultManager
]
requestAVAssetForVideo
:
assets
options
:
options
resultHandler
:^
(
AVAsset
*
_Nullable
asset
,
AVAudioMix
*
_Nullable
audioMix
,
NSDictionary
*
_Nullable
info
)
{
AVURLAsset
*
urlAsset
=
(
AVURLAsset
*
)
asset
;
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultTemp
]
:
[
NSString
stringWithFormat
:
@"%@"
,
urlAsset
.
URL
]];
}];
}
else
{
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultTemp
]
:
nil
];
}
}
else
{
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultTemp
]
:
nil
];
}
}
else
{
result
(
FlutterMethodNotImplemented
);
result
(
FlutterMethodNotImplemented
);
}
}
}
}
...
...
lib/ScanImagePlugn.dart
View file @
119c7c10
...
@@ -75,6 +75,14 @@ class ScanImagePlugn {
...
@@ -75,6 +75,14 @@ class ScanImagePlugn {
}
}
}
}
static
Future
getIosImageData
(
MethodChannel
channel
,
String
path
)
async
{
return
await
channel
.
invokeMethod
(
"GET_IOS_IMAGE_DATA"
,
path
);
}
static
Future
getIosVideoData
(
MethodChannel
channel
,
String
path
)
async
{
return
await
channel
.
invokeMethod
(
"GET_IOS_IMAGE_DATA"
,
path
);
}
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 @
119c7c10
...
@@ -49,6 +49,14 @@ class GengmeiFlutterPlugin {
...
@@ -49,6 +49,14 @@ class GengmeiFlutterPlugin {
isVideo
,
path
,
realPath
,
folderName
,
during
,
_channel
);
isVideo
,
path
,
realPath
,
folderName
,
during
,
_channel
);
}
}
static
Future
getIosImageData
(
String
path
)
async
{
return
await
ScanImagePlugn
.
getIosImageData
(
_channel
,
path
);
}
static
Future
getIosVideoData
(
String
path
)
async
{
return
await
ScanImagePlugn
.
getIosVideoData
(
_channel
,
path
);
}
static
Future
<
bool
>
quitPage
()
async
{
static
Future
<
bool
>
quitPage
()
async
{
return
await
ScanImagePlugn
.
quitPage
(
_channel
);
return
await
ScanImagePlugn
.
quitPage
(
_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