117 Commits

Author SHA1 Message Date
Yegor
9c49255f3e
a11y: remove SemanticsSortOrder; sort locally only; semanticsOwner post-test check (#15537)
* a11y: remove SemanticsSortOrder; sort locally only; semanticsOwner post-test check

* update accessibility test framework

- default nextNodeId/previousNodeId to -1
- stop treating null as opt-out from value testing
- add `id`, `TestSemantics.root`, and `tags` to the suggested code in the TestSemantics failure message
- fix a small bug with raw string escaping
- update all tests accordingly

* fix sortKey doc

* prefer const over final
2018-03-18 22:18:52 -07:00
Vyacheslav Egorov
ce82cc656c
Fix Dart 2 issues in editable_text_test. (#14632)
Need to use `typed(any)` instead of `any` in Dart 2.
2018-02-12 08:20:32 +01:00
Alexandre Ardhuin
841d5d7bd5
prefer_const_declarations on local variables (#14358) 2018-02-01 07:51:26 +01:00
Michael Goderbauer
3fd737c8f7
a11y on Android: copy/cut/paste (#14343)
With a little refactor and unification of how availability of copy/cut/paste is determined across platforms.

Minor remaining issue: https://github.com/flutter/flutter/issues/14331.

Fixes https://github.com/flutter/flutter/issues/13501.
2018-01-31 12:26:24 -08:00
Michael Goderbauer
671c1101a4
Change text selection (or cursor position) via a11y (#14275)
Roll engine to 7c34dfafc9acece1a9438f206bfbb0a9bedba3bf
2018-01-26 10:44:41 -08:00
Michael Goderbauer
24e3f70536
Rename SemanticsFlags to SemanticsFlag (#13994)
to align with `SemanticsAction` and other enum-like types.
2018-01-09 10:31:23 -08:00
Michael Goderbauer
d04c906e0b
Add arguments to SemanticsActions; implement extend selection for a11y (#13490)
**This PR contains a breaking API change:**
`SemanticsConfiguration.addAction()` has been removed and replaces by action-specific setters (`onTap`, `onLongPress`, etc.) to take care of the fact that some action handlers (those, who take arguments) have different signatures.
2017-12-12 16:59:35 -08:00
Michael Goderbauer
52d06b8213 a11y cursor movement (#13405) 2017-12-07 19:06:16 -08:00
Michael Goderbauer
045ee5fd0a
Do not show handles when changing text selection via keyboard (#13338)
This contains a breaking API change to `SelectionChangedHandler`.

This is part of making text input accessible on Andriod (https://github.com/flutter/flutter/issues/12785).
2017-12-06 13:37:15 -08:00
Michael Goderbauer
736b414f13
Add text field content to semantics (#13000)
* Add text field content to semantics

* remove controller dup
2017-11-14 09:52:24 -08:00
Mikkel Nygaard Ravn
7298f9ca0b
Expose isMethodCall matcher in flutter_test (#12942) 2017-11-10 08:09:14 +01:00
Chris Bracken
4e2e69797a
Eliminate MethodCall hashCode and equals (#12277)
Since MethodCall equality checks are limited to test scenarios, this
patch replaces them with an equivalent test matcher. At present
MethodCalls are always used in scenarios where indentity-based
equality/hashing is appropriate.

This change avoids an assertion failure when MethodCall args are
Iterable (possible since args are of type dyanmic), and hashValue() from
dart:ui asserts that its input is not an Iterable.

The alternative of implementing support for deep equality in dart:ui was
rejected on the basis that if we're to encourage performant code,
expensive checks should be obviously-expensive to the author.
2017-11-06 09:52:57 -08:00
Michael Goderbauer
1d4607ff04
Identify text fields as such to a11y (#12804)
* Identify text fields as such to a11y

* focus

* make travis happy

* review comments
2017-11-02 10:08:56 -07:00
Chris Bracken
2698fe852e Delete a duplicate EditableText test (#12325)
In 85c425ac88, a test was added to ensure that widget.onChanged was
fired when the contents of an EditableText changed via system paste
events (e.g. triggered from a TextSelectionOverlay). Due to a long stack
of rebases and (less-than-perfect) manual merge conflict merge
resolution, it was inadvertently added twice.
2017-09-29 11:18:53 -07:00
Chris Bracken
85c425ac88 Improved behaviour for text-editing widgets (#12273)
This patch fixes a collection of issues with widgets involved in text
editing:

  * Fire widget.onChanged on EditableText value change:
    The value of an EditableText is composed of the text value as well
    as other editing-related data such as selection-related information.

    Previously, widget.onChanged() was only called for updates via
    updateEditingValue(). For pastes via a TextSelectionOverlay, updates
    are signalled via _handleSelectionOverlayChanged(), which only ever
    triggered widget.onSelectionChanged(), but not widget.onChanged().

    Both updateEditingValue() and _handleSelectionOverlayChanged()
    perform the value update via _formatAndSetValue(), which is where
    this patch moves the widget.onChanged() call.

  * Correctly update TextFormField value on edits via controller:
    The textual value of a TextFormField exists in two locations:
      1. FormField.value, as with all FormFields and subclasses.
      2. TextEditingController.value associated with the TextField
         underlying the TextFormField.

    Previously, edits to the TextEditingController associated with a
    TextFormField resulted in updates to the rendered TextField widget,
    but did not update TextFormField.value. FormField.value is updated
    via FormField's onChanged function, which is called from the
    EditableText underlying the TextField underlying the TextFormField.
    EditableText only fires onChanged when it receives changes from the
    engine. It does not fire onChanged for changes made to the
    underlying TextController, since the owner of the TextController is
    the one making these changes and thus, already aware of them.
    FormField, however, *does* need to listen to these changes to update
    its value.

  * Adds an initialValue parameter to the TextFormField constructor:
    FormField's constructor already takes an initialValue parameter,
    which specifies the initial value in the field, which is also the
    value to which reset() returns the field.

    Previously, TextFormField took its initial value from the controller
    value (if a controller was passed in) or the empty string (if not).
    This had the undesirable effect that calling reset() always resets
    the value to the current value of the controller... i.e., does
    nothing.

    We now take an initial value explicitly.
2017-09-28 17:45:49 -07:00
Chris Bracken
f06ef528e9 Verify EditableText fires update on replaced controller (#12276)
Adds a test that verifies that EditableText sends a
TextInput.setEditingState message to the engine when the associated
TextEditingController is replaced.
2017-09-28 12:18:56 -07:00
gspencergoog
4389f07024 This adds multiline text widget support. (#12120)
Add multiline keyboard support to editable text widget.  Fixes #8028.
2017-09-27 14:23:34 -07:00