Skip to content

Instantly share code, notes, and snippets.

@wess
Last active Jun 4, 2021
Embed
What would you like to do?
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