Skip to content

Commit fe84be7

Browse files
committed
[two_dimensional_scrollables] Fix lints in examples
Adds `const` to constructors and curly braces to control flow statements to fix new lint warnings in the `table_explorer.dart` and `tree_explorer.dart` examples.
1 parent 7b2db36 commit fe84be7

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

packages/two_dimensional_scrollables/example/lib/table_view/table_explorer.dart

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,20 @@ class _TableExplorerState extends State<TableExplorer> {
5959
RadioGroup<TableType>(
6060
groupValue: _currentExample,
6161
onChanged: (TableType? value) {
62-
if (value == null) return;
62+
if (value == null) {
63+
return;
64+
}
6365
setState(() => _currentExample = value);
6466
},
6567
child: Row(
6668
children: <Widget>[
67-
Radio<TableType>(value: TableType.simple),
69+
const Radio<TableType>(value: TableType.simple),
6870
const Text('Simple'),
6971
_spacer,
70-
Radio<TableType>(value: TableType.merged),
72+
const Radio<TableType>(value: TableType.merged),
7173
const Text('Merged'),
7274
_spacer,
73-
Radio<TableType>(value: TableType.infinite),
75+
const Radio<TableType>(value: TableType.infinite),
7476
const Text('Infinite'),
7577
],
7678
),
@@ -88,10 +90,7 @@ class _TableExplorerState extends State<TableExplorer> {
8890
title: Text(_getTitle()),
8991
bottom: PreferredSize(
9092
preferredSize: const Size.fromHeight(50),
91-
child: Padding(
92-
padding: const EdgeInsets.all(8.0),
93-
child: _getRadioRow(),
94-
),
93+
child: Padding(padding: const EdgeInsets.all(8.0), child: _getRadioRow()),
9594
),
9695
),
9796
body: _getTable(),

packages/two_dimensional_scrollables/example/lib/tree_view/tree_explorer.dart

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,17 @@ class _TreeExplorerState extends State<TreeExplorer> {
5353
RadioGroup<TreeType>(
5454
groupValue: _currentExample,
5555
onChanged: (TreeType? value) {
56-
if (value == null) return;
56+
if (value == null) {
57+
return;
58+
}
5759
setState(() => _currentExample = value);
5860
},
5961
child: Row(
6062
children: <Widget>[
61-
Radio<TreeType>(value: TreeType.simple),
63+
const Radio<TreeType>(value: TreeType.simple),
6264
const Text('Simple'),
6365
_spacer,
64-
Radio<TreeType>(value: TreeType.custom),
66+
const Radio<TreeType>(value: TreeType.custom),
6567
const Text('Custom'),
6668
],
6769
),
@@ -79,10 +81,7 @@ class _TreeExplorerState extends State<TreeExplorer> {
7981
title: Text(_getTitle()),
8082
bottom: PreferredSize(
8183
preferredSize: const Size.fromHeight(50),
82-
child: Padding(
83-
padding: const EdgeInsets.all(8.0),
84-
child: _getRadioRow(),
85-
),
84+
child: Padding(padding: const EdgeInsets.all(8.0), child: _getRadioRow()),
8685
),
8786
),
8887
body: _getTree(),

0 commit comments

Comments
 (0)