Flutter makes it easy and fast to build beautiful apps for mobile and beyond
Go to file
David Iglesias 34b42acf1b
[web] Hides that Flutter uses requireJS in debug. (#129032)
Flutter web uses requireJS in `debug` mode to assemble a DDC-compiled app from a bunch of small files ("modules").

This caused that `canvaskit.js` (and all other modules that used a browserify-like loading header) didn't work because they attempted to use the `define` function provided by Flutter's instance of `requireJS` (which kept the defined modules private, rather than as globals on the page, as the users of the JS expected).

A [fix](https://github.com/flutter/engine/pull/27342) was added to `flutter/engine` to trick loaders into *not* using the `requireJS` module loader, but a recent change in the fix's js-interop layer *subtly* changed its JS output on the page (objects went from `undefined` to `null`), causing this:

* https://github.com/flutter/flutter/issues/126131 (and others)

This PR hides a bit of code that is commonly used by module loaders to decide that they may use the `define` function provided by requireJS (so the engine workaround can be removed).

## Next steps

* https://github.com/flutter/engine/pull/42941

## Issues

Partially addresses: https://github.com/flutter/flutter/issues/126131 (and others)

## Tests

* Added a unit test to ensure the `delete` stays
* Manually tested with the Gallery app in `debug` mode with a bunch of user-supplied scripts that currently fail to load.
  * Also tested hot restart as suggested by @nshahan
2023-06-23 02:09:12 +00:00
.github [process] Add a design doc issue template. (#128361) 2023-06-20 13:42:34 +00:00
.vscode Adjust repo config for VS Code formatting (#122758) 2023-04-14 12:35:42 +02:00
bin Roll Flutter Engine from 86820cbd40c5 to aca26b2afc27 (2 revisions) (#129393) 2023-06-23 01:05:08 +00:00
dev Revert "Fix Material 3 Scrollable TabBar" (#129383) 2023-06-22 22:34:06 +00:00
examples Selection area right click behavior should match native (#128224) 2023-06-21 19:32:04 +00:00
packages [web] Hides that Flutter uses requireJS in debug. (#129032) 2023-06-23 02:09:12 +00:00
.ci.yaml Unpin path_provider_android (#129205) 2023-06-22 21:22:49 +00:00
.cirrus.yml Update .cirrus.yml (#126166) 2023-05-05 19:16:55 +00:00
.gitattributes Add pre-stable support for create on Windows (#51895) 2020-03-23 10:42:26 -07:00
.gitignore add .pub-cache back to .gitignore (#128894) 2023-06-15 19:21:05 +00:00
analysis_options.yaml Sync Lints (#127976) 2023-06-02 04:27:17 +00:00
AUTHORS Add myself to AUTHORS (#127298) 2023-05-22 07:21:07 -07:00
CODE_OF_CONDUCT.md Update CODE_OF_CONDUCT.md (#94583) 2021-12-03 13:39:06 -08:00
CODEOWNERS Remove self from CODEOWNERS (#125337) 2023-04-21 22:33:05 +00:00
CONTRIBUTING.md add link to design doc wiki page (#127442) 2023-06-01 02:39:15 +00:00
dartdoc_options.yaml Eliminate uses of pub executable in docs publishing and sample analysis. (#89181) 2021-08-30 12:16:05 -07:00
flutter_console.bat License update (#45373) 2019-11-27 15:04:02 -08:00
LICENSE License update (#45373) 2019-11-27 15:04:02 -08:00
PATENT_GRANT Rename patent file (#38686) 2019-08-16 16:54:58 +01:00
README.md add slsa l1 badge (#125932) 2023-05-03 20:01:34 +00:00
TESTOWNERS move test ownership from zanderso -> tools team (#129199) 2023-06-21 16:43:33 +00:00

Flutter

Build Status - Cirrus Discord badge Twitter handle codecov CII Best Practices OpenSSF Scorecard SLSA 1

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, follow the flutter-announce@googlegroups.com mailing list. Our documentation also tracks breaking changes across releases.

Terms of service

The Flutter tool may occasionally download resources from Google servers. By downloading or using the Flutter SDK, you agree to the Google Terms of Service: https://policies.google.com/terms

For example, when installed from GitHub (as opposed to from a prepackaged archive), the Flutter tool will download the Dart SDK from Google servers immediately when first run, as it is used to execute the flutter tool itself. This will also occur when Flutter is upgraded (e.g. by running the flutter upgrade command).

About Flutter

We think Flutter will help you create beautiful, fast apps, with a productive, extensible and open development model, whether you're targeting iOS or Android, web, Windows, macOS, Linux or embedding it as the UI toolkit for a platform of your choice.

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 whether you're building for iOS (Cupertino) or other platforms (Material), along with support for customizing or creating entirely new visual components.

Reflectly hero image

Fast results

Flutter is fast. It's powered by the same hardware-accelerated 2D graphics library that underpins Chrome and Android: Skia. 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 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), and also includes editor plug-ins for both Visual Studio Code and IntelliJ / Android Studio. Flutter provides tens of thousands of packages to speed your development, regardless of your target platform. And accessing other native code is easy, with support for both FFI (on Android, on iOS, on macOS, and on Windows) as well as platform-specific APIs.

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