3667 Commits

Author SHA1 Message Date
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
Michael Goderbauer
c3e049613d Support for accessibilityHint and accessibilityValue (#12677)
* Support accessibility labels and hints

* more tests

* ++

* review comments

* fix merge

* test fix
2017-10-24 11:17:51 -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
xster
52815b2224 Revive "Add a way to get the furthest Navigator" (#12647)
* Revert "Construct the accessibility channel's events by SemanticsEvent. (#12638)"

This reverts commit 4c1150dd01c0efb55278d35a9ce1467a65c45e40.

* Revert "Revert "Add a way to get the furthest Navigator" (#12608)"

This reverts commit 79f13c36258380408eb1a1738178b964be3bf7f3.
2017-10-23 12:24:19 -07:00
Ian Hickson
05a22fe0ab FittedBox RTL (#12662) 2017-10-23 11:05:23 -07:00
Ian Hickson
662b668485 Revert "nav bar font styles are special, do not inherit (#12578)" (#12661)
This reverts commit 964a138d80e4b0778bdb31f0d0c4d3b34d100f84.

It may (or may not) have caused a performance regression. Hard to say.
2017-10-23 11:05:12 -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
Ian Hickson
faf44b592a Factor out painting logic for DecorationImage (#12646)
This avoids some code duplication that existed before and will make
further modifications easier.
2017-10-20 16:58:16 -07:00
Hans Muller
796c5439f6 Language-specific LocalizationDelegates (#12645) 2017-10-20 10:45:28 -07:00
xster
b96fa4de11 Let CupertinoNavBar automatically have a back or close button (#12575)
* create auto back button behaviour

* cosmetic fidelity

* tests

* review

* document new icon
2017-10-19 19:19:49 -07:00
amirh
4c1150dd01 Construct the accessibility channel's events by SemanticsEvent. (#12638)
This refactoring allows us to have SemanticsEvent object for events that are not
associated with an accessibility node id.
And allow https://github.com/flutter/flutter/pull/12594 to be a bit
cleaner with a single place for accessibility channel documentation (the
SemanticsEvent classes documentation).
2017-10-19 18:31:58 -07:00
xster
79f13c3625 Revert "Add a way to get the furthest Navigator" (#12608)
* Revert "BoxDecoration.borderRadius and RoundedRectangleBorder.borderRadius RTL (#12603)"

This reverts commit 07908916003fdc9078275b75eee40090f36b1cef.

* Revert "Copy snapshot file into assets (#12523)"

This reverts commit f6135107bcba92f02df6572d1a8be5e93863e6f6.

* Revert "Add a rootNavigator option to Navigator.of (#12580)"

This reverts commit 822084b235eab2f899a89706c622c08512295a4b.
2017-10-19 17:34:39 -07:00
Ian Hickson
982f511c90 Make Border more general (#12619) 2017-10-19 17:06:01 -07:00
xster
f2d3b99b43 Add docs for cupertino icons (#12610) 2017-10-19 16:45:22 -07:00
robertoscaramuzzi
1573d3b886 Fix error message to refer to actual ClipRect widget instead of non-existing RectClip (#12632) 2017-10-19 15:27:48 -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
Sarah Zakarias
f74cd91761 Update TextStyle doc and remove package field (#12577) 2017-10-19 10:14:38 +02:00
Sarah Zakarias
e4f53c3abd Add 'package' argument to IconData (#12560) 2017-10-19 09:38:54 +02: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
Michael Goderbauer
9baca00119 Make Tab take a widget as child (#12613)
* Make Tab take a widget as child

This way you can override the semantics information of a Tab (see test).

Fixes https://github.com/flutter/flutter/issues/12432

* more tests

* review comments

* review comment

* doc nits

* style fix
2017-10-18 16:19:54 -07:00
Ian Hickson
0790891600 BoxDecoration.borderRadius and RoundedRectangleBorder.borderRadius RTL (#12603) 2017-10-18 11:24:54 -07:00
xster
822084b235 Add a rootNavigator option to Navigator.of (#12580) 2017-10-18 01:31:29 -07:00
xster
964a138d80 nav bar font styles are special, do not inherit (#12578) 2017-10-18 01:30:43 -07:00
Ian Hickson
d920fdd11a RoundedRectangleBorder (#12591) 2017-10-17 17:58:04 -07:00
Ian Hickson
0e34c7f28c CircleBorder (#12570) 2017-10-17 13:38:06 -07:00
Ian Hickson
1f82733a3b Make BoxDecoration lerp gradients (#12451)
This still is very limited in what it can lerp, but it sets the stage for arbitrary lerps later.
2017-10-17 13:10:10 -07:00
Adam Barth
a13320253c Don't attempt to draw invisible overflow indicator (#12534)
If the flex is empty, there's no space in which to draw the overflow indicator,
so we shouldn't bother trying to draw it.

Fixes #12532
2017-10-17 11:17:08 -07:00
amirh
3d7a4eed44 Short circuit _checkUp if tap callbacks were triggered by resolve. (#12521) 2017-10-17 10:29:29 -07:00
Hans Muller
bd3e91ed98 AssetImage.obtainKey handles devicePixelRatio == null (#12564) 2017-10-17 09:27:04 -07:00
xster
9ce3ba314e Add Cupertino icon fonts helper and dependency for default template (#12559)
* add CupertinoIcons

* Use new font name convention

* review
2017-10-16 18:59:28 -07:00
Greg Spencer
25ac924e01 Modify the MaterialButton to expand when text is scaled. (#12431)
This modifies the MaterialButton to expand vertically to fit the size of the contained child, no matter what the child widget is. It tries to be as close as possible to the minHeight constraint.

Also updated some doc comments to have headers (extra blank line after first sentence), and to wrap at 80 cols.

Addresses #12311
2017-10-13 16:07:05 -07:00
amirh
3616ebbd30 Emphasize the behavior property in GestureDetector's class doc. (#12536) 2017-10-13 13:33:39 -07:00
Michael Goderbauer
4ffa801cb1 Remove parentSemantics from semantics tree compliation (#12479) 2017-10-13 12:27:23 -07:00
amirh
32c038ee3f Add missing curly braces in icon.dart (#12529)
(post-merge followup for #12516)
2017-10-13 10:20:22 -07:00
gspencergoog
e316956888 Make tooltips scale with textScaleFactor (#12498)
Fixes #12480
2017-10-12 16:44:21 -07:00
gspencergoog
ba0618d35d Make material slider respect textScaleFactor (#12511)
Make material slider respect textScaleFactor

Fixes #5938
2017-10-12 16:43:28 -07:00
amirh
c312b3d9ae Keep Icon's subtree structure the same with and without a semanticLabel. (#12516)
* Keep Icon's subtree structure the same with and without a semanticLabel.

This avoids rebuilding the subtree when a semanticLabel is set/unset.
Also updated some doc comments.

(This is a followup on post-merge comments for #12475)
2017-10-12 13:52:55 -07:00
gspencergoog
f5cc816c54 Keep CircleAvatar from scaling the text with textScaleFactor (#12499)
Fixes #12483
2017-10-12 08:21:28 -07:00
Hans Muller
c3d56b1dad flutter_localization optional package (#12410) 2017-10-11 16:01:13 -07:00
Michael Goderbauer
f07170b45b Update Semantics for SingleChildScrollViews (#12376)
* Update Semantics for SingleChildScrollViews

* refactor

* review feedback

* added assert and comments

* doc
2017-10-11 13:07:19 -07:00
Alexander Aprelev
095e6af0b8 Reroll engine to 2a84f18c795d24ba95baed360fcb58b3dc66d661 (#12487) 2017-10-10 16:27:51 -07:00
amirh
5e595d12e4 Allow specifying and a11y label for Icon widget (#12475)
* Allow specifying and a11y label for Icon widget
2017-10-10 14:04:43 -07:00
Alexander Aprelev
c38b843460 Move -referencing asserts to constructor body. (#12478) 2017-10-10 09:05:20 -07:00
Alexander Aprelev
7f5b973cb1 Revert "Roll engine after dart roll (#12473)" (#12477)
This reverts commit e7061698147e80fa53ec3ed0cf048f4d68df7d68.

This causes preview-dart-2 test failures.
2017-10-10 07:27:39 -07:00
Alexander Aprelev
e706169814 Roll engine after dart roll (#12473)
* Roll engine

* Move assert requiring 'this' from initializer to constructor body

* Update test expected message

* Relax regexp to allow wider array of dart uris
2017-10-10 06:38:51 -07:00