Due to a synchronization issue, a PR was merged with a green build
that was supposed to be rebuilt and to fail. This commit fixes the
issue by renaming the usage of a constant.
* Added OverscrollIndicatorEdge et al
* RefreshIndicator only clamps its scrollable edge
* added a test
* Updated the test
* fixed lint-os
* fixed a typo
* Scrollable should restore its viewport dimensions when it reappears
* removed an accidental commit
* updated per review feedback
installed changed to installs:
The `flutter run --release` command both builds and installed the Flutter app.
changed to
The `flutter run --release` command both builds and installs the Flutter app.
Instead of a PNG, the Flutter gallery widget is now drawn in code.
There's now a FlutterLogoDecoration class that paints the flutter logo
anywhere you can use a Decoration (e.g. AnimatedContainer).
There's now a FlutterLogo class that honors the IconTheme.
The About dialog box API now takes a Widget for the applicationIcon,
instead of an ImageProvider. It uses IconTheme to make the icon the
right size instead of using an Image widget.
Add padding, duration, and curve properties to the DrawerHeader.
Make the child of a DrawerHeader optional.
Clean up UserAccuntsDrawerHeader a bit.
Add some useful properties and methods to EdgeInsets.
Add some debug logic to RenderDecoratedBox to catch unpaired
save/restore calls when possible.
Make GestureDetector fill its parent if it has no children. Fixes
https://github.com/flutter/flutter/issues/5380
* Remove stray PRODUCT_BUNDLE_IDENTIFIER
This was erroneously added and overrides
the bundle for the gallery causing signing
to fail in my setup.
@chinmaygarde
* Remove PRODUCT_BUNDLE_IDENTIFIER from all Runner pbxproj's
I took the logo_square from:
https://github.com/flutter/identity-assets/tree/master/assets/logo_square
Opened it in preview, gave it a white background
and then dropped it in the icon tool to create
these updated icons.
We may want to use offwhite like we did for Android
but this is sufficient for my demo today.
@hansmuller
This patch improves the Post and Shrine transitions by making the AppBar
into a Hero and changing the default MaterialPageTransition. Now the
AppBar transitions smoothly between screens and the
MaterialPageTransition doesn't involve a fade effect.
Also, rejigger the bounds of the image header in Pesto to avoid the
"pop" at the end of the animation by laying out the image header at its
final visual size instead of relying on occlusion to size the image
header.
Fixes#5202Fixes#5204
Previously we were resizing a paragraph of text during the animation. Now we
animate the text and the image separately. Also, add a default hero tag for
FloatingActionButton so that it animates as part of the hero transition as
well.
* Added custom radii to RRect.
This is the first commit towads an implementation of
MergeableMaterial. It adds custom radii to RRect.
* Renamed RRect constructors and added BorderRadius.
BorderRadius is a class similar to EdgeInsets that lets you define
all rounded corners of a rounded rectangle easily.
This patch includes a number of improvements:
* Material page routes now put a repaint boundary inside their transition so
they don't repaint during the transition.
* Heroes that are on a quest now get a repaint boundary so we repaint them
individually.
* I've hoisted the transparent material for the product items up in the widget
tree, which doesn't affect performance but makes the ink splashes reach the
edge of the product cards.
* I've changed the repaint rainbow visualization to make it easier to see
what's going on.
Removed old Stack layout and added a simple-to-extend interface for the
new drawer header. Also added a specialized UserAccountsDrawerHeader
consistent with Material Design guidelines.
Rather than requiring the developer to specify a full Decoration, we now
just take an ImageProvider for the thumb image. Also, fix
ImageFit.scaleDown to actually work.
Fixes#4571Fixes#4673
We now use a different approach for ios projects where the developer controls
the Xcode project file. This patch removes the old ".generated" approach in
favor of the new approach.
This patch changes the default `flutter create` command to generate a
HelloServices-style app on iOS. As a consequence, the Atom integration now
fully works with HelloServices.
* Change how navigator prevents redundant operations
Instead of requiring transactions, we now cancel all active pointers that are
interacting with the navigator and absorb future pointers until we get a chance
to build. This approach isn't perfect (e.g., events that trigger off the
cancelled pointers could still interact with the navigator), but it should be
better than the current transaction-based approach.
Fixes#4716
* Remove openTransaction
* test
* fixup
This API is the front-end part of the work on showing licenses.
Future patches will:
* Provide an API for registering what licenses should be shown here,
which will be used by this feature to shown licenses but could also be
used by custom code for showing licenses (e.g. for people not using
the Material widgets).
* Actually populate this license API from all the licenses we currently
use in the engine, in the framework, and from any pub packages that
are used (directly or indirectly) by the application.
Anywhere that accepted IconData now accepts either an Icon or an
ImageIcon.
Places that used to take an IconData in an `icon` argument, notably
IconButton and DrawerItem, now take a Widget in that slot. You can wrap
the value that used to be passed in in an Icon constructor to get the
same result.
Icon itself now takes the icon as a positional argument, for brevity.
ThemeData now has an iconTheme as well as a primaryIconTheme, the same
way it has had a textTheme and primaryTextTheme for a while.
IconTheme.of() always returns a value now (though that value itself may
have nulls in it). It defaults to the ThemeData.iconTheme.
IconThemeData.fallback() is a new method that returns an icon theme data
structure with all fields filled in.
IconTheme.merge() is a new constructor that takes a context and creates
a widget that mixes in the new values with the inherited values.
Most places that introduced an IconTheme widget now use IconTheme.merge.
IconThemeData.merge and IconThemeData.copyWith act in a way analogous to
the similarly-named members of TextStyle.
ImageIcon is introduced. It acts like Icon but takes an ImageProvider
instead of an IconData.
Also: Fix the analyzer to actually check the stocks app.
The problem was that the Scaffold was getting a new key each time we
navigated to the main page. The key influences where page state is
stored, including the scroll offset. So for a single frame, the Scaffold
incorrectly thinks the scroll offset is 0 and the app bar should be
expanded.
BUG=https://github.com/flutter/flutter/issues/4400
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
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
Also:
* Make PaginatedDataTable able to scroll itself horizontally.
* Make drop down buttons support having an explicit text style and icon
size given.
* Fix a bug with drop-down buttons asserting when opened partly
off-screen.
* Make sure to pop the drop-down button's route if the drop-down button
is discarded while the route is up.
* Remove extraneous padding on drop-down buttons. (Couldn't figure out
why it was there, and it breaks alignment when a drop-down is mixed
with other text.)
* Some docs improvements.
* Add Route.isActive
* Add a setState() method to ModalRoutes.
I was also going to implement sorting and emptying the cart but the
current data model doesn't make that easy, so I gave up on that. That's
why the TODOs are moved around though.
This fix isn't completely statisfying because it has a scaling limit. The ideal
fix would actually viewport the tiles in the grid. However, this fix is much
easier at the moment.
Fixes#4395
Now that there's a new string_scanner in town, we're having dependency
resolution conflict because of flutter_markdown's tight dependency. This
patch loosens the dependency and resolves the conflict.
Although beautiful, having a continuous animation on the front page of the
gallery gives the impression that Flutter burns battery and makes phones hot.
This patch replaces the animation with solid purple. However, we might
eventually want to use a static image.
This demo burns battery continuously even when there's no change to the visual
appearance. This patch removes this demo to avoid giving the impression that
Flutter burns battery.
Related to #4120
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.
Looks like our intent here was to show the tab label rather than
"Instance of '_Page'".
Also, fix an issue where the scrollableKey wasn't being forwarded to the
actual scrollable.
Fixes#3090
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.
This reverts commit 55f9145ef4.
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.
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
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`.
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.
* Move global analysis options file to the repo root
Also restore the analysis options file for stocks example, since
the global options trigger warnings on generated intl files.
* Remove obsolete analysis options file for Material Gallery example
This test hangs occationally on the bots and the bots aren't smart enough to
recover, which means the whole project gets blocked.
Filed #3735 about the hang.
Instead of incorporating the margin into the button, introduce a ButtonBar
widget that supplies the proper spacing between the buttons. Also, make these
buttons more configurable via ButtonTheme so that dialogs can change the
minWidth and padding of the buttons as required by the spec.
Fixes#1843Fixes#3184
* 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
This reorders some classes so that this file makes more sense, and adds
a bunch of docs. It also makes the following changes:
* Move allElements from Instrumentation to TestWidgets. (Instrumentation
is going away.)
* Remove findElements.
* Rename byElement to byElementPredicate
* Rename byPredicate to byWidgetPredicate
* Implement _WidgetPredicateFinder so that byWidgetPredicate has good
messages
* Fix one use of byElementPredicate to use byWidgetPredicate.
Previously the widgets layer only provided a concrete binding, which
makes it awkward to extend it compared to other bindings. This moves
widgets to the same style as the other layers.
In a subsequent patch I'll use this to make the tests layer saner.
The 'routes' table is a point of confusion with new developers. By
providing a 'home' argument that sets the '/' route, we can delay the
point at which we teach developers about 'routes' until the point where
they want to have a second route.
+ Add new demo to gallery to show data tables. (This currently doesn't
use a Card; I'll create a Card version in a subsequent patch.)
+ Fix checkbox alignment. It now centers in its box regardless.
+ Add Colors.black54.
+ Some minor fixes to dartdocs.
+ DataTable, DataColumn, DataRow, DataCell
+ RowInkWell
+ Augment dartdocs of materia/debug.dart.
+ DropDownButtonHideUnderline to hide the underline in a drop-down when
used in a DataTable.
+ Add new capabilities to InkResponse to support RowInkWell.
+ Augment dartdocs of materia/material.dart.
+ Add an assert to catch nested Blocks.
+ Fix a crash in RenderBox when you remove an object and an ancestor
used its baseline. (https://github.com/flutter/flutter/issues/2874)
+ Fix (and redocument) RenderBaseline/Baseline.
+ Add flex support to IntrinsicColumnWidth.
+ Document more stuff on the RenderTable side.
+ Fix a bug with parentData handling on RenderTable children.
+ Completely rewrite the column width computations. The old logic made
no sense at all.
+ Add dartdocs to widgets/debug.dart.
+ Add a toString for TableRow.