Skip to content

[FlexibleSpaceBar] can't build 'background' according to the stretch state #108655

@cyjaysong

Description

@cyjaysong

Use case

Because 'background' can only pass one fixed component and cannot display different component contents according to 'FlexibleSpaceBar' stretch, we need a way to build a 'background' according to the stretch state.

Proposal

add backgroundBuilder, expose 'FlexibleSpacebarSettings' and' BoxConstraints' to users to build components more flexibly according to stretch state.

Widget (BuildContext context, FlexibleSpaceBarSettings settings, BoxConstraints constraints) backgroundBuilder 

`Background 'and' backgroundBuilder' can't be used at the same time. Retaining 'background' ensures forward compatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityd: api docsIssues with https://api.flutter.dev/d: examplesSample code and demosd: stackoverflowGood question for Stack Overflowf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.team-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