Add analysis_options, fix and format. (#102)

pull/109/head
Brett Morgan 5 years ago committed by GitHub
parent 87b42f92e3
commit 45e4a228f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,30 @@
include: package:pedantic/analysis_options.yaml
analyzer:
strong-mode:
implicit-casts: false
implicit-dynamic: false
linter:
rules:
- avoid_types_on_closure_parameters
- avoid_void_async
- await_only_futures
- camel_case_types
- cancel_subscriptions
- close_sinks
- constant_identifier_names
- control_flow_in_finally
- empty_statements
- hash_and_equals
- implementation_imports
- non_constant_identifier_names
- package_api_docs
- package_names
- package_prefixed_library_names
- test_types_in_equals
- throw_in_finally
- unnecessary_brace_in_string_interps
- unnecessary_getters_setters
- unnecessary_new
- unnecessary_statements

@ -109,7 +109,7 @@ class StoreCarousel extends StatelessWidget {
padding: const EdgeInsets.only(top: 10),
child: SizedBox(
height: 90,
child: new StoreCarouselList(
child: StoreCarouselList(
documents: documents,
mapController: mapController,
),
@ -187,8 +187,8 @@ class _StoreListTileState extends State<StoreListTile> {
}
Future<void> _retrievePlacesDetails() async {
final details =
await _placesApiClient.getDetailsByPlaceId(widget.document['placeId']);
final details = await _placesApiClient
.getDetailsByPlaceId(widget.document['placeId'] as String);
if (!_disposed) {
setState(() {
_placePhotoUrl = _placesApiClient.buildPhotoUrl(
@ -202,8 +202,8 @@ class _StoreListTileState extends State<StoreListTile> {
@override
Widget build(BuildContext context) {
return ListTile(
title: Text(widget.document['name']),
subtitle: Text(widget.document['address']),
title: Text(widget.document['name'] as String),
subtitle: Text(widget.document['address'] as String),
leading: Container(
width: 100,
height: 100,
@ -220,8 +220,8 @@ class _StoreListTileState extends State<StoreListTile> {
CameraUpdate.newCameraPosition(
CameraPosition(
target: LatLng(
widget.document['location'].latitude,
widget.document['location'].longitude,
widget.document['location'].latitude as double,
widget.document['location'].longitude as double,
),
zoom: 16,
),
@ -253,15 +253,15 @@ class StoreMap extends StatelessWidget {
),
markers: documents
.map((document) => Marker(
markerId: MarkerId(document['placeId']),
markerId: MarkerId(document['placeId'] as String),
icon: BitmapDescriptor.defaultMarkerWithHue(_pinkHue),
position: LatLng(
document['location'].latitude,
document['location'].longitude,
document['location'].latitude as double,
document['location'].longitude as double,
),
infoWindow: InfoWindow(
title: document['name'],
snippet: document['address'],
title: document['name'] as String,
snippet: document['address'] as String,
),
))
.toSet(),

@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.2.0"
boolean_selector:
dependency: transitive
description:
@ -110,7 +110,7 @@ packages:
source: hosted
version: "1.6.2"
pedantic:
dependency: transitive
dependency: "direct dev"
description:
name: pedantic
url: "https://pub.dartlang.org"
@ -122,7 +122,7 @@ packages:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
version: "2.0.3"
sky_engine:
dependency: transitive
description: flutter
@ -169,7 +169,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.4"
version: "0.2.5"
typed_data:
dependency: transitive
description:

@ -16,6 +16,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
pedantic: ^1.5.0
flutter:
uses-material-design: true

@ -5,5 +5,5 @@
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('This test always passes', (WidgetTester tester) async {});
testWidgets('This test always passes', (tester) async {});
}

Loading…
Cancel
Save