Browse Source

image

null_safety
fmk 3 years ago
parent
commit
55846bc68a
  1. 3
      ios/Runner/AppDelegate.mm
  2. 12
      lib/address/address_map_page.dart
  3. 2
      lib/main.dart
  4. 7
      lib/union/union_page.dart

3
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<FlutterBinaryMessenger> *)controller];
@ -81,6 +81,7 @@
if ([method isEqual:@"action"]) {
if (remoteNotification != NULL) {
result(remoteNotification[@"custom"]);
remoteNotification = nil;
}
result(@"");
}

12
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<AddressMapPage> {
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<AddressMapPage> {
}
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 {

2
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);
}

7
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<UnionPage>
),
],
),
SizedBox(
height: 4.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
@ -665,6 +661,9 @@ class _UnionPage extends State<UnionPage>
),
],
),
SizedBox(
height: 4.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,

Loading…
Cancel
Save