我尝试在我的flutter应用程序中实现这个地图: https://github.com/apptreesoftware/flutter_map
如果我从上面的github运行示例代码,则会抛出这样的错误:
type 'Bounds<num>' is not a subtype of type 'Bounds<double>' where
Bounds is from package:flutter_map/src/core/bounds.dart
num is from dart:core
Bounds is from package:flutter_map/src/core/bounds.dart
double is from dart:core
我的进口商品:
import 'package:flutter/material.dart';
import 'package:latlong/latlong.dart';
import 'package:flutter_map/flutter_map.dart';
答案 0 :(得分:1)
我会说flutter_map
已被破坏,应该向作者报告,因为是的,num不是double的子类型。
答案 1 :(得分:0)
截至发布当天,flutter_map未更新为支持dart 2.0中更强大的类型系统。它适用于dart 1.0。
自4/18/2018起,flutter_map版本0.0.3已经发布,根据the changelog修复了此问题。
答案 2 :(得分:0)
尝试
import 'package:flutter/material.dart';
import 'package:latlong/latlong.dart';
import 'package:flutter_map/flutter_map.dart' as mp;