414 Commits

Author SHA1 Message Date
xster
e2192a90fc
Remove top mediaquery padding from modal bottom sheets (#13497) 2017-12-12 11:25:20 -08:00
Fredrik Simón
eed471ea3d Expose textAlign on TextFormField (#13414)
* Expose textAlign on TextFormField

Fixes #11404

* Added name to AUTHORS

* Added a test for TextFormWidget's textAlign
2017-12-11 13:29:22 -08:00
Mehmet Fidanboylu
0c09179b65
Fix for incorrect transparent -> DividerColor animation for ExpansionTile (#13449)
* Fix for incorrect transparent -> DividerColor animation for ExpansionTile

* Add comments and tests. Fix background color too.

* Fix analyzer warnings
2017-12-09 22:04:06 -08:00
Chris Bracken
355ebef5fe
Remove bottom padding in SliverAppBar (#13471)
Removes bottom padding from the child AppBar in SliverAppBar. Scaffold
already does this for its own app bars, but sliver app bars in the body
should also apply the bottom padding removal.

Fixes flutter/flutter#13458
2017-12-08 18:53:55 -08:00
Ian Hickson
d25e0eb0d3
Fix tapping on a test in flutter run (#13397)
Also:

* Remove find.byIcon since it's identical to find.icon. (I sent mail to flutter-dev about this.)

* Fix IconData's operator== and hashCode, which had not been updated when we added fields.

* Add the byTooltip finder to the list of suggested finders.

* Make the suggested Key finder prettier.
2017-12-08 14:37:24 -08:00
Yegor
b80751cdc3
Make time picker accessible (#13152)
* make time picker accessible

* use new CustomPaint a11y API

* flutter_localizations tests; use bigger distance delta

* fix am/pm control; selected values

* fix translations; remove @mustCallSuper in describeSemanticsConfiguration

* exclude AM/PM announcement from iOS as on iOS the label is read back automatically
2017-12-08 14:29:28 -08:00
Chris Bracken
276cbb1c27
Apply media bottom padding in BottomNavigationBar (#13431)
Updates scaffold to expose bottom padding to the associated
BottonNavigationBar (if present). BottomNavigationBar is now responsible
for adjusting itself to account for bottom padding.

This change is necessary to support the updated BottomNavigationBar
layout for the iPhone X.
2017-12-07 18:15:29 -08:00
xster
6f773944ae
Remove dangling MediaQuery paddings for non-fullscreen dialogs - 2 (#13438)
* Remove MediaQuery padding for various PopupRoutes that don't extend to the edge of the screen

* bottom sheet doesn't actually need handling. Scaffold does it already. Add test for others.
2017-12-07 17:58:50 -08:00
Chris Bracken
6ff844a9c0
Scaffold resizeToAvoidBottomPadding uses view insets (#13437)
Now that keyboard height is modelled as a (bottom) view inset, migrate
scaffold bottom resizing to use view insets instead of bottom padding,
which, after an engine roll, will only be used for safe areas.

Until the aforementioned engine roll, the keyboard height is still
included in both bottom padding and view insets. As such
resizeToAvoidBottomPadding still drives bottom padding removal until
that roll lands.

Renames _ScaffoldLayout.bottomPadding to bottomViewInset
2017-12-07 17:49:11 -08:00
Chris Bracken
38c82ea88f
Update scaffold test bottom bar height (#13429)
This patch contains no framework changes.

This change adjusts a test bottom navigation bar height to be greater
than the media bottom padding.

This change is pre-factoring to clarify diffs in an upcoming change that
will expose bottom padding to the bottom navigation bar in order to
allow it to visually adapt its appearance in the presence of bottom
padding such as thatexposed for the iPhone X home screen indicator.
Since the bottom padding was previously greater than the height of the
bottom navigation bar, the height of insideBottomNavigation bar was
driven to 0 when padding is exposed.
2017-12-07 14:53:26 -08:00
Chris Bracken
71021b4706
Use greater of viewInsets, padding for Scaffold bottom padding (#13423)
Scaffold bottom padding now applies the maximum of window
viewInsets.bottom (typically used for iOS safe areas) and padding.bottom
(typically used for keyboard height).
2017-12-07 12:59:26 -08:00
Ian Hickson
c44f15e6e9
Add a showBottomSheet for consistency with showModalBottomSheet. (#13314)
Also, extra docs.

Fixes https://github.com/flutter/flutter/issues/13279
Fixes https://github.com/flutter/flutter/issues/2115
2017-12-04 13:43:09 -08:00
Ian Hickson
d6f496cab8
Localize the Chip delete button's default tooltip (#13312)
...and document what I did.
2017-12-04 12:59:48 -08:00
Yusuke Konishi
a46679f758 Implements FlatButton debugFillProperties (#13217)
* Implements FlatButton debugFillDescription

* Fix doc comment

* Override debugFillProperties instead of debugFillDescription

* Remove child debug property
2017-11-29 15:35:37 -08:00
Devon Carew
792e7ce872
add an assert to validate the RefreshIndicator.onRefresh result (#13198)
* add an assert to validate the RefreshIndicator.onRefresh result

* add a test for RefreshIndicator.onRefresh assert

* switch to using FlutterError.reportError, FlutterErrorDetails, and FlutterError
2017-11-28 11:00:36 -08:00
Ian Hickson
4c9013b71b
BottomNavigationBar RTL (#13167) 2017-11-22 18:55:07 -08:00
Ian Hickson
9afc853f75
Revert "Reenable fade transition for Material page transition (#13048)" (#13172)
This reverts commit e73d406106aefb5b1d4d06bb209d19618bd0e6ac.

It caused major performance regressions.
2017-11-22 18:54:15 -08:00
Ian Hickson
2bda59a1fe
TabBar RTL (#13164) 2017-11-22 18:53:42 -08:00
Leonardo Bispo de Oliveira
b3fa055894 ExpansionTile opened - initial state (#13115)
Changed the ExpansionTile widget to have an optional value to
initialize the widget as collapsed or expanded.

The widget will be collapsed by default.
2017-11-22 15:16:27 -08:00
Ian Hickson
34ba6be93a
Popup menus RTL (#13110)
This fixes the popup menu code to do a better job of expanding
smoothly regardless of which side of the screen it's on. It still
results in a bidirection growth when positioned at the bottom of the
screen, so maybe we'll need to animate menus differently, but that's
a problem for another patch.

Also, improve some docs and provide RelativeRect.toSize which I needed
at one point while building this patch (though it didn't survive all
the way to the end).
2017-11-22 15:15:21 -08:00
Pascal Welsch
e73d406106 Reenable fade transition for Material page transition (#13048)
Fixes #12877 by reverting #9472
2017-11-22 15:07:41 -08:00
Ian Hickson
8b15b537b3
DropdownButton RTL (#13040)
This fixes DropdownButtons to align their popups correctly in RTL as well.

Also while I was there I fixed the issue with text scale factor in the gallery.
2017-11-16 17:57:50 -08:00
Ian Hickson
c97fc2063f
ExpansionPanel animation fixes (#13032)
Previously, ExpansionPanel would do weird things if interacted with
when it was already animating. This is fixed and there's now a test.

Also:

 * Minor fixes to make the gallery work in RTL, not that there's
   any way to see that without hard-coding the framework to RTL.
   But at least I'll be less annoyed when doing that.

 * Some trivial code and documentation cleanup.
2017-11-16 10:22:50 -08:00
Greg Spencer
c15c021e6c
Adding accomodations to ListTile for scaleTextFactor. (#12973)
This makes ListTile expand vertically when text is scaled, or really when whatever is placed inside it is larger than the available space.

In order for UnconstrainedBox to be useful here, I needed for it to only unconstrain the child Row in one dimension, so I added a "constrainedAxis" parameter to the UnconstrainedBox.

Also, changed one enum test to use a switch instead.

I modified the ListTile test to be more representative of the intention of the spec: we were testing with text in the leading and trailing sections, and the design wants icons there. Because there was leading text, and the dense mode only changes the font size on the text lines, the leading text was propping up the minimum size of the tile, making so that the test wasn't really testing any changes in dense mode.
2017-11-15 09:00:36 -08:00
Hans Muller
53a2ec1bc9
Add support for baseline alignment to TextField (RenderEditable) (#13006) 2017-11-14 10:43:22 -08:00
Greg Spencer
3541ad0a64
Add an UnconstrainedBox and factor out debug overflow indicator. (#12856)
UnconstrainedBox will allow its child to size itself as if it had no constraints, and then attempt to fit around that object, until its own constraints are exceeded, in which case it will clip and display an overflow warning.

I also factored out DebugOverflowIndicator, which will draw overflow indicators on containers which overflow but aren't expected to.
2017-11-08 20:15:06 -08:00
Yegor
a75f003b9c
add within matcher for comparing metric-space values (#12908) 2017-11-08 13:36:16 -08:00
Sebastiano Poggi
dfd1ffa7c5 Surface elevation shadow colour on Material (#12881)
* Surface shadowColor from RenderPhysicalModel to Material

* Fix typo in material_test

* Add nullability info to documentation

* Add support for animating elevation shadow color

* Add shadowColor to Material's debugFillProperties()

* Add missing default value for elevation in Material debugFillProperties()

* Add missing non-null asserts for animate flags in AnimatedPhysicalModel

* Add test for shadow color animating smoothly
2017-11-06 17:40:13 -08:00
Jason Simmons
b865b0eb2f
Use TextPainter.preferredLineHeight to estimate line height for Cupertino selection handles (#12833)
Fixes https://github.com/flutter/flutter/issues/12046
2017-11-03 09:47:46 -07:00
Greg Spencer
79862a7262
Fixing assumption that baseStyle is a complete style. (#12836)
This fixes the assumption that InputDecorator had where it expected baseStyle to be a complete style. Now it merges the baseStyle with the subhead style instead of substituting it entirely.

This fixes #12832.
2017-11-02 16:42:02 -07:00
Ian Hickson
c13ed90c87
TextStyle is not an enum (fixes crash with InputDecorator.toString) (#12835) 2017-11-02 12:19:58 -07:00
Michael Goderbauer
1d4607ff04
Identify text fields as such to a11y (#12804)
* Identify text fields as such to a11y

* focus

* make travis happy

* review comments
2017-11-02 10:08:56 -07:00
Adam Barth
3914214641
Fix analyzer warnings (#12840) 2017-11-01 22:31:29 -07:00
5u3it
c608e666ad Material scaffold to have simultaneous left-and-right drawers (#12686)
Adds `Scaffold#endDrawer` property to supply a second drawer to a Scaffold.
2017-11-01 21:35:28 -07:00
Greg Spencer
05e10633f2
Adding proper accommodation for textScaleFactor in chips, and StadiumBorder border. (#12533)
In order to allow chips to be properly drawn when they expand in size (without
using IntrinsicHeight), I needed a BoxDecoration shape that would be dependent
upon the rendered height of the widget. This seemed to be pretty generally
useful, so I added a new ShapeDecoration called StadiumBorder. It uses the
minimum dimension to adjust the BorderRadius of a rounded rect in the shape
decoration.

I also converted some uses of BoxShape to be case statements, updated the
chips to use the StadiumBorder decoration, and updated some of the metrics to match
the Material spec, as well as implementing lerping to and from StadiumBorder.
2017-11-01 19:37:02 -07:00
Yegor
f4b0ccd9fd
Use alwaysUse24HourFormat when formatting time of day (#12517)
* alwaysUse24HourFormat in MediaQuery and time picker

* docs; dead code

* address some comments

* MaterialLocalizations.timeOfDayFormat is the single source of 24-hour-formattedness

* Make TimePickerDialog private again

* wire up MediaQueryData.fromWindow to Window
2017-11-01 14:52:28 -07:00
Roberto Scaramuzzi
80e159d469
Add acceptNotification parameter to RefreshIndicator and OverscrollIn… (#12716)
* Add acceptNotification parameter to RefreshIndicator and OverscrollIndicator

* Various fixes suggested by reviewer

* Fixed lint errors
2017-11-01 10:29:37 -07:00
Alexandre Ardhuin
c9b94e1412 enable lint prefer_const_constructors_in_immutables (#12693)
* enable lint prefer_const_constructors_in_immutables

* remove LabeledGlobalKey._
2017-10-25 11:20:36 +02:00
Greg Spencer
ea679171e5 Add Material character counter to TextField. (#12648)
This adds an optional character counter and maxLength parameter to the TextField, as described in the Material Design Spec.

The counter text and style in the input decorator may be specified, but will default to the "right thing" if not specified, where the "right thing" is a counter that looks like "3 / 10" (if there are three characters entered into a field where maxLength is set to 10).

To limit the number of characters entered, I created a LengthLimitingTextFormatter that will limit the number of characters (Unicode runes) in the input, which can be used independently. The formatter is applied after the other formatters supplied (if any). Even if there is no decorator, the text field will limit the number of characters input if maxLength is set.

If maxLengthEnforced is set to false (it defaults to true), then the max length will not be enforced. In that case, if the text exceeds the length, then the counter will turn red, and it will make the divider turn red.
2017-10-24 14:49:39 -07:00
Greg Spencer
80b820a26d Revert "Revert "Fixes InputDecorator to work with textScaleFactor, fixes Material Design differences. (#12595)" (#12678)" (#12689)
This reverts commit 72dc7d9146e3b35d3253e86bd4ee295e0718c610.

Re-landing my InputDecorator changes so that I can land the character counter PR.
2017-10-24 11:07:14 -07:00
Michael Goderbauer
141a6355ce Performance improvements for semantics tree compilation (#12682)
* Without checking compatibility

* ++

* ++

* ++

* more docs
2017-10-23 17:33:46 -07:00
Greg Spencer
72dc7d9146 Revert "Fixes InputDecorator to work with textScaleFactor, fixes Material Design differences. (#12595)" (#12678)
This reverts commit 67cf7918cfc9201cfc05f508278a3ab6571bbb8e.

Reverting because this causes scuba regressions that I'd like to
address in another PR that is pending, but we'd like to roll Flutter.
2017-10-23 14:56:50 -07:00
amirh
ce4a45779d Add an isButton flag to the Semantic widget,use it for MaterialButton (#12657)
https://github.com/flutter/flutter/issues/11992
2017-10-23 14:52:41 -07:00
Alexandre Ardhuin
1fce14a31c enable lint prefer_single_quotes (#12665) 2017-10-22 18:11:36 +02:00
Yegor
67d16cd517 Theme.of provides all TextStyle properties (#12552)
* Theme provides all TextStyle properties

* match field declaration order in the test

* Theme.of returns text style with inherit == false

* change TextStyle.inherit logic; docs

* add TextStyle.debugLabel

* address comments

* add debug labels to Typography text styles
2017-10-20 20:17:07 -07:00
Hans Muller
796c5439f6 Language-specific LocalizationDelegates (#12645) 2017-10-20 10:45:28 -07:00
Greg Spencer
67cf7918cf Fixes InputDecorator to work with textScaleFactor, fixes Material Design differences. (#12595)
Fixes InputDecorator to work with textScaleFactor, fixes Material Design differences.

There were a number of differences with the Material Design spec, including
several different padding values and underline thickness.  This corrects
that so that the decorator is in line with the Material Design spec now.

Also, the decorator properly handles changes to the textScaleFactor, where
before it would not re-layout when needed, painting the cursor and
underline incorrectly.

The decorator also now properly animates helper, error, and hint text when
the textScaleFactor or input decoration properties change.

Helper text is now properly displayed in dense mode, as the spec shows.
Before this change, it was never displayed in dense mode.

Fixes #12485
2017-10-19 10:11:07 -07:00
Greg Spencer
7e09649c41 Override just the textScaleFactor (#12530)
Hixie pointed out that what I had before was resetting all of the MediaQuery values, not just textScaleFactor. This should fix that.
2017-10-19 09:24:05 -07:00
Michael Goderbauer
a5a75e3d84 Fix tabs Semantics test (#12620)
Merge confliuct between #12605 and #12613
2017-10-18 17:11:50 -07:00
Michael Goderbauer
f8a2bd20e9 Redesign Semantic Tree Compilation Algorithm (#12605)
* Oct 12 10:12am

* implicit_semantics_test.dart passes

* refactoring

* works in nice

* minor rename

* more doc comments

* to be explicit check better

* fix test

* ++

* ++

* semantics_9_test (BlockSemantics) and implicit_semantics_test are passing

* doc updates

* tiny refactor

* fix static errors in tests

* fix gesture detector

* ++

* ++

* geometry

* ++

* remove noGeometry

* revert test

* +

* all tests but scrolling/clipping pass

* clipping works

* scrolling halfway

* sliver tests pass

* ALL TESTS PASS

* SemanticsNode changed

* docs and tiny fixes

* card test

* more doc comments

* remove missed print

* more tests

* make test pass on Linux

* remove changes to intellij proj file

* review comments
2017-10-18 16:28:24 -07:00