Add shared analysis_options.yaml to animation samples (#145)

pull/147/head
Thea Flowers 5 years ago committed by GitHub
parent 22ca7f462b
commit e3338726c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,30 @@
include: package:pedantic/analysis_options.1.7.0.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

@ -14,7 +14,7 @@ class PageRouteBuilderDemo extends StatelessWidget {
child: RaisedButton( child: RaisedButton(
child: Text('Go!'), child: Text('Go!'),
onPressed: () { onPressed: () {
Navigator.of(context).push(_createRoute()); Navigator.of(context).push<void>(_createRoute());
}, },
), ),
), ),
@ -23,7 +23,7 @@ class PageRouteBuilderDemo extends StatelessWidget {
} }
Route _createRoute() { Route _createRoute() {
return PageRouteBuilder( return PageRouteBuilder<SlideTransition>(
pageBuilder: (context, animation, secondaryAnimation) => _Page2(), pageBuilder: (context, animation, secondaryAnimation) => _Page2(),
transitionsBuilder: (context, animation, secondaryAnimation, child) { transitionsBuilder: (context, animation, secondaryAnimation, child) {
var tween = Tween<Offset>(begin: Offset(0.0, 1.0), end: Offset.zero); var tween = Tween<Offset>(begin: Offset(0.0, 1.0), end: Offset.zero);

@ -176,7 +176,7 @@ class _SwipeableCardState extends State<SwipeableCard>
var description = SpringDescription(mass: 50, stiffness: 1, damping: 1); var description = SpringDescription(mass: 50, stiffness: 1, damping: 1);
var simulation = var simulation =
SpringSimulation(description, _controller.value, 1, velocity); SpringSimulation(description, _controller.value, 1, velocity);
_controller.animateWith(simulation).then((_) { _controller.animateWith(simulation).then<void>((_) {
widget.onSwiped(); widget.onSwiped();
}); });
} }

@ -36,7 +36,7 @@ class CarouselDemo extends StatelessWidget {
); );
} }
Widget widgetBuilder(context, int index) { Widget widgetBuilder(BuildContext context, int index) {
return images[index % images.length]; return images[index % images.length];
} }
} }

@ -33,7 +33,7 @@ class Grid extends StatelessWidget {
} }
Route _createRoute(BuildContext parentContext, String image) { Route _createRoute(BuildContext parentContext, String image) {
return PageRouteBuilder( return PageRouteBuilder<void>(
pageBuilder: (context, animation, secondaryAnimation) { pageBuilder: (context, animation, secondaryAnimation) {
return _SecondPage(image); return _SecondPage(image);
}, },
@ -74,7 +74,7 @@ class SmallCard extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
var nav = Navigator.of(context); var nav = Navigator.of(context);
nav.push(_createRoute(context, imageAssetName)); nav.push<void>(_createRoute(context, imageAssetName));
}, },
child: Image.asset( child: Image.asset(
imageAssetName, imageAssetName,

@ -1,6 +1,20 @@
# Generated by pub # Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile # See https://dart.dev/tools/pub/glossary#lockfile
packages: packages:
archive:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.10"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.2"
async: async:
dependency: transitive dependency: transitive
description: description:
@ -29,6 +43,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.14.11" version: "1.14.11"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
@ -46,6 +74,13 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
@ -74,6 +109,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0+1" version: "1.8.0+1"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
quiver: quiver:
dependency: transitive dependency: transitive
description: description:
@ -142,5 +184,12 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.8" version: "2.0.8"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.5.0"
sdks: sdks:
dart: ">=2.5.0 <3.0.0" dart: ">=2.5.0 <3.0.0"

Loading…
Cancel
Save