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); NSLog(@"notification dic: %@", remoteNotification);
FlutterMethodChannel* bridgeAppChannel = [FlutterMethodChannel methodChannelWithName:@"bridge" binaryMessenger:(NSObject<FlutterBinaryMessenger> *)controller]; FlutterMethodChannel* bridgeAppChannel = [FlutterMethodChannel methodChannelWithName:@"bridge" binaryMessenger:(NSObject<FlutterBinaryMessenger> *)controller];
@ -81,6 +81,7 @@
if ([method isEqual:@"action"]) { if ([method isEqual:@"action"]) {
if (remoteNotification != NULL) { if (remoteNotification != NULL) {
result(remoteNotification[@"custom"]); result(remoteNotification[@"custom"]);
remoteNotification = nil;
} }
result(@""); result(@"");
} }

12
lib/address/address_map_page.dart

@ -1,5 +1,6 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'dart:ui';
import 'package:android_intent_plus/android_intent.dart'; import 'package:android_intent_plus/android_intent.dart';
import 'package:dio/dio.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_wid: ${MediaQuery.of(context).size.width}");
print("map_hei: ${MediaQuery.of(context).size.height}"); print("map_hei: ${MediaQuery.of(context).size.height}");
bmfMarker = BMFMarker( bmfMarker = BMFMarker(
position: latLng, position: latLng,
screenPointToLock: BMFPoint(MediaQuery.of(context).size.width / 2, screenPointToLock: BMFPoint(window.physicalSize.width / 2,
MediaQuery.of(context).size.height / 4), window.physicalSize.height / 4),
isLockedToScreen: true, isLockedToScreen: true,
centerOffset: BMFPoint(0.5, 0.9), centerOffset: BMFPoint(1, 1),
enabled: false, enabled: false,
icon: "assets/image/icon_map_marker.png", icon: "assets/image/icon_map_marker.png",
draggable: false, draggable: false,
@ -294,8 +296,8 @@ class _AddressMapPage extends State<AddressMapPage> {
} }
bmfMarker.updateIsLockedToScreen( bmfMarker.updateIsLockedToScreen(
true, true,
BMFPoint(MediaQuery.of(context).size.width / 2, BMFPoint(window.physicalSize.width / 2,
MediaQuery.of(context).size.height / 4)); window.physicalSize.height / 4));
} }
saveLatLng(BMFCoordinate latLng) async { saveLatLng(BMFCoordinate latLng) async {

2
lib/main.dart

@ -120,7 +120,7 @@ initSdk() async {
if(Platform.isIOS){ if(Platform.isIOS){
LocationFlutterPlugin.setApiKey("ylW2QPlsbERkho7jOgU4GQSeawmdUIoR"); LocationFlutterPlugin.setApiKey("ylW2QPlsbERkho7jOgU4GQSeawmdUIoR");
BMFMapSDK.setApiKeyAndCoordType( BMFMapSDK.setApiKeyAndCoordType(
'7IACaFNxOX2EMauupIZisjI8XSxe09ER', BMF_COORD_TYPE.BD09LL); '7IACaFNxOX2EMauupIZisjI8XSxe09ER', BMF_COORD_TYPE.COMMON);
} else if(Platform.isAndroid) { } else if(Platform.isAndroid) {
BMFMapSDK.setCoordType(BMF_COORD_TYPE.COMMON); 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:permission_handler/permission_handler.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'dart:typed_data';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.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( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -665,6 +661,9 @@ class _UnionPage extends State<UnionPage>
), ),
], ],
), ),
SizedBox(
height: 4.h,
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

Loading…
Cancel
Save