gpt4 book ai didi

flutter 谷歌地方 : Unhandled Exception: Null check operator used on a null value

转载 作者:行者123 更新时间:2023-12-04 07:37:32 60 4
gpt4 key购买 nike

我正在使用 google map 开发应用程序和 google places .
当我打电话时PlacesAutocomplete.show() ,它给出了以下错误消息。 Null check operator used on a null value

  • pubspec.yaml
    environment:
    sdk: ">=2.7.0 <3.0.0"

    dependencies:
    google_maps_flutter: ^2.0.5
    flutter_polyline_points: ^1.0.0
    location: ^4.1.1
    flutter_google_places: ^0.3.0
  • 称呼
    InkWell(
    onTap: () async {
    Prediction p = await PlacesAutocomplete.show(
    context: context,
    apiKey: GOOGLE_API_KEY,
    );
    }, child: Text("SHOW")
    ),

  • screenshot
    提前致谢。

    最佳答案

    您需要提供函数 .show 的所有必需和非空参数。类似的东西:

    Prediction p = await PlacesAutocomplete.show(
    offset: 0,
    radius: 1000,
    strictbounds: false,
    region: "us",
    language: "en",
    context: context,
    mode: Mode.overlay,
    apiKey: Env.googleapikey,
    sessionToken: sessionToken,
    components: [new Component(Component.country, "us")],
    types: ["(cities)"],
    hint: "Search City",
    startText: city == null || city == "" ? "" : city
    );

    关于 flutter 谷歌地方 : Unhandled Exception: Null check operator used on a null value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67666215/

    60 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com