Skip to content

Commit bc65a79

Browse files
committed
[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.
1 parent f32f78c commit bc65a79

File tree

6 files changed

+25
-19
lines changed

6 files changed

+25
-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: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1+
## 4.0.1
2+
3+
- Upgrade the `web` dependency to version 1.0.0.
4+
15
## 4.0.0
26

37
**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.
8+
9+
- Migrates from dart:html to package:web and dart:js_interop
10+
- Migrates to Dart SDK 3.3.0 and Flutter 3.16.0.
611

712
## 3.0.0
813

914
**BREAKING CHANGE:**
15+
1016
- `getServiceStatusStream` on web returns a PlatformException i.s.o. UnimplementedError. As the concept of location service doesn't exist on the web platform.
1117

1218
## 2.2.1
@@ -19,7 +25,7 @@
1925

2026
## 2.1.7
2127

22-
- Mark `geolocator_web` as implementation of `geolocator`
28+
- Mark `geolocator_web` as implementation of `geolocator`
2329

2430
## 2.1.6
2531

@@ -35,7 +41,7 @@
3541

3642
## 2.1.3
3743

38-
- Updated to the latest version of the `geolocator_platform_interface': `4.0.0`.
44+
- Updated to the latest version of the `geolocator_platform_interface':`4.0.0`.
3945

4046
## 2.1.2
4147

@@ -47,7 +53,7 @@
4753

4854
## 2.1.0
4955

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

5359
## 2.0.6
@@ -72,7 +78,7 @@
7278

7379
## 2.0.1
7480

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

7783
## 2.0.0
7884

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.3.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)