1
0
mirror of https://github.com/flutter/samples.git synced 2026-04-28 02:18:47 +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

@@ -10,7 +10,7 @@ class FocusImageDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Focus Image')),
appBar: AppBar(title: const Text('Focus Image')),
body: Grid(),
);
}
@@ -23,11 +23,11 @@ class Grid extends StatelessWidget {
body: GridView.builder(
itemCount: 40,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4),
const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4),
itemBuilder: (context, index) {
return (index >= 20)
? SmallCard('assets/eat_cape_town_sm.jpg')
: SmallCard('assets/eat_new_orleans_sm.jpg');
? const SmallCard('assets/eat_cape_town_sm.jpg')
: const SmallCard('assets/eat_new_orleans_sm.jpg');
},
),
);
@@ -68,7 +68,7 @@ Tween<RelativeRect> _createTween(BuildContext context) {
class SmallCard extends StatelessWidget {
final String imageAssetName;
SmallCard(this.imageAssetName);
const SmallCard(this.imageAssetName);
@override
Widget build(BuildContext context) {
@@ -92,7 +92,7 @@ class SmallCard extends StatelessWidget {
class _SecondPage extends StatelessWidget {
final String imageAssetName;
_SecondPage(this.imageAssetName);
const _SecondPage(this.imageAssetName);
@override
Widget build(BuildContext context) {