File tree Expand file tree Collapse file tree 2 files changed +27
-45
lines changed
packages/two_dimensional_scrollables/example/lib Expand file tree Collapse file tree 2 files changed +27
-45
lines changed Original file line number Diff line number Diff line change @@ -56,38 +56,25 @@ class _TableExplorerState extends State<TableExplorer> {
56
56
child: Row (
57
57
children: < Widget > [
58
58
const Spacer (),
59
- Radio <TableType >(
60
- value: TableType .simple,
59
+ RadioGroup <TableType >(
61
60
groupValue: _currentExample,
62
61
onChanged: (TableType ? value) {
63
- setState (() {
64
- _currentExample = value! ;
65
- });
62
+ if (value == null ) return ;
63
+ setState (() => _currentExample = value);
66
64
},
65
+ child: Row (
66
+ children: < Widget > [
67
+ Radio <TableType >(value: TableType .simple),
68
+ const Text ('Simple' ),
69
+ _spacer,
70
+ Radio <TableType >(value: TableType .merged),
71
+ const Text ('Merged' ),
72
+ _spacer,
73
+ Radio <TableType >(value: TableType .infinite),
74
+ const Text ('Infinite' ),
75
+ ],
76
+ ),
67
77
),
68
- const Text ('Simple' ),
69
- _spacer,
70
- Radio <TableType >(
71
- value: TableType .merged,
72
- groupValue: _currentExample,
73
- onChanged: (TableType ? value) {
74
- setState (() {
75
- _currentExample = value! ;
76
- });
77
- },
78
- ),
79
- const Text ('Merged' ),
80
- _spacer,
81
- Radio <TableType >(
82
- value: TableType .infinite,
83
- groupValue: _currentExample,
84
- onChanged: (TableType ? value) {
85
- setState (() {
86
- _currentExample = value! ;
87
- });
88
- },
89
- ),
90
- const Text ('Infinite' ),
91
78
const Spacer (),
92
79
],
93
80
),
Original file line number Diff line number Diff line change @@ -50,27 +50,22 @@ class _TreeExplorerState extends State<TreeExplorer> {
50
50
child: Row (
51
51
children: < Widget > [
52
52
const Spacer (),
53
- Radio <TreeType >(
54
- value: TreeType .simple,
53
+ RadioGroup <TreeType >(
55
54
groupValue: _currentExample,
56
55
onChanged: (TreeType ? value) {
57
- setState (() {
58
- _currentExample = value! ;
59
- });
56
+ if (value == null ) return ;
57
+ setState (() => _currentExample = value);
60
58
},
59
+ child: Row (
60
+ children: < Widget > [
61
+ Radio <TreeType >(value: TreeType .simple),
62
+ const Text ('Simple' ),
63
+ _spacer,
64
+ Radio <TreeType >(value: TreeType .custom),
65
+ const Text ('Custom' ),
66
+ ],
67
+ ),
61
68
),
62
- const Text ('Simple' ),
63
- _spacer,
64
- Radio <TreeType >(
65
- value: TreeType .custom,
66
- groupValue: _currentExample,
67
- onChanged: (TreeType ? value) {
68
- setState (() {
69
- _currentExample = value! ;
70
- });
71
- },
72
- ),
73
- const Text ('Custom' ),
74
69
const Spacer (),
75
70
],
76
71
),
You can’t perform that action at this time.
0 commit comments