fix lints

This commit is contained in:
shilangyu 2020-08-21 00:37:51 +00:00
parent bbc27a3715
commit b19e7d50fa
1 changed files with 29 additions and 33 deletions

View File

@ -6,16 +6,14 @@ void main() {
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) => MaterialApp(
return MaterialApp( title: 'Flutter Demo',
title: 'Flutter Demo', theme: ThemeData(
theme: ThemeData( primarySwatch: Colors.blue,
primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity,
visualDensity: VisualDensity.adaptivePlatformDensity, ),
), home: MyHomePage(title: 'Flutter Demo Home Page'),
home: MyHomePage(title: 'Flutter Demo Home Page'), );
);
}
} }
class MyHomePage extends StatefulWidget { class MyHomePage extends StatefulWidget {
@ -37,28 +35,26 @@ class _MyHomePageState extends State<MyHomePage> {
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) => Scaffold(
return Scaffold( appBar: AppBar(
appBar: AppBar( title: Text(widget.title),
title: Text(widget.title), ),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('You have pushed the button this many times:'),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
],
), ),
body: Center( ),
child: Column( floatingActionButton: FloatingActionButton(
mainAxisAlignment: MainAxisAlignment.center, onPressed: _incrementCounter,
children: <Widget>[ tooltip: 'Increment',
Text('You have pushed the button this many times:'), child: Icon(Icons.add),
Text( ),
'$_counter', );
style: Theme.of(context).textTheme.headline4,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
),
);
}
} }