- 16 Jun, 2016 2 commits
-
-
Hans Muller authored
-
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
-
- 15 Jun, 2016 1 commit
-
-
Hans Muller authored
-
- 14 Jun, 2016 2 commits
- 13 Jun, 2016 1 commit
-
-
Adam Barth authored
Instead of flinging to between 0.0 and 1.0, we should adapt the default spring to the controller's upper and lower bounds. Fixes #3545
-
- 12 Jun, 2016 1 commit
-
-
Adam Barth authored
We now use the `@required` annotation to encourage developers to explicitly set onPressed and onChanged callbacks to null when that would disable the widget. Fixes #287
-
- 09 Jun, 2016 1 commit
-
-
Adam Barth authored
Instead of using getTotalMatrix and setMatrix, we can just use save/restore, which is more idiomatic. The getTotalMatrix/setMatrix pattern was introduced to improve performance, but the original code was calling getTotalMatrix/setMatrix at every node in the sprite tree, which is much slower than the normal save/transform/restore pattern. Related to #4254
-
- 08 Jun, 2016 1 commit
-
-
Ian Hickson authored
Also, make sure that the parent is notified when they change. Fixes #2298
-
- 07 Jun, 2016 1 commit
-
-
Adam Barth authored
We were trying to unregister the pointer route twice. Now we only unregister it once. Fixes #4341
-
- 06 Jun, 2016 1 commit
- 03 Jun, 2016 3 commits
-
-
Adam Barth authored
Previously we supplied individual parameters to the various drag and pan callbacks. However, that approach isn't extensible because each new parameter is a breaking change to the API. This patch makes a one-time breaking change to the API to provide a "details" object that we can extend over time as we need to expose more information. The first planned extension is adding enough information to accurately produce an overscroll glow on Android.
-
Ian Hickson authored
The old code had gotten crufty with all the refactors. This simplifies it down to what it really means. Also, add a bunch of tests.
-
Ian Hickson authored
We used to rely on BoxConstraints.deflate's clamping, but now we have to roll our own.
-
- 02 Jun, 2016 1 commit
-
-
Adam Barth authored
This required refactoring some cases where we weren't following the rules for the protected annotation.
-
- 01 Jun, 2016 1 commit
-
-
Ian Hickson authored
This introduces the key parts of a paginated data table, not including the built-in pagination features. * Provide more data for the data table demo, so there's data to page. * Introduce a ChangeNotifier class which abstracts out addListener/removeListener/notifyListeners. We might be able to use this to simplify existing classes as well, though this patch doesn't do that. * Introduce DataTableSource, a delegate for getting data for data tables. This will also be used by ScrollingDataTable in due course. * Introduce PaginatedDataTable, a widget that wraps DataTable and only shows N rows at a time, fed by a DataTableSource.
-
- 31 May, 2016 2 commits
-
-
Adam Barth authored
As requested by the material design team. Fixes #4182
-
Ian Hickson authored
-
- 29 May, 2016 2 commits
-
-
Adam Barth authored
We used to use this mechanism to paint scrollbars, but it's awkward. The new approach to scrollbars is much cleaner. This mechanism has no other clients, so we should remove it.
-
Adam Barth authored
The new mojom.dart code makes mocking services a bit tricky. I've filed https://github.com/domokit/mojo/issues/786 about improving that.
-
- 27 May, 2016 1 commit
-
-
Adam Barth authored
We'll use this functionality to implement some subtle behaviors for tooltips.
-
- 26 May, 2016 3 commits
-
-
Hans Muller authored
-
Adam Barth authored
We weren't listening to the decorations to see when they loaded. Fixes #4185
-
Adam Barth authored
The new version has an API change. Also, up our SDK requirements to be a bit more realistic.
-
- 23 May, 2016 1 commit
-
-
Ian Hickson authored
-
- 20 May, 2016 2 commits
-
-
Hans Muller authored
-
Ian Hickson authored
-
- 19 May, 2016 1 commit
-
-
Hans Muller authored
-
- 18 May, 2016 1 commit
-
-
Ian Hickson authored
* Add a "build" phase to EnginePhase for completeness. * Ignore events from the device during test execution. * More dartdocs * Slightly more helpful messages about Timers in verifyInvariants. * Add widgetList, elementList, stateList, renderObjectList. * Send test events asynchronously for consistency with other APIs. * Fix a test that was depending on test events being synchronous (or rather, scheduled in a microtask that came before the microtask for the completer of the future that the tap() function returned).
-
- 17 May, 2016 3 commits
-
-
Adam Barth authored
Also, remove several unused configuration options and fix an animation leak.
-
Ian Hickson authored
-
Hans Muller authored
* Add a Scrollable builder, refactor ScrollableList, et al * Add space between the dialog demo buttons * removed vestigial code
-
- 16 May, 2016 3 commits
-
-
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.
-
Ian Hickson authored
This reverts commit 55f9145e. Turns out that this commit breaks apps that use the material library, because of the _errorTextStyle DefaultTextStyle which has inherit:true. Just setting it to false doesn't work, unfortunately, because then you hit some sort of issue with merging that text style with others that have inherit:true.
-
Adam Barth authored
To make it clear that this constructor requires an explicit style. Also throw a descriptive error recommending the inherit constructor for styles with the inherit bit set. Fixes #3842
-
- 13 May, 2016 1 commit
-
-
Matt Perry authored
- Handles appear with tap or long press. - Toolbar appears with long press on text, or tap on handle. - Correct toolbar items shown depending on context.
-
- 12 May, 2016 1 commit
-
-
pq authored
It's safe to remove the unneeded `void`s from setters since the blocking issues in the `always_declare_return_types` lint have been fixed (https://github.com/dart-lang/linter/). We can also safely flip the bit on `avoid_return_types_on_setters`.
-
- 10 May, 2016 1 commit
-
-
Matt Perry authored
* Use mojo clipboard service for copy/paste toolbar. BUG=https://github.com/flutter/flutter/issues/1567
-
- 05 May, 2016 2 commits
-
-
Adam Barth authored
Previously it used Block, which is less efficient for large numbers of items. Also move the top margin out of the menu item to fix the baseline alignment of the text. Fixes #1615
-
Adam Barth authored
This patch sizes the menu such that it is always on screen, but doesn't scroll the menu to ensure that the currently selected item is always visible and on top of the button. That will need to wait for a later patch. Also, teach CustomPaint how to repaint animations more efficiently. Fixes #3720
-