aloisdeniel/flutter_device_preview

Device Preview as a target platform

Open

#111 opened on Mar 11, 2021

View on GitHub
 (2 comments) (1 reaction) (0 assignees)Dart (233 forks)batch import
designenhancementhelp wanted

Repository metrics

Stars
 (1,823 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

I'm currently thinking about defining Device Preview as a target platform instead of an embedded widget. This would basically launch the app as an inner view.

Concept

image

Instead of compiling the application as a macOS (or Windows), it would launch it as an embedded view in a macOS Device Preview application.

Ideally, this Device Preview shell app would be developed with Flutter to make it cross platform!

Advantages

No configuration needed for users, just choosing Device Preview as a target platform.

This would also simplify a lot of device preview implementation by implementing the platform elements instead of relying only on MediaQuery.

It would also allow simulating system events, and even overriding plugins to create simulations (push, ...).

The problem

I have absolutely no idea how to achieve that. I know that I would have to create a fork of Flutter engine and tweak the default macos/windows targets to embed the application.

Contributor guide