flutter/examples/layers
Todd Volkert 835c7fab45
Fix FocusManager constructor (#75894)
The FocusManager constructor was registering global event handlers
on the shared RawKeyboard instance and the global pointer router.
This posed a few problems: (1) there was no way to unregister these
handlers, and (2) instantiating a second FocusManager would overwrite
the existing focus manager's RawKeyboard handler. This was manifesting
in unexpected ways, such as the fact that constructing a second
BuildOwner (for a parallel tree, for instance) was obliterating the
event handler for the main BuildOwner's focus manager, thus messing
with focus.

This change separates those global event registrations into a
dedicated method, registerGlobalHandlers(), and overrides dispose()
to properly unregister those handlers.
2021-02-12 17:19:20 -08:00
..
android Relands: Migrate template to Gradle 6.7 and AGP 4.1.0 (#71446) 2020-12-01 19:01:09 -08:00
ios Build iOS apps using Swift Packages (#73508) 2021-01-07 15:59:09 -08:00
lib License update (#45373) 2019-11-27 15:04:02 -08:00
raw Remove "unnecessary" imports. (#74820) 2021-01-27 16:19:04 -08:00
rendering Remove "unnecessary" imports. (#74820) 2021-01-27 16:19:04 -08:00
services Migrate all of examples/layers to sound null safety (#68744) 2020-10-22 13:33:07 -07:00
test Remove "unnecessary" imports. (#74820) 2021-01-27 16:19:04 -08:00
widgets Fix FocusManager constructor (#75894) 2021-02-12 17:19:20 -08:00
analysis_options.yaml [null-safety] remove enable experiment flags (#69930) 2020-11-05 23:58:11 -08:00
pubspec.yaml roll packages (#75370) 2021-02-04 11:41:03 -08:00
README.md ✒ Spell Check All .md Files Related to Flutter 💙 (#61564) 2020-07-22 18:23:47 -07:00

Examples of Flutter's layered architecture

This directory contains several self-contained examples that illustrate Flutter's layered architecture.

  • raw/ These examples show how to program against the lowest layer of the system. They manually receive input packets and construct composited scenes.

  • rendering/ These examples use Flutter's render tree to structure your app using a retained tree of visual objects. These objects coordinate to determine their size and position on screen and to handle events.

  • widgets/ These examples use Flutter's widgets to build more elaborate apps using a reactive framework.

  • services/ These examples use services available in Flutter to interact with the host platform.

To run each example, specify the demo file on the flutter run command line, for example:

flutter run raw/spinning_square.dart
flutter run rendering/spinning_square.dart
flutter run widgets/spinning_square.dart