Skip to content

Commit 84da70c

Browse files
authored
Merge pull request #19 from filiph/chore/update-dart-version
Update Dart version to 3.8
2 parents fb3f4af + c3698fa commit 84da70c

14 files changed

+92
-63
lines changed

lib/main.dart

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class MyHomePage extends StatelessWidget {
9494
mainAxisSpacing: 10,
9595
children: [
9696
for (var (index, sample) in samples.indexed)
97-
_buildCard(index, sample, context)
97+
_buildCard(index, sample, context),
9898
],
9999
),
100100
);
@@ -114,10 +114,8 @@ class MyHomePage extends StatelessWidget {
114114
Navigator.push(
115115
context,
116116
MaterialPageRoute(
117-
builder: (context) => _SharedScaffold(
118-
title: title,
119-
child: widget,
120-
),
117+
builder: (context) =>
118+
_SharedScaffold(title: title, child: widget),
121119
),
122120
);
123121
},
@@ -141,14 +139,17 @@ class MyHomePage extends StatelessWidget {
141139
}
142140

143141
String _describe(Widget widget) {
144-
final camelCaseString =
145-
widget.runtimeType.toString().replaceAll('Sample', '');
142+
final camelCaseString = widget.runtimeType.toString().replaceAll(
143+
'Sample',
144+
'',
145+
);
146146

147147
// Use a RegEx to find uppercase letters preceded by lowercase letters
148148
// or other uppercase letters
149149
return camelCaseString.replaceAllMapped(
150-
RegExp(r'(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])'),
151-
(match) => ' ');
150+
RegExp(r'(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])'),
151+
(match) => ' ',
152+
);
152153
}
153154
}
154155

lib/samples/camera_animate.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class _AnimateCameraSampleState extends State<AnimateCameraSample> {
4242
onPressed: _onPressed,
4343
child: Text('Fly to New York'),
4444
),
45-
)
45+
),
4646
],
4747
);
4848
}
@@ -57,7 +57,11 @@ class _AnimateCameraSampleState extends State<AnimateCameraSample> {
5757
void _onPressed() {
5858
// Set up the desired camera update.
5959
final newYork = CameraPosition(
60-
target: LatLng(40.7128, -74.0060), bearing: 270, tilt: 30, zoom: 18);
60+
target: LatLng(40.7128, -74.0060),
61+
bearing: 270,
62+
tilt: 30,
63+
zoom: 18,
64+
);
6165
final update = CameraUpdate.newCameraPosition(newYork);
6266

6367
// Start the animation.

lib/samples/camera_move.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class _MoveCameraSampleState extends State<MoveCameraSample> {
4242
onPressed: _onPressed,
4343
child: Text('Jump to New York'),
4444
),
45-
)
45+
),
4646
],
4747
);
4848
}

lib/samples/handle_events.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class _HandleEventsSampleState extends State<HandleEventsSample> {
5050
child: Text(_response),
5151
),
5252
),
53-
)
53+
),
5454
],
5555
);
5656
}

lib/samples/map_controller_async.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ class _MapControllerAsyncSampleState extends State<MapControllerAsyncSample> {
3636
///
3737
/// In real apps, this could be a stream of changes to the user's position,
3838
/// for example.
39-
final Stream<void> _myEventsStream =
40-
Stream.periodic(const Duration(seconds: 1)).take(5);
39+
final Stream<void> _myEventsStream = Stream.periodic(
40+
const Duration(seconds: 1),
41+
).take(5);
4142

4243
/// A subscription to [_myEventsStream], so we can properly cancel it.
4344
StreamSubscription<void>? _myStreamSubscription;

lib/samples/marker_clusters.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
2020
class ClustersSample extends StatelessWidget {
2121
ClustersSample({super.key});
2222

23-
final ClusterManager _myCluster =
24-
ClusterManager(clusterManagerId: ClusterManagerId('my cluster'));
23+
final ClusterManager _myCluster = ClusterManager(
24+
clusterManagerId: ClusterManagerId('my cluster'),
25+
);
2526

2627
@override
2728
Widget build(BuildContext context) {
@@ -61,10 +62,7 @@ class ClustersSample extends StatelessWidget {
6162
),
6263

6364
// Markers without a clusterManagerId will always show independently.
64-
Marker(
65-
markerId: MarkerId('out'),
66-
position: LatLng(5.31, -3.99),
67-
),
65+
Marker(markerId: MarkerId('out'), position: LatLng(5.31, -3.99)),
6866
},
6967
);
7068
}

lib/samples/marker_clusters_dynamic.dart

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,26 @@ class _DynamicClustersSampleState extends State<DynamicClustersSample> {
5050

5151
/// Creates clusters according to some business logic, then calls [setState].
5252
void _computeClusters() {
53-
final spainCluster =
54-
ClusterManager(clusterManagerId: ClusterManagerId('spain'));
55-
final moroccoCluster =
56-
ClusterManager(clusterManagerId: ClusterManagerId('morocco'));
53+
final spainCluster = ClusterManager(
54+
clusterManagerId: ClusterManagerId('spain'),
55+
);
56+
final moroccoCluster = ClusterManager(
57+
clusterManagerId: ClusterManagerId('morocco'),
58+
);
5759

5860
// Here, we simply assign markers above a certain latitude to one cluster,
5961
// and ones below to another.
6062
//
6163
// Real apps will cluster according to some more meaningful relationships
6264
// between markers.
6365
final updatedMarkers = _markers
64-
.map((marker) => marker.copyWith(
65-
clusterManagerIdParam: marker.position.latitude > 35.96
66-
? spainCluster.clusterManagerId
67-
: moroccoCluster.clusterManagerId,
68-
))
66+
.map(
67+
(marker) => marker.copyWith(
68+
clusterManagerIdParam: marker.position.latitude > 35.96
69+
? spainCluster.clusterManagerId
70+
: moroccoCluster.clusterManagerId,
71+
),
72+
)
6973
.toSet();
7074

7175
setState(() {

lib/samples/marker_custom.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ class _CustomMarkerSampleState extends State<CustomMarkerSample> {
4242

4343
void _changeIcon() async {
4444
// Set up the image configuration for the new icon, including its size.
45-
final imageConfiguration =
46-
createLocalImageConfiguration(context, size: Size(42, 52));
45+
final imageConfiguration = createLocalImageConfiguration(
46+
context,
47+
size: Size(42, 52),
48+
);
4749

4850
// Load the icon image from an asset.
4951
// Alternatively, you can create the icon with BitmapDescriptor.bytes(),

lib/samples/marker_dynamic.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ class _DynamicMarkerSampleState extends State<DynamicMarkerSample> {
4646
return Stack(
4747
children: [
4848
GoogleMap(
49-
initialCameraPosition:
50-
CameraPosition(target: LatLng(37.7749, -122.4194), zoom: 12.5),
49+
initialCameraPosition: CameraPosition(
50+
target: LatLng(37.7749, -122.4194),
51+
zoom: 12.5,
52+
),
5153
// Simply pass the set of current markers as an argument.
5254
markers: _markers,
5355
),
@@ -57,7 +59,7 @@ class _DynamicMarkerSampleState extends State<DynamicMarkerSample> {
5759
onPressed: _onPressed,
5860
child: Text('Add Fisherman’s Wharf'),
5961
),
60-
)
62+
),
6163
],
6264
);
6365
}

lib/samples/my_location.dart

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,24 +73,30 @@ class _MyLocationSampleState extends State<MyLocationSample> {
7373
title: Text('Requesting permission'),
7474
children: [
7575
SimpleDialogOption(
76-
onPressed: () => Navigator.pop(context, true),
77-
child: Text('Grant')),
76+
onPressed: () => Navigator.pop(context, true),
77+
child: Text('Grant'),
78+
),
7879
SimpleDialogOption(
79-
onPressed: () => Navigator.pop(context, false),
80-
child: Text('Deny')),
80+
onPressed: () => Navigator.pop(context, false),
81+
child: Text('Deny'),
82+
),
8183
],
8284
),
8385
);
8486

8587
if (!mounted) return;
86-
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
87-
content: Text('Fake permission granted: $result. '
88+
ScaffoldMessenger.of(context).showSnackBar(
89+
SnackBar(
90+
content: Text(
91+
'Fake permission granted: $result. '
8892
'Remember that for My Location to actually work, '
8993
'you need an actual runtime permission on some platforms. '
90-
'See the code of this sample for more info.'),
91-
duration: const Duration(seconds: 10),
92-
showCloseIcon: true,
93-
));
94+
'See the code of this sample for more info.',
95+
),
96+
duration: const Duration(seconds: 10),
97+
showCloseIcon: true,
98+
),
99+
);
94100

95101
setState(() {
96102
_permissionGranted = result;

0 commit comments

Comments
 (0)