1. 15 Aug, 2018 1 commit
  2. 20 Jul, 2018 2 commits
  3. 19 Jul, 2018 1 commit
  4. 14 Jul, 2018 1 commit
  5. 05 Jun, 2018 1 commit
  6. 09 Apr, 2018 1 commit
  7. 29 Mar, 2018 1 commit
  8. 22 Mar, 2018 1 commit
  9. 14 Mar, 2018 2 commits
  10. 20 Jan, 2018 1 commit
  11. 03 Jan, 2018 1 commit
  12. 11 Dec, 2017 1 commit
  13. 29 Sep, 2017 1 commit
    • Chris Bracken's avatar
      Improved behaviour for text-editing widgets (#12273) · 85c425ac
      Chris Bracken authored
      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.
      85c425ac
  14. 18 Jul, 2017 1 commit
  15. 13 Jun, 2017 1 commit
  16. 28 Apr, 2017 1 commit
    • xster's avatar
      Create a text validator/formatter mechanism (#9535) · f65fea8e
      xster authored
      * Add a text formatter interface used by EditingText. Provide some default implementations.
      
      * self nits
      
      * Handle -1 selection offsets
      
      * review notes
      
      * simplify regular expression
      
      * Add whitelisting formatters. Use a custom phone number formatter in text demo.
      
      * review notes
      
      * not being able to addAll(null) is pretty annoying
      
      * review notes
      
      * partial tests
      
      * Add tests
      
      * didn’t end up needing mockito
      
      * move to services
      f65fea8e
  17. 04 Apr, 2017 1 commit
    • Adam Barth's avatar
      Defer to TextField in TextFormField docs (#9144) · d88ff907
      Adam Barth authored
      TextFormField doesn't actually have many properties because it wraps a
      TextField. Rather than trying to document all the arguments in the
      constructor, we now refer to the docs for TextField, which explain the
      parameters in a more readable way.
      
      Fixes #7245
      d88ff907
  18. 02 Apr, 2017 1 commit
    • Adam Barth's avatar
      Rationalize text input widgets (#9119) · ae899486
      Adam Barth authored
      After this patch, there are three major text input widgets:
      
       * EditableText. This widget is a low-level editing control that
         interacts with the IME and displays a blinking cursor.
      
       * TextField. This widget is a Material Design text field, with all the
         bells and whistles. It is highly configurable and can be reduced down
         to a fairly simple control by setting its `decoration` property to
         null.
      
       * TextFormField. This widget is a FormField that wraps a TextField.
      
      This patch also replaces the InputValue data model for these widgets
      with a Listenable TextEditingController, which is much more flexible.
      
      Fixes #7031
      ae899486