0

The glow acts like the entire screen is a list. There some way that I can put the glow below the appbar? (edit: without losing the floating effect of the appbar)

<code>**</code>enter image description here<code>**</code>

CustomScrollView(
      slivers: <Widget>[
        SliverAppBar(
          title: Text('Home Scree'),
          floating: true,
          leading: Icon(Icons.alarm),
        ),
        SliverList(
          delegate: SliverChildBuilderDelegate(
            (ctx, i) {
              return Column(
                children: <Widget>[
                  ProductCard(),
                  Divider(
                    height: 0,
                    thickness: 1,
                  ),
                ],
              );
            },
            childCount: 10,
          ),
        ),
      ],
    ),
Denilson
  • 45
  • 1
  • 4

1 Answers1

0

Maybe you can try to use NestedScrollView,like this:

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: NestedScrollView(
        headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
          return [SliverAppBar(
            leading: Icon(Icons.alarm),
            title: Text('Home Scree'),
            expandedHeight: kToolbarHeight,
            floating: true,
          )];
        },
        body: ListView.builder(
          padding: EdgeInsets.zero,
            itemCount: 10,
            itemBuilder: (context, index) {
              return Column(
                children: <Widget>[
                  ProductCard(),
                  Divider(
                    height: 0,
                    thickness: 1,
                  ),
                ],
              );
            }),
      ),
    );
  }
Lucky Dog
  • 608
  • 5
  • 15