diff --git a/packages/flutter_tools/templates/plugin/ios-swift.tmpl/Classes/pluginClass.h.tmpl b/packages/flutter_tools/templates/plugin/ios-swift.tmpl/Classes/pluginClass.h.tmpl deleted file mode 100644 index 560ffa569c..0000000000 --- a/packages/flutter_tools/templates/plugin/ios-swift.tmpl/Classes/pluginClass.h.tmpl +++ /dev/null @@ -1,4 +0,0 @@ -#import - -@interface {{pluginClass}} : NSObject -@end diff --git a/packages/flutter_tools/templates/plugin/ios-swift.tmpl/Classes/pluginClass.m.tmpl b/packages/flutter_tools/templates/plugin/ios-swift.tmpl/Classes/pluginClass.m.tmpl deleted file mode 100644 index 4e16e6c0d1..0000000000 --- a/packages/flutter_tools/templates/plugin/ios-swift.tmpl/Classes/pluginClass.m.tmpl +++ /dev/null @@ -1,15 +0,0 @@ -#import "{{pluginClass}}.h" -#if __has_include(<{{projectName}}/{{projectName}}-Swift.h>) -#import <{{projectName}}/{{projectName}}-Swift.h> -#else -// Support project import fallback if the generated compatibility header -// is not copied when this plugin is created as a library. -// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 -#import "{{projectName}}-Swift.h" -#endif - -@implementation {{pluginClass}} -+ (void)registerWithRegistrar:(NSObject*)registrar { - [Swift{{pluginClass}} registerWithRegistrar:registrar]; -} -@end diff --git a/packages/flutter_tools/templates/plugin/ios-swift.tmpl/Classes/SwiftpluginClass.swift.tmpl b/packages/flutter_tools/templates/plugin/ios-swift.tmpl/Classes/pluginClass.swift.tmpl similarity index 80% rename from packages/flutter_tools/templates/plugin/ios-swift.tmpl/Classes/SwiftpluginClass.swift.tmpl rename to packages/flutter_tools/templates/plugin/ios-swift.tmpl/Classes/pluginClass.swift.tmpl index 952508a7c1..b2d52f925d 100644 --- a/packages/flutter_tools/templates/plugin/ios-swift.tmpl/Classes/SwiftpluginClass.swift.tmpl +++ b/packages/flutter_tools/templates/plugin/ios-swift.tmpl/Classes/pluginClass.swift.tmpl @@ -1,10 +1,10 @@ import Flutter import UIKit -public class Swift{{pluginClass}}: NSObject, FlutterPlugin { +public class {{pluginClass}}: NSObject, FlutterPlugin { public static func register(with registrar: FlutterPluginRegistrar) { let channel = FlutterMethodChannel(name: "{{projectName}}", binaryMessenger: registrar.messenger()) - let instance = Swift{{pluginClass}}() + let instance = {{pluginClass}}() registrar.addMethodCallDelegate(instance, channel: channel) } diff --git a/packages/flutter_tools/templates/template_manifest.json b/packages/flutter_tools/templates/template_manifest.json index 8751ab8e45..c452abec1b 100644 --- a/packages/flutter_tools/templates/template_manifest.json +++ b/packages/flutter_tools/templates/template_manifest.json @@ -258,9 +258,7 @@ "templates/plugin/ios-objc.tmpl/Classes/pluginClass.h.tmpl", "templates/plugin/ios-objc.tmpl/Classes/pluginClass.m.tmpl", "templates/plugin/ios-objc.tmpl/projectName.podspec.tmpl", - "templates/plugin/ios-swift.tmpl/Classes/pluginClass.h.tmpl", - "templates/plugin/ios-swift.tmpl/Classes/pluginClass.m.tmpl", - "templates/plugin/ios-swift.tmpl/Classes/SwiftpluginClass.swift.tmpl", + "templates/plugin/ios-swift.tmpl/Classes/pluginClass.swift.tmpl", "templates/plugin/ios-swift.tmpl/projectName.podspec.tmpl", "templates/plugin/ios.tmpl/.gitignore", "templates/plugin/ios.tmpl/Assets/.gitkeep", diff --git a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart index 9d1b0257f8..6d217a8ed4 100644 --- a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart @@ -638,9 +638,7 @@ void main() { 'example/ios/Runner/AppDelegate.swift', 'example/ios/Runner/Runner-Bridging-Header.h', 'example/lib/main.dart', - 'ios/Classes/FlutterProjectPlugin.h', - 'ios/Classes/FlutterProjectPlugin.m', - 'ios/Classes/SwiftFlutterProjectPlugin.swift', + 'ios/Classes/FlutterProjectPlugin.swift', 'lib/flutter_project.dart', ], unexpectedPaths: [ @@ -649,6 +647,8 @@ void main() { 'example/ios/Runner/AppDelegate.h', 'example/ios/Runner/AppDelegate.m', 'example/ios/Runner/main.m', + 'ios/Classes/FlutterProjectPlugin.h', + 'ios/Classes/FlutterProjectPlugin.m', ], ); });