Add macOS to TargetPlatform (#43457)
This PR adds TargetPlatform.macOS to the TargetPlatform enum. This allows us to begin implementation of some adaptive UI based on which target platform is desired.
I haven't updated the tests here, that will come in a follow-up PR.
diff --git a/packages/flutter_tools/lib/src/commands/create.dart b/packages/flutter_tools/lib/src/commands/create.dart
index 4fd4377ae..645c625 100644
--- a/packages/flutter_tools/lib/src/commands/create.dart
+++ b/packages/flutter_tools/lib/src/commands/create.dart
@@ -656,7 +656,8 @@
// removed, and the new schema should always be used.
'useNewPluginSchema': macos,
// If a desktop platform is included, add a workaround for #31366.
- 'includeTargetPlatformWorkaround': macos,
+ // When Linux and Windows are added, we will need this workaround again.
+ 'includeTargetPlatformWorkaround': false,
};
}
diff --git a/packages/flutter_tools/templates/app/lib/main.dart.tmpl b/packages/flutter_tools/templates/app/lib/main.dart.tmpl
index fa01186..40c8db1 100644
--- a/packages/flutter_tools/templates/app/lib/main.dart.tmpl
+++ b/packages/flutter_tools/templates/app/lib/main.dart.tmpl
@@ -18,7 +18,7 @@
// Sets a platform override for desktop to avoid exceptions. See
// https://flutter.dev/desktop#target-platform-override for more info.
void _enablePlatformOverrideForDesktop() {
- if (!kIsWeb && (Platform.isMacOS || Platform.isWindows || Platform.isLinux)) {
+ if (!kIsWeb && (Platform.isWindows || Platform.isLinux)) {
debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;
}
}