Restructure the Windows app template (#53600)

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
50 files changed
tree: 44b8d7565f87536c171e26214ba854bb913eeba2
  1. .github/
  2. bin/
  3. dev/
  4. examples/
  5. packages/
  6. .cirrus.yml
  7. .codecov.yml
  8. .gitattributes
  9. .gitignore
  10. analysis_options.yaml
  11. AUTHORS
  12. CODE_OF_CONDUCT.md
  13. CODEOWNERS
  14. CONTRIBUTING.md
  15. dartdoc_options.yaml
  16. flutter_console.bat
  17. LICENSE
  18. PATENT_GRANT
  19. README.md
README.md

Flutter logo

Build Status - Cirrus Gitter Channel Twitter handle

Flutter is Google's SDK for crafting beautiful, fast user experiences for mobile, web and desktop from a single codebase. Flutter works with existing code, is used by developers and organizations around the world, and is free and open source.

Documentation

For announcements about new releases and breaking changes, follow the flutter-announce@googlegroups.com mailing list.

About Flutter

We think Flutter will help you create beautiful, fast apps, with a productive, extensible and open development model.

Beautiful user experiences

We want to enable designers to deliver their full creative vision without being forced to water it down due to limitations of the underlying framework. Flutter's layered architecture gives you control over every pixel on the screen, and its powerful compositing capabilities let you overlay and animate graphics, video, text and controls without limitation. Flutter includes a full set of widgets that deliver pixel-perfect experiences on both iOS and Android.

Reflectly hero image

Fast results

Flutter is fast. It's powered by the same hardware-accelerated Skia 2D graphics library that underpins Chrome and Android. We architected Flutter to support glitch-free, jank-free graphics at the native speed of your device. Flutter code is powered by the world-class Dart platform, which enables compilation to 32-bit and 64-bit ARM machine code for iOS and Android, as well as JavaScript for the web and Intel x64 for desktop devices.

Dart platform diagram

Productive development

Flutter offers stateful hot reload, allowing you to make changes to your code and see the results instantly without restarting your app or losing its state.

Hot reload animation

Extensible and open model

Flutter works with any development tool (or none at all), but includes editor plug-ins for both Visual Studio Code and IntelliJ / Android Studio. Flutter provides thousands of packages to speed your development, regardless of your target platform. And accessing other native code is easy, with support for both FFI and platform-specific APIs.

Flutter is a fully open source project, and we welcome contributions. Information on how to get started can be found at our contributor guide.