Commit graph

458 commits

Author SHA1 Message Date
Ian Hickson 3ac9449ad4
Fix the confusing-zero case with NestedScrollView. (#14133)
* Fix the confusing-zero case with NestedScrollView.

* Update mock_canvas.dart

* Update tabs_demo.dart

* more tweaks
2018-01-18 20:21:15 -08:00
Alexandre Ardhuin 0fe1e5bf5b
apply upcoming lint prefer_const_literals_to_create_immutables (#14029) 2018-01-11 08:38:55 +01:00
xster 0f11de2e06
add email to the text fields demo (#13946) 2018-01-08 16:57:52 -08:00
xster 1eb6a95fcb
Pipe onsubmit for text form fields (#13687) 2018-01-03 23:57:38 +08:00
Michael Goderbauer 94f48c2cc6
Make UserAccountsDrawerHeader accessible (#13851)
Fixes #13743 
Fixes #12379
Follow-up to #13745

Also adds an option to hide gestures introduced by `InkWell` and `InkResponse` from the semantics tree (see also `GestureDetector.excludeFromSemantics`).
2018-01-02 16:28:31 -08:00
Chris Bracken f4040455d1
Minor formatting fixes (no logical changes) (#13855)
Reformats a SafeArea introduced in #13853.
2018-01-02 15:42:48 -08:00
Chris Bracken ece737d145
Apply media padding to Gallery animation demo (#13853)
Applies horizontal safe area insets to the animation demo in the
Gallery. Specifically, this ensures the back button is positioned
consistently with iOS expectations and that that main image card in the
detail view respects safe area insets.

This is to support the iPhone X sensor housing notch and other similarly
creative display features when in landscape orientation.
2018-01-02 14:09:32 -08:00
Chris Bracken 882eb24e1e
Apply media padding to Gallery video demo (#13847)
Applies horizontal safe area insets to the video demo in the Gallery.
This is to support the iPhone X sensor housing notch and other similarly
creative display features when in landscape orientation.
2018-01-02 12:33:36 -08:00
Leaf Petersen b3cfa785c4
Uncontroversial and backwards compatible 2.0 SDK fixes (#13723)
Small code changes as part of moving the framework SDK forward to a 2.0 dev version.
2017-12-21 13:39:03 -08:00
Ian Hickson 78ff7707e1
Fix niggling PaginatedDataTable bugs (#13556)
Prevent header from thinking it can wrap and then overflowing.

Fix default footer string which lost its colon (localized values are fine).

Make the "rows per page" drop-down include at least one value even when the table lacks many items. (Previously it would assert if your table was too short.)

Make the footer scrollable.

Fix some todos and improve some debug output.

Tests for much of the above.
2017-12-19 12:39:48 -08:00
Chris Bracken e478a5472d
Apply media padding in Gallery Pesto demo (#13668)
Applies horizontal safe area insets to the Pesto demo in the Gallery.
This is to support the iPhone X sensor housing notch and other similarly
creative display features when in landscape orientation.
2017-12-19 09:15:26 -08:00
Chris Bracken e85d099229
Apply media padding to Contacts demo (#13628)
Applies horizontal safe area insets to the Contacts demo in the Gallery.
This is to support the iPhone X sensor housing notch and other similarly
creative display features when in landscape orientation.
2017-12-15 19:10:18 -08:00
Chris Bracken d8bfb3a99b
Apply media padding to Gallery Material Design demos (#13593)
Applies media padding (e.g. iPhone X safe area insets) to the Material Design demos in the Gallery.

Covers the following demos:
* Buttons (via the TabbedComponentDemoScaffold change)
* Cards
* Expansion panels
* Grid list
* Icons
* Images (via the TabbedComponentDemoScaffold change)
* Page Selector
* Progress Indicator
* Scrollable tabs
* Selection controls (via the TabbedComponentDemoScaffold change)
* Snack bar
* Tabs
* Text fields
* Tooltips

Fixes #13594
2017-12-15 10:13:30 -08:00
Chris Bracken dc9c95375f
Apply media padding in Color, Typography demos (#13592) 2017-12-14 18:32:41 -08:00
Chris Bracken dd943fefe0
Apply media padding in Cupertino Navigation demo (#13585)
Adds safe areas around:
1. The body of the colour swatch view (tab 1)
2. The chat header (tab 2)
3. The chat bubbles (tab 2)
4. The 'Sign In' launcher button (tab 3)
2017-12-14 17:38:48 -08:00
Chris Bracken 8a77036b35
Center Shrine demo title with centerTitle (#13586)
Rather than use a Center widget, center the title using AppBar's
centerTitle property. This ensures the title is horizontally centred
with respect to the screen rather than centred in the space between the
leading and trailing app bar widgets, which are asymmetrical in Shrine.
2017-12-14 16:53:30 -08:00
Chris Bracken 20fb6621eb
Apply media padding in ListTile (#13545)
Applies media padding (e.g. iOS safe area insets) around the list tile
children inside the InkWell.

Also adds safe area around gallery section titles for consistency with
surrounding list tiles.
2017-12-13 18:39:36 -08:00
xster ecf5041807
Let translucent Cupertino bars have its scaffold children automatically pad their heights - second try (#13440)
* Let translucent Cupertino bars have its scaffold children automatically pad their heights (#13194)

* Let lists automatically add sliver padding from media query. Translucent nav and tab bars leave behind media query paddings in scaffolds.

* tests

* const lint

* Rename base abstract class to generalized ObstructingPreferredSizeWidget

* review

* More docs and comments from #13317
2017-12-08 09:00:20 -08:00
Yegor e3cf62bc5b
modernize corners & borders in animation demo (#13352) 2017-12-05 16:38:42 -08:00
xster 9db8966f94
Make drawer demo header not scroll away (#13337)
* Make drawer demo header not scroll

* Add test for gallery drawer demo and fix user accounts drawer header overflow
2017-12-05 11:58:03 -08:00
Sigurd Meldgaard 2352e31f4e
Video demo is unsupported on simulator (#13333)
* Video demo is unsupported on simulator

Display a message stating this.

* Address review
2017-12-05 13:39:24 +01:00
Sigurd Meldgaard b46d79041a
Add spinner to loading video (#13330)
* Add spinner to loading video
2017-12-05 10:20:13 +01:00
xster 2d6f268df6 Revert "Let translucent Cupertino bars have its scaffold children automatically pad their heights (#13194)" (#13317)
This reverts commit 5c4ffa13a6.
2017-12-01 21:18:36 -08:00
Sigurd Meldgaard 3a393249dc Gallery video demo (#13195) 2017-12-01 18:28:36 +01:00
Chris Bracken 7a4df90bfb
Extract Cupertino chat row class (#13288)
Extracts Tab2ConversationRow class that consolidates widget tree for a
chat message in the Cupertino navagation chat demo. This refactoring
simplifies adding SafeArea support to handle iOS 11 safe areas in a
followup patch.
2017-11-30 18:47:57 -08:00
xster 5c4ffa13a6
Let translucent Cupertino bars have its scaffold children automatically pad their heights (#13194)
* Let lists automatically add sliver padding from media query. Translucent nav and tab bars leave behind media query paddings in scaffolds.

* tests

* const lint

* Rename base abstract class to generalized ObstructingPreferredSizeWidget
2017-11-30 13:55:30 -08:00
Ian Hickson 4a4fa2a7c7
Cupertino RTL (#13273)
Fixes the remaining known issues with widgets supporting RTL.
2017-11-30 12:24:40 -08:00
amirh fcdbdfb476
Move the Icons demo into a card, and refactor it to use a Table widget. (#13257)
This is in preparation for adding a second card with a demo for animated
icons.

Table refactor is just a cleanup (that also fixes an alignment bug).
2017-11-29 18:46:59 -08:00
amirh a8f565eb43
Icons demo cleanup - set color in the icon theme, remove unused iconOpacity (#13255) 2017-11-29 16:02:39 -08:00
amirh 47b5c37f1a
Add Images demo to the gallery app. (#13141) 2017-11-28 18:17:11 -08:00
Devon Carew bdbe53be01
remove unused constants (#13199) 2017-11-24 19:13:18 -08:00
Ian Hickson 2bda59a1fe
TabBar RTL (#13164) 2017-11-22 18:53:42 -08:00
Ian Hickson 2db0c25f82
Dismissible RTL (#13137)
Fix the dismissible demo in the gallery (make it actuall update when you pick something from its menu; give it a better affordance for resetting once you've dismissed everything).

Improve some docs.

Fix various flinging bugs with dismissible. Add tests for those cases.

Add a feature to flutter_test to support a drag-then-fling gesture (used by the flinging tests).
2017-11-22 15:20:15 -08:00
Greg Spencer 0259be90b8
Fix spelling errors in all the dartdocs. (#13061)
I got tired of drive-by spelling fixes, so I figured I'd just take care of them all at once.

This only corrects errors in the dartdocs, not regular comments, and I skipped any sample code in the dartdocs. It doesn't touch any identifiers in the dartdocs either. No code changes, just comments.
2017-11-17 10:05:21 -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
xster 89405002bc
Add an iOS style demo to the gallery (#12651)
* Built first tab

* Small additions

* started tab 3

* Need color arithmetics

* tab 2 built

* finalize

* lint and tests

* review

* Reapply docs after rebase

* use color.computeLuminance

* linter

* nit
2017-11-03 08:50:29 -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
Chris Bracken d69fcea1a8 Use Mountain View/Cupertino terms in drawer on iOS (#12699)
Use our platform identifiers rather than OS names for the platform
switcher radio buttons in the drawer as noted in section 2.3.10 of the
App Store review guidelines.

See: https://developer.apple.com/app-store/review/guidelines/
2017-10-24 18:11:10 -07:00
Phil Quitslund d6a7d05a25 Fix typo in Calculator demo. (#12688) 2017-10-24 10:36:31 -07:00
Alexandre Ardhuin 1fce14a31c enable lint prefer_single_quotes (#12665) 2017-10-22 18:11:36 +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
Greg Spencer e697e5523f Add large text switching to Gallery app. (#12443)
This lets us preview widgets in the gallery using small, normal, large, and HUGE text.

Added selections to the main drawer for these options. Defaults to "normal", obviously.
2017-10-13 21:44:24 -07:00
Adam Barth 6128f48c80 Switch SlideTransition over to using Offset (#12369)
Previously, we used `Alignment`, which was difficult to understand. Now,
we just use an `Offset` scaled to the child's size, which is much easier
to understand.
2017-10-02 23:30:14 -07:00
Adam Barth 0044ea2dbb Replace usage of FractionalOffset with Alignment (#12348)
Alignment will eventually replace FractionalOffset.
2017-10-02 00:06:24 -07:00
Ian Hickson efb45ea788 Trivial nit fixes (#12285) 2017-09-27 16:13:48 -07:00
Sarah Zakarias a0e91bf9e8 Update Flutter Gallery to use new asset api for package assets (#12254) 2017-09-26 15:21:01 +02:00
Jason Simmons 6420c75f26 Handle cancellation of the date/time picker in the Gallery full screen dialog demo (#12248) 2017-09-25 13:59:05 -07:00
Yegor f2d096010d Internationalize time numerals in the time picker and TimeOfDay (#12166)
* internationalize time numerals

* tests

* use foundation.dart instead of meta.dart

* address comments
2017-09-22 14:35:25 -07:00
Alexandre Ardhuin 2958d7d0fc use bool in assert (#12170) 2017-09-21 09:33:01 +02:00
Todd Volkert 11de1a516f Fix capitalization in gallery RegExp (#12035) 2017-09-11 12:56:38 -07:00
Adam Barth 1792766a88 Rename BannerLocation enum values (#11960)
* Rename BannerLocation enum values

 * topLeft -> topStart
 * topRight -> topEnd
 * bottomLeft -> bottomStart
 * bottomRight -> bottomEnd

These names will make it easier for us to adjust the location of the
banner in right-to-left mode.

See the discussion on flutter-dev.

* Add RTL support for Banner

Fixes #11905
2017-09-07 21:12:28 -07:00
Alexandre Ardhuin 8a88e2efca Bump Dart SDK to 1.25.0-dev.9.0 (#11509)
* Bump Dart SDK to 1.25.0-dev.9.0

* add link to sdk bug
2017-08-09 14:45:55 +02:00
Jacob Richman 93a98327a8 Add Diagnosticable base class and add documentation. (#11458)
Add Diagnosticable base class and documentation
2017-08-03 09:49:44 -07:00
Jacob Richman 9f510ebdc9 Refactor RenderObject.toStringDeep and Widget.toStringDeep code to use DiagnosticsNode (#11359)
Refactor RenderObject.toStringDeep and Widget.toStringDeep code to use DiagnosticsNode.
2017-07-25 09:25:13 -07:00
Michael Goderbauer 6ac0f61234 Gallery: remove unused code and a11y fix (#11209) 2017-07-14 14:44:11 -07:00
Michael Goderbauer cb35a1c728 Tiny a11y fix for Gallery (#11187) 2017-07-13 09:50:37 -07:00
Michael Goderbauer 792c98751f a11y fix for list_demo.dart (#11142)
* a11y fix for list_demo.dart

* fix semantics of persistant bottom sheet
2017-07-10 17:37:21 -07:00
Michael Goderbauer 0e1b652d53 Make Demos in flutter_gallery more accessible (#10832)
Remaining known issues are #10831 and #10830.
2017-06-20 11:09:57 -07:00
Hans Muller 40db1e4bc6 Added InputDecoration helperText, helperStyle (#10852) 2017-06-20 09:33:26 -07:00
gspencergoog 9f344b695d Adds prefix and suffix support to TextField, per Material Design spec. (#10675)
* Prefix and Suffix support for TextFields

* Adding Tests

* Removing spurious newline.

* Fixing a small problem with the test

* Review Changes
2017-06-13 19:17:04 -07:00
Ian Hickson a9f1cb8c0a More documentation (#10606)
- How do you handle a tap on text?
- Why is AnimatedOpacity expensive?
- Why would you use a gesture arena team?
...and other minor fixes
2017-06-12 16:53:01 -07:00
Ian Hickson 9ac16680d2 Analyze sample code (#10619) 2017-06-12 16:52:35 -07:00
Alexandre Ardhuin 1eaefe1837 more const for immutables (#10563) 2017-06-08 22:04:18 +02:00
Alexandre Ardhuin 7d71326363 apply prefer_asserts_in_initializer_list lint (#10540) 2017-06-07 21:39:47 +02:00
Ian Hickson ccad2849e7 Docs for menus (#10396)
Also, clean up the menus code a bit.

Also, make it easier to write a PopupMenuEntry that has itself many
items (for example, the way Chrome's menu has icons in a row).
2017-05-31 10:48:49 -07:00
Ian Hickson f50caddfbd Much work on the documentation (#10331)
Minor fixes throughout, e.g. removing trailing commas from the end of sample code expressions, changing headings to "sample code" more consistently, removing stale todos, fix typos in a private method name, minor grammar fixes, added some clarifications to CircularProgressIndicator, LinearProgressIndicator, CrossAxisAlignment, added some cross-references to various members, made it slightly clearer that layout algorithms are implementation details.

Clarified "elevation" throughout.

Added docs to InkResponse and InkWell.

Added sample code for: SliverAppBar, Card, ListTile, EdgeInsets, Row, Column, CustomScrollView, ListView, SliverFixedExtentList, and SliverGrid.

Fixes #10317.
Fixes #10316.
Fixes #10267. (sort of, see comment therein)
Fixes #9331. (sort of, see comment therein)
Fixes #9407. (sort of, see comment therein)
2017-05-26 17:15:09 -07:00
Ian Hickson cd6e3b1ac2 CheckboxListTile, RadioListTile, SwitchListTile (#10160) 2017-05-19 08:46:17 -07:00
Ian Hickson 61c56ba15f Make Slider take up whatever space it has. (#10132)
Previously it was (arbitrarily?) set to 144.0 pixels wide.
2017-05-17 14:31:55 -07:00
Ian Hickson 6ffcadfa38 Remove the slider from the Icon demo page (#10134)
The slider never really made much sense and it violated UX guidelines.

https://github.com/flutter/flutter/issues/4147
2017-05-16 19:34:50 -07:00
stevemessick cc91b159c0 Fix typo (#10111) 2017-05-16 10:19:21 -07:00
Jason Simmons e65d47d4ba Update Gallery primary swatch colors in order to select the intended text color (#10090) 2017-05-15 12:40:20 -07:00
Jason Simmons 91b1a07656 Framework support for checkerboardOffscreenLayers (#10054)
See https://github.com/flutter/flutter/issues/9473
2017-05-12 14:41:07 -07:00
xster 81ec553fb6 More Cupertino dialog UI tweaks (#9960)
* is default

* hit target

* correct test name

* review note
2017-05-10 18:59:50 -07:00
Alexandre Ardhuin 9b56c1c58c enable always_put_control_body_on_new_line lint (#9950) 2017-05-10 09:41:55 +02:00
Alexandre Ardhuin e4546584d1 enable always_require_non_null_named_parameters lint (#9948)
* enable always_require_non_null_named_parameters lint

* Update home.dart
2017-05-10 08:45:36 +02:00
Chris Bracken 60f5ae8e77 Add const non-null asserts where required (#9945)
Also includes minor doc fixes.
2017-05-09 21:15:42 -07:00
Hans Muller 1157812bb9 Added ExpansionTile and deprecated TwoLevelList et al (#9938) 2017-05-09 16:32:01 -07:00
Sarah Zakarias ee6cd679c8 More use of url_launcher plugin in Flutter Gallery (#9836) 2017-05-09 15:05:23 +02:00
Sarah Zakarias 2dd26a93a5 Revert "Revert plugin use in gallery (#9838)" (#9913)
This reverts commit 4bbf158b6a.
2017-05-09 11:49:03 +02:00
Ian Hickson 3012cce146 Clean up Tween and friends. (#9858) 2017-05-08 10:42:06 -07:00
Hans Muller a6eb0a3e38 Gallery animation demo back button update (#9853) 2017-05-08 10:13:13 -07:00
Ian Hickson a5894fca82 Revert "Revert "Revert plugin use in gallery (#9838)"" (#9883)
* Revert "Update reference to url_launcher plugin in Gallery pubspec (#9879)"

This reverts commit 96a04dea0d.

* Revert "Revert "Revert plugin use in gallery (#9838)" (#9877)"

This reverts commit ede72a8043.
2017-05-08 09:42:23 -07:00
Sarah Zakarias ede72a8043 Revert "Revert plugin use in gallery (#9838)" (#9877)
This reverts commit 4bbf158b6a.
2017-05-08 13:32:41 +02:00
Hans Muller 3681aee5a4 Selectively enable page scrolling in the gallery animation demo (#9845) 2017-05-05 16:02:25 -07:00
Sarah Zakarias 4bbf158b6a Revert plugin use in gallery (#9838)
* Revert "add Podfile (#9835)"

This reverts commit 74e656752c.

* Revert "update ref to url_launcher plugin in Flutter Gallery (#9833)"

This reverts commit 30c49781c5.

* Revert "Use url_launcher plugin in Flutter Gallery (#9751)"

This reverts commit 02dfd6be53.
2017-05-05 14:14:33 +02:00
Sarah Zakarias 02dfd6be53 Use url_launcher plugin in Flutter Gallery (#9751) 2017-05-05 10:48:46 +02:00
Hans Muller 6d8930e4d6 Animation demo scrolling (#9804) 2017-05-04 11:13:36 -07:00
Hans Muller cddf06cf26 Added scroll snapping to the gallery animation demo (#9710) 2017-05-03 16:35:28 -07:00
Kyle Bradshaw b5671f1b22 Gallery Cupertino Dialog demo snackbar fix (#9764)
Fixes #9757
2017-05-03 12:29:45 -07:00
Jason Simmons b586a97ad2 Enable physical model shadows (with animation) and change elevation to a double (#9756)
Fixes https://github.com/flutter/flutter/issues/9342
2017-05-03 12:11:01 -07:00
Ian Hickson 89856c0e5b Adjust the defaults behaviour of scroll views. (#9679)
* Adjust the defaults behaviour of scroll views.

Now, primary scroll views scroll by default. Others only scroll if necessary.

* apply suggested changes
2017-05-02 09:14:50 -07:00
xster f65fea8e2e Create a text validator/formatter mechanism (#9535)
* Add a text formatter interface used by EditingText. Provide some default implementations.

* self nits

* Handle -1 selection offsets

* review notes

* simplify regular expression

* Add whitelisting formatters. Use a custom phone number formatter in text demo.

* review notes

* not being able to addAll(null) is pretty annoying

* review notes

* partial tests

* Add tests

* didn’t end up needing mockito

* move to services
2017-04-28 15:33:38 -07:00
Jason Simmons a4992f0eac Fix the sizing of the stack containing the Gallery preview banner (#9657) 2017-04-27 15:16:05 -07:00
Ian Hickson 36052e68dd BoxDecoration API changes: backgroundColor -> color et al (#9648)
backgroundColor -> color
backgroundImage -> image
BackgroundImage -> DecorationImage
2017-04-27 14:19:01 -07:00
Adam Barth 744c91265b Add NestedScrollView (#9640)
A NestedScrollView lets you implement patterns where you have a header, tabs,
and additional scrollers inside the tabs.

Fixes #8359
2017-04-27 12:29:40 -07:00
Jason Simmons 834c142d04 Fix the sizing of the image in Gallery/Contacts (#9625) 2017-04-27 11:32:53 -07:00
Alexandre Ardhuin 31828609dc add @required (#9579) 2017-04-25 08:59:43 +02:00
Adam Barth c288c7064f Refactor scrolling code to prepare for nested scrolling (#9575)
This patch reworks some of the guts of scrolling to make it easier to
implement nested scrolling effects. The actually nested scrolling effect
will be included in a later patch.
2017-04-24 23:32:55 -07:00
Alexandre Ardhuin 83fce211a3 More const immutable classes (#9544)
* more widget const constructors

* prefer const constructors

* address review comments
2017-04-23 22:37:29 +02:00