alfonsocejudo / fluster

A geospatial point clustering library for Dart.
MIT License
68 stars 25 forks source link

Null safety migration #12

Closed sunderee closed 3 years ago

sunderee commented 3 years ago

This pull request addresses migration to Dart's new safety feature and it brings many improvements related to lint rules which haven't been followed thus far (for instance, preferring var).

pawelpetruch commented 3 years ago

@alfonsocejudo can you merge this and publish a new pub.dev?

PaoloP98 commented 3 years ago

I have an error using the null safety version

E/flutter ( 687): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: type '(BaseCluster, double, double) => MapMarker' is not a subtype of type '((BaseCluster?, double?, double?) => MapMarker)?'

I initialised the cluster in this way:

      minZoom: minZoom,
      maxZoom: maxZoom,
      radius: 150,
      extent: 4096,
      nodeSize: 64,
      points: markers,
      createCluster: (
        BaseCluster cluster,
        double lng,
        double lat,
      ) =>
          MapMarker(
        id: cluster.id.toString(),
        latitude: lat,
        longitude: lng,
        isCluster: cluster.isCluster,
        clusterId: cluster.id,
        pointsSize: cluster.pointsSize,
        childMarkerId: cluster.childMarkerId,
      ),
    );

Do you know what the problem is?