Skip to content

Commit c07ac1c

Browse files
authored
[geolocator_web]: Bump web from 0.5.1 to 1.0.0 in /geolocator_web (#1547)
* [geolocator_web]: Bump web from 0.5.1 to 1.0.0 in /geolocator_web chore: Update background color in geolocator examples 'background' is deprecated and shouldn't be used. Use surface instead. This feature was deprecated after v3.18.0-0.1. * Update to match package `web` change log: - Require Dart ^3.4.0. - APIs that return a double value now return double instead of num. This is to avoid users accidentally downcasting num, which has different semantics depending on whether you compile to JS or Wasm. See issue #57[] for more details.
1 parent f32f78c commit c07ac1c

File tree

6 files changed

+26
-19
lines changed

6 files changed

+26
-19
lines changed

geolocator_apple/example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class _GeolocatorWidgetState extends State<GeolocatorWidget> {
118118
ExamplePage(
119119
Icons.location_on,
120120
(context) => Scaffold(
121-
backgroundColor: Theme.of(context).colorScheme.background,
121+
backgroundColor: Theme.of(context).colorScheme.surface,
122122
body: ListView.builder(
123123
itemCount: _positionItems.length,
124124
itemBuilder: (context, index) {

geolocator_linux/example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class _GeolocatorWidgetState extends State<GeolocatorWidget> {
5252
);
5353

5454
return Scaffold(
55-
backgroundColor: Theme.of(context).colorScheme.background,
55+
backgroundColor: Theme.of(context).colorScheme.surface,
5656
body: ListView.builder(
5757
itemCount: _positionItems.length,
5858
itemBuilder: (context, index) {

geolocator_web/CHANGELOG.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1+
## 4.0.1
2+
3+
- Upgrade the package:web dependency to version 1.0.0.
4+
- Upgrade Dart SDK from 3.3.0 to 3.4.0 for geolocator_web
5+
16
## 4.0.0
27

38
**BREAKING CHANGE:**
4-
- Migrates from dart:html to package:web and dart:js_interop
5-
- Migrates to Dart SDK 3.3.0 and Flutter 3.16.0.
9+
10+
- Migrates from dart:html to package:web and dart:js_interop
11+
- Migrates to Dart SDK 3.3.0 and Flutter 3.16.0.
612

713
## 3.0.0
814

915
**BREAKING CHANGE:**
16+
1017
- `getServiceStatusStream` on web returns a PlatformException i.s.o. UnimplementedError. As the concept of location service doesn't exist on the web platform.
1118

1219
## 2.2.1
@@ -19,7 +26,7 @@
1926

2027
## 2.1.7
2128

22-
- Mark `geolocator_web` as implementation of `geolocator`
29+
- Mark `geolocator_web` as implementation of `geolocator`
2330

2431
## 2.1.6
2532

@@ -35,7 +42,7 @@
3542

3643
## 2.1.3
3744

38-
- Updated to the latest version of the `geolocator_platform_interface': `4.0.0`.
45+
- Updated to the latest version of the `geolocator_platform_interface':`4.0.0`.
3946

4047
## 2.1.2
4148

@@ -47,7 +54,7 @@
4754

4855
## 2.1.0
4956

50-
- Made changes to the implementation of the `getCurrentPosition` and `getPositionStream` method to match new platform interface.
57+
- Made changes to the implementation of the `getCurrentPosition` and `getPositionStream` method to match new platform interface.
5158
- Fixes issues where geolocator doesn't work on Safari due to missing implementation of `query` method in the browser.
5259

5360
## 2.0.6
@@ -72,7 +79,7 @@
7279

7380
## 2.0.1
7481

75-
- Solve bug causing error when requesting permissions (see issue [#673](https://github.com/Baseflow/flutter-geolocator/issues/673)).
82+
- Solve bug causing error when requesting permissions (see issue [#673](https://github.com/Baseflow/flutter-geolocator/issues/673)).
7683

7784
## 2.0.0
7885

geolocator_web/lib/src/utils.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
import 'dart:async';
2-
import 'package:web/web.dart' as web;
2+
33
import 'package:flutter/services.dart';
44
import 'package:geolocator_platform_interface/geolocator_platform_interface.dart';
5+
import 'package:web/web.dart' as web;
56

67
/// Converts the Geoposition object into a [Position] object.
78
Position toPosition(web.GeolocationPosition webPosition) {
89
final coords = webPosition.coords;
910

1011
return Position(
11-
latitude: coords.latitude as double,
12-
longitude: coords.longitude as double,
12+
latitude: coords.latitude,
13+
longitude: coords.longitude,
1314
timestamp: DateTime.fromMillisecondsSinceEpoch(webPosition.timestamp),
14-
altitude: coords.altitude as double? ?? 0.0,
15-
altitudeAccuracy: coords.altitudeAccuracy as double? ?? 0.0,
15+
altitude: coords.altitude ?? 0.0,
16+
altitudeAccuracy: coords.altitudeAccuracy ?? 0.0,
1617
accuracy: coords.accuracy as double? ?? 0.0,
17-
heading: coords.heading as double? ?? 0.0,
18+
heading: coords.heading ?? 0.0,
1819
headingAccuracy: 0.0,
1920
floor: null,
20-
speed: coords.speed as double? ?? 0.0,
21+
speed: coords.speed ?? 0.0,
2122
speedAccuracy: 0.0,
2223
isMocked: false,
2324
);

geolocator_web/pubspec.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
flutter_web_plugins:
1919
sdk: flutter
2020
geolocator_platform_interface: ^4.2.2
21-
web: ^0.5.1
21+
web: ^1.0.0
2222

2323
dev_dependencies:
2424
build_runner: ^2.4.8
@@ -27,7 +27,6 @@ dev_dependencies:
2727
flutter_lints: ">=3.0.1 <5.0.0"
2828
mockito: ^5.4.0
2929

30-
3130
environment:
32-
sdk: '>=3.3.0 <4.0.0'
31+
sdk: ">=3.4.0 <4.0.0"
3332
flutter: ">=3.16.0"

geolocator_windows/example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class _GeolocatorWidgetState extends State<GeolocatorWidget> {
105105
ExamplePage(
106106
Icons.location_on,
107107
(context) => Scaffold(
108-
backgroundColor: Theme.of(context).colorScheme.background,
108+
backgroundColor: Theme.of(context).colorScheme.surface,
109109
body: ListView.builder(
110110
itemCount: _positionItems.length,
111111
itemBuilder: (context, index) {

0 commit comments

Comments
 (0)