Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nullsafety #851

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/stale.yml
@@ -0,0 +1,19 @@
name: 'Close stale issues and PR'
on:
schedule:
- cron: '30 1 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
days-before-stale: 30
days-before-close: 5
days-before-pr-close: -1

86 changes: 86 additions & 0 deletions .packages
@@ -0,0 +1,86 @@
# This file is deprecated. Tools should instead consume
escamoteur marked this conversation as resolved.
Show resolved Hide resolved
# `.dart_tools/package_config.json`.
#
# For more info see: https://dart.dev/go/dot-packages-deprecation
#
# Generated by pub on 2021-03-22 15:51:25.463978.
_fe_analyzer_shared:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/_fe_analyzer_shared-18.0.0/lib/
analyzer:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/analyzer-1.2.0/lib/
args:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/args-2.0.0/lib/
async:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/async-2.5.0/lib/
boolean_selector:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/lib/
build:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/build-1.6.3/lib/
built_collection:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/built_collection-5.0.0/lib/
built_value:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/built_value-8.0.3/lib/
characters:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/characters-1.1.0/lib/
charcode:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/charcode-1.2.0/lib/
cli_util:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/cli_util-0.3.0/lib/
clock:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/clock-1.1.0/lib/
code_builder:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/code_builder-3.7.0/lib/
collection:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/collection-1.15.0/lib/
convert:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/convert-3.0.0/lib/
coverage:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/coverage-0.15.2/lib/
crypto:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/crypto-3.0.0/lib/
dart_style:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/dart_style-1.3.14/lib/
fake_async:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/fake_async-1.2.0/lib/
file:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/file-6.1.0/lib/
fixnum:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/fixnum-1.0.0/lib/
flutter:file:///C:/Entwicklung/flutter/packages/flutter/lib/
flutter_image:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/git/flutter_image-b3d792066477efc57c7baa57098cfc3a0164de41/lib/
flutter_test:file:///C:/Entwicklung/flutter/packages/flutter_test/lib/
flutter_web_plugins:file:///C:/Entwicklung/flutter/packages/flutter_web_plugins/lib/
glob:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/glob-2.0.0/lib/
http_multi_server:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/http_multi_server-3.0.0/lib/
http_parser:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/http_parser-4.0.0/lib/
intl:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/intl-0.17.0/lib/
io:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/io-1.0.0/lib/
js:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/js-0.6.3/lib/
latlong2:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/latlong2-0.8.0/lib/
lists:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/lists-0.1.6/lib/
location:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/location-4.1.1/lib/
location_platform_interface:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/location_platform_interface-2.1.0/lib/
location_web:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/location_web-3.0.0/lib/
logging:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/logging-0.11.4/lib/
matcher:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/matcher-0.12.10/lib/
meta:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/meta-1.3.0/lib/
mgrs_dart:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/mgrs_dart-1.0.1/lib/
mime:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/mime-1.0.0/lib/
mockito:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/mockito-5.0.2/lib/
node_preamble:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/node_preamble-1.4.13/lib/
package_config:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/package_config-2.0.0/lib/
path:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/path-1.8.0/lib/
pedantic:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/pedantic-1.11.0/lib/
plugin_platform_interface:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/plugin_platform_interface-2.0.0/lib/
pool:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/pool-1.5.0/lib/
positioned_tap_detector_2:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/positioned_tap_detector_2-1.0.0/lib/
proj4dart:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/proj4dart-1.0.5/lib/
pub_semver:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/pub_semver-2.0.0/lib/
quiver:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/quiver-3.0.0/lib/
shelf:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/shelf-1.1.0/lib/
shelf_packages_handler:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/shelf_packages_handler-3.0.0/lib/
shelf_static:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/shelf_static-1.0.0/lib/
shelf_web_socket:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/shelf_web_socket-1.0.1/lib/
sky_engine:file:///C:/Entwicklung/flutter/bin/cache/pkg/sky_engine/lib/
source_gen:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/source_gen-0.9.10+3/lib/
source_map_stack_trace:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/source_map_stack_trace-2.1.0/lib/
source_maps:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/source_maps-0.10.10/lib/
source_span:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/source_span-1.8.0/lib/
stack_trace:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/stack_trace-1.10.0/lib/
stream_channel:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/stream_channel-2.1.0/lib/
string_scanner:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/string_scanner-1.1.0/lib/
term_glyph:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/term_glyph-1.2.0/lib/
test:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/test-1.16.5/lib/
test_api:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/test_api-0.2.19/lib/
test_core:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/test_core-0.3.15/lib/
transparent_image:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/transparent_image-2.0.0/lib/
tuple:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/tuple-2.0.0/lib/
typed_data:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/typed_data-1.3.0/lib/
unicode:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/unicode-0.2.4/lib/
vector_math:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/vector_math-2.1.0/lib/
vm_service:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/vm_service-6.1.0+1/lib/
watcher:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/watcher-1.0.0/lib/
web_socket_channel:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/web_socket_channel-2.0.0/lib/
webkit_inspection_protocol:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/webkit_inspection_protocol-0.7.5/lib/
wkt_parser:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/wkt_parser-1.0.7/lib/
yaml:file:///C:/Users/escam/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/yaml-3.1.0/lib/
flutter_map:lib/
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -249,7 +249,7 @@ release!
- Set Dart SDK to 2

