Skip to content

Instantly share code, notes, and snippets.

@li9ht
Created December 1, 2021 01:54
Show Gist options
  • Save li9ht/2e789790702de762bf69d29425fc8876 to your computer and use it in GitHub Desktop.
Save li9ht/2e789790702de762bf69d29425fc8876 to your computer and use it in GitHub Desktop.
import UIKit
import Flutter
import FlutterPluginRegistrant
class ShowFlutterViewControler: UIViewController{
func showFlutter(){
let flutterEnggine = (UIApplication.shared.delegate as! AppDelegate).flutter_engine
let flutterController = FlutterViewController(engine:flutterEnggine,nibName:nil,bundle:nil)
//start
//if your have scrollview in your flutter app
if #available(iOS 13.0, *) {
flutterController.isModalInPresentation = false
} else {
// Fallback on earlier versions
}
flutterController.modalPresentationStyle = .fullScreen
//end
self.present(flutterController, animated: true, completion: nil)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment