Find a file
Greg Spencer d4226566d4
Change Focus.unfocus to take a disposition for where the focus… (#50831)
When Focus.unfocus is called, the caller usually just thinks about wanting to remove focus from the node, but really, unfocus is a request to automatically pass the focus to another (hopefully useful) node.

This PR removes the focusPrevious flag from unfocus, and replaces it with a disposition enum that indicates where the focus should go from here.

The other value of the UnfocusDisposition enum is UnfocusDisposition.scope.

UnfocusDisposition.previouslyFocusedChild is closest to what focusPrevious used to do: focus the nearest enclosing scope and use its focusedChild field to walk down the tree, finding the leaf focusedChild. This PR modifies it slightly so that it walks up to the nearest focusable enclosing scope before trying to focus the children. This change addresses #48903

A new mode: UnfocusDisposition.scope will focus the nearest focusable enclosing scope of this node without trying to use the FocusScopeNode.focusedChild value to descend to the leaf focused child. This is useful as a default for both text field finalization and for what happens when canRequestFocus is set to false. It allows the scope to stay focused so that nextFocus/previousFocus still work as expected, but removes the focus from primary focus.

In addition to those changes, unfocus called on a FocuScope that wasn't the primary focus used to unfocus the primary focus instead. I removed that behavior, since it was buggy: if the primary focus was inside of a child scope, and you called unfocus on the parent scope, then the child scope could have focused another of its children instead, leaving the scope that you called unfocus on with hasFocus returning true still. If you want to remove the focus from the primary focus instead of the scope, that's easy enough to do: just call primaryFocus.unfocus().

Fixes #48903
2020-02-26 18:04:32 -08:00
.github Update BUG.md (#48539) 2020-01-11 11:04:29 -08:00
bin Roll engine ecdfc91d1618..ecabc1037652 (20 commits) (#51480) 2020-02-26 12:43:39 -08:00
dev Live image cache (#51485) 2020-02-26 16:01:56 -08:00
examples [flutter_tools] remove vm_service_client dependency from flutter tool (#51227) 2020-02-24 14:19:43 -08:00
packages Change Focus.unfocus to take a disposition for where the focus… (#50831) 2020-02-26 18:04:32 -08:00
.cirrus.yml Run verify-binaries-signed on pre-submit when merging to release branches (#51221) 2020-02-25 18:12:29 -08:00
.codecov.yml dont require diffs to have a percentage coverage greater than the previous diff (#36090) 2019-07-12 15:10:41 -07:00
.gitattributes Add git config option to automatically convert CRLF to LF (#8122) 2017-02-14 10:21:33 -08:00
.gitignore [flutter_tools] support --split-debug-info option in android builds (#49650) 2020-02-05 17:45:24 -08:00
analysis_options.yaml update lint list + enable unnecessary_string_interpolations (#50593) 2020-02-14 09:43:52 +01:00
AUTHORS Added linking to viewInsets and viewPadding in MediaQuery padding docs (#50659) 2020-02-12 14:58:05 -08:00
CODE_OF_CONDUCT.md Mention conduct@flutter.dev (#39150) 2019-08-25 10:46:02 -07:00
CODEOWNERS Add @christopherfujino as owner of dev/ci (docker) (#48261) 2020-01-06 13:55:03 -08:00
CONTRIBUTING.md Revert "Revert "Add many more global analyses. (#47875)" (#48080)" (#48081) 2020-01-02 11:47:28 -08:00
dartdoc_options.yaml Reverse the sense of the terms snippet and sample. (#48254) 2020-01-08 15:28:02 -08: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 Update README.md (#49078) 2020-01-17 13:43:23 -08:00

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.