1. 10 Apr, 2019 1 commit
  2. 08 Apr, 2019 1 commit
    • Todd Volkert's avatar
      Add Form.onSaved (#30643) · 949023b2
      Todd Volkert authored
      When submitting data to a server, callers need a callback that will
      get invoked after all the individual form fields are saved. If they
      have a button that submits the form, they could just do this logic
      in the click handler for the button (save the form, then submit to
      the server), but if they have more ways than one to submit the form
      (i.e. hitting enter while in a text form field), then it becomes
      more convoluted and calls for a unified callback that will get
      notified when the form is submitted.
      949023b2
  3. 01 Mar, 2019 1 commit
    • Alexandre Ardhuin's avatar
      Add missing trailing commas (#28673) · 387f8854
      Alexandre Ardhuin authored
      * add trailing commas on list/map/parameters
      
      * add trailing commas on Invocation with nb of arg>1
      
      * add commas for widget containing widgets
      
      * add trailing commas if instantiation contains trailing comma
      
      * revert bad change
      387f8854
  4. 29 Jan, 2019 1 commit
  5. 16 Oct, 2018 1 commit
  6. 12 Sep, 2018 1 commit
  7. 26 Jun, 2018 1 commit
  8. 14 Mar, 2018 1 commit
  9. 16 Feb, 2018 1 commit
  10. 01 Feb, 2018 1 commit
  11. 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
  12. 07 Sep, 2017 1 commit
  13. 05 Sep, 2017 1 commit
  14. 14 Apr, 2017 1 commit
  15. 11 Apr, 2017 1 commit
    • xster's avatar
      Rename State.config to widget everywhere (#9273) · 89a7fdfc
      xster authored
      Rename State.config to State.widget
      Rename State.didUpdateConfig to State.didUpdateWidget
      Renamed all State subclasses' local variables named config to something else
      89a7fdfc
  16. 02 Apr, 2017 2 commits
    • Adam Barth's avatar
      Make it possible to center the text in a TextField (#9140) · 0b31c699
      Adam Barth authored
      Also, fix an issue where hint text wasn't visible when the
      InputDecoration was collapsed.
      
      Fixes #8541
      0b31c699
    • 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
  17. 31 Mar, 2017 1 commit
    • Adam Barth's avatar
      Improve focus management (#9074) · 89aaaa9c
      Adam Barth authored
      We now have an explicit focus tree that we manage. Instead of using
      GlobalKeys to manage focus, we use FocusNode and FocusScopeNode objects.
      The FocusNode is Listenable and notifies when its focus state changes.
      
      Focus notifications trigger by tree mutations are now delayed by one
      frame, which is necessary to handle certain complex tree mutations. In
      the common case of focus changes being triggered by user input, the
      focus notificiation still arives in the same frame.
      89aaaa9c
  18. 04 Mar, 2017 1 commit
  19. 07 Feb, 2017 1 commit
  20. 04 Feb, 2017 1 commit
  21. 25 Jan, 2017 1 commit
    • Adam Barth's avatar
      Add a sliver-based ScrollView (#7627) · eba5fb1a
      Adam Barth authored
      This patch introduces ScrollView, which is a convenience widget for using a
      SliverBlock. This patch also switches a number of tests from Block to
      ScrollView. Once we support more features of block (e.g., padding and
      shrinkwrapping), we'll be able to move over more clients.
      eba5fb1a
  22. 20 Jan, 2017 1 commit
  23. 19 Jan, 2017 1 commit
  24. 09 Jan, 2017 1 commit
  25. 16 Dec, 2016 1 commit
  26. 08 Nov, 2016 1 commit
  27. 07 Nov, 2016 2 commits
  28. 02 Nov, 2016 1 commit
  29. 19 Oct, 2016 2 commits
  30. 07 Oct, 2016 1 commit
    • Adam Barth's avatar
      Deploy `@checked` (#6244) · 2c21d795
      Adam Barth authored
      This patch adds `@checked` everywhere is needed to remove the
      `strong_mode_invalid_method_override` strong mode error.
      2c21d795
  31. 21 Sep, 2016 2 commits
  32. 29 May, 2016 1 commit
  33. 16 May, 2016 1 commit
    • Ian Hickson's avatar
      Make it possible to run tests live on a device (#3936) · 32527017
      Ian Hickson authored
      This makes it possible to substitute 'flutter run' for 'flutter test'
      and actually watch a test run on a device.
      
      For any test that depends on flutter_test:
      
      1. Remove any import of 'package:test/test.dart'.
      
      2. Replace `testWidgets('...', (WidgetTester tester) {`
            with `testWidgets('...', (WidgetTester tester) async {`
      
      3. Add an "await" in front of calls to any of the following:
          * tap()
          * tapAt()
          * fling()
          * flingFrom()
          * scroll()
          * scrollAt()
          * pump()
          * pumpWidget()
      
      4. Replace any calls to `tester.flushMicrotasks()` with calls to
         `await tester.idle()`.
      
      There's a guarding API that you can use, if you have particularly
      complicated tests, to get better error messages. Search for
      TestAsyncUtils.
      32527017
  34. 29 Apr, 2016 1 commit
    • Ian Hickson's avatar
      Refactor the test framework (#3622) · 91dd9699
      Ian Hickson authored
      * Refactor widget test framework
      
      Instead of:
      
      ```dart
        test("Card Collection smoke test", () {
          testWidgets((WidgetTester tester) {
      ```
      
      ...you now say:
      
      ```dart
        testWidgets("Card Collection smoke test", (WidgetTester tester) {
      ```
      
      Instead of:
      
      ```dart
        expect(tester, hasWidget(find.text('hello')));
      ```
      
      ...you now say:
      
      ```dart
        expect(find.text('hello'), findsOneWidget);
      ```
      
      Instead of the previous API (exists, widgets, widget, stateOf,
      elementOf, etc), you now have the following comprehensive API. All these
      are functions that take a Finder, except the all* properties.
      
      * `any()` - true if anything matches, c.f. `Iterable.any`
      * `allWidgets` - all the widgets in the tree
      * `widget()` - the one and only widget that matches the finder
      * `firstWidget()` - the first widget that matches the finder
      * `allElements` - all the elements in the tree
      * `element()` - the one and only element that matches the finder
      * `firstElement()` - the first element that matches the finder
      * `allStates` - all the `State`s in the tree
      * `state()` - the one and only state that matches the finder
      * `firstState()` - the first state that matches the finder
      * `allRenderObjects` - all the render objects in the tree
      * `renderObject()` - the one and only render object that matches the finder
      * `firstRenderObject()` - the first render object that matches the finder
      
      There's also `layers' which returns the list of current layers.
      
      `tap`, `fling`, getCenter, getSize, etc, take Finders, like the APIs
      above, and expect there to only be one matching widget.
      
      The finders are:
      
       * `find.text(String text)`
       * `find.widgetWithText(Type widgetType, String text)`
       * `find.byKey(Key key)`
       * `find.byType(Type type)`
       * `find.byElementType(Type type)`
       * `find.byConfig(Widget config)`
       * `find.byWidgetPredicate(WidgetPredicate predicate)`
       * `find.byElementPredicate(ElementPredicate predicate)`
      
      The matchers (for `expect`) are:
      
       * `findsNothing`
       * `findsWidgets`
       * `findsOneWidget`
       * `findsNWidgets(n)`
       * `isOnStage`
       * `isOffStage`
       * `isInCard`
       * `isNotInCard`
      
      Benchmarks now use benchmarkWidgets instead of testWidgets.
      
      Also, for those of you using mockers, `serviceMocker` now automatically
      handles the binding initialization.
      
      This patch also:
      
      * changes how tests are run so that we can more easily swap the logic
        out for a "real" mode instead of FakeAsync.
      
      * introduces CachingIterable.
      
      * changes how flutter_driver interacts with the widget tree to use the
        aforementioned new API rather than ElementTreeTester, which is gone.
      
      * removes ElementTreeTester.
      
      * changes the semantics of a test for scrollables because we couldn't
        convince ourselves that the old semantics made sense; it only worked
        before because flushing the microtasks after every event was broken.
      
      * fixes the flushing of microtasks after every event.
      
      * Reindent the tests
      
      * Fix review comments
      91dd9699
  35. 22 Apr, 2016 1 commit
  36. 14 Apr, 2016 1 commit