Skip to content

Instantly share code, notes, and snippets.

@wess
Last active June 4, 2021 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wess/3c4d2f5afaaeeebcea920dee6fd778a3 to your computer and use it in GitHub Desktop.
Save wess/3c4d2f5afaaeeebcea920dee6fd778a3 to your computer and use it in GitHub Desktop.
FlutterChannel.swift
class FlutterChannel {
static private let _instance = FlutterChannel()
private let channel = {
let _channel = FlutterMethodChannel(...)
channel.setMethodCallhandler(FlutterChannel.route)
return _channel
}()
private class func route(call:FlutterMethodCall, result: FlutterResult) {
switch call.method {
case "accessToken":
result(SessionCache...accessToken)
break
}
}
private func init() {}
public class func init() { _instance.init() }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment