chore: generate template (#17)
This commit is contained in:
committed by
GitHub
parent
5baf0dfa61
commit
699457e663
@@ -0,0 +1,21 @@
|
||||
import FlutterMacOS
|
||||
import Foundation
|
||||
|
||||
public class {{project_name.pascalCase()}}Plugin: NSObject, FlutterPlugin {
|
||||
public static func register(with registrar: FlutterPluginRegistrar) {
|
||||
let channel = FlutterMethodChannel(
|
||||
name: "{{project_name.snakeCase()}}_macos",
|
||||
binaryMessenger: registrar.messenger)
|
||||
let instance = {{project_name.pascalCase()}}Plugin()
|
||||
registrar.addMethodCallDelegate(instance, channel: channel)
|
||||
}
|
||||
|
||||
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
switch call.method {
|
||||
case "getPlatformName":
|
||||
result("MacOS")
|
||||
default:
|
||||
result(FlutterMethodNotImplemented)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#
|
||||
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
|
||||
#
|
||||
Pod::Spec.new do |s|
|
||||
s.name = '{{project_name.snakeCase()}}_macos'
|
||||
s.version = '0.0.1'
|
||||
s.summary = 'A macOS implementation of the {{project_name.snakeCase()}} plugin.'
|
||||
s.description = <<-DESC
|
||||
A macOS implementation of the {{project_name.snakeCase()}} plugin.
|
||||
DESC
|
||||
s.homepage = 'http://example.com'
|
||||
s.license = { :type => 'BSD', :file => '../LICENSE' }
|
||||
s.author = { 'Your Company' => 'email@example.com' }
|
||||
s.source = { :path => '.' }
|
||||
s.source_files = 'Classes/**/*'
|
||||
s.dependency 'FlutterMacOS'
|
||||
|
||||
s.platform = :osx
|
||||
s.osx.deployment_target = '10.11'
|
||||
s.swift_version = '5.0'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user