Flutter Restorablez

pub package

Restorable Flutter widgets that automatically save and restore positions for widgets such as scrollables, tab bar, bottom navigation bar and navigation rail.

Documentation

The generated documentation has a great overview of all that is available.

Features

RestorableScroll

RestorableScroll(
  id: 'example-scroll',
  builder: (BuildContext context, ScrollController controller) {
    return ListView.builder(
      controller: controller,
      itemCount: 200,
      itemBuilder: (BuildContext context, int index) {
        return ListTile(
          title: Text('Item $index'),
        );
      },
    );
  },
);

RestorableTabBar

DefaultTabController(
  length: 3,
  child: Scaffold(
    appBar: AppBar(
      title: 'Example Tab Bar',
    ),
    bottom: RestorableTabBar(
      id: 'example-tab-bar',
      tabs: <Widget>[
        Tab(text: 'Tab 1'),
        Tab(text: 'Tab 2'),
        Tab(text: 'Tab 3'),
      ],
    ),
    body: TabBarView(
      children: <Widget>[
        Text('Child 1'),
        Text('Child 2'),
        Text('Child 3'),
      ],
    ),
  ),
);