Commit 900f5e18 authored by 林生雨's avatar 林生雨

commit

parent 65d6fd04
This diff is collapsed.
......@@ -43,6 +43,7 @@ class GengmeiFlutterPlugin : MethodCallHandler {
private var record: HashMap<String, ArrayList<HashMap<String, Any>>>? = null;
var nativeImage: File? = null
var isTaskingExectured: Boolean = false;
@Volatile
var quit_page = false;
companion object {
......@@ -257,9 +258,11 @@ class GengmeiFlutterPlugin : MethodCallHandler {
fun savePreview() {
ImageRespository.getInstance().savePreviewImg(resign.context().applicationContext, object : ImageRespository.savePreviewListener {
override fun onSuccess(data: HashMap<String, ArrayList<HashMap<String, Any>>>) {
Handler(resign.activeContext().applicationContext.mainLooper).post {
listener?.run {
this.success(data)
if (!quit_page) {
Handler(resign.activeContext().applicationContext.mainLooper).post {
listener?.run {
this.success(data)
}
}
}
}
......
......@@ -21,7 +21,15 @@ class _MyAppState extends State<MyApp> {
void initState() {
super.initState();
// GengmeiFlutterPlugin.saveInt("INT", 5);
// GengmeiFlutterPlugin.clearShare().then((value){
// print("CLEAR ---> $value");
// });
// GengmeiFlutterPlugin.saveInt("INT", 6).then((value){
// print("VALUEEE --> $value");
// });
// GengmeiFlutterPlugin.getInt("INT", 0).then((value){
// print("get VALUEEE --> $value");
// });
// GengmeiFlutterPlugin.saveString("STRINGQW", "qwe");
// GengmeiFlutterPlugin.saveDouble("DOUBLE", 2.888);
// GengmeiFlutterPlugin.saveBool("BOOLEAN", false);
......
......@@ -200,12 +200,28 @@ FlutterEventSink _eventSink;
[[ResultManager sharedSingleton] resultSuccess:[NSNumber numberWithLong:temp] :result];
});
});
}else if([@"CLEAR_SHARE" isEqualToString:call.method]){
long temp=self.resultKey;
dispatch_async(queue, ^{
[self clearAllUserDefaultsData];
dispatch_async(dispatch_get_main_queue(), ^{
[[ResultManager sharedSingleton] resultSuccess:[NSNumber numberWithLong:temp] :@YES];
});
});
}
else{
result(FlutterMethodNotImplemented);
}
}
- (void)clearAllUserDefaultsData {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
NSDictionary *dic = [userDefaults dictionaryRepresentation];
for (id key in dic) {
[userDefaults removeObjectForKey:key];
}
[userDefaults synchronize];
}
-(void)nativeCamera{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment