Skip to content

[Documentation] Drawer.child has inconsistencies in docstring and api.flutter.dev #100268

@bradyt

Description

@bradyt

If I'm writing a Scaffold.drawer argument, docstring suggests Drawer. I check the docstring for Drawer.child, using jump to definition in the editor, and I see this:

  /// The widget below this widget in the tree.
  ///
  /// Typically a [SliverList].
  ///
  /// {@macro flutter.widgets.ProxyWidget.child}
  final Widget? child;

I'm not familiar with Flutter slivers, but imagine maybe it's the best way, and work on researching SliverList, and using it. I get some errors along the way, and suddenly realize that the online documentation, at https://api.flutter.dev/flutter/material/Drawer/child.html, has a modified version of the docstring, as follows:

The widget below this widget in the tree.

Typically a SliverList.

This widget can only have one child. To lay out multiple children, let this widget's child be a widget such as Row, Column, or Stack, which have a children property, and then provide the children to that widget.

It seems I'm being pulled in two directions, trying to decide between a SliverList or Column. What is the best way to resolve this apparent ambiguity?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectd: api docsIssues with https://api.flutter.dev/f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions