package com.atmob.keyboard_android.util

import io.flutter.embedding.engine.FlutterEngine

/**
 * Flutter引擎持有者
 */
object FlutterEngineHolder {
    private var mFlutterEngine: FlutterEngine? = null

    /**
     * 保存Flutter引擎
     */
    fun attachFlutterEngine(engine: FlutterEngine) {
        this.mFlutterEngine = engine
    }

    /**
     * 取消保存Flutter引擎
     */
    fun detachFlutterEngine() {
        this.mFlutterEngine = null
    }

    /**
     * 获取FlutterEngine
     */
    fun getFlutterEngine(): FlutterEngine? {
        return mFlutterEngine
    }
}