Git Product home page Git Product logo

ai_amap's Issues

空安全

什么时候可以支持空安全呀

请求重构

// ignore: must_be_immutable
class AiAMapPlatformWidget extends StatefulWidget {
///
static const String UNSUPPORTED_DESCRIPTION_DEFAULT = "Unsupported platform";
String _unsupportedDescription;
///
/// constructor
AiAMapPlatformWidget({
String unsupportedDescription = UNSUPPORTED_DESCRIPTION_DEFAULT,
}) {
_unsupportedDescription =
unsupportedDescription ?? UNSUPPORTED_DESCRIPTION_DEFAULT;
}
@override
State<StatefulWidget> createState() {
return _AiAMapPlatformState(
unsupportedDescription: _unsupportedDescription);
}
}
///
/// _AiAMapPlatformState
class _AiAMapPlatformState extends State<AiAMapPlatformWidget> {
static const String _viewTypeId = "view_type_id_map_platform_view";
String _unsupportedDescription;
///
/// constructor
_AiAMapPlatformState({

  1. 支持空安全
  2. STF写法不好,不应该向state构造函数手动传参,改成final设变量,state里widget接受

关于1.1.0 IOS 提示 type 'AiAMapLocationPlatformView' does not conform to protocol 'AMapGeoFenceManagerDelegate'

日志如下:
/Users/zhangzhigang/.pub-cache/hosted/pub.flutter-io.cn/ai_amap-1.1.0/ios/Classes/AiAMapLocationPlatformView.swift:17:7: error: type 'AiAMapLocationPlatformView' does not conform to protocol 'AMapGeoFenceManagerDelegate'
class AiAMapLocationPlatformView:NSObject,FlutterPlatformView,MAMapViewDelegate, AMapLocationManagerDelegate,AMapGeoFenceManagerDelegate,AMapNaviCompositeManagerDelegate{
^
/Users/zhangzhigang/.pub-cache/hosted/pub.flutter-io.cn/ai_amap-1.1.0/ios/Classes/AiAMapLocationPlatformView.swift:17:7: note: do you want to add protocol stubs?
class AiAMapLocationPlatformView:NSObject,FlutterPlatformView,MAMapViewDelegate, AMapLocationManagerDelegate,AMapGeoFenceManagerDelegate,AMapNaviCompositeManagerDelegate{
^
/Users/zhangzhigang/.pub-cache/hosted/pub.flutter-io.cn/ai_amap-1.1.0/ios/Classes/AiAMapLocationPlatformView.swift:231:46: warning: forced cast from 'String??' to 'String' only unwraps optionals; did you mean to use '!!'?
naviTitle = annotation.title as! String;
~~~~~~~~~~~~~~~~~^~~~~~~~~~
!!

> 日志如下:

日志如下:
/Users/zhangzhigang/.pub-cache/hosted/pub.flutter-io.cn/ai_amap-1.1.0/ios/Classes/AiAMapLocationPlatformView.swift:17:7: error: type 'AiAMapLocationPlatformView' does not conform to protocol 'AMapGeoFenceManagerDelegate'
class AiAMapLocationPlatformView:NSObject,FlutterPlatformView,MAMapViewDelegate, AMapLocationManagerDelegate,AMapGeoFenceManagerDelegate,AMapNaviCompositeManagerDelegate{
^
/Users/zhangzhigang/.pub-cache/hosted/pub.flutter-io.cn/ai_amap-1.1.0/ios/Classes/AiAMapLocationPlatformView.swift:17:7: note: do you want to add protocol stubs?
class AiAMapLocationPlatformView:NSObject,FlutterPlatformView,MAMapViewDelegate, AMapLocationManagerDelegate,AMapGeoFenceManagerDelegate,AMapNaviCompositeManagerDelegate{
^
/Users/zhangzhigang/.pub-cache/hosted/pub.flutter-io.cn/ai_amap-1.1.0/ios/Classes/AiAMapLocationPlatformView.swift:231:46: warning: forced cast from 'String??' to 'String' only unwraps optionals; did you mean to use '!!'?
naviTitle = annotation.title as! String;

!!

may be because of swift version difference...
what's your version about swift develop language?

Originally posted by @pdliuw in #3 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.