Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed window reference #183

Merged
merged 1 commit into from
Dec 21, 2020
Merged

Changed window reference #183

merged 1 commit into from
Dec 21, 2020

Conversation

Tkko
Copy link
Contributor

@Tkko Tkko commented Dec 18, 2020

I've changed reference of window object as it is recommended in windows docs.

window.dart
/// Please try to avoid statically referencing this and instead use a
/// binding for dependency resolution such as WidgetsBinding.instance.window.

binding.dart
/// Each of these other bindings could individually access a [Window] statically,
/// but that would preclude the ability to test these behaviors with a fake
/// window for verification purposes. Therefore, [BindingBase] exposes this
/// [Window] for use by other bindings. A subclass of [BindingBase], such as
/// [TestWidgetsFlutterBinding], can override this accessor to return a
/// different [Window] implementation, such as a [TestWindow].

I've changed reference of window object as it is recommended in windows docs.

window.dart
/// Please try to avoid statically referencing this and instead use a
/// binding for dependency resolution such as `WidgetsBinding.instance.window`.

binding.dart
/// Each of these other bindings could individually access a [Window] statically,
/// but that would preclude the ability to test these behaviors with a fake 
/// window for verification purposes.  Therefore, [BindingBase] exposes this
/// [Window] for use by other bindings.  A subclass of [BindingBase], such as
/// [TestWidgetsFlutterBinding], can override this accessor to return a
/// different [Window] implementation, such as a [TestWindow].
@lizhuoyuan lizhuoyuan merged commit bcc55f3 into OpenFlutter:master Dec 21, 2020
@lizhuoyuan
Copy link
Collaborator

lizhuoyuan commented Dec 21, 2020

beta:

image

I changed it:

    var mediaQuery = WidgetsBinding.instance?.window ?? ui.window;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants