Tabbed sliverlist - A simple flutter plugin to setup sliverlist with TabBar with minimal code.

Overview

tabbed_sliverlist

A package to simplify initialization of TabBar with ListView builder implemented using sliverappbar and sliverlist. Scroll position can be maintained by different tabs by providing unique string to each tablist.

  LinkedIn   Get the library   Example

Supported Dart Versions

Dart SDK version >= >=2.15.1

Demo

tabbed_sliverlist Demo

Installation

Pub

Add the Package

dependencies:
  tabbed_sliverlist: ^0.1.0

How to use

Import the package in your dart file

import 'package:tabbed_sliverlist/tabbed_sliverlist.dart';

Wrap the widget inside Scaffold widget. Below code is an example of how this plugin can be used

import 'package:flutter/material.dart';
import 'package:tabbed_sliverlist/tabbed_sliverlist.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  MyHomePage({Key? key}) : super(key: key);
  var listitems = [
    'item1','item2','item3','item4','item5','item6','item7','item8','item9','item10','item11','item12','item13','item14','item15','item16','item18','item19','item20'
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: TabbedList(
          tabLength: 3,
          sliverTabBar: const SliverTabBar(
              title: Text('Tabbed SliverList'),
              centerTitle: true,
              tabBar: TabBar(
                tabs: [
                  Tab(
                    text: 'tab1',
                  ),
                  Tab(
                    text: 'tab2',
                  ),
                  Tab(
                    text: 'tab3',
                  )
                ],
              )),
          tabLists: [
            TabListBuilder(
                uniquePageKey: 'page1',
                length: listitems.length,
                builder: (BuildContext context, index) {
                  return Padding(
                      padding: const EdgeInsets.only(top: 10),
                      child: ListTile(
                        title: Text(listitems[index].toString()),
                        tileColor: Colors.white,
                      ));
                }),
            TabListBuilder(
                uniquePageKey: 'page2',
                length: listitems.length,
                builder: (context, index) {
                  return Padding(
                      padding: const EdgeInsets.only(top: 10),
                      child: ListTile(
                        title: Text(listitems[index].toString()),
                        tileColor: Colors.white,
                      ));
                }),
            TabListBuilder(
                uniquePageKey: 'page3',
                length: listitems.length,
                builder: (context, index) {
                  return Padding(
                      padding: const EdgeInsets.only(top: 10),
                      child: ListTile(
                        title: Text(listitems[index].toString()),
                        tileColor: Colors.white,
                      ));
                })
          ]),
    );
  }
}
Note: 
You don't need to use all parameters, few of them are optional.
Make sure that tabLength matches number of Tab's and TabListBuilder's.

Want to contribute?

Pull requests and issues are always welcome!

How to contribute?

  1. Fork the repository
  2. Clone it to your local machine
  3. Open the project in your favourite editor
  4. Open cmd/terminal and run flutter clean and then flutter packages get
  5. Make the changes
  6. Create a Pull Request

Future Improvements?

  1. Enable loading if the data is yet to be fetched.
  2. Register a callback when the tabbar is pressed to perform task like API call.
  3. Scroll notification to identify the position to where it is scrolled.

View the issues here

This library is only tested for Android, iOS I expect it to work fine.

You might also like...

This is template toolkit fasten your project setup within a minute. The toolkit is based on MVC+S structure.

This is template toolkit fasten your project setup within a minute. The toolkit is based on MVC+S structure.

BWeird Flutter Toolkit! Hi! From a Weirder Flutter has been great on mobile development and I took this opportunity to make it even greater with templ

Aug 22, 2021

Demo app with continuous integration setup for auto across android/iOS app stores

demo_flutter_ci A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Dec 25, 2021

Wrapper for flutter_test that adds a tester argument to setUp and tearDown functions

flutter_test_ui Wrapper of testWidgets, setUp, and tearDown that provide the WidgetTesterCallback argument to the set-up and tear-down functions: test

Apr 10, 2022

CovidApp - A simple and minimal UI design COVID APP made with Flutter

CovidApp - A simple and minimal UI design COVID APP made with Flutter

covid_app A simple and minimal UI design COVID APP made with Flutter UI

Feb 5, 2022

A minimal meditation app made with Flutter

A minimal meditation app made with  Flutter

justBreathe Official Website A minimal meditation app. There's no paid courses and no subscriptions. It's just you, the mind, and the breath. Features

Sep 25, 2022

A minimal front-end library genesis client, built with Flutter

A minimal front-end library genesis client, built with Flutter

Librebook A minimal front-end library genesis client, built by Flutter Note: This project is now archived. See: https://github.com/atticdev/librebook/

Jan 6, 2023

(Flutter)Minimal App With Offline Storage(Using HIVE) Functionality.

(Flutter)Minimal App With Offline Storage(Using HIVE) Functionality.

TaskZ (Minimal + Offline TODO List App) Minimal App With Offline Storage(Using HIVE) Functionality. Getting Started 👍 Any suggestion, improvement on

Oct 2, 2022

Dart port of FormCoreJS: A minimal pure functional language based on self dependent types.

FormCore.js port to Dart. So far only the parser and typechecker have been ported i.e. the FormCore.js file in the original repo. (Original readme fro

Jan 28, 2022
Owner
Akshay A S
Just a coder!
Akshay A S
Let's setup Firebase​​ for our Flutter​​ app on Android​, iOS​ and Flutter Web. Setup Firebase to use Firebase products.

Flutter Tutorial - Firebase Setup For Flutter Web Let's setup Firebase for our Flutter app on Android, iOS and Flutter Web. Setup Firebase to use Fire

null 1 Apr 27, 2022
A flutter plugin about qr code or bar code scan , it can scan from file、url、memory and camera qr code or bar code .Welcome to feedback your issue.

r_scan A flutter plugin about qr code or bar code scan , it can scan from file、url、memory and camera qr code or bar code .Welcome to feedback your iss

PengHui Li 112 Nov 11, 2022
Add beautiful and trending tab indicators directly to your default Flutter TabBar

Add beautiful and trending tab indicators directly to your default Flutter TabBar. Features ?? Supports Android, iOS, Web Can be directly added to the

Adar 51 Dec 23, 2022
A colorful TabBar Flutter library with color animating indicator where each tab has a color. (inspired by SmartNews app)

Flutter Colorful TabBar A colorful TabBar for Flutter where each tab has a color (inspired by SmartNews app). Getting Started Add this to your package

null 8 Jun 17, 2022
A powerful official extension library of Tab/TabBar/TabView, which support to scroll ancestor or child Tabs when current is overscroll, and set scroll direction and cache extent.

extended_tabs Language: English | 中文简体 A powerful official extension library of Tab/TabBar/TabView, which support to scroll ancestor or child Tabs whe

FlutterCandies 185 Dec 13, 2022
Flashy_tab_bar - One another nice animated tabbar

One another nice animated tabbar (Inspired by Cuberto) Getting Started Add the dependency at pubspec.yaml:

TheBrio 9 Nov 16, 2022
Pre-defined setup to start developing flutter project with stacked architecture.

un_official A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if t

Aashish Jha 0 Dec 27, 2021
This project demonstarates UI setup for some basic flutter widgets.

Flutter Widgets This project demonstarates UI setup for some basic flutter widgets. Container | | Text | | Button | | Textfield | | Column | | Row | |

Girisankar G 2 Nov 20, 2021
A comprehensive flutter/dart tutorial with setup instructions and learning exercises.

flutter-tutorial A comprehensive flutter/dart tutorial with setup instructions and learning exercises. Setup Folder: https://drive.google.com/drive/u/

Eduardo Piccin 1 Oct 21, 2022
A fast start flutter project to make aps faster and skip setup on every application. I am personally using this structure while creating a new project

Flutter Fast Start A fast start flutter project to make apps faster and skip setup on every application. I am personally using this structure while cr

Okan Demir 2 Dec 15, 2022