You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
2.0 KiB
76 lines
2.0 KiB
import 'dart:async'; |
|
import 'dart:io'; |
|
|
|
import 'package:flutter/services.dart'; |
|
|
|
class Min { |
|
static const MethodChannel _channel = const MethodChannel('min'); |
|
|
|
static Future<bool> isInitialize() async { |
|
return await _channel.invokeMethod('isInitialize'); |
|
} |
|
|
|
static Future<bool> isExistsApp(appid) async { |
|
return await _channel |
|
.invokeMethod('isExistsApp', <String, dynamic>{"appid": appid}); |
|
} |
|
|
|
static Future<String> getAppVersionInfo(appid) async { |
|
final String version = await _channel.invokeMethod('getAppVersionInfo', <String, dynamic>{"appid": appid}); |
|
return version; |
|
} |
|
|
|
static Future<String> getAppBasePath(appid) async { |
|
if(Platform.isIOS) { |
|
final String getAppBasePath = await _channel.invokeMethod( |
|
'getAppBasePath', <String, dynamic>{"appid": appid} |
|
); |
|
return getAppBasePath; |
|
} else { |
|
final String getAppBasePath = await _channel.invokeMethod( |
|
'getAppBasePath', |
|
); |
|
return getAppBasePath; |
|
} |
|
} |
|
|
|
static Future<String> runingAppid() async { |
|
final String runingAppid = await _channel.invokeMethod( |
|
'runingAppid', |
|
); |
|
return runingAppid; |
|
} |
|
|
|
static Future<String> currentPageUrl() async { |
|
final String currentPageUrl = await _channel.invokeMethod( |
|
'currentPageUrl', |
|
); |
|
return currentPageUrl; |
|
} |
|
|
|
static Future<bool> closeCurrentApp() async { |
|
final bool isExists = await _channel.invokeMethod('closeCurrentApp'); |
|
return isExists; |
|
} |
|
|
|
static Future<bool> initialize() async { |
|
final bool isInit = await _channel.invokeMethod('initialize'); |
|
return isInit; |
|
} |
|
|
|
static startMin(appid, json) async { |
|
print("startMin: $json"); |
|
_channel.invokeMethod( |
|
'startMin', <String, dynamic>{"appid": appid, "json": json}); |
|
} |
|
|
|
static Future<bool> reloadWgt(appid, wgtPath) async { |
|
final bool isReload = await _channel.invokeMethod( |
|
'reloadWgt', <String, dynamic>{"appid": appid, "wgtPath": wgtPath}); |
|
return isReload; |
|
} |
|
|
|
static clickListener() { |
|
_channel.invokeMethod('clickListener'); |
|
} |
|
}
|
|
|