[H] Provide some more locations for the FAB.#24736
Conversation
|
cc @HansMuller |
Top left and top right for big FABs, and top left for mini FABs.
69c6267 to
bd480f1
Compare
| /// * <https://material.google.com/components/buttons-floating-action-button.html> | ||
| /// * [Scaffold], in which floating action buttons typically live. | ||
| /// * [RaisedButton], another kind of button that appears to float above the | ||
| /// content. |
There was a problem hiding this comment.
Nit: should FlatButton be included in this list?
There was a problem hiding this comment.
I included raised button because it floats. I think if we start including all the buttons, this will quickly be overwhelming for readers.
| // We have to offset the FAB by four pixels because the FAB itself _adds_ | ||
| // four pixels in every direction in order to have a hit target area of 48 | ||
| // pixels in each dimension, despite being a circle of radius 40. | ||
| return Offset(_startOffset(scaffoldGeometry, offset: 4.0), _straddleAppBar(scaffoldGeometry)); |
There was a problem hiding this comment.
nit: making the magic 4.0 offset a constant could make the code a bit more self documenting and would avoid having the offsets get out of sync.
There was a problem hiding this comment.
The problem is the 4.0 doesn't actually appear anywhere else. It's a side-effect of the MaterialTapTargetSize being 48.0x48.0 while the _kMiniSizeConstraints are 40.0x40.0, but the code that knows about one doesn't know about the other, so they don't appear together anywhere.
|
Thanks for the review. I'm going to land as-is based on my comments above, but let me know if you'd like further changes. |
* flt_master: (143 commits) Roll engine 215ca15..d8c5ec0 (12 commits) (flutter#25728) Provide some more locations for the FAB. (flutter#24736) Undeprecated BigInteger support, but document what it actually does. (flutter#24511) ClipPath.shape and related fixes (flutter#24816) Handle errors in `compute()` by propagating them to the Future. (flutter#24848) Fix merge conflict. (flutter#25718) Some minor tweaks to InputDecoration (mainly docs). (flutter#24643) Expose font fallback API in TextStyle, Roll engine 54a3577..215ca15 (8 commits) (flutter#25585) Updated Shrine demo (flutter#25674) Pin the goldens repo to a specific commit in the android_views test. (flutter#25678) Friendlier flags for Dart compilation training. (flutter#25645) Revert dependency upgrade to see if it helps with build times and APK size (flutter#25642) Depend on the goldens repo through git. (flutter#25479) no period after an alone link in see also section (flutter#25604) Update links for China help (flutter#25238) Roll engine 6a90418..54a3577 (23 commits) (flutter#25649) Roll engine e859296..6a90418 (4 commits) (flutter#25643) Adding support for android app bundle - Issue flutter#17829 (flutter#24440) Revert "[O] Remove many timeouts. (flutter#23531)" (flutter#25646) [O] Remove many timeouts. (flutter#23531) ...
|
lgtm |
Top left and top right for big FABs, and top left for mini FABs.