Skip to content

Commit b6044cf

Browse files
Re-land: Enable lints library_private_types_in_public_api, sort_child_properties_last and use_key_in_widget_constructors (#5692)
Re-lands flutter/plugins#5428 This is a revert of flutter/plugins#5691 (the revert of the above) with the following changes: - Excludes the repo tooling changes that had to be added to the revert, since we want those - Fixes local_auth: - Updates code for the new analysis failure - Fixes the bad version merge that dropped the version change - Reverts a version change in `file_selector_platform_interface`, which didn't otherwise change
1 parent 8572154 commit b6044cf

23 files changed

+102
-82
lines changed

google_maps_flutter/CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
## NEXT
1+
## 2.1.5
22

33
* Removes unnecessary imports.
4+
* Fixes library_private_types_in_public_api, sort_child_properties_last and use_key_in_widget_constructors
5+
lint warnings.
46

57
## 2.1.4
68

@@ -223,7 +225,7 @@ GoogleMapController is now uniformly driven by implementing `DefaultLifecycleObs
223225

224226
## 0.5.26+1
225227

226-
* Removes a errorneously added method from the GoogleMapController.h header file.
228+
* Removes an erroneously added method from the GoogleMapController.h header file.
227229

228230
## 0.5.26
229231

google_maps_flutter/example/lib/animate_camera.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
1010
import 'page.dart';
1111

1212
class AnimateCameraPage extends GoogleMapExampleAppPage {
13-
const AnimateCameraPage()
14-
: super(const Icon(Icons.map), 'Camera control, animated');
13+
const AnimateCameraPage({Key? key})
14+
: super(const Icon(Icons.map), 'Camera control, animated', key: key);
1515

1616
@override
1717
Widget build(BuildContext context) {
@@ -20,7 +20,7 @@ class AnimateCameraPage extends GoogleMapExampleAppPage {
2020
}
2121

2222
class AnimateCamera extends StatefulWidget {
23-
const AnimateCamera();
23+
const AnimateCamera({Key? key}) : super(key: key);
2424
@override
2525
State createState() => AnimateCameraState();
2626
}

google_maps_flutter/example/lib/lite_mode.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ const CameraPosition _kInitialPosition =
1212
CameraPosition(target: LatLng(-33.852, 151.211), zoom: 11.0);
1313

1414
class LiteModePage extends GoogleMapExampleAppPage {
15-
const LiteModePage() : super(const Icon(Icons.map), 'Lite mode');
15+
const LiteModePage({Key? key})
16+
: super(const Icon(Icons.map), 'Lite mode', key: key);
1617

1718
@override
1819
Widget build(BuildContext context) {

google_maps_flutter/example/lib/main.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// ignore_for_file: public_member_api_docs
6-
75
import 'package:flutter/foundation.dart';
86
import 'package:flutter/material.dart';
97

@@ -43,7 +41,11 @@ final List<GoogleMapExampleAppPage> _allPages = <GoogleMapExampleAppPage>[
4341
const TileOverlayPage(),
4442
];
4543

44+
/// MapsDemo is the Main Application.
4645
class MapsDemo extends StatelessWidget {
46+
/// Default Constructor
47+
const MapsDemo({Key? key}) : super(key: key);
48+
4749
void _pushPage(BuildContext context, GoogleMapExampleAppPage page) {
4850
Navigator.of(context).push(MaterialPageRoute<void>(
4951
builder: (_) => Scaffold(
@@ -72,5 +74,5 @@ void main() {
7274
if (defaultTargetPlatform == TargetPlatform.android) {
7375
AndroidGoogleMapsFlutter.useAndroidViewSurface = true;
7476
}
75-
runApp(MaterialApp(home: MapsDemo()));
77+
runApp(const MaterialApp(home: MapsDemo()));
7678
}

google_maps_flutter/example/lib/map_click.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ const CameraPosition _kInitialPosition =
1212
CameraPosition(target: LatLng(-33.852, 151.211), zoom: 11.0);
1313

1414
class MapClickPage extends GoogleMapExampleAppPage {
15-
const MapClickPage() : super(const Icon(Icons.mouse), 'Map click');
15+
const MapClickPage({Key? key})
16+
: super(const Icon(Icons.mouse), 'Map click', key: key);
1617

1718
@override
1819
Widget build(BuildContext context) {

google_maps_flutter/example/lib/map_coordinates.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ const CameraPosition _kInitialPosition =
1212
CameraPosition(target: LatLng(-33.852, 151.211), zoom: 11.0);
1313

1414
class MapCoordinatesPage extends GoogleMapExampleAppPage {
15-
const MapCoordinatesPage() : super(const Icon(Icons.map), 'Map coordinates');
15+
const MapCoordinatesPage({Key? key})
16+
: super(const Icon(Icons.map), 'Map coordinates', key: key);
1617

1718
@override
1819
Widget build(BuildContext context) {

google_maps_flutter/example/lib/map_ui.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ final LatLngBounds sydneyBounds = LatLngBounds(
1616
);
1717

1818
class MapUiPage extends GoogleMapExampleAppPage {
19-
const MapUiPage() : super(const Icon(Icons.map), 'User interface');
19+
const MapUiPage({Key? key})
20+
: super(const Icon(Icons.map), 'User interface', key: key);
2021

2122
@override
2223
Widget build(BuildContext context) {
@@ -25,7 +26,7 @@ class MapUiPage extends GoogleMapExampleAppPage {
2526
}
2627

2728
class MapUiBody extends StatefulWidget {
28-
const MapUiBody();
29+
const MapUiBody({Key? key}) : super(key: key);
2930

3031
@override
3132
State<StatefulWidget> createState() => MapUiBodyState();

google_maps_flutter/example/lib/marker_icons.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
1111
import 'page.dart';
1212

1313
class MarkerIconsPage extends GoogleMapExampleAppPage {
14-
const MarkerIconsPage() : super(const Icon(Icons.image), 'Marker icons');
14+
const MarkerIconsPage({Key? key})
15+
: super(const Icon(Icons.image), 'Marker icons', key: key);
1516

1617
@override
1718
Widget build(BuildContext context) {
@@ -20,7 +21,7 @@ class MarkerIconsPage extends GoogleMapExampleAppPage {
2021
}
2122

2223
class MarkerIconsBody extends StatefulWidget {
23-
const MarkerIconsBody();
24+
const MarkerIconsBody({Key? key}) : super(key: key);
2425

2526
@override
2627
State<StatefulWidget> createState() => MarkerIconsBodyState();

google_maps_flutter/example/lib/move_camera.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
1010
import 'page.dart';
1111

1212
class MoveCameraPage extends GoogleMapExampleAppPage {
13-
const MoveCameraPage() : super(const Icon(Icons.map), 'Camera control');
13+
const MoveCameraPage({Key? key})
14+
: super(const Icon(Icons.map), 'Camera control', key: key);
1415

1516
@override
1617
Widget build(BuildContext context) {
@@ -19,7 +20,7 @@ class MoveCameraPage extends GoogleMapExampleAppPage {
1920
}
2021

2122
class MoveCamera extends StatefulWidget {
22-
const MoveCamera();
23+
const MoveCamera({Key? key}) : super(key: key);
2324
@override
2425
State createState() => MoveCameraState();
2526
}

google_maps_flutter/example/lib/padding.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
99
import 'page.dart';
1010

1111
class PaddingPage extends GoogleMapExampleAppPage {
12-
const PaddingPage() : super(const Icon(Icons.map), 'Add padding to the map');
12+
const PaddingPage({Key? key})
13+
: super(const Icon(Icons.map), 'Add padding to the map', key: key);
1314

1415
@override
1516
Widget build(BuildContext context) {
@@ -18,7 +19,7 @@ class PaddingPage extends GoogleMapExampleAppPage {
1819
}
1920

2021
class MarkerIconsBody extends StatefulWidget {
21-
const MarkerIconsBody();
22+
const MarkerIconsBody({Key? key}) : super(key: key);
2223

2324
@override
2425
State<StatefulWidget> createState() => MarkerIconsBodyState();

google_maps_flutter/example/lib/page.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
import 'package:flutter/material.dart';
88

99
abstract class GoogleMapExampleAppPage extends StatelessWidget {
10-
const GoogleMapExampleAppPage(this.leading, this.title);
10+
const GoogleMapExampleAppPage(this.leading, this.title, {Key? key})
11+
: super(key: key);
1112

1213
final Widget leading;
1314
final String title;

google_maps_flutter/example/lib/place_circle.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
1010
import 'page.dart';
1111

1212
class PlaceCirclePage extends GoogleMapExampleAppPage {
13-
const PlaceCirclePage()
14-
: super(const Icon(Icons.linear_scale), 'Place circle');
13+
const PlaceCirclePage({Key? key})
14+
: super(const Icon(Icons.linear_scale), 'Place circle', key: key);
1515

1616
@override
1717
Widget build(BuildContext context) {
@@ -20,7 +20,7 @@ class PlaceCirclePage extends GoogleMapExampleAppPage {
2020
}
2121

2222
class PlaceCircleBody extends StatefulWidget {
23-
const PlaceCircleBody();
23+
const PlaceCircleBody({Key? key}) : super(key: key);
2424

2525
@override
2626
State<StatefulWidget> createState() => PlaceCircleBodyState();
@@ -170,42 +170,42 @@ class PlaceCircleBodyState extends State<PlaceCircleBody> {
170170
Column(
171171
children: <Widget>[
172172
TextButton(
173-
child: const Text('add'),
174173
onPressed: _add,
174+
child: const Text('add'),
175175
),
176176
TextButton(
177-
child: const Text('remove'),
178177
onPressed: (selectedId == null)
179178
? null
180179
: () => _remove(selectedId),
180+
child: const Text('remove'),
181181
),
182182
TextButton(
183-
child: const Text('toggle visible'),
184183
onPressed: (selectedId == null)
185184
? null
186185
: () => _toggleVisible(selectedId),
186+
child: const Text('toggle visible'),
187187
),
188188
],
189189
),
190190
Column(
191191
children: <Widget>[
192192
TextButton(
193-
child: const Text('change stroke width'),
194193
onPressed: (selectedId == null)
195194
? null
196195
: () => _changeStrokeWidth(selectedId),
196+
child: const Text('change stroke width'),
197197
),
198198
TextButton(
199-
child: const Text('change stroke color'),
200199
onPressed: (selectedId == null)
201200
? null
202201
: () => _changeStrokeColor(selectedId),
202+
child: const Text('change stroke color'),
203203
),
204204
TextButton(
205-
child: const Text('change fill color'),
206205
onPressed: (selectedId == null)
207206
? null
208207
: () => _changeFillColor(selectedId),
208+
child: const Text('change fill color'),
209209
),
210210
],
211211
)

google_maps_flutter/example/lib/place_marker.dart

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
1515
import 'page.dart';
1616

1717
class PlaceMarkerPage extends GoogleMapExampleAppPage {
18-
const PlaceMarkerPage() : super(const Icon(Icons.place), 'Place marker');
18+
const PlaceMarkerPage({Key? key})
19+
: super(const Icon(Icons.place), 'Place marker', key: key);
1920

2021
@override
2122
Widget build(BuildContext context) {
@@ -24,7 +25,7 @@ class PlaceMarkerPage extends GoogleMapExampleAppPage {
2425
}
2526

2627
class PlaceMarkerBody extends StatefulWidget {
27-
const PlaceMarkerBody();
28+
const PlaceMarkerBody({Key? key}) : super(key: key);
2829

2930
@override
3031
State<StatefulWidget> createState() => PlaceMarkerBodyState();
@@ -308,76 +309,75 @@ class PlaceMarkerBodyState extends State<PlaceMarkerBody> {
308309
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
309310
children: <Widget>[
310311
TextButton(
311-
child: const Text('Add'),
312312
onPressed: _add,
313+
child: const Text('Add'),
313314
),
314315
TextButton(
315-
child: const Text('Remove'),
316316
onPressed:
317317
selectedId == null ? null : () => _remove(selectedId),
318+
child: const Text('Remove'),
318319
),
319320
],
320321
),
321322
Wrap(
322323
alignment: WrapAlignment.spaceEvenly,
323324
children: <Widget>[
324325
TextButton(
325-
child: const Text('change info'),
326326
onPressed:
327327
selectedId == null ? null : () => _changeInfo(selectedId),
328+
child: const Text('change info'),
328329
),
329330
TextButton(
330-
child: const Text('change info anchor'),
331331
onPressed: selectedId == null
332332
? null
333333
: () => _changeInfoAnchor(selectedId),
334+
child: const Text('change info anchor'),
334335
),
335336
TextButton(
336-
child: const Text('change alpha'),
337337
onPressed:
338338
selectedId == null ? null : () => _changeAlpha(selectedId),
339+
child: const Text('change alpha'),
339340
),
340341
TextButton(
341-
child: const Text('change anchor'),
342342
onPressed:
343343
selectedId == null ? null : () => _changeAnchor(selectedId),
344+
child: const Text('change anchor'),
344345
),
345346
TextButton(
346-
child: const Text('toggle draggable'),
347347
onPressed: selectedId == null
348348
? null
349349
: () => _toggleDraggable(selectedId),
350+
child: const Text('toggle draggable'),
350351
),
351352
TextButton(
352-
child: const Text('toggle flat'),
353353
onPressed:
354354
selectedId == null ? null : () => _toggleFlat(selectedId),
355+
child: const Text('toggle flat'),
355356
),
356357
TextButton(
357-
child: const Text('change position'),
358358
onPressed: selectedId == null
359359
? null
360360
: () => _changePosition(selectedId),
361+
child: const Text('change position'),
361362
),
362363
TextButton(
363-
child: const Text('change rotation'),
364364
onPressed: selectedId == null
365365
? null
366366
: () => _changeRotation(selectedId),
367+
child: const Text('change rotation'),
367368
),
368369
TextButton(
369-
child: const Text('toggle visible'),
370370
onPressed: selectedId == null
371371
? null
372372
: () => _toggleVisible(selectedId),
373+
child: const Text('toggle visible'),
373374
),
374375
TextButton(
375-
child: const Text('change zIndex'),
376376
onPressed:
377377
selectedId == null ? null : () => _changeZIndex(selectedId),
378+
child: const Text('change zIndex'),
378379
),
379380
TextButton(
380-
child: const Text('set marker icon'),
381381
onPressed: selectedId == null
382382
? null
383383
: () {
@@ -387,6 +387,7 @@ class PlaceMarkerBodyState extends State<PlaceMarkerBody> {
387387
},
388388
);
389389
},
390+
child: const Text('set marker icon'),
390391
),
391392
],
392393
),

0 commit comments

Comments
 (0)