Registering the service worker immediately after the documented has loaded may cause SW initialization to compete with framework initialization. It was recommended to us that we defer the service worker setup until after the framework is done with setup, which should be sometime after the first frame.
To implement this, I augmented the binding setup to dispatch an event on the document after the binding has initialized. I don't see any obvious risks with this setup.
Fixes#66066
Based on feedback from various desktop developers, and to be consistent between the defaults and the sample code, this PR switches the default for visual density in desktop themes to be compact instead of standard.
It also removes the same setting from the sample code generated by "flutter create" because it is no longer needed now that it is the default.
Updates all null safe dependencies to versions that allow 2.10 stable and 2.11 dev releases.
Also updates flutter_goldens and flutter_goldens_client to allow 2.11 dev.
Removes the template version from the Windows template; the API and
tooling boundary will now be considered stable, so there will no longer
be frequent breaking changes.
Also updates the link for adding desktop support to a project for all
three platforms to reflect the current location.
Fixes https://github.com/flutter/flutter/issues/52748
Adds a VERSIONINFO to Runner.rc in the Windows app template, populated
from the project creation metadata.
Currently the version itself is hard-coded, but it is future-proofed to
allow plumbing the actual version through at build time via preprocessor
defines.
People frequently assume they can run the executable they find at the
top level of the build directory, and don't understand why they get
resource errors from the engine. To avoid that, this puts the unbundled
copy of the executable in a subdirectory with a name that should warn
people away from running it.
Fixes#64963
The pointer-argument-based version of Success() is deprecated; this
updates the template to use the new reference-based version (which
allows for inline construction of the response value).
Part of https://github.com/flutter/flutter/issues/63975
This wires up the new WindowProc delegation system that allows plugins
to handle top-level window messages (e.g., to control resize behavior).
Fixes#53168
* First pass at CMake files; untested
* First pass of adding CMake generation logic on Windows
* Misc fixes
* Get bundling working, start incoprorating CMake build into tool
* Fix debug, exe name.
* Add resources
* Move cmake.dart
* Rip out all the vcxproj/solution plumbing
* Fix plugin cmake generation
* Build with cmake rather than calling VS directly
* Adjust Windows plugin template to match standard header directory structure
* Pass config selection when building
* Partially fix multi-config handling
* Rev template version
* Share the CMake generation instead of splitting it out
* VS build/run cycle works, with slightly awkward requirement to always build all
* Update manifest
* Plugin template fixes
* Minor adjustments
* Build install as part of build command, instead of separately
* Test cleanup
* Update Linux test for adjusted generated CMake approach
* Plugin test typo fix
* Add missing stub file for project test
* Add a constant for VS generator
First pass at fixing #57985 and implementing #59602
This doesn't have enough metadata to be useful for IDEs yet, but it prevents the issue from getting worse while we iterate on it.
Remove the version checking and associated warnings. The Linux template
and build process will now be subject to more typical Flutter breaking
change policy, and should no longer require regularly deleting and
recreating the platform directory.
Updates the tooling to use the GTK embedding, rather than the GLFW embedding:
- Adds new requirements to `doctor`
- Updates the app and plugin templates to make GTK-based runners and plugins
- Stops downloading and installing the GLFW artifacts
Final part of #54860, other than cleanup.
This install step fails if the list is empty, which is the case for projects without plugins (or Dart-only plugins, so flutter/plugins presubmits are currently broken).
PR #57749 included changes to the way the project interacts with the
build process (e.g., bundling the necessary library), so should have
incremented the template version to trigger the messaging to developers.
BundleUtilities apparently doesn't do build-system-style timestamp
analysis when deciding what to copy, and instead just doesn't copy
things that are already present. This cleans that bundle directory on
each build, so that it includes the up-to-date library versions.
Since this is just copying from build artifacts, this is very fast; the
build steps themselves are not affected.
Fixes https://github.com/flutter/flutter/issues/58049
The CMake plugin build wasn't setting visibility to hidden by default,
which meant that plugins exported everything by default. This would make
bad interactions between plugins much more likely; only the intended API
should be exported by the shared library.
The Linux CMakeLists.txt are intended to be compatible with 3.10, but
accedintally used a list construct that wasn't added until 3.12. This
adds a custom replacement function.
This makes the build compatible with 3.10 as originally intended.
Updates the Linux templates to use CMake+ninja, rather than Make, and updates the tooling to generate CMake support files rather than Make support files, and to drive the build using cmake and ninja.
Also updates doctor to check for cmake and ninja in place of make.
Note: While we could use CMake+Make rather than CMake+ninja, in testing ninja handled the tool_backend.sh call much better, calling it only once rather than once per dependent target. While it does add another dependency that people are less likely to already have, it's widely available in package managers, as well as being available as a direct download. Longer term, we could potentially switch from ninja to Make if it's an issue.
Fixes#52751
Redirects stdout/stderr in the Windows template when creating a console. This fixes the console opened when running from Visual Studio to actually show output, instead of being empty.
Fixes#53169
Plugins, and the library, should be able to use COM without special
setup. This adds COM initialization to the runner template so that it's
available for any code on the main thread.
This moves the app template more toward being a more generic starting
point for any Flutter application, eliminating some hard-code
assumptions about there being a single window/engine pair that is
directly bound to the life of the application:
- Moves the runloop into its own class, making it capable of servicing
any number of engine instances.
- Moves the logic for setting up a window containing only a Flutter view
into a window subclass for ease of re-use.
- Makes quit-on-window-close an optional property. (Long term this
should be even more generic, like a quit-when-last-window-closes
option, but this is a short-term improvement that removes the binding
between the runloop and the window).
- Allows for multiple instances of Win32Window to exist without issues
relating to the window class registration.
Since there are getting to be a non-trivial number of files associated
with the runner, this moves the source into a runner/ directory, as is
already done on some other platforms.
Note that creating multiple Flutter windows at the same time still
doesn't work correctly even with this change, but this addresses some of
the known issues, and makes it easier to test in the future (e.g., for
debugging engine-level issues with multiple instances).
Fixes#45397
Adds a VisualDensity.adaptivePlatformDensity static function that returns different values for visual density based on the defaultTargetPlatform. Returns compact for desktop platforms, and a default visual density for other platforms.
Updates the Windows app template to use the new DartProject API, significantly simplifying the template.
Increments the template version, even though this isn't itself a breaking change, so that users will be prompted to update their projects rather than be broken later when the old API is removed.
Adds initial support for flutter create of apps and plugins. This is derived from the current FDE example app and sample plugin, adding template values where relevant.
Since the APIs/tooling/template aren't stable yet, the app template includes a version marker, which will be updated each time there's a breaking change. The build now checks that the template version matches the version known by that version of the tool, and gives a specific error message when there's a mismatch, which improves over the current breaking change experience of hitting whatever build failure the breaking change causes and having to figure out that the problem is that the runner is out of date. It also adds a warning to the create output about the fact that it won't be stable.
Plugins don't currently have a version marker since in practice this is not a significant problem for plugins yet the way it is for runners; we can add it later if that changes.
Fixes#30704