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:
@@ -48,20 +48,14 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
}
|
||||
|
||||
static Widget get _buttonText {
|
||||
switch (defaultTargetPlatform) {
|
||||
case TargetPlatform.android:
|
||||
return const Text('Continue in Android view');
|
||||
case TargetPlatform.iOS:
|
||||
return const Text('Continue in iOS view');
|
||||
case TargetPlatform.windows:
|
||||
return const Text('Continue in Windows view');
|
||||
case TargetPlatform.macOS:
|
||||
return const Text('Continue in macOS view');
|
||||
case TargetPlatform.linux:
|
||||
return const Text('Continue in Linux view');
|
||||
case TargetPlatform.fuchsia:
|
||||
throw UnimplementedError('Platform not yet implemented');
|
||||
}
|
||||
return switch (defaultTargetPlatform) {
|
||||
TargetPlatform.android => const Text('Continue in Android view'),
|
||||
TargetPlatform.iOS => const Text('Continue in iOS view'),
|
||||
TargetPlatform.windows => const Text('Continue in Windows view'),
|
||||
TargetPlatform.macOS => const Text('Continue in macOS view'),
|
||||
TargetPlatform.linux => const Text('Continue in Linux view'),
|
||||
TargetPlatform.fuchsia => throw UnimplementedError('Platform not yet implemented'),
|
||||
};
|
||||
}
|
||||
|
||||
Future<void> _launchPlatformCount() async {
|
||||
|
||||
Reference in New Issue
Block a user