aloisdeniel/flutter_device_preview

Custom WidgetsBinding

Open

#10 opened on Oct 20, 2019

View on GitHub
 (1 comment) (2 reactions) (0 assignees)Dart (233 forks)batch import
enhancementhelp wanted

Repository metrics

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

Description

Ideally, a custom WidgetsBinding should be provided to emulate the host.

This would allow to emulate more things :

  • Application lifecycle events
  • Memory pressure event
  • Platform channels
  • A mouse pointer

The DevicePreview.appBuilder (injects a custom MediaQuery) and DevicePreview.of(context).locale parameters wouldn't be needed anymore too since they would be managed by the binding itself.

The issue is that the WidgetBindings.instance is unique and static, so it is not possible to override it only from the encapsulated user app.

Contributor guide