Skip to content

Unable to create RegularWindow on Windows when preferredSize not set #185123

Description

@robert-ancell

If you create a RegularWindow without a preferred size no window is created on Windows and the following error shown on the terminal:

[FATAL:flutter/shell/platform/windows/host_window_regular.cc(19)] Check failed: preferred_size.has_preferred_view_size.

Example code:

final RegularWindowController controller = RegularWindowController();
RegularWindow(controller: controller);

Works if you add a size, i.e.:

final RegularWindowController controller = RegularWindowController(preferredSize: const Size(400, 300));

This works on Linux.

See https://github.com/robert-ancell/regular_window_no_preferred_size for a full example that shows this problem.

Metadata

Metadata

Assignees

Labels

team-windowsOwned by the Windows platform team

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions