mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Add shared analysis_options.yaml to animation samples (#145)
This commit is contained in:
@@ -14,7 +14,7 @@ class PageRouteBuilderDemo extends StatelessWidget {
|
||||
child: RaisedButton(
|
||||
child: Text('Go!'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).push(_createRoute());
|
||||
Navigator.of(context).push<void>(_createRoute());
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -23,7 +23,7 @@ class PageRouteBuilderDemo extends StatelessWidget {
|
||||
}
|
||||
|
||||
Route _createRoute() {
|
||||
return PageRouteBuilder(
|
||||
return PageRouteBuilder<SlideTransition>(
|
||||
pageBuilder: (context, animation, secondaryAnimation) => _Page2(),
|
||||
transitionsBuilder: (context, animation, secondaryAnimation, child) {
|
||||
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 simulation =
|
||||
SpringSimulation(description, _controller.value, 1, velocity);
|
||||
_controller.animateWith(simulation).then((_) {
|
||||
_controller.animateWith(simulation).then<void>((_) {
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class Grid extends StatelessWidget {
|
||||
}
|
||||
|
||||
Route _createRoute(BuildContext parentContext, String image) {
|
||||
return PageRouteBuilder(
|
||||
return PageRouteBuilder<void>(
|
||||
pageBuilder: (context, animation, secondaryAnimation) {
|
||||
return _SecondPage(image);
|
||||
},
|
||||
@@ -74,7 +74,7 @@ class SmallCard extends StatelessWidget {
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
var nav = Navigator.of(context);
|
||||
nav.push(_createRoute(context, imageAssetName));
|
||||
nav.push<void>(_createRoute(context, imageAssetName));
|
||||
},
|
||||
child: Image.asset(
|
||||
imageAssetName,
|
||||
|
||||
Reference in New Issue
Block a user