Implement switch expressions in examples/ and animation/ (#139882)
Thanks so much for approving the previous PR (#139048) a couple weeks ago! This one is the same, except it's covering files in `examples/` and `packages/flutter/lib/src/animation/`. (solving issue #136139)
This commit is contained in:
@@ -272,14 +272,11 @@ class IsolateExampleState extends State<StatefulWidget> with SingleTickerProvide
|
||||
}
|
||||
|
||||
String _getStatus(CalculationState state) {
|
||||
switch (state) {
|
||||
case CalculationState.loading:
|
||||
return 'Loading...';
|
||||
case CalculationState.calculating:
|
||||
return 'In Progress';
|
||||
case CalculationState.idle:
|
||||
return 'Idle';
|
||||
}
|
||||
return switch (state) {
|
||||
CalculationState.loading => 'Loading...',
|
||||
CalculationState.calculating => 'In Progress',
|
||||
CalculationState.idle => 'Idle',
|
||||
};
|
||||
}
|
||||
|
||||
void _updateState(String result, double progress) {
|
||||
|
||||
Reference in New Issue
Block a user