@ -28,7 +28,8 @@ void main() async {
// await AmapCore.init('');
// await AmapLocation.instance.init(iosKey: '');
JPush jpush = new JPush();
DevUtil.setDev(true);
const isProduct = const bool.fromEnvironment('ISPRODUCT');
DevUtil.setDev(!isProduct);
jpush.addEventHandler(
// 接收通知回调方法。
onReceiveNotification: (Map<String, dynamic> message) async {
@ -13,3 +13,20 @@ build() {
@Task()
clean() => defaultClean();
buildApk() async {
await runAsync('flutter', arguments: [
'build',
'apk',
'--target-platform=android-arm64',
'--dart-define',
'ISPRODUCT=true'
]);
}
buildIos() async {
await runAsync('flutter',
arguments: ['build', 'ios', '--dart-define', 'BUILD_TYPE=PRODUCT']);