Revert "if chains → switch expressions" (#148556)
Reverts flutter/flutter#147793 Introduced https://github.com/flutter/flutter/issues/148548.
This commit is contained in:
@@ -123,10 +123,13 @@ class _SnackBarExampleState extends State<SnackBarExample> {
|
||||
const Text('Multi Line Text'),
|
||||
Switch(
|
||||
value: _multiLine,
|
||||
onChanged: switch (_snackBarBehavior) {
|
||||
SnackBarBehavior.fixed || null => null,
|
||||
SnackBarBehavior.floating => (bool value) => setState(() { _multiLine = !_multiLine; }),
|
||||
},
|
||||
onChanged: _snackBarBehavior == SnackBarBehavior.fixed
|
||||
? null
|
||||
: (bool value) {
|
||||
setState(() {
|
||||
_multiLine = !_multiLine;
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -136,10 +139,13 @@ class _SnackBarExampleState extends State<SnackBarExample> {
|
||||
value: _sliderValue,
|
||||
divisions: 20,
|
||||
label: _sliderValue.toStringAsFixed(2),
|
||||
onChanged: switch (_snackBarBehavior) {
|
||||
SnackBarBehavior.fixed || null => null,
|
||||
SnackBarBehavior.floating => (double value) => setState(() { _sliderValue = value; }),
|
||||
},
|
||||
onChanged: _snackBarBehavior == SnackBarBehavior.fixed
|
||||
? null
|
||||
: (double value) {
|
||||
setState(() {
|
||||
_sliderValue = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
]),
|
||||
const SizedBox(height: 16.0),
|
||||
|
||||
Reference in New Issue
Block a user