## [0.0.11] - 8/2/2018
- upgrade to latlong from 0.4.0 to 0.5.3
- upgrade to latlong2 from 0.4.0 to 0.5.3
escamoteur marked this conversation as resolved.
Show resolved Hide resolved

## [0.0.11] - 7/31/2018
- fix LICENSE spelling error
Expand Down
4 changes: 2 additions & 2 deletions example/lib/pages/animated_map_controller.dart
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong/latlong.dart';
import 'package:latlong2/latlong.dart';

import '../widgets/drawer.dart';

Expand Down Expand Up @@ -29,7 +29,7 @@ class AnimatedMapControllerPageState extends State<AnimatedMapControllerPage>
static LatLng paris = LatLng(48.8566, 2.3522);
static LatLng dublin = LatLng(53.3498, -6.2603);

MapController mapController;
late MapController mapController;

@override
void initState() {
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/circle.dart
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong/latlong.dart';
import 'package:latlong2/latlong.dart';

import '../widgets/drawer.dart';

Expand Down
11 changes: 6 additions & 5 deletions example/lib/pages/custom_crs/custom_crs.dart
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map/plugin_api.dart';
import 'package:latlong/latlong.dart';
import 'package:latlong2/latlong.dart';
import 'package:proj4dart/proj4dart.dart' as proj4;

import '../../widgets/drawer.dart';
Expand All @@ -14,18 +14,18 @@ class CustomCrsPage extends StatefulWidget {
}

class _CustomCrsPageState extends State<CustomCrsPage> {
Proj4Crs epsg3413CRS;
late Proj4Crs epsg3413CRS;

double maxZoom;
double? maxZoom;

// Define start center
proj4.Point point = proj4.Point(x: 65.05166470332148, y: -19.171744826394896);

String initText = 'Map centered to';

proj4.Projection epsg4326;
late proj4.Projection epsg4326;

proj4.Projection epsg3413;
late proj4.Projection epsg3413;

@override
void initState() {
Expand All @@ -37,6 +37,7 @@ class _CustomCrsPageState extends State<CustomCrsPage> {
// EPSG:3413 is a user-defined projection from a valid Proj4 definition string
// From: http://epsg.io/3413, proj definition: http://epsg.io/3413.proj4
// Find Projection by name or define it if not exists
// TODO the warning here will go away as soon as proj4 is migrated to null safety
epsg3413 = proj4.Projection('EPSG:3413') ??
proj4.Projection.add('EPSG:3413',
'+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs');
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/esri.dart
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong/latlong.dart';
import 'package:latlong2/latlong.dart';

import '../widgets/drawer.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/home.dart
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong/latlong.dart';
import 'package:latlong2/latlong.dart';

import '../widgets/drawer.dart';

Expand Down
8 changes: 4 additions & 4 deletions example/lib/pages/interactive_test_page.dart
Expand Up @@ -2,7 +2,7 @@ import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong/latlong.dart';
import 'package:latlong2/latlong.dart';

import '../widgets/drawer.dart';

Expand All @@ -16,12 +16,12 @@ class InteractiveTestPage extends StatefulWidget {
}

class _InteractiveTestPageState extends State<InteractiveTestPage> {
MapController mapController;
late MapController mapController;

// Enable pinchZoom and doubleTapZoomBy by default
int flags = InteractiveFlag.pinchZoom | InteractiveFlag.doubleTapZoom;

StreamSubscription<MapEvent> subscription;
late StreamSubscription<MapEvent> subscription;

@override
void initState() {
Expand Down Expand Up @@ -159,7 +159,7 @@ class _InteractiveTestPageState extends State<InteractiveTestPage> {
}

return Text(
'Current event: ${snapshot.data.runtimeType}\nSource: ${snapshot.data.source}',
'Current event: ${snapshot.data.runtimeType}\nSource: ${snapshot.data!.source}',
textAlign: TextAlign.center,
);
},
Expand Down
25 changes: 12 additions & 13 deletions example/lib/pages/live_location.dart
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong/latlong.dart';
import 'package:latlong2/latlong.dart';
import 'package:location/location.dart';

import '../widgets/drawer.dart';
Expand All @@ -14,13 +14,13 @@ class LiveLocationPage extends StatefulWidget {
}

class _LiveLocationPageState extends State<LiveLocationPage> {
LocationData _currentLocation;
MapController _mapController;
LocationData? _currentLocation;
late MapController _mapController;

bool _liveUpdate = false;
bool _permission = false;

String _serviceError = '';
String? _serviceError = '';

var interActiveFlags = InteractiveFlag.all;

Expand All @@ -35,11 +35,11 @@ class _LiveLocationPageState extends State<LiveLocationPage> {

void initLocationService() async {
await _locationService.changeSettings(
accuracy: LocationAccuracy.HIGH,
accuracy: LocationAccuracy.high,
interval: 1000,
);

LocationData location;
LocationData? location;
bool serviceEnabled;
bool serviceRequestResult;

Expand All @@ -48,13 +48,12 @@ class _LiveLocationPageState extends State<LiveLocationPage> {

if (serviceEnabled) {
var permission = await _locationService.requestPermission();
_permission = permission == PermissionStatus.GRANTED;
_permission = permission == PermissionStatus.granted;

if (_permission) {
location = await _locationService.getLocation();
_currentLocation = location;
_locationService
.onLocationChanged()
_locationService.onLocationChanged
.listen((LocationData result) async {
if (mounted) {
setState(() {
Expand All @@ -63,8 +62,8 @@ class _LiveLocationPageState extends State<LiveLocationPage> {
// If Live Update is enabled, move map center
if (_liveUpdate) {
_mapController.move(
LatLng(_currentLocation.latitude,
_currentLocation.longitude),
LatLng(_currentLocation!.latitude!,
_currentLocation!.longitude!),
_mapController.zoom);
}
});
Expand Down Expand Up @@ -97,7 +96,7 @@ class _LiveLocationPageState extends State<LiveLocationPage> {
// by default or store previous location value to show.
if (_currentLocation != null) {
currentLatLng =
LatLng(_currentLocation.latitude, _currentLocation.longitude);
LatLng(_currentLocation!.latitude!, _currentLocation!.longitude!);
} else {
currentLatLng = LatLng(0, 0);
}
Expand Down Expand Up @@ -125,7 +124,7 @@ class _LiveLocationPageState extends State<LiveLocationPage> {
children: [
Padding(
padding: EdgeInsets.only(top: 8.0, bottom: 8.0),
child: _serviceError.isEmpty
child: _serviceError!.isEmpty
? Text('This is a map that is showing '
'(${currentLatLng.latitude}, ${currentLatLng.longitude}).')
: Text(
Expand Down
14 changes: 7 additions & 7 deletions example/lib/pages/map_controller.dart
Expand Up @@ -2,7 +2,7 @@ import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong/latlong.dart';
import 'package:latlong2/latlong.dart';
import 'package:location/location.dart';

import '../widgets/drawer.dart';
Expand All @@ -21,7 +21,7 @@ class MapControllerPageState extends State<MapControllerPage> {
static LatLng paris = LatLng(48.8566, 2.3522);
static LatLng dublin = LatLng(53.3498, -6.2603);

MapController mapController;
late MapController mapController;
double rotation = 0.0;

@override
Expand Down Expand Up @@ -119,7 +119,7 @@ class MapControllerPageState extends State<MapControllerPage> {
Builder(builder: (BuildContext context) {
return MaterialButton(
onPressed: () {
final bounds = mapController.bounds;
final bounds = mapController.bounds!;

ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(
Expand Down Expand Up @@ -178,8 +178,8 @@ class MapControllerPageState extends State<MapControllerPage> {

class CurrentLocation extends StatefulWidget {
const CurrentLocation({
Key key,
@required this.mapController,
Key? key,
required this.mapController,
}) : super(key: key);

final MapController mapController;
Expand All @@ -192,7 +192,7 @@ class _CurrentLocationState extends State<CurrentLocation> {
int _eventKey = 0;

var icon = Icons.gps_not_fixed;
StreamSubscription<MapEvent> mapEventSubscription;
late StreamSubscription<MapEvent> mapEventSubscription;

@override
void initState() {
Expand Down Expand Up @@ -229,7 +229,7 @@ class _CurrentLocationState extends State<CurrentLocation> {
try {
var currentLocation = await location.getLocation();
var moved = widget.mapController.move(
LatLng(currentLocation.latitude, currentLocation.longitude),
LatLng(currentLocation.latitude!, currentLocation.longitude!),
18,
id: _eventKey.toString(),
);
Expand Down
4 changes: 2 additions & 2 deletions example/lib/pages/marker_anchor.dart
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong/latlong.dart';
import 'package:latlong2/latlong.dart';

import '../widgets/drawer.dart';

Expand All @@ -13,7 +13,7 @@ class MarkerAnchorPage extends StatefulWidget {
}

class MarkerAnchorPageState extends State<MarkerAnchorPage> {
AnchorPos anchorPos;
late AnchorPos anchorPos;

@override
void initState() {
Expand Down