颤振:showLocationPicker 不起作用

时间:2021-05-17 22:26:50

标签: flutter google-maps dart google-cloud-platform

我正在尝试使用 showLocationPicker 但搜索不起作用,并且任何地方的名称都像这张图片一样未命名

enter image description here

这是我的控制台

<块引用>

W/PlatformViewsController(22275):创建大小的虚拟显示: [1080, 2301] 可能会导致 问题(https://github.com/flutter/flutter/issues/2897)。它更大 比设备屏幕尺寸:[1080, 2218]。我/对话(22275): mIsSamsungBasicInteraction = false,isMetaDataInActivity = false I/Google Maps Android API(22275):Google Play 服务包 版本:211515046 I/System.out(22275):(HTTPLog)-静态: isSBSettingEnabled false I/System.out(22275): (HTTPLog)-静态: isSBSettingEnabled false I/System.out(22275): (HTTPLog)-静态: isSBSettingEnabled false I/System.out(22275): (HTTPLog)-静态: isSBSettingEnabled false I/DecorView(22275): [INFO] isPopOver=false, config=false I/DecorView(22275): updateCaptionType >> DecorView@56c47a[], isFloating=false, isApplication=false, hasWindowDecorCaption=false,hasWindowControllerCallback=false D/DecorView(22275): setCaptionType = 0, this = DecorView@56c47a[] D/InputTransport(22275):输入通道构造:'d51b19e',fd=118 I/ViewRootImpl@a21ad34MainActivity: setView = com.android.internal.policy.DecorView@56c47a TM=true I/SurfaceView(22275): onWindowVisibilityChanged(0) true com.google.maps.api.android.lib6.gmm6.api.at{e69cda3 VFE...C.. ......ID 0,0-0,0} 的 ViewRootImpl@a21ad34[MainActivity] I/ViewRootImpl@a21ad34MainActivity:Relayout 返回: 旧=(0,0,1080,2301) 新=(0,0,1080,2301) req=(1080,2301)0 dur=9 res=0x7 s={true 542107345360} ch=true fn=-1 I/SurfaceView(22275): 窗口停止(假)真 com.google.maps.api.android.lib6.gmm6.api.at{e69cda3 VFE...C.. ......ID 0,0-0,0} 的 ViewRootImpl@a21ad34[MainActivity] I/ViewRootImpl@a21ad34MainActivity: [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:10761 android.view.ViewRootImpl.performTraversals:3733 android.view.ViewRootImpl.doTraversal:2519 I/SurfaceView(22275): 更新表面:可见 = 真 mSurface.isValid() = 真 I/SurfaceView(22275): updateSurface: mSurfaceCreated = false surfaceChanged = true visibleChanged = true I/SurfaceView(22275): 表面创建 1 #8 com.google.maps.api.android.lib6.gmm6.api.at{e69cda3 VFE...C.. ......ID 0,0-1080,2301} I/SurfaceView(22275):surfaceChanged (1080,2301) 1 #8 com.google.maps.api.android.lib6.gmm6.api.at{e69cda3 VFE...C... ......ID 0,0-1080,2301} I/ViewRootImpl@a21ad34MainActivity: [DP] dp(2) 1 android.view.SurfaceView.updateSurface:1300 android.view.SurfaceView$1.onPreDraw:218 android.view.ViewTreeObserver.dispatchOnPreDraw:1124 I/ViewRootImpl@a21ad34MainActivity: [DP] pdf(1) 1 android.view.SurfaceView.notifyDrawFinished:567 android.view.SurfaceView.performDrawFinished:554 android.view.SurfaceView.lambda$TWz4D2u33ZlAmRtgKzbqqDue3iM:0 I/ViewRootImpl@a21ad34MainActivity: [DP] pd() Asnyc 报告 I/ViewRootImpl@a21ad34MainActivity: [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$performDraw$1$ViewRootImpl:4554 android.view.-$$Lambda$ViewRootImpl$DJd0VUYJgsebcnSohO6h8zc_ONI.run:6 android.os.Handler.handleCallback:938 I/ViewRootImpl@a21ad34MainActivity: [DP] rdf() I/flutter (22275): onCameraIdle#_lastMapPosition = LatLng(0.0, 0.0) I/System.out(22275): (HTTPLog)-Static: isSBSettingEnabled false I/System.out(22275): (HTTPLog)-Static: isSBSettingEnabled false I/flutter (22275): RangeError (index): Invalid value: Valid value 范围为空:0 I/flutter (22275): RangeError (index): Invalid 值:有效值范围为空:0 I/flutter (22275): 包:google_map_location_picker/src/map.dart 99:7 |位置 = 纬度:31.0402895,经度:30.4769815 I/flutter (22275): 包:google_map_location_picker/src/map.dart 117:5 | MapPickerState.moveToCurrentLocation "currentLocation = [LatLng(31.0402895, 30.476981499999994)]" I/flutter (22275): onCameraMoveStarted#_lastMapPosition = LatLng(0.0, 0.0) 带系统 (22275):资源无法调用释放。我/扑(22275): RangeError(索引):无效值:有效值范围为空:0 I/flutter (22275): onCameraIdle#_lastMapPosition = LatLng(31.04029281306172, 30.476981475949287) I/flutter (22275): RangeError (index): Invalid value: Valid value range is empty: 0

这是我在这部分使用的代码

LocationResult result = await showLocationPicker(
                        context,
                        apiKey,
                        initialCenter: LatLng(0, 0),
                        automaticallyAnimateToCurrentLocation: true,
//                      mapStylePath: 'assets/mapStyle.json',
                        myLocationButtonEnabled: true,
                        // requiredGPS: true,
                        layersButtonEnabled: true,
                        language: 'ar',
                        countries: ['SA', 'EG'],
                        resultCardAlignment: Alignment.bottomCenter,
                        desiredAccuracy: LocationAccuracy.best,
                      );
                      print("result = $result");
                      setState(() => _pickedLocation = result);

请注意,我正在控制台中启用此 api:

Android 版地图 SDK iOS 版地图 SDK 地点 API 地理定位 API 地理编码 API

我有结算帐号

0 个答案:

没有答案