3

"Link to code"

I was following the Flutter State Management tutorial and came across this.

Please explain what are Slivers, Delegates. Especially this part that I have attached.

class MyCatalog extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(
        slivers: [
          _MyAppBar(),
          SliverToBoxAdapter(child: SizedBox(height: 12)),
          SliverList(
            delegate: SliverChildBuilderDelegate(
                (context, index) => _MyListItem(index)),
          ),
        ],
      ),
    );
  }
}
Sunit Gautam
  • 5,495
  • 2
  • 18
  • 31
rushikesh chaskar
  • 642
  • 1
  • 7
  • 12

1 Answers1

0

I can say it briefly: Slivers special animation area. Slivers You have a lot of option slivers widget also normal widgets (SliverGrid => GridView). Sliver scroll affects the biggest difference in normal listview.

Slivers ok, so what is ChildDelegate?

Delegate: Slivers draw type. Maybe sometimes set array builder function need. SliverListDelegate Delagete needs children array also SliverListBuilderDelagate return builder function and children count. Child Delegate

vb10
  • 641
  • 5
  • 14