kekland / flutter_simulator

WIP: Experimental package to support desktop development for Apple/Android devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flutter_simulator

Warning: still highly experimental.

Light         Dark

https://github.com/kekland/flutter_simulator/blob/master/assets/demo.mov

Features

  • Support for emulating any kind of a device
  • Rotating devices
  • Emulating the software keyboard
  • Brightness selector
  • Quickly screenshotting the screen/frame

TODO

  • Improve documentation
  • Improve iOS keyboard
  • Emulating gestures (pinch, zoom, rotate)
  • Improve window_manager to handle some cases when the window is resized
  • Fix some antialiasing issues
  • Add more devices
  • Optimize rasterization performance (e.g. screen_interceptor.dart) - maybe add quality toggles?

Devices

  • iPhone 14

Installation

This is still WIP, so I didn't publish it to Pub yet. Will do once it's more-less stable.

Add this package with a git reference to pubspec.yaml:

flutter_simulator:
  git:
    url: https://github.com/kekland/flutter_simulator
    ref: f8368c5

Edit main.dart or create another entrypoint (something like simulator.main.dart), and tweak a couple of things:

  • Instead of calling WidgetsFlutterBinding.ensureInitialized(), call await SimulatorWidgetsBinding.ensureInitialized().
  • Instead of calling runApp(...), call runFlutterSimulatorApp(...)
  • Doesn't work with FlutterNativeSplash. Remove any calls to FlutterNativeSplash.preserve() in the entrypoint. This might be fixed in the future, but due to the native splash package delaying the first frame paint, the stuff needed to initialize the simulator are never called.

Credits

iPhone Simulator:

Supporters:

  • Azat Smet
  • Dilmurat Yunussov
  • Daniyar Zakarin

Contact me

If you have any questions or suggestions feel free to open an issue or email me directly at kk.erzhan@gmail.com.

About

WIP: Experimental package to support desktop development for Apple/Android devices

License:Other


Languages

Language:Dart 74.0%Language:C++ 12.3%Language:CMake 9.7%Language:Ruby 1.4%Language:HTML 0.9%Language:Swift 0.9%Language:C 0.7%Language:Kotlin 0.1%Language:Objective-C 0.0%