1. 17 Nov, 2021 2 commits
  2. 04 Oct, 2021 1 commit
    • Greg Spencer's avatar
      Clean up examples, remove section markers and --template args (#91133) · fd9ce277
      Greg Spencer authored
      This does a cleanup of the examples, removing all of the "section" markers and extra comments that we don't need anymore now that the samples are no longer in the source code. It also removes the --template arguments from the {@tool dartpad} and {@tool sample} directives, since those are no longer used. It converts two examples that I discovered were still embedded into linked examples in the examples folder.
      
      I didn't delete the templates from the snippets config folder yet, because there are still embedded samples in the dart:ui package from the engine that use them. Once dart:ui no longer uses the templates, they can be removed.
      
      I bumped the version of the snippets package to pick up a change that allows removal of the --template argument.
      fd9ce277
  3. 25 Aug, 2021 1 commit
    • Greg Spencer's avatar
      Extract Sample code into examples/api (#87280) · 33403bd2
      Greg Spencer authored
      This extracts the sample code out from the API doc comments, and places them in separate files on disk, allowing running of the examples locally, testing them, and building of slightly larger examples.
      33403bd2
  4. 29 Jul, 2021 1 commit
  5. 28 Jul, 2021 1 commit
  6. 26 Jul, 2021 1 commit
  7. 09 Jul, 2021 1 commit
  8. 12 Jun, 2021 1 commit
  9. 19 May, 2021 1 commit
  10. 10 May, 2021 1 commit
  11. 28 Apr, 2021 1 commit
  12. 26 Apr, 2021 1 commit
  13. 15 Apr, 2021 1 commit
    • Tong Mu's avatar
      Shortcut activator (#78522) · eb735167
      Tong Mu authored
      This PR introduced a new class, ShortcutActivator, and refactored the the definition and lookup system of shortcuts, in order to solve a few issues of the previous algorithm.
      eb735167
  14. 14 Apr, 2021 1 commit
    • Greg Spencer's avatar
      Handle null primary focus when receiving key events (#80302) · 6b06943c
      Greg Spencer authored
      This allows the key handling code in the shortcut manager to function when there is a null primaryFocus. The primary focus can be null only in some special circumstances (e.g. when an app hasn't set any focus at all), but that shouldn't cause a crash.
      6b06943c
  15. 03 Apr, 2021 1 commit
  16. 31 Mar, 2021 1 commit
  17. 16 Mar, 2021 1 commit
  18. 19 Jan, 2021 1 commit
  19. 22 Dec, 2020 1 commit
  20. 11 Dec, 2020 1 commit
  21. 03 Dec, 2020 1 commit
  22. 20 Nov, 2020 1 commit
  23. 17 Nov, 2020 1 commit
  24. 16 Nov, 2020 1 commit
  25. 12 Nov, 2020 1 commit
  26. 11 Nov, 2020 1 commit
  27. 05 Nov, 2020 1 commit
  28. 02 Nov, 2020 1 commit
  29. 29 Oct, 2020 1 commit
    • Greg Spencer's avatar
      Remove nullOk parameter from Shortcuts.of, Actions.find, and Actions.handler (#68921) · 4f586fa3
      Greg Spencer authored
      This removes the nullOk parameter from Shortcuts.of, Actions.find and Actions.handler and created Shortcuts.maybeOf and Actions.maybeFind. Shortcuts.of and Actions.find now return non-nullable values, and the maybe versions return a nullable value. I didn't create a non-nullable version of Actions.handler, since it needs to be able to return null if an action is not enabled, but I did remove the nullOk parameter, effectively setting it to true permanently, since setting it to false doesn't make much sense if the function can still return null when the action is not enabled.
      4f586fa3
  30. 19 Oct, 2020 1 commit
    • Greg Spencer's avatar
      Mark keys that match a shortcut, but have no action defined as "not handled". (#67359) · 8c03ff8c
      Greg Spencer authored
      - - When I added notification of key events before processing them as text, it made it so that shortcut key bindings like the spacebar would prevent spaces from being inserted into text fields, which is obviously not desirable (and so that change was reverted). At the same time, we do want to make it possible to override key events so that they can do things like intercept a tab key or arrow keys that change the focus.
      
      This PR changes the behavior of the Shortcuts widget so that if it has a shortcut defined, but no action is bound to the intent, then instead of responding that the key is "handled", it responds as if nothing handled it. This allows the engine to continue to process the key as text entry.
      
      This PR includes:
      
      - Modification of the callback type for key handlers to return a KeyEventResult instead of a bool, so that we can return more information (i.e. the extra state of "stop propagation").
      - Modification of the ActionDispatcher.invokeAction contract to require that Action.isEnabled return true before calling it. It will now assert if the action isn't enabled when invokeAction is called. This is to allow optimization of the number of calls to isEnabled, since the shortcuts widget now wants to know if the action was enabled before deciding to either handle the key or to return ignored.
      - Modification to ShortcutManager.handleKeypress to return KeyEventResult.ignored for keys which don't have an enabled action associated with them.
      - Adds an attribute to DoNothingAction that allows it to mark a key as not handled, even though it does have an action associated with it. This will allow disabling of a shortcut for a subtree.
      8c03ff8c
  31. 15 Sep, 2020 1 commit
    • Alexandre Ardhuin's avatar
      Reland "Nnbd widgets" (#65528) · b007a81a
      Alexandre Ardhuin authored
      * Reland "Nnbd widgets (#64672)"
      
      This reverts commit 127e6790.
      
      * remove non-nullable enforcement on AsyncSnapshot
      
      * make data param non-nullable for AsyncSnapshot.withData
      
      * make some Text params non-nullable
      b007a81a
  32. 09 Sep, 2020 2 commits
    • Michael Goderbauer's avatar
      Revert "Nnbd widgets (#64672)" (#65488) · 127e6790
      Michael Goderbauer authored
      This reverts commit e682ec71.
      127e6790
    • Alexandre Ardhuin's avatar
      Nnbd widgets (#64672) · e682ec71
      Alexandre Ardhuin authored
      * migrate widget to nullsafety
      
      * remove double blank line after license
      
      * address review comments in actions.dart
      
      * nullable ObjectKey.value
      
      * use local variable oldElement
      
      * make State.build non-nullable
      
      * make State.context non-nullable
      
      * newline at eof
      
      * make ProxyWidget.child non-nullable
      
      * make _InactiveElements.debugContains non-nullable
      
      * make Element.depth non-nullable
      
      * make ProxyElement.build non-nullable
      
      * make StatefulElement.state non-nullable
      
      * remove 'Notice that'
      
      * avoid cast of list in RenderObjectElement.updateChildren
      
      * make IndexedSlot.value non-nullable
      
      * avoid cast of list in MultiChildRenderObjectElement.mount
      
      * make some WidgetsApp parameters non-nullable
      
      * hitTest take non-nullable position
      
      * make ScrollableState.position non-nullable
      
      * use _pixels instead of pixels
      
      * make ViewportOffset.pixels non-nullable
      
      * make param and return type of IndexedWidgetBuilder non-nullable
      
      * unused_import
      
      * make context param non-nullable for Builder in animated_list.dart
      
      * make ScrollMetrics.viewportDimension non-nullable
      
      * make ScrollMetrics.{min,max}ScrollExtent non-nullable
      
      * make _Location.file non-nullable
      
      * _WidgetForTypeTests.createElement throw UnimplementedError
      
      * update _NullWidget.build error message
      
      * make _ShortcutsState.manager non-nullable
      
      * Fix childCount issues for NNBD
      
      * fix childCount computation on web
      
      * increase max value on js side to compute childCount
      
      * make aspect parameter of dependOnInheritedWidgetOfExactType nullable
      
      * merge has{min,max}ScrollExtent into hasScrollExtents
      
      * update focus_manager.dart
      
      * address review comments in icon.dart
      
      * address review comments in image.dart
      
      * address review comments in routes.dart
      
      * address review comments in scroll_activity.dart
      
      * update doc comments
      
      * make UserScrollNotification.direction non-nullable and required
      
      * rename hasScrollExtents to hasContentDimensions
      
      * unnecessary late
      Co-authored-by: 's avatarIan Hickson <ian@hixie.ch>
      e682ec71
  33. 11 Aug, 2020 1 commit
    • Greg Spencer's avatar
      Make RawKeyboard assert when no keys are in keysPressed when sending a key down event. (#63426) · 0ec0bf50
      Greg Spencer authored
      This adds an assert in RawKeyboard that catches the case where it tries to send a key down event, but (after synchronizing modifiers) there are no keys in keysPressed. This state can occur if the modifier flags are not set properly for the platform.
      
      Also prevents shortcuts attempting to handle a key down when no keys are pressed at the moment (which was causing a crash in release mode).
      0ec0bf50
  34. 29 Jul, 2020 1 commit
  35. 16 Jun, 2020 1 commit
    • Greg Spencer's avatar
      Remove dependency on package:collection by moving mergeSort into... · c5527dc8
      Greg Spencer authored
      Remove dependency on package:collection by moving mergeSort into foundation/collections.dart (#59521)
      
      This removes a dependency from Flutter (package:collection) by copying the implementation of mergeSort into Flutter's foundation/collections.dart.
      
      Also, removed a reference to UnmodifiableSetView from the shortcuts code by just returning a copy instead.
      c5527dc8
  36. 11 Jun, 2020 1 commit
  37. 03 Jun, 2020 1 commit
  38. 07 Apr, 2020 1 commit
    • Greg Spencer's avatar
      Revise Action API (#42940) · 0f68b46f
      Greg Spencer authored
      This updates the Action API in accordance with the design doc for the changes: flutter.dev/go/actions-and-shortcuts-design-revision
      
      Fixes #53276
      0f68b46f