Skip to content

Conversation

@mehmetf
Copy link
Contributor

@mehmetf mehmetf commented Jul 17, 2017

If automaticallyImplyLeading is true (by default), then we try to derive back or menu icon. If false, we do not.

@mehmetf mehmetf requested a review from Hixie July 17, 2017 22:47
/// example, if the [AppBar] is in a [Scaffold] that also has a [Drawer], the
/// [Scaffold] will fill this widget with an [IconButton] that opens the
/// drawer. If there's no [Drawer] and the parent [Navigator] can go back, the
/// [AppBar] will use a [BackButton] that calls [Navigator.maybePop].
Copy link
Contributor

Choose a reason for hiding this comment

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

This doc needs updating as well.

/// Creates a material design app bar.
///
/// Typically used in the [Scaffold.appBar] property.
AppBar({
Copy link
Contributor

Choose a reason for hiding this comment

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

constructor doc should say that automaticallyImplyLeading must not be null (please copy similar text from another constructor to match style), then add an assert that it's not null.

@Hixie
Copy link
Contributor

Hixie commented Jul 17, 2017

SliverAppBar needs the same treatment.

@mehmetf
Copy link
Contributor Author

mehmetf commented Jul 18, 2017

Fixes applied @Hixie PTAL.

/// Creates a material design app bar.
///
/// Arguments [elevation], [primary], [toolbarOpacity], [bottomOpacity],
/// [automaticallyImplyLeading], must not be null.
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding this. Can you add a "The" at the stand and an "and" between the last two and remove the final comma, to match the grammar used elsewhere? Thanks! (If this is the style you found somewhere, please let me know and I'll go fix it there too.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copied it from somewhere else but I don't recall where.

assert(primary != null),
assert(toolbarOpacity != null),
assert(bottomOpacity != null),
assert(automaticallyImplyLeading != null),
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: the order of the asserts should match the order of the arguments (see the style guide - we try to keep the order of everything the same everywhere where the order wouldn't otherwise matter).

/// [Scaffold] will fill this widget with an [IconButton] that opens the
/// drawer. If there's no [Drawer] and the parent [Navigator] can go back, the
/// [AppBar] will use a [BackButton] that calls [Navigator.maybePop].
/// If this is null and automaticallyImplyLeading is set to true, the [AppBar] will
Copy link
Contributor

Choose a reason for hiding this comment

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

hyperlink "automaticallyImplyLeading"

/// [Navigator.maybePop].
final Widget leading;

/// Controls whether we should try to imply the leading widget if null.
Copy link
Contributor

Choose a reason for hiding this comment

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

hyperlink "leading"

(see the style guide; we try to add breadcrumbs everywhere so that people reading the docs have always got something new to read)

/// Controls whether we should try to imply the leading widget if null.
///
/// If true and leading is null, automatically try to deduce what the leading
/// widget should be. If false and leading is null, leading space is given to title.
Copy link
Contributor

Choose a reason for hiding this comment

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

hyperlink all occurrences of "leading", and "title".

/// If true and leading is null, automatically try to deduce what the leading
/// widget should be. If false and leading is null, leading space is given to title.
/// If leading widget is not null, this parameter has no effect.
final bool automaticallyImplyLeading;
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto above comments here

/// * <https://material.google.com/layout/structure.html#structure-toolbars>
class SliverAppBar extends StatefulWidget {
/// Creates a material design app bar that can be placed in a [CustomScrollView].
const SliverAppBar({
Copy link
Contributor

Choose a reason for hiding this comment

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

this constructor should mention non-nullable arguments too

@Hixie
Copy link
Contributor

Hixie commented Jul 19, 2017

This is great. Sorry for the nitpicky doc comments. The code looks great.

@mehmetf
Copy link
Contributor Author

mehmetf commented Jul 21, 2017

All done!

@Hixie
Copy link
Contributor

Hixie commented Jul 21, 2017

LGTM

@mehmetf mehmetf merged commit 94ed7dc into flutter:master Jul 22, 2017
goderbauer added a commit that referenced this pull request Jul 24, 2017
@mehmetf mehmetf deleted the appbar_fix branch September 6, 2017 21:23
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants