mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Upgrading samples to flutter_lints, part 1 of n (#804)
This commit is contained in:
@@ -43,7 +43,7 @@ class DataTransferPage extends StatelessWidget {
|
||||
'Number Generator Progress',
|
||||
style: Theme.of(context).textTheme.headline6,
|
||||
),
|
||||
padding: EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(8),
|
||||
),
|
||||
LinearProgressIndicator(
|
||||
value: controller.progressPercent,
|
||||
@@ -213,7 +213,7 @@ class RunningList extends StatelessWidget {
|
||||
),
|
||||
color: Colors.lightGreenAccent,
|
||||
),
|
||||
Divider(
|
||||
const Divider(
|
||||
color: Colors.blue,
|
||||
height: 3,
|
||||
),
|
||||
|
||||
@@ -76,7 +76,7 @@ class InfiniteProcessPage extends StatelessWidget {
|
||||
inactiveTrackColor: Colors.deepOrangeAccent,
|
||||
inactiveThumbColor: Colors.black,
|
||||
),
|
||||
Text('Pause/Resume'),
|
||||
const Text('Pause/Resume'),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
@@ -207,7 +207,7 @@ class RunningList extends StatelessWidget {
|
||||
? Colors.lightGreenAccent
|
||||
: Colors.deepOrangeAccent,
|
||||
),
|
||||
Divider(
|
||||
const Divider(
|
||||
color: Colors.blue,
|
||||
height: 3,
|
||||
),
|
||||
|
||||
@@ -34,7 +34,7 @@ class HomePage extends StatelessWidget {
|
||||
length: 3,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
bottom: TabBar(
|
||||
bottom: const TabBar(
|
||||
tabs: [
|
||||
Tab(
|
||||
icon: Icon(Icons.flash_on),
|
||||
@@ -50,7 +50,7 @@ class HomePage extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
title: Text('Isolate Example'),
|
||||
title: const Text('Isolate Example'),
|
||||
),
|
||||
body: TabBarView(
|
||||
children: [
|
||||
|
||||
@@ -46,7 +46,7 @@ class _PerformancePageState extends State<PerformancePage> {
|
||||
SmoothAnimationWidget(),
|
||||
Container(
|
||||
alignment: Alignment.bottomCenter,
|
||||
padding: EdgeInsets.only(top: 150),
|
||||
padding: const EdgeInsets.only(top: 150),
|
||||
child: Column(
|
||||
children: [
|
||||
FutureBuilder(
|
||||
@@ -85,7 +85,7 @@ class _PerformancePageState extends State<PerformancePage> {
|
||||
void handleComputeOnMain(BuildContext context) {
|
||||
var future = computeOnMainIsolate()
|
||||
..then((_) {
|
||||
var snackBar = SnackBar(
|
||||
var snackBar = const SnackBar(
|
||||
content: Text('Main Isolate Done!'),
|
||||
);
|
||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||
@@ -99,7 +99,7 @@ class _PerformancePageState extends State<PerformancePage> {
|
||||
void handleComputeOnSecondary(BuildContext context) {
|
||||
var future = computeOnSecondaryIsolate()
|
||||
..then((_) {
|
||||
var snackBar = SnackBar(
|
||||
var snackBar = const SnackBar(
|
||||
content: Text('Secondary Isolate Done!'),
|
||||
);
|
||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||
@@ -114,7 +114,7 @@ class _PerformancePageState extends State<PerformancePage> {
|
||||
// A delay is added here to give Flutter the chance to redraw the UI at
|
||||
// least once before the computation (which, since it's run on the main
|
||||
// isolate, will lock up the app) begins executing.
|
||||
await Future<void>.delayed(Duration(milliseconds: 100));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||
fib(45);
|
||||
}
|
||||
|
||||
@@ -156,14 +156,14 @@ class SmoothAnimationWidgetState extends State<SmoothAnimationWidget>
|
||||
animation: _borderAnimation,
|
||||
builder: (context, child) {
|
||||
return Container(
|
||||
child: FlutterLogo(
|
||||
child: const FlutterLogo(
|
||||
size: 200,
|
||||
),
|
||||
alignment: Alignment.bottomCenter,
|
||||
width: 350,
|
||||
height: 200,
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
colors: [
|
||||
Colors.blueAccent,
|
||||
|
||||
Reference in New Issue
Block a user