mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
> [!IMPORTANT] > Requires the following engine PR: > * https://github.com/flutter/engine/pull/52380 > ---- This PR refactors Flutter `foundation`'s library `platform` for the web with the same code we use to detect platforms in the engine. ## Issues * Fixes: https://github.com/flutter/flutter/issues/128943 ## Testing Demo app deployed here: * https://dit-browser-detect.web.app
The rule for packages in this directory is that they can depend on
nothing but core Dart packages. They can't depend on dart:ui, they
can't depend on any package:, and they can't depend on anything
outside this directory.
Currently they do depend on dart:ui, but only for VoidCallback and
clampDouble (and maybe one day lerpDouble), which are all intended
to be moved out of dart:ui and into dart:core.
There is currently also an unfortunate dependency on the platform dispatcher logic (SingletonFlutterWindow, Brightness, PlatformDispatcher, window), though that should probably move to the 'services' library.
See also: