Enable sort_child_properties_last lint (#91585)

This commit is contained in:
Ian Hickson
2021-10-11 21:23:02 -07:00
committed by GitHub
parent ee07b0eafc
commit 6d5fc420b6
42 changed files with 171 additions and 169 deletions

View File

@@ -42,7 +42,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
AnimatedSwitcher(
duration: const Duration(milliseconds: 500),
transitionBuilder: (Widget child, Animation<double> animation) {
return ScaleTransition(child: child, scale: animation);
return ScaleTransition(scale: animation, child: child);
},
child: Text(
'$_count',

View File

@@ -71,9 +71,9 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
} else {
children = const <Widget>[
SizedBox(
child: CircularProgressIndicator(),
width: 60,
height: 60,
child: CircularProgressIndicator(),
),
Padding(
padding: EdgeInsets.only(top: 16),

View File

@@ -82,9 +82,9 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
case ConnectionState.waiting:
children = const <Widget>[
SizedBox(
child: CircularProgressIndicator(),
width: 60,
height: 60,
child: CircularProgressIndicator(),
),
Padding(
padding: EdgeInsets.only(top: 16),

View File

@@ -37,9 +37,9 @@ class MyStatelessWidget extends StatelessWidget {
width: 300,
color: Colors.red,
child: FittedBox(
fit: BoxFit.fill,
child: Image.network(
'https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg'),
fit: BoxFit.fill,
),
);
}

View File

@@ -34,7 +34,15 @@ class MyStatelessWidget extends StatelessWidget {
body: Center(
child: PhysicalShape(
elevation: 5.0,
clipper: ShapeBorderClipper(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
),
color: Colors.orange,
child: const SizedBox(
height: 200.0,
width: 200.0,
child: Center(
child: Text(
'Hello, World!',
@@ -44,14 +52,7 @@ class MyStatelessWidget extends StatelessWidget {
),
),
),
height: 200.0,
width: 200.0,
),
clipper: ShapeBorderClipper(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
)),
color: Colors.orange,
),
),
);

View File

@@ -42,11 +42,6 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
padding: const EdgeInsets.symmetric(vertical: 16),
itemBuilder: (BuildContext context, int index) {
return Dismissible(
child: ListTile(
title: Text(
'Item ${items[index]}',
),
),
background: Container(
color: Colors.green,
),
@@ -56,6 +51,11 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
items.removeAt(index);
});
},
child: ListTile(
title: Text(
'Item ${items[index]}',
),
),
);
},
);

View File

@@ -43,14 +43,6 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
Draggable<int>(
// Data is the value this Draggable stores.
data: 10,
child: Container(
height: 100.0,
width: 100.0,
color: Colors.lightGreenAccent,
child: const Center(
child: Text('Draggable'),
),
),
feedback: Container(
color: Colors.deepOrange,
height: 100,
@@ -65,6 +57,14 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
child: Text('Child When Dragging'),
),
),
child: Container(
height: 100.0,
width: 100.0,
color: Colors.lightGreenAccent,
child: const Center(
child: Text('Draggable'),
),
),
),
DragTarget<int>(
builder: (

View File

@@ -42,10 +42,10 @@ class MyStatelessWidget extends StatelessWidget {
return child;
}
return AnimatedOpacity(
child: child,
opacity: frame == null ? 0 : 1,
duration: const Duration(seconds: 1),
curve: Curves.easeOut,
child: child,
);
},
),

View File

@@ -49,12 +49,12 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ElevatedButton(
child: const Text('Slide up'),
onPressed: _slideUp,
child: const Text('Slide up'),
),
ElevatedButton(
child: const Text('Slide down'),
onPressed: _slideDown,
child: const Text('Slide down'),
),
Padding(
padding: const EdgeInsets.all(50),

View File

@@ -45,8 +45,8 @@ class _MyHomePageState extends State<MyHomePage> {
title: const Text('Persistence Example'),
),
body: PageStorage(
child: pages[currentTab],
bucket: _bucket,
child: pages[currentTab],
),
bottomNavigationBar: BottomNavigationBar(
currentIndex: currentTab,

View File

@@ -74,8 +74,8 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget>
@override
Widget build(BuildContext context) {
return OutlinedButton(
child: Text('${_answer.value}'),
onPressed: _incrementAnswer,
child: Text('${_answer.value}'),
);
}
}

View File

@@ -29,16 +29,16 @@ class MyStatelessWidget extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
body: RawScrollbar(
child: ListView(
children: List<Text>.generate(
100, (int index) => Text((index * index).toString())),
physics: const BouncingScrollPhysics(),
),
shape: const StadiumBorder(
side: BorderSide(color: Colors.brown, width: 3.0)),
thickness: 15.0,
thumbColor: Colors.blue,
isAlwaysShown: true,
child: ListView(
physics: const BouncingScrollPhysics(),
children: List<Text>.generate(
100, (int index) => Text((index * index).toString())),
),
),
);
}