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
14a8a5b0
Commit
14a8a5b0
authored
Oct 09, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
11f928f7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
85 deletions
+90
-85
workspace.xml
.idea/workspace.xml
+37
-22
ImageRespository.kt
...flutter_plugin/ImagePlugin/repository/ImageRespository.kt
+2
-2
Engine.kt
...mei_flutter_plugin/ImagePlugin/repository/luban/Engine.kt
+1
-1
main.dart
example/lib/main.dart
+32
-32
GengmeiFlutterPlugin.m
ios/Classes/GengmeiFlutterPlugin.m
+18
-28
No files found.
.idea/workspace.xml
View file @
14a8a5b0
...
...
@@ -6,10 +6,7 @@
</component>
<component
name=
"ChangeListManager"
>
<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$/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/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/main.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/lib/main.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
afterDir=
"false"
/>
</list>
<ignored
path=
"$PROJECT_DIR$/.dart_tool/"
/>
...
...
@@ -30,18 +27,25 @@
<component
name=
"ExecutionTargetManager"
SELECTED_TARGET=
"AKC0218316000622"
/>
<component
name=
"FileEditorManager"
>
<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$/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"
/>
<caret
line=
"238"
column=
"5"
selection-start-line=
"238"
selection-start-column=
"5"
selection-end-line=
"238"
selection-end-column=
"5"
/>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/Image/AlbumItem.m"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
<file
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/main.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"493"
>
<caret
line=
"54"
column=
"9"
selection-start-line=
"54"
selection-start-column=
"9"
selection-end-line=
"54"
selection-end-column=
"9"
/>
<folding>
<element
signature=
"e#0#17#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
...
...
@@ -148,16 +152,16 @@
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
/>
<option
value=
"$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
/>
<option
value=
"$PROJECT_DIR$/lib/SharedPlugin.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/main.dart"
/>
<option
value=
"$PROJECT_DIR$/pubspec.yaml"
/>
<option
value=
"$PROJECT_DIR$/lib/A.dart"
/>
<option
value=
"$PROJECT_DIR$/android/build.gradle"
/>
<option
value=
"$PROJECT_DIR$/.gitignore"
/>
<option
value=
"$PROJECT_DIR$/example/lib/main.dart"
/>
</list>
</option>
</component>
<component
name=
"ProjectFrameBounds"
extendedState=
"6"
>
<option
name=
"x"
value=
"
329
"
/>
<option
name=
"x"
value=
"
-41
"
/>
<option
name=
"y"
value=
"-1080"
/>
<option
name=
"width"
value=
"1920"
/>
<option
name=
"height"
value=
"1080"
/>
...
...
@@ -193,6 +197,17 @@
<item
name=
"main"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"example"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"example"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"lib"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
...
...
@@ -389,16 +404,6 @@
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/bean/DirBean.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/lib/main.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"1012"
>
<caret
line=
"46"
column=
"54"
selection-start-line=
"46"
selection-start-column=
"54"
selection-end-line=
"46"
selection-end-column=
"54"
/>
<folding>
<element
signature=
"e#0#17#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/android/src/main/kotlin/com/example/gengmei_flutter_plugin/sharedPrefernces/SharedManager.kt"
/>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
...
...
@@ -539,7 +544,17 @@
<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"
/>
<caret
line=
"238"
column=
"5"
selection-start-line=
"238"
selection-start-column=
"5"
selection-end-line=
"238"
selection-end-column=
"5"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/lib/main.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"493"
>
<caret
line=
"54"
column=
"9"
selection-start-line=
"54"
selection-start-column=
"9"
selection-end-line=
"54"
selection-end-column=
"9"
/>
<folding>
<element
signature=
"e#0#17#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
...
...
android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/ImageRespository.kt
View file @
14a8a5b0
...
...
@@ -49,7 +49,7 @@ class ImageRespository {
fun
savePreviewImg
(
context
:
Context
,
listener
:
savePreviewListener
)
{
val
needSize
=
recordImageListMap
.
size
;
var
currentSize
=
0
;
var
letSize
=
3
0
var
letSize
=
1
0
var
noPathSize
=
0
;
recordImageListMap
.
forEach
{
val
any
=
it
[
"path"
]
...
...
@@ -69,7 +69,7 @@ class ImageRespository {
listener
.
onSuccess
(
toMap
(
context
,
recordImageListMap
))
}
else
{
if
(
noPathSize
>
letSize
)
{
letSize
+=
30
letSize
+=
15
listener
.
onSuccess
(
toMap
(
context
,
recordImageListMap
))
}
}
...
...
android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/luban/Engine.kt
View file @
14a8a5b0
...
...
@@ -70,7 +70,7 @@ constructor(private val srcImg: InputStreamProvider, private val tagImgPath: Str
if
(
quality
==
100
)
{
options
.
inSampleSize
=
computeSize
()
}
else
{
options
.
inSampleSize
=
(
srcWidth
/
2
4
0
).
toInt
();
options
.
inSampleSize
=
(
srcWidth
/
2
0
0
).
toInt
();
}
// Log.e("lsy"," SAMPLE SIZE ${options.inSampleSize} ${srcWidth}")
...
...
example/lib/main.dart
View file @
14a8a5b0
...
...
@@ -21,38 +21,38 @@ class _MyAppState extends State<MyApp> {
void
initState
()
{
super
.
initState
();
GengmeiFlutterPlugin
.
saveInt
(
"INT"
,
5
);
GengmeiFlutterPlugin
.
saveString
(
"STRINGQW"
,
"qwe"
);
GengmeiFlutterPlugin
.
saveDouble
(
"DOUBLE"
,
2.888
);
GengmeiFlutterPlugin
.
saveBool
(
"BOOLEAN"
,
false
);
List
<
String
>
set
=
new
List
();
set
.
add
(
"ww"
);
set
.
add
(
"qq"
);
set
.
add
(
"ww"
);
set
.
add
(
"ee"
);
set
.
add
(
"qwe"
);
set
.
add
(
"ewq"
);
set
.
add
(
"ppoo"
);
GengmeiFlutterPlugin
.
saveStringList
(
"LIST"
,
set
).
then
((
value
)
{
print
(
"SAVE
$value
"
);
});
GengmeiFlutterPlugin
.
getStringList
(
"LIST"
,
null
).
then
((
value
)
{
print
(
"LIST
$value
"
);
});
GengmeiFlutterPlugin
.
getInt
(
"INT"
,
0
).
then
((
value
)
{
print
(
"INT
$value
"
);
});
GengmeiFlutterPlugin
.
getString
(
"STRINGeqweq"
,
null
).
then
((
value
)
{
print
(
"STRING
$value
"
);
});
GengmeiFlutterPlugin
.
getDouble
(
"DOUBLE"
,
1.1
).
then
((
value
)
{
print
(
"DOUBLEEE
$value
"
);
});
GengmeiFlutterPlugin
.
getbool
(
"BOOLEAN"
,
false
).
then
((
value
)
{
print
(
"BOOL
$value
"
);
});
//
GengmeiFlutterPlugin.saveInt("INT", 5);
//
GengmeiFlutterPlugin.saveString("STRINGQW", "qwe");
//
GengmeiFlutterPlugin.saveDouble("DOUBLE", 2.888);
//
GengmeiFlutterPlugin.saveBool("BOOLEAN", false);
//
List<String> set = new List();
//
set.add("ww");
//
set.add("qq");
//
set.add("ww");
//
set.add("ee");
//
set.add("qwe");
//
set.add("ewq");
//
set.add("ppoo");
//
GengmeiFlutterPlugin.saveStringList("LIST", set).then((value) {
//
print("SAVE $value");
//
});
//
//
GengmeiFlutterPlugin.getStringList("LIST", null).then((value) {
//
print("LIST $value");
//
});
//
//
GengmeiFlutterPlugin.getInt("INT", 0).then((value) {
//
print("INT $value");
//
});
//
GengmeiFlutterPlugin.getString("STRINGeqweq", null).then((value) {
//
print("STRING $value");
//
});
//
GengmeiFlutterPlugin.getDouble("DOUBLE", 1.1).then((value) {
//
print("DOUBLEEE $value");
//
});
//
GengmeiFlutterPlugin.getbool("BOOLEAN", false).then((value) {
//
print("BOOL $value");
//
});
// GengmeiFlutterPlugin.saveStringList("LIST", ["ww"]);
...
...
ios/Classes/GengmeiFlutterPlugin.m
View file @
14a8a5b0
...
...
@@ -4,7 +4,7 @@
#import "Image/AlbumItem.h"
#import "ResultManager.h"
@interface
GengmeiFlutterPlugin
()
<
UIActionSheetDelegate
,
UIImagePickerControllerDelegate
,
UINavigationControllerDelegate
,
FlutterStreamHandler
>
//一定要声明这三个协议,缺一不可
@interface
GengmeiFlutterPlugin
()
<
UIActionSheetDelegate
,
UIImagePickerControllerDelegate
,
UINavigationControllerDelegate
,
FlutterStreamHandler
>
//一定要声明这三个协议,缺一不可
//@property(nonatomic)FlutterResult result;
@property
(
atomic
)
int
needSize
;
@property
(
nonatomic
)
int
nowSize
;
...
...
@@ -17,38 +17,29 @@
@property
(
atomic
)
Boolean
execdTask
;
@end
@implementation
GengmeiFlutterPlugin
{}
@implementation
GengmeiFlutterPlugin
{
FlutterEventSink
_eventSink
;
}
NSMutableArray
<
AlbumItem
*>
*
assetCollectionList
;
UIViewController
*
viewController
;
dispatch_queue_t
queue
;
NSObject
<
FlutterPluginRegistrar
>*
resign
;
+
(
void
)
registerWithRegistrar
:(
NSObject
<
FlutterPluginRegistrar
>*
)
registrar
{
resign
=
registrar
;
GengmeiFlutterPlugin
*
instance
=
[[
GengmeiFlutterPlugin
alloc
]
init
];
// resign=registrar;
FlutterMethodChannel
*
channel
=
[
FlutterMethodChannel
methodChannelWithName
:
@"gengmei_flutter_plugin"
binaryMessenger
:[
registrar
messenger
]];
GengmeiFlutterPlugin
*
instance
=
[[
GengmeiFlutterPlugin
alloc
]
init
];
[
registrar
addMethodCallDelegate
:
instance
channel
:
channel
];
assetCollectionList
=
[
NSMutableArray
array
];
viewController
=
[
UIApplication
sharedApplication
].
delegate
.
window
.
rootViewController
;
queue
=
dispatch_queue_create
(
"com.gengmei_flutter_plugin"
,
DISPATCH_QUEUE_CONCURRENT
);
FlutterEventChannel
*
chargingChannel
=
[
FlutterEventChannel
eventChannelWithName
:
@"gengmei_flutter_plugin_event"
binaryMessenger
:[
re
sign
messenger
]];
binaryMessenger
:[
re
gistrar
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
;
}
...
...
@@ -608,24 +599,23 @@ NSObject<FlutterPluginRegistrar>* resign;
NSMutableArray
*
dirArray
=
[[
NSMutableArray
alloc
]
init
];
//在上面那段程序中获得的fileList中列出文件夹名
for
(
NSString
*
file
in
fileList
)
{
NSString
*
path
=
[
tmpDirectory
stringByAppendingPathComponent
:
file
];
NSLog
(
@"patH!!! %@"
,
path
);
}
for
(
NSString
*
file
in
fileList
)
{
NSString
*
path
=
[
tmpDirectory
stringByAppendingPathComponent
:
file
];
NSLog
(
@"patH!!! %@"
,
path
);
}
}
FlutterEventSink
_eventSink
;
-
(
FlutterError
*
)
onListenWithArguments
:(
id
)
arguments
eventSink
:(
FlutterEventSink
)
eventSink
{
//FlutterEventSink _eventSink;
-
(
FlutterError
*
_Nullable
)
onListenWithArguments
:
(
id
_Nullable
)
arguments
eventSink
:
(
FlutterEventSink
)
events
{
NSLog
(
@"QWEQWEQEW"
);
_eventSink
=
eventSink
;
// _eventSink = events
;
return
nil
;
}
-
(
FlutterError
*
)
onCancelWithArguments
:(
id
)
arguments
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
-
(
FlutterError
*
_Nullable
)
onCancelWithArguments
:
(
id
_Nullable
)
arguments
{
_eventSink
=
nil
;
NSLog
(
@"QWEQWEQEW"
);
return
nil
;
}
@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