diff --git a/ios/Runner/AppDelegate.mm b/ios/Runner/AppDelegate.mm index 005f3a64..4e2d7e3b 100644 --- a/ios/Runner/AppDelegate.mm +++ b/ios/Runner/AppDelegate.mm @@ -72,7 +72,7 @@ }]; // 消息内容获取 - NSDictionary *remoteNotification = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; + __block NSDictionary *remoteNotification = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; NSLog(@"notification dic: %@", remoteNotification); FlutterMethodChannel* bridgeAppChannel = [FlutterMethodChannel methodChannelWithName:@"bridge" binaryMessenger:(NSObject *)controller]; @@ -81,6 +81,7 @@ if ([method isEqual:@"action"]) { if (remoteNotification != NULL) { result(remoteNotification[@"custom"]); + remoteNotification = nil; } result(@""); } diff --git a/lib/address/address_map_page.dart b/lib/address/address_map_page.dart index 5b9b153a..2dc06eae 100644 --- a/lib/address/address_map_page.dart +++ b/lib/address/address_map_page.dart @@ -1,5 +1,6 @@ import 'dart:convert'; import 'dart:io'; +import 'dart:ui'; import 'package:android_intent_plus/android_intent.dart'; import 'package:dio/dio.dart'; @@ -280,12 +281,13 @@ class _AddressMapPage extends State { print("map_wid: ${MediaQuery.of(context).size.width}"); print("map_hei: ${MediaQuery.of(context).size.height}"); + bmfMarker = BMFMarker( position: latLng, - screenPointToLock: BMFPoint(MediaQuery.of(context).size.width / 2, - MediaQuery.of(context).size.height / 4), + screenPointToLock: BMFPoint(window.physicalSize.width / 2, + window.physicalSize.height / 4), isLockedToScreen: true, - centerOffset: BMFPoint(0.5, 0.9), + centerOffset: BMFPoint(1, 1), enabled: false, icon: "assets/image/icon_map_marker.png", draggable: false, @@ -294,8 +296,8 @@ class _AddressMapPage extends State { } bmfMarker.updateIsLockedToScreen( true, - BMFPoint(MediaQuery.of(context).size.width / 2, - MediaQuery.of(context).size.height / 4)); + BMFPoint(window.physicalSize.width / 2, + window.physicalSize.height / 4)); } saveLatLng(BMFCoordinate latLng) async { diff --git a/lib/main.dart b/lib/main.dart index c18695fe..d837bc2d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -120,7 +120,7 @@ initSdk() async { if(Platform.isIOS){ LocationFlutterPlugin.setApiKey("ylW2QPlsbERkho7jOgU4GQSeawmdUIoR"); BMFMapSDK.setApiKeyAndCoordType( - '7IACaFNxOX2EMauupIZisjI8XSxe09ER', BMF_COORD_TYPE.BD09LL); + '7IACaFNxOX2EMauupIZisjI8XSxe09ER', BMF_COORD_TYPE.COMMON); } else if(Platform.isAndroid) { BMFMapSDK.setCoordType(BMF_COORD_TYPE.COMMON); } diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 74bd2220..ae9353f4 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -25,7 +25,6 @@ import 'package:huixiang/view_widget/request_permission.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'dart:typed_data'; import 'package:flutter/rendering.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; @@ -624,9 +623,6 @@ class _UnionPage extends State ), ], ), - SizedBox( - height: 4.h, - ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, @@ -665,6 +661,9 @@ class _UnionPage extends State ), ], ), + SizedBox( + height: 4.h, + ), Row( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start,