Skip to content

Conversation

@Hixie
Copy link
Contributor

@Hixie Hixie commented Nov 26, 2018

Top left and top right for big FABs, and top left for mini FABs.

@Hixie
Copy link
Contributor Author

Hixie commented Nov 26, 2018

cc @HansMuller

@Hixie Hixie changed the title Provide some more locations for the FAB. [H] Provide some more locations for the FAB. Nov 26, 2018
@zoechi zoechi added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Nov 28, 2018
Top left and top right for big FABs, and top left for mini FABs.
@Hixie Hixie requested a review from HansMuller December 23, 2018 19:44
@Hixie Hixie force-pushed the floating_action_button_locations branch from 69c6267 to bd480f1 Compare December 23, 2018 19:44
/// * <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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: should FlatButton be included in this list?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Hixie
Copy link
Contributor Author

Hixie commented Dec 24, 2018

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.

@Hixie Hixie merged commit 1e78c47 into flutter:master Dec 24, 2018
@Hixie Hixie deleted the floating_action_button_locations branch December 24, 2018 23:22
kangwang1988 added a commit to XianyuTech/flutter that referenced this pull request Dec 26, 2018
* 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)
  ...
@jacob314
Copy link
Contributor

lgtm

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants