- 16 Jun, 2016 1 commit
-
-
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
-
- 10 Jun, 2016 1 commit
-
-
Jason Simmons authored
-
- 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
-
- 29 May, 2016 1 commit
-
-
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.
-
- 26 May, 2016 1 commit
-
-
Adam Barth authored
The new version has an API change. Also, up our SDK requirements to be a bit more realistic.
-
- 19 May, 2016 2 commits
-
-
Viktor Lidholt authored
-
pq authored
Quick pass at fixing a few dangling references as revealed by the new `comment_references` lint (https://github.com/dart-lang/linter/issues/240). There's a bunch more to do here before we can turn it on by default (~430 lints as of now). Many of them are a simple matter of adding an import (e.g., `dart:async` for library docs that reference `Future`) but others will require a bit of thought. Probably best done by the folks writing the code. :)
-
- 16 May, 2016 2 commits
-
-
Viktor Lidholt authored
-
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.
-
- 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`.
-
- 07 May, 2016 1 commit
-
-
Adam Barth authored
TextAlign applies to a whole paragraph instead of applying to an individual text span. This patch moves the property out of TextStyle and into a separate property on Text and RichText.
-
- 06 May, 2016 1 commit
-
-
Viktor Lidholt authored
-
- 04 May, 2016 2 commits
-
-
pq authored
As per the recent fix to the `always_specify_types` lint (https://github.com/dart-lang/linter/issues/199), literal maps and lists are now expected to be explicitly typed. Running that lint on the repo identifies quite a few spots to update. This focuses on `flutter_driver` and `flutter_sprites` (somewhat arbitrarily) but the changes are fairly representative. Note there are a number of places where I made a quick judgement on how specific to make the types. Feedback on those is welcome. (Especially as we move forward with more.)
-
Viktor Lidholt authored
-
- 29 Apr, 2016 2 commits
-
-
Viktor Lidholt authored
* Initial set of tests for flutter sprites
-
Adam Barth authored
Instead of using properties, TextPainter now receives min and max width as parameters to layout. Also, this patch integrates the intrinsic sizing logic into the main layout function, which satisfies all the existing uses cases.
-
- 23 Apr, 2016 1 commit
-
-
Adam Barth authored
Fixes #3510
-
- 22 Apr, 2016 2 commits
-
-
Ian Hickson authored
The old names were getting silly and started stepping on valuable namespace. The new names are consistent and clear.
-
Viktor Lidholt authored
* Adds NineSliceSprite and optimizes gallery front page
-
- 08 Apr, 2016 1 commit
-
-
Adam Barth authored
We need to pin the version of package:analyzer we use to avoid version skew within our project.
-
- 06 Apr, 2016 1 commit
-
-
Adam Barth authored
This patch adds dartdoc to LazyBlock. Also, this patch fixes the scrolling physics of LazyBlock. Previously, we updated a running simulation only when the change in scroll behavior changed the current scroll offset. Now we update running simulations every time the behavior changes because the simulation might depend on quantities other than the current scroll offset.
-
- 30 Mar, 2016 1 commit
-
-
Viktor Lidholt authored
-
- 25 Mar, 2016 1 commit
-
-
Viktor Lidholt authored
-
- 24 Mar, 2016 1 commit
-
-
Kris Giesing authored
Fixes #2723
-
- 18 Mar, 2016 1 commit
-
-
Ian Hickson authored
-
- 14 Mar, 2016 1 commit
-
-
Hixie authored
-
- 12 Mar, 2016 4 commits
-
-
Adam Barth authored
Fixes #1482
-
Hixie authored
And fix the zillion issues that uncovered.
-
Ian Hickson authored
This reverts commit f41b3411, reversing changes made to e33d8d96. This was a bad check-in due to my mangling uploading a new version of the branch from a different machine. This reverts https://github.com/flutter/flutter/pull/2639 and will be replaced by https://github.com/flutter/flutter/pull/2640
-
Hixie authored
And fix the zillion issues that uncovered.
-
- 11 Mar, 2016 2 commits
-
-
Adam Barth authored
We'll need this for RTL support because the RTL state will live in the widget tree. Also, remove the `oldWidget` argument to updateRenderObject because there aren't any clients for it.
-
Ian Hickson authored
Well, all the easy ones, anyway. For some reason `// ignore:` isn't working for me so I've disabled lints that need that. Also disabled those that require a ton of work (which I'm doing, but not in this PR, to keep it reviewable). This adds: - avoid_init_to_null - library_names - package_api_docs - package_names - package_prefixed_library_names - prefer_is_not_empty - sort_constructors_first - sort_unnamed_constructors_first - unnecessary_getters_setters
-
- 10 Mar, 2016 1 commit
-
-
Hixie authored
And fix a zillion omissions this uncovered.
-
- 01 Mar, 2016 1 commit
-
-
Adam Barth authored
Fixes #1381
-
- 24 Feb, 2016 1 commit
-
-
Adam Barth authored
Now we just have one TextSpan class that handles both simple strings, trees of children, and styling both. This approach simplifies the interface for most clients. This patch also removes StyledText, which was weakly typed and tricky to use correctly. The replacement is RichText, which is strongly typed and uses TextSpan.
-
- 17 Feb, 2016 1 commit
-
-
Viktor Lidholt authored
-
- 11 Feb, 2016 1 commit
-
-
Ian Hickson authored
Each layer is supposed to reexport the parts of the previous layer that are part of its API. - In painting.dart, export from dart:ui all the Canvas-related APIs that make sense to be used at higher levels, e.g. PaintingStyle. - Delete painting/shadows.dart. It was dead code. - In rendering/object.dart, export all of painting.dart. - In widgets/basic.dart, export all of painting.dart and animation.dart. Some classes in animation/ are renamed to make this less disruptive and confusing to the namespace. - Split out Stocks back into an import model rather than a part model, so that it's easier to manage its dependencies on a per-file basis. - Move Ticker to scheduler library. - Remove as many redundant imports as possible now. - Some minor nit picking cleanup in various files.
-
- 08 Feb, 2016 1 commit
-
-
Viktor Lidholt authored
-
- 03 Feb, 2016 1 commit
-
-
Jason Simmons authored
-
- 29 Jan, 2016 1 commit
-
-
Viktor Lidholt authored
-