Skip to content

[flutter_adaptive_scaffold] Exposing way to customize NavigationRailDestination #141060

@dikatok

Description

@dikatok

Use case

Currently, AdaptiveScaffold takes only List<NavigationDestination> as destinations parameter, which is understandable, to make its type common. But, it results in us not being able to use other parameter exposed by NavigationRailDestination such as individual indicatorColor, indicatorShape and the most important one for me personally, padding.

Proposal

Expose a mapper method parameter to allow us customize individual NavigationRailDestination.

    return AdaptiveScaffold(
      mapNavigationRailDestination: (int index, NavigationDestination dest) {
        return NavigationRailDestination(
          icon: dest.icon,
          label: Text(dest.label),
          padding: newSections.contains(index)
              ? const EdgeInsets.only(top: 12)
              : EdgeInsets.zero,
        );
      },
    );

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: flutter_adaptive_scaffoldThe flutter_adaptive_scaffold packagepackageflutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionteam-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions