1
0
mirror of https://github.com/flutter/samples.git synced 2026-05-20 14:07:34 +00:00

Upgrading samples to flutter_lints, part 1 of n (#804)

This commit is contained in:
Brett Morgan
2021-06-05 12:24:28 +10:00
committed by GitHub
parent 14921d0c06
commit 936d1fdaae
230 changed files with 2361 additions and 2444 deletions

View File

@@ -11,11 +11,11 @@ class PageRouteBuilderDemo extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Page 1'),
title: const Text('Page 1'),
),
body: Center(
child: ElevatedButton(
child: Text('Go!'),
child: const Text('Go!'),
onPressed: () {
Navigator.of(context).push<void>(_createRoute());
},
@@ -29,7 +29,8 @@ Route _createRoute() {
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);
var tween =
Tween<Offset>(begin: const Offset(0.0, 1.0), end: Offset.zero);
var curveTween = CurveTween(curve: Curves.ease);
return SlideTransition(
@@ -45,7 +46,7 @@ class _Page2 extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Page 2'),
title: const Text('Page 2'),
),
body: Center(
child: Text('Page 2!', style: Theme.of(context).textTheme.headline4),