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

Upgrade to sound null-safety #870

Merged
merged 62 commits into from Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
911ca0d
Add actions/stale@v3 GitHub Action
johnpryan Mar 19, 2021
dfb91ef
updated to latest master version
escamoteur Jan 6, 2021
49119d1
updated dependcies to compile again
escamoteur Mar 22, 2021
f084f2a
updated latlong import
escamoteur Mar 22, 2021
98ebcff
migrated to unsound null safety
escamoteur Mar 22, 2021
d210359
removed .packages from repository
escamoteur Mar 23, 2021
5633366
small fixes
escamoteur Mar 23, 2021
0bf64bf
Update lib/src/core/point.dart
escamoteur Mar 25, 2021
c7d523a
Update pubspec.yaml
escamoteur Mar 25, 2021
48f361e
Update lib/src/gestures/latlng_tween.dart
escamoteur Mar 25, 2021
d1be78e
type '_ControllerStream<LatLng?>' is not a subtype of type 'Stream<La…
tazik561 Mar 25, 2021
f2aaf92
changes according to review
escamoteur Mar 25, 2021
2affa2c
made key nullable
escamoteur Apr 2, 2021
34bf621
made rebuild nullable again
escamoteur Apr 2, 2021
cd6ec35
Fix polyline border drawing
Ahmed-gubara Apr 6, 2021
53be3ce
corrected typo in dependency_overrides
escamoteur Apr 8, 2021
8bb439c
Removed unnecessary null-checks
kengu Apr 8, 2021
2b509ad
Limit number of purges in TileLayer and cancel pending on dispose
kengu Apr 14, 2021
235dea9
Fix error messages in mocked classes
kengu Apr 14, 2021
2ff083d
Set ready to true always (state is never null)
kengu Apr 14, 2021
0145354
Merge improved fling physics into sound null-safety branch
kengu Apr 25, 2021
2a71f18
Merge Added new plugin to README
kengu Apr 27, 2021
622d7e8
make bounds, getBounds and getCenter null safe
kengu Apr 27, 2021
daf1dbb
Merge Optimize markers calculations as null safe
kengu Apr 28, 2021
37e8f07
Merge Added onMapCreated callback
kengu Apr 30, 2021
09b306a
Merge Add a fastReplace option to TileLayerOptions
kengu Apr 30, 2021
72786e6
use http.RetryClient instead of flutter_image
josxha May 10, 2021
a1496c5
formatting
josxha May 10, 2021
0c7462f
add change notes
josxha May 10, 2021
45c94ea
Added example page for NetworkTileProvider
kengu May 15, 2021
d9dd158
Added dependency on null safe version 0.17.0 of package intl (would n…
kengu May 15, 2021
e72a6f0
Changed to master branch of flutter_image that is now null-safe
kengu May 15, 2021
f132c35
Change override of package flutter_image to new location in flutter p…
kengu May 15, 2021
85146e2
Merge Add a key for markers to preserve state
kengu May 15, 2021
de5d4da
Merge remote-tracking branch 'fleaflet/issues/829-nullsafety' into is…
ThexXTURBOXx May 19, 2021
910f701
Update git repo link
ThexXTURBOXx May 19, 2021
079daaf
Fix typos
ThexXTURBOXx May 19, 2021
918d65b
Sort dependencies
ThexXTURBOXx May 19, 2021
8c36591
Reformat and improve pub score
ThexXTURBOXx May 19, 2021
c7da0c9
Upgraded to flutter_image ^4.0.1
kengu May 19, 2021
932d6d8
Merge remote-tracking branch 'fleaflet/issues/829-nullsafety' into is…
ThexXTURBOXx May 19, 2021
793b4f0
Reformatted files to standard settings
kengu May 19, 2021
00fa7fb
Merge remote-tracking branch 'fleaflet/issues/829-nullsafety' into is…
ThexXTURBOXx May 19, 2021
6023f61
Reformatted crs.dart that wasn't changed using command line
kengu May 19, 2021
a4e1b5d
Merge remote-tracking branch 'fleaflet/issues/829-nullsafety' into is…
ThexXTURBOXx May 19, 2021
1882f32
Random Fixes Everywhere (#910)
ThexXTURBOXx May 20, 2021
8899a7b
Merge remote-tracking branch 'fleaflet/issues/829-nullsafety' into is…
ThexXTURBOXx May 20, 2021
252bbc4
Merge pull request #1 from ThexXTURBOXx/issues/829-nullsafety
josxha May 20, 2021
d9674b5
Merge pull request #894 from josxha/issues/829-nullsafety
kengu May 22, 2021
8378acb
remove TODO
johnpryan Jun 4, 2021
705e32c
Clarification of all options available for offline mapping (#913)
JaffaKetchup Jun 4, 2021
a249d23
Merge branch 'master' of github.com:fleaflet/flutter_map into issues/…
johnpryan Jun 4, 2021
618bc12
Merge branch 'issues/829-nullsafety' of github.com:fleaflet/flutter_m…
johnpryan Jun 4, 2021
b870970
fix Group Layer Options constructor wrong nullability (#921)
tlserver Jun 4, 2021
36154f4
null check regex in template()
johnpryan Jun 4, 2021
863c797
Merge remote-tracking branch 'origin/issues/829-nullsafety' into issu…
johnpryan Jun 4, 2021
9e6dd84
re-apply #913 into null safety branch
johnpryan Jun 4, 2021
c3659d9
Review comments from issues/829-nullsafety (#919)
andreandersson Jun 4, 2021
a86caca
dart format
johnpryan Jun 4, 2021
40d3a59
make urlTemplate required, make throttleSTreamTransformerWithTrailing…
johnpryan Jun 4, 2021
3ea0500
use late final where possible
johnpryan Jun 4, 2021
2765f26
revert making urlTemplate non-nullable
johnpryan Jun 4, 2021
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
11 changes: 11 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,14 @@
## [0.13.0] - xx/xx/2021
This version has support for sound null safety. For this purpose, some inactive packages were exchanged with active forks.

- Sound null safety migration (#851, #870)
- requires flutter version 2.0.0 or higher
- latlong is replaced with latlong2
- Remove the package flutter_image and add http instead (#894)
- http has to be version 0.13.2 or higher for this package (#894)

Thanks to escamoteur, ThexXTURBOXx, Sata51, tazik561, kengu, passsy, Ahmed-gubara, johnpryan and josxha for this release!

## [0.12.0] - 3/16/2021
TileLayerOptions now takes some additional options, templateFunction,
tileBuilder, tilesContainerBuilder, and evictErrorTileStrategy
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -286,6 +286,6 @@ Note that there is also `FileTileProvider()`, which you can use to load tiles fr

For the latest roadmap, please see the [Issue Tracker]

[Leaflet]: http://leafletjs.com/
[Leaflet]: https://leafletjs.com/
[Mapbox]: https://www.mapbox.com/
[Issue Tracker]: https://github.com/johnpryan/flutter_map/issues
1 change: 1 addition & 0 deletions analysis_options.yaml
Expand Up @@ -36,6 +36,7 @@ linter:
- prefer_null_aware_operators
- prefer_single_quotes
- prefer_typing_uninitialized_variables
- sort_pub_dependencies
- test_types_in_equals
- throw_in_finally
- unnecessary_brace_in_string_interps
Expand Down
1 change: 1 addition & 0 deletions example/ios/Flutter/Debug.xcconfig
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions example/ios/Flutter/Release.xcconfig
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
2 changes: 2 additions & 0 deletions example/lib/main.dart
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_map_example/pages/network_tile_provider.dart';

import './pages/animated_map_controller.dart';
import './pages/circle.dart';
Expand Down Expand Up @@ -40,6 +41,7 @@ class MyApp extends StatelessWidget {
),
home: HomePage(),
routes: <String, WidgetBuilder>{
NetworkTileProviderPage.route: (context) => NetworkTileProviderPage(),
WidgetsPage.route: (context) => WidgetsPage(),
TapToAddPage.route: (context) => TapToAddPage(),
EsriPage.route: (context) => EsriPage(),
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/animated_map_controller.dart
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
13 changes: 7 additions & 6 deletions example/lib/pages/custom_crs/custom_crs.dart
Expand Up @@ -14,30 +14,31 @@ 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() {
super.initState();

// EPSG:4326 is a predefined projection ships with proj4dart
epsg4326 = proj4.Projection('EPSG:4326');
epsg4326 = proj4.Projection.get('EPSG:4326')!;

// 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
epsg3413 = proj4.Projection('EPSG:3413') ??
// TODO the warning here will go away as soon as proj4 is migrated to null safety
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This TODO could certainly get removed now

epsg3413 = proj4.Projection.get('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
6 changes: 3 additions & 3 deletions example/lib/pages/interactive_test_page.dart
Expand Up @@ -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
23 changes: 11 additions & 12 deletions example/lib/pages/live_location.dart
Expand Up @@ -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
12 changes: 6 additions & 6 deletions example/lib/pages/map_controller.dart
Expand Up @@ -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
2 changes: 1 addition & 1 deletion example/lib/pages/marker_anchor.dart
Expand Up @@ -13,7 +13,7 @@ class MarkerAnchorPage extends StatefulWidget {
}

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

@override
void initState() {
Expand Down
12 changes: 6 additions & 6 deletions example/lib/pages/marker_rotate.dart
Expand Up @@ -13,9 +13,9 @@ class MarkerRotatePage extends StatefulWidget {
}

class MarkerRotatePageState extends State<MarkerRotatePage> {
bool rotateMarkerLondon;
bool rotateMarkerDublin;
bool rotateMarkerParis;
bool? rotateMarkerLondon;
bool? rotateMarkerDublin;
bool? rotateMarkerParis;
bool rotateMarkerLayerOptions = false;

@override
Expand All @@ -33,7 +33,7 @@ class MarkerRotatePageState extends State<MarkerRotatePage> {
setState(() {
if (rotateMarkerLondon == null) {
rotateMarkerLondon = true;
} else if (rotateMarkerLondon) {
} else if (rotateMarkerLondon != null) {
rotateMarkerLondon = false;
} else {
rotateMarkerLondon = null;
Expand All @@ -45,7 +45,7 @@ class MarkerRotatePageState extends State<MarkerRotatePage> {
setState(() {
if (rotateMarkerDublin == null) {
rotateMarkerDublin = true;
} else if (rotateMarkerDublin) {
} else if (rotateMarkerDublin != null) {
rotateMarkerDublin = false;
} else {
rotateMarkerDublin = null;
Expand All @@ -57,7 +57,7 @@ class MarkerRotatePageState extends State<MarkerRotatePage> {
setState(() {
if (rotateMarkerParis == null) {
rotateMarkerParis = true;
} else if (rotateMarkerParis) {
} else if (rotateMarkerParis != null) {
rotateMarkerParis = false;
} else {
rotateMarkerParis = null;
Expand Down
6 changes: 3 additions & 3 deletions example/lib/pages/moving_markers.dart
Expand Up @@ -16,8 +16,8 @@ class MovingMarkersPage extends StatefulWidget {
}

class _MovingMarkersPageState extends State<MovingMarkersPage> {
Marker _marker;
Timer _timer;
Marker? _marker;
late Timer _timer;
int _markerIndex = 0;

@override
Expand Down Expand Up @@ -62,7 +62,7 @@ class _MovingMarkersPageState extends State<MovingMarkersPage> {
urlTemplate:
'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c']),
MarkerLayerOptions(markers: <Marker>[_marker])
MarkerLayerOptions(markers: [_marker!])
],
),
),
Expand Down