Skip to content

Commit 45e4a22

Browse files
Add analysis_options, fix and format. (#102)
1 parent 87b42f9 commit 45e4a22

File tree

5 files changed

+48
-17
lines changed

5 files changed

+48
-17
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
include: package:pedantic/analysis_options.yaml
2+
3+
analyzer:
4+
strong-mode:
5+
implicit-casts: false
6+
implicit-dynamic: false
7+
8+
linter:
9+
rules:
10+
- avoid_types_on_closure_parameters
11+
- avoid_void_async
12+
- await_only_futures
13+
- camel_case_types
14+
- cancel_subscriptions
15+
- close_sinks
16+
- constant_identifier_names
17+
- control_flow_in_finally
18+
- empty_statements
19+
- hash_and_equals
20+
- implementation_imports
21+
- non_constant_identifier_names
22+
- package_api_docs
23+
- package_names
24+
- package_prefixed_library_names
25+
- test_types_in_equals
26+
- throw_in_finally
27+
- unnecessary_brace_in_string_interps
28+
- unnecessary_getters_setters
29+
- unnecessary_new
30+
- unnecessary_statements

flutter_maps_firestore/lib/main.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class StoreCarousel extends StatelessWidget {
109109
padding: const EdgeInsets.only(top: 10),
110110
child: SizedBox(
111111
height: 90,
112-
child: new StoreCarouselList(
112+
child: StoreCarouselList(
113113
documents: documents,
114114
mapController: mapController,
115115
),
@@ -187,8 +187,8 @@ class _StoreListTileState extends State<StoreListTile> {
187187
}
188188

189189
Future<void> _retrievePlacesDetails() async {
190-
final details =
191-
await _placesApiClient.getDetailsByPlaceId(widget.document['placeId']);
190+
final details = await _placesApiClient
191+
.getDetailsByPlaceId(widget.document['placeId'] as String);
192192
if (!_disposed) {
193193
setState(() {
194194
_placePhotoUrl = _placesApiClient.buildPhotoUrl(
@@ -202,8 +202,8 @@ class _StoreListTileState extends State<StoreListTile> {
202202
@override
203203
Widget build(BuildContext context) {
204204
return ListTile(
205-
title: Text(widget.document['name']),
206-
subtitle: Text(widget.document['address']),
205+
title: Text(widget.document['name'] as String),
206+
subtitle: Text(widget.document['address'] as String),
207207
leading: Container(
208208
width: 100,
209209
height: 100,
@@ -220,8 +220,8 @@ class _StoreListTileState extends State<StoreListTile> {
220220
CameraUpdate.newCameraPosition(
221221
CameraPosition(
222222
target: LatLng(
223-
widget.document['location'].latitude,
224-
widget.document['location'].longitude,
223+
widget.document['location'].latitude as double,
224+
widget.document['location'].longitude as double,
225225
),
226226
zoom: 16,
227227
),
@@ -253,15 +253,15 @@ class StoreMap extends StatelessWidget {
253253
),
254254
markers: documents
255255
.map((document) => Marker(
256-
markerId: MarkerId(document['placeId']),
256+
markerId: MarkerId(document['placeId'] as String),
257257
icon: BitmapDescriptor.defaultMarkerWithHue(_pinkHue),
258258
position: LatLng(
259-
document['location'].latitude,
260-
document['location'].longitude,
259+
document['location'].latitude as double,
260+
document['location'].longitude as double,
261261
),
262262
infoWindow: InfoWindow(
263-
title: document['name'],
264-
snippet: document['address'],
263+
title: document['name'] as String,
264+
snippet: document['address'] as String,
265265
),
266266
))
267267
.toSet(),

flutter_maps_firestore/pubspec.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
name: async
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.1.0"
10+
version: "2.2.0"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
@@ -110,7 +110,7 @@ packages:
110110
source: hosted
111111
version: "1.6.2"
112112
pedantic:
113-
dependency: transitive
113+
dependency: "direct dev"
114114
description:
115115
name: pedantic
116116
url: "https://pub.dartlang.org"
@@ -122,7 +122,7 @@ packages:
122122
name: quiver
123123
url: "https://pub.dartlang.org"
124124
source: hosted
125-
version: "2.0.2"
125+
version: "2.0.3"
126126
sky_engine:
127127
dependency: transitive
128128
description: flutter
@@ -169,7 +169,7 @@ packages:
169169
name: test_api
170170
url: "https://pub.dartlang.org"
171171
source: hosted
172-
version: "0.2.4"
172+
version: "0.2.5"
173173
typed_data:
174174
dependency: transitive
175175
description:

flutter_maps_firestore/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dependencies:
1616
dev_dependencies:
1717
flutter_test:
1818
sdk: flutter
19+
pedantic: ^1.5.0
1920

2021
flutter:
2122
uses-material-design: true

flutter_maps_firestore/test/widget_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
import 'package:flutter_test/flutter_test.dart';
66

77
void main() {
8-
testWidgets('This test always passes', (WidgetTester tester) async {});
8+
testWidgets('This test always passes', (tester) async {});
99
}

0 commit comments

Comments
 (0)