Commit Graph

127 Commits

Author SHA1 Message Date
Hans Muller
66127250c9 Fix Gallery example code display initialization (#6176) 2016-10-03 12:00:01 -07:00
Hans Muller
fc83640c88 ClampOverscrolls clamps Scrollable, not its Viewport (#5909) 2016-09-21 11:32:19 -07:00
Dragoș Tiselice
cc3df14268 Removed Pesto's drawer. (#5722)
The drawer was confusing without adding much value. It was
especially confusing when wanting to go back to the Gallery on iOS.
Fixes #5713.
2016-09-09 13:19:03 -07:00
Seth Ladd
9e808aad7e Change from plural to singular (#5705)
Closes #5702

Update transitions_perf_test.dart

Update simple_smoke_test.dart
2016-09-02 09:14:06 -07:00
Chris Bracken
4bc70c9e91 Fix minor misspellings in comments. (#5641) 2016-08-29 10:05:22 -07:00
Collin Jackson
701e0d054a Add update dialog to gallery (#5569)
Add update dialog to gallery, open source part of #4626
2016-08-24 13:32:27 -07:00
Hans Muller
96ec30b8af Fix Pesto appbar heroics (#5447) 2016-08-17 10:38:38 -07:00
Ian Hickson
9c15407ba9 When a list is scrolling, children can't be tapped (#5222) (#5348) 2016-08-11 13:40:26 -07:00
Ian Hickson
84cbefe2d4 Revert "When a list is scrolling, children can't be tapped" (#5264) 2016-08-05 13:42:55 -07:00
Ian Hickson
ea7d5bf291 When a list is scrolling, children can't be tapped (#5222) 2016-08-05 10:40:24 -07:00
Hans Muller
3a7508d702 New gallery identity (#5210) 2016-08-04 11:07:59 -07:00
Hans Muller
56a2d2262c Pesto home stack (#5168) 2016-08-01 15:09:50 -07:00
Hans Muller
445f250c91 Gallery UI tweaks (#4861) 2016-07-11 07:26:36 -07:00
Ian Hickson
2dfdc840b1 Refactor everything to do with images (#4583)
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
2016-06-16 09:49:48 -07:00
Hans Muller
f21b140115 One list of GalleryItems to rule them all (#4549) 2016-06-13 16:50:12 -07:00
Adam Barth
1d5d7f4ad3 Reorganize the calculator demo (#4536)
This patch is a warmup to improving the visuals in the calculator demo.

Related to #4535
2016-06-13 11:44:46 -07:00
Matt Perry
60e7535b58 Pesto demo for the Flutter Gallery app. (#4328)
* Pesto demo for the Flutter Gallery app.

* pesto.special.case
2016-06-03 17:05:01 -04:00
Hans Muller
1d516f0e94 Update gallery demo list (again) (#4339) 2016-06-03 08:37:16 -07:00
Ian Hickson
bf6ae3ee76 Reenable the gallery smoke test (#4303)
...and fix some grid and table intrinsic issues it uncovered.
2016-06-01 15:34:48 -07:00
Devon Carew
65bed96103 move the calculator files around (#4112) 2016-05-23 12:55:09 -07:00
Hans Muller
41d1a9f1da Skip gallery smoke test (#4108) 2016-05-23 12:04:33 -07:00
Ian Hickson
d0bac85da4 Move the new calculator demo into the gallery. (#4092) 2016-05-21 10:56:02 -07:00
Ian Hickson
06d80f22f0 Identify the widgets you tap on in live tests (#4079) 2016-05-20 14:21:38 -07:00
Mitch Rudominer
719add8171 New Material Design calculator example. (#3999)
* New Material Design calculator example. (Attempt 2 after git fetch upstream).

* Responded to code review.

* Second round of code review.
2016-05-20 10:27:03 -07:00
Hans Muller
b4ecaaa9f6 Enable the gallery smoke test (#4060) 2016-05-19 17:12:35 -07:00
Ian Hickson
3252701753 Make it possible to run tests live on a device (#3936)
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.
2016-05-16 12:53:13 -07:00
Hans Muller
74c3e74fba Call it Flutter Gallery (#3801) 2016-05-09 11:00:54 -07:00