)]}'
{
  "commit": "d4226566d4de00ec2c1cabb69c3eaa906b99bbce",
  "tree": "0d5ce1bb0e722d0b68fa30058ee0cd9e65cfcde9",
  "parents": [
    "444b13b89518d59f2d8a8d914e5568d31563134a"
  ],
  "author": {
    "name": "Greg Spencer",
    "email": "gspencergoog@users.noreply.github.com",
    "time": "Wed Feb 26 18:04:32 2020 -0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Feb 26 18:04:32 2020 -0800"
  },
  "message": "Change Focus.unfocus to take a disposition for where the focus… (#50831)\n\nWhen 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.\r\n\r\nThis PR removes the focusPrevious flag from unfocus, and replaces it with a disposition enum that indicates where the focus should go from here.\r\n\r\nThe other value of the UnfocusDisposition enum is UnfocusDisposition.scope.\r\n\r\nUnfocusDisposition.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\r\n\r\nA 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.\r\n\r\nIn addition to those changes, unfocus called on a FocuScope that wasn\u0027t 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\u0027s easy enough to do: just call primaryFocus.unfocus().\r\n\r\nFixes #48903",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f133dbc3a76fd290347537fbcf11366f13d637bb",
      "old_mode": 33188,
      "old_path": "packages/flutter/lib/src/widgets/focus_manager.dart",
      "new_id": "fc17b2492c6aae6d0f46f9fe3d966cbedd2c1f08",
      "new_mode": 33188,
      "new_path": "packages/flutter/lib/src/widgets/focus_manager.dart"
    },
    {
      "type": "modify",
      "old_id": "f3da8cafb8196150acc34fdab24d1c2165128207",
      "old_mode": 33188,
      "old_path": "packages/flutter/test/widgets/editable_text_test.dart",
      "new_id": "66628a3ffed28acedc44b0c373484c5437f75a00",
      "new_mode": 33188,
      "new_path": "packages/flutter/test/widgets/editable_text_test.dart"
    },
    {
      "type": "modify",
      "old_id": "9a6b3b05d40dc1a333e639802bb4192df576e1f3",
      "old_mode": 33188,
      "old_path": "packages/flutter/test/widgets/focus_manager_test.dart",
      "new_id": "88513d04a14203be4679bf1601445f128cd471b0",
      "new_mode": 33188,
      "new_path": "packages/flutter/test/widgets/focus_manager_test.dart"
    },
    {
      "type": "modify",
      "old_id": "101b87c1769bae3a9228b1c61b8634d0e754c82f",
      "old_mode": 33188,
      "old_path": "packages/flutter/test/widgets/focus_scope_test.dart",
      "new_id": "ad5a6cbfa70de246ae6007795493ab01ea03cc9e",
      "new_mode": 33188,
      "new_path": "packages/flutter/test/widgets/focus_scope_test.dart"
    },
    {
      "type": "modify",
      "old_id": "c8c4a7c7555aa3baaa34b13b3cdccca61fd58afa",
      "old_mode": 33188,
      "old_path": "packages/flutter/test/widgets/routes_test.dart",
      "new_id": "4fc4e2b8bea2c878a15980d6260051b3f53bd5c8",
      "new_mode": 33188,
      "new_path": "packages/flutter/test/widgets/routes_test.dart"
    }
  ]
}
