1. 31 Jul, 2018 1 commit
  2. 24 Jul, 2018 1 commit
    • Jonah Williams's avatar
      Semantics framework updates (#18758) · 810a29d6
      Jonah Williams authored
      Changes:
      
      - Move the SemanticsConfiguration update from RenderToggleable to each subclass, so that Switch can use toggled.
      - Add image, liveRegion, toggled properties to Semantics, SemanticsConfiguration, SemanticsNode
      - Added semanticsLabel and excludeFromSemantics to Image (the latter so that we avoid creating a semantics node)
      - Added onDismiss semantics action which maps to the modal escape on iOS and dismiss action on Android.
      - Added dismiss and liveRegion to snackbar widget
      - Updated custom painter semantics to handle image, liveRegion, toggle
      - Updated relevant tests to use correct flag/action
      810a29d6
  3. 12 Jun, 2018 1 commit
  4. 21 Apr, 2018 1 commit
  5. 17 Apr, 2018 3 commits
    • Chinmay Garde's avatar
      Roll engine to 0c09bf03d. (#16668) · e9177ba3
      Chinmay Garde authored
      This roll includes the following engine commits:
      
      * flutter/engine@0c09bf03: In the service protocol, if no view is specified to flush tasks on, pick the first one. (#5028)
      * flutter/engine@ecaefd7a: Roll src/third_party/skia/ 276886160..1cd6098d5 (50 commits) (#5026)
      * flutter/engine@e6545573: Enable 'Speak Screen' and 'Switch Control' for iOS (#5016)
      * flutter/engine@3393c179: Fix Android platform channels (#5025)
      * flutter/engine@1bc0e1bb: On windows, refer to Dart snapshot directly executable. (#5024)
      * flutter/engine@cf6ca32d: Revert "Roll Dart to fe606f890b0a311da802c78b0af414a3c2087a79" (#5023)
      * flutter/engine@4b45a53e: Only make ERROR and FATAL log levels visible by default. (#5022)
      * flutter/engine@98f6c2d5: Fix shell launcher test (dart2 compliant and stop polling) (#5009)
      * flutter/engine@75851f08: Roll Dart to fe606f890b0a311da802c78b0af414a3c2087a79 (#5020)
      * flutter/engine@9495a52d: On iOS, try to use ES3, then fall back to ES2. (#5006)
      * flutter/engine@d6d4eec2: Fix broken Linux build (#5019)
      * flutter/engine@d15dc76e: Fix broken Chromebot build (#5018)
      * flutter/engine@c17a6290: Breadcrumbs to the wiki (#5017)
      * flutter/engine@4eaf2c2f: Return raw (unencoded) bytes in Image.toByteData() (#5008)
      * flutter/engine@d812a617: Roll src/third_party/skia/ e669bdfad..276886160 (9 commits) (#5014)
      * flutter/engine@62aeab72: Call SkSurface::flush instead of getting a backend handle in vulkan_swapchain. (#5012)
      * flutter/engine@f4ebb180: Roll src/third_party/skia/ 3462eb034..e669bdfad (54 commits) (#5007)
      * flutter/engine@0b7d6be9: Re-land "do not pause rendering when android view loses focus" (#5004)
      * flutter/engine@91dee598: If the rasterizer has a valid surface context, use that to create a snapshotting render target. (#4979)
      * flutter/engine@570231b7: Specify the packages file path when running engine dart tests. (#5005)
      * flutter/engine@0b9cef5a: Minor update to README (#5003)
      * flutter/engine@c386418f: Promote line height in text style created from paragraph style (#4995)
      * flutter/engine@4e0fbb6f: If the test specifies a .dill file, dont make the engine interpret is as source. (#5002)
      * flutter/engine@58e84c8b: Re-land "Support multiple shells in a single process. (#4932)" (#4998)
      * flutter/engine@37e5df05: Remove only use of SkPaint::kGenA8FromLCD (#4994)
      * flutter/engine@b7358b33: libtxt: cache font families that are remapped to the default font family (#4990)
      * flutter/engine@a530035b: libtxt: fix leaks in Skia object reference counting (#4988)
      * flutter/engine@0c74fc93: [fuchsia] Fix use-after-free (#4987)
      * flutter/engine@b6d2dde9: [fuchsia] Fix build (#4986)
      * flutter/engine@1dd12649: [async] Adapt to libasync API changes. (#4980)
      e9177ba3
    • Mikkel Nygaard Ravn's avatar
    • Todd Volkert's avatar
      Roll engine to 1bc0e1bb9a8db882a21086096cc2b1e0854312b7 (#16643) · dd32d1b1
      Todd Volkert authored
      * Roll engine to d6d4eec24c38bb06a9b1aef4e70c321d447ba762
      
      Contains the following engine commits:
      
      flutter/engine@1bc0e1b On windows, refer to Dart snapshot directly executable.
      flutter/engine@cf6ca32 Revert "Roll Dart to fe606f890b0a311da802c78b0af414a3c2087a79"
      flutter/engine@4b45a53 Only make ERROR and FATAL log levels visible by default.
      flutter/engine@98f6c2d Fix shell launcher test (dart2 compliant and stop polling)
      flutter/engine@75851f0 Roll Dart to fe606f890b0a311da802c78b0af414a3c2087a79
      flutter/engine@9495a52 On iOS, try to use ES3, then fall back to ES2.
      flutter/engine@d6d4eec Fix broken Linux build
      flutter/engine@d15dc76 Fix broken Chromebot build
      flutter/engine@c17a629 Breadcrumbs to the wiki
      flutter/engine@4eaf2c2 Return raw (unencoded) bytes in Image.toByteData()
      flutter/engine@d812a61 Roll src/third_party/skia/ e669bdfad..276886160 (9 commits)
      flutter/engine@62aeab7 Call SkSurface::flush instead of getting a backend handle in vulkan_swapchain.
      flutter/engine@f4ebb18 Roll src/third_party/skia/ 3462eb034..e669bdfad (54 commits)
      flutter/engine@0b7d6be Re-land "do not pause rendering when android view loses focus"
      flutter/engine@91dee59 If the rasterizer has a valid surface context, use that to create a snapshotting render target.
      flutter/engine@570231b Specify the packages file path when running engine dart tests.
      flutter/engine@0b9cef5 Minor update to README
      flutter/engine@c386418 Promote line height in text style created from paragraph style
      flutter/engine@4e0fbb6 If the test specifies a .dill file, dont make the engine interpret is as source.
      flutter/engine@58e84c8 Re-land "Support multiple shells in a single process.
      flutter/engine@37e5df0 Remove only use of SkPaint::kGenA8FromLCD
      flutter/engine@b7358b3 libtxt: cache font families that are remapped to the default font family
      flutter/engine@a530035 libtxt: fix leaks in Skia object reference counting
      flutter/engine@0c74fc9 [fuchsia] Fix use-after-free
      flutter/engine@b6d2dde [fuchsia] Fix build
      flutter/engine@1dd1264 [async] Adapt to libasync API changes.
      
      * Run test platform finalizers in reverse order to ensure that shell is shutdown before trying to delete any temporary files or directories. This fixes "Access Denied" error on Windows (see #16657).
      dd32d1b1
  6. 06 Apr, 2018 1 commit
  7. 09 Feb, 2018 1 commit
  8. 02 Feb, 2018 1 commit
  9. 16 Jan, 2018 1 commit
    • Dwayne Slater's avatar
      Set _imageInfo to null BEFORE adding listener to new ImageStream (#13825) · 4488f58a
      Dwayne Slater authored
      * Set _imageInfo to null before adding listener to new ImageStream
      
      Fixes an edge case where switching the ImageStream to an already completed ImageStream caused the Image widget to show nothing. ImageStreamCompleter calls the listener during addListener if their image is already loaded.
      
      * Fix whitespace
      
      * Add test to verify correct behavior
      
      * Added test from mravn-google's PR
      4488f58a
  10. 10 Jan, 2018 1 commit
    • Ian Hickson's avatar
      Make DecoratedBox repaint after being reparented (#13927) · 316d8e1c
      Ian Hickson authored
      Fixes https://github.com/flutter/flutter/issues/12553
      
      The root cause of https://github.com/flutter/flutter/issues/12553 was that when the refresh indicator went away, which happened after the avatars had started their image loads but before the avatars had loaded, the DecoratedBoxes, along with the rest of the list, got GlobalKey-reparented, which caused the RenderDecoratedBox objects to unregister from the DecorationImagePainters, but they never re-registered since the whole subtree was in a RepaintBoundary and was therefore not explicitly repainted when the tree got reattached.
      
      This fixes the bug by explicitly requiring any RenderDecoratedBox to repaint when it's reattached. This is probably a little more aggressive than required; we could probably expose a flag on Decoration that says whether or not the onChanged handler will ever be invoked, and only call markNeedsPaint if that's true, but we'll do that if it turns out that there's a performance issue here.
      
      (This patch also introduces a bunch of improved debugging information that I used to track down the bug.)
      316d8e1c
  11. 07 Dec, 2017 1 commit
    • Ian Hickson's avatar
      Move image logic from services/ to painting/. (#13409) · 44e228eb
      Ian Hickson authored
      This allows the scheduler library to depend on the services library
      and the painting library to depend on the scheduler library without
      the services library having to depend on the scheduler library.
      
      While I was at it I also cleaned up some of the binding logic: the
      licenses logic can now be overridden (and the test library does so),
      and the image cache can now be overridden as well.
      44e228eb
  12. 22 Nov, 2017 1 commit
    • amirh's avatar
      Don't keep image stream listeners when TickerMode is disabled. (#13106) · 155a4cab
      amirh authored
      This makes sure that we don't decode frames when we don't need to run
      the animation.
      
      For example, prior to this CL: an animated image in a page that is not
      currently at the top of the page stack (it is covered by another page),
      will keep the the image stream listener, and thus frames will still be
      decoded.
      155a4cab
  13. 28 Aug, 2017 1 commit
    • Ian Hickson's avatar
      RTL: Padding, Flex (#11709) · f235a2c1
      Ian Hickson authored
      * Introduce a Directionality inherited widget which sets the ambient LTR vs RTL mode (defaulting to null, which means you cannot use directionality-influenced values).
      
      * Make it possible to configure Padding (including Container.padding and Container.margin) using a directionality-agnostic EdgeInsets variant.
      
      * Provide textDirection and verticalDirection controls on Row and Column to make them RTL-aware.
      
      * Introduce a variant of FractionalOffset based on the EdgeInsets variant. Not yet actually used.
      
      * Fix all the tests that depended on Row defaulting to LTR.
      f235a2c1
  14. 03 Aug, 2017 1 commit
  15. 02 Aug, 2017 1 commit
  16. 25 Jul, 2017 1 commit
  17. 27 Jun, 2017 1 commit
  18. 21 Jun, 2017 3 commits
  19. 20 Apr, 2017 1 commit
  20. 20 Mar, 2017 1 commit
  21. 04 Mar, 2017 1 commit
  22. 16 Feb, 2017 1 commit
  23. 09 Dec, 2016 1 commit
  24. 19 Nov, 2016 1 commit
  25. 07 Nov, 2016 1 commit
  26. 12 Sep, 2016 1 commit
  27. 30 Aug, 2016 1 commit
  28. 16 Jun, 2016 1 commit
    • Ian Hickson's avatar
      Refactor everything to do with images (#4583) · 2dfdc840
      Ian Hickson authored
      Overview
      ========
      
      This patch refactors images to achieve the following goals:
      
      * it allows references to unresolved assets to be passed
        around (previously, almost every layer of the system had to know about
        whether an image came from an asset bundle or the network or
        elsewhere, and had to manually interact with the image cache).
      
      * it allows decorations to use the same API for declaring images as the
        widget tree.
      
      It requires some minor changes to call sites that use images, as
      discussed below.
      
      Widgets
      -------
      
      Change this:
      
      ```dart
            child: new AssetImage(
              name: 'my_asset.png',
              ...
            )
      ```
      
      ...to this:
      
      ```dart
            child: new Image(
              image: new AssetImage('my_asset.png'),
              ...
            )
      ```
      
      Decorations
      -----------
      
      Change this:
      
      ```dart
            child: new DecoratedBox(
              decoration: new BoxDecoration(
                backgroundImage: new BackgroundImage(
                  image: DefaultAssetBundle.of(context).loadImage('my_asset.png'),
                  ...
                ),
                ...
              ),
              child: ...
            )
      ```
      
      ...to this:
      
      ```dart
            child: new DecoratedBox(
              decoration: new BoxDecoration(
                backgroundImage: new BackgroundImage(
                  image: new AssetImage('my_asset.png'),
                  ...
                ),
                ...
              ),
              child: ...
            )
      ```
      
      DETAILED CHANGE LOG
      ===================
      
      The following APIs have been replaced in this patch:
      
      * The `AssetImage` and `NetworkImage` widgets have been split in two,
        with identically-named `ImageProvider` subclasses providing the
        image-loading logic, and a single `Image` widget providing all the
        widget tree logic.
      
      * `ImageResource` is now `ImageStream`. Rather than configuring it with
        a `Future<ImageInfo>`, you complete it with an `ImageStreamCompleter`.
      
      * `ImageCache.load` and `ImageCache.loadProvider` are replaced by
        `ImageCache.putIfAbsent`.
      
      The following APIs have changed in this patch:
      
      * `ImageCache` works in terms of arbitrary keys and caches
        `ImageStreamCompleter` objects using those keys. With the new model,
        you should never need to interact with the cache directly.
      
      * `Decoration` can now be `const`. The state has moved to the
        `BoxPainter` class. Instead of a list of listeners, there's now just a
        single callback and a `dispose()` method on the painter. The callback
        is passed in to the `createBoxPainter()` method. When invoked, you
        should repaint the painter.
      
      The following new APIs are introduced:
      
      * `AssetBundle.loadStructuredData`.
      
      * `SynchronousFuture`, a variant of `Future` that calls the `then`
        callback synchronously. This enables the asynchronous and
        synchronous (in-the-cache) code paths to look identical yet for the
        latter to avoid returning to the event loop mid-paint.
      
      * `ExactAssetImage`, a variant of `AssetImage` that doesn't do anything clever.
      
      * `ImageConfiguration`, a class that describes parameters that configure
        the `AssetImage` resolver.
      
      The following APIs are entirely removed by this patch:
      
      * `AssetBundle.loadImage` is gone. Use an `AssetImage` instead.
      
      * `AssetVendor` is gone. `AssetImage` handles everything `AssetVendor`
        used to handle.
      
      * `RawImageResource` and `AsyncImage` are gone.
      
      The following code-level changes are performed:
      
      * `Image`, which replaces `AsyncImage`, `NetworkImage`, `AssetImage`,
        and `RawResourceImage`, lives in `image.dart`.
      
      * `DecoratedBox` and `Container` live in their own file now,
        `container.dart` (they reference `image.dart`).
      
      DIRECTIONS FOR FUTURE RESEARCH
      ==============================
      
      * The `ImageConfiguration` fields are mostly aspirational. Right now
        only `devicePixelRatio` and `bundle` are implemented. `locale` isn't
        even plumbed through, it will require work on the localisation logic.
      
      * We should go through and make `BoxDecoration`, `AssetImage`, and
        `NetworkImage` objects `const` where possible.
      
      * This patch makes supporting animated GIFs much easier.
      
      * This patch makes it possible to create an abstract concept of an
        "Icon" that could be either an image or a font-based glyph (using
        `IconData` or similar). (see
        https://github.com/flutter/flutter/issues/4494)
      
      RELATED ISSUES
      ==============
      
      Fixes https://github.com/flutter/flutter/issues/4500
      Fixes https://github.com/flutter/flutter/issues/4495
      Obsoletes https://github.com/flutter/flutter/issues/4496
      2dfdc840
  29. 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
  30. 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
  31. 14 Apr, 2016 1 commit
  32. 02 Apr, 2016 1 commit
    • Ian Hickson's avatar
      Rationalise all our exception handling. · ee703da9
      Ian Hickson authored
      - Create a FlutterErrorDetails struct-like class that describes an
      
        exception along with more details that aren't in the exception, like
      
        where it was caught and what was going on when it was caught.
      
      
      
      - Provide a FlutterError static API for handling these objects:
      
      
      
        - FlutterError.onError which is called whenever Flutter catches an
      
          error.
      
      
      
        - FlutterError.reportError() which handles an error.
      
      
      
        - FlutterError.dumpErrorToConsole() which is the default behavior
      
          for onError.
      
      
      
      - Removes all the existing exception handler callbacks.
      
      
      
      - Replaces all the existing places that described exceptions using
      
        debugPrint with calls to FlutterError.reportError().
      
      
      
      - Extend lockState() to also catch exceptions, so that we catch
      
        exceptions that happen during finalizers.
      
      
      
      - Make the test framework catch errors and treat them as failures.
      
      
      
      - Provide a mechanism to override this behavior in the test framework.
      
      
      
      - Make the tests that used to depend on the exception handler
      
        callbacks use this new mechanism.
      
      
      
      - Make pump() also support the phase argument.
      
      
      
      - Improve some tests using these new features.
      
      
      
      Fixes #2356, #2988, #2985, #2220.
      ee703da9
  33. 29 Mar, 2016 1 commit