Giter VIP home page Giter VIP logo

mikaelim-id / vertical_scrollable_tabview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wayne900204/vertical_scrollable_tabview

0.0 0.0 0.0 21.42 MB

A Flutter plugin which synchronize a ScrollView and a custom tab view.

Home Page: https://pub.dev/packages/vertical_scrollable_tabview

License: MIT License

Ruby 4.53% Objective-C 0.13% Kotlin 0.51% Dart 80.31% Swift 1.35% HTML 13.18%

vertical_scrollable_tabview's Introduction

vertical_scrollable_tabview

A Flutter widget which synchronize a ScrollView and a custom tab view.

The main idea is to create a custom tab view synchronizing with inner ScrollView. The scroll activity will trigger custom tab view at the top to follow the index of the inner scroll view widget.

exposes Scrollbar and CustomScrollView parameters to VerticalScrollableTabView

Demo

Installation

Add dependency for package on your pubspec.yaml:

dependencies:
    vertical_scrollable_tabview: <latest>
    scroll_to_index: <latest>

Usage

To use this widget we must first define how our tabs will look like.

VerticalScrollableTabView

you need to implement TabController and AutoScrollController

Import Parameter ๐Ÿ‘‡

Parameter Definition
autoScrollController Scrollbar's controller and CustomScrollView's controller.
tabController Trailing widget for a tab, typically an TabController.
listItemData It must be List< dynamic > Type
eachItemChild A item child that in ListView.Builder, First parameter is an object that you put in listItemData, Second parameter is the index in ListView.Builder
verticalScrollPosition A Item Position
TabBar A TabBar, That required in slivers[SliverAppbar(bottom:TabBar())]

Copy parameters from Scrollbar

Parameter Definition ( parameter from Scrollbar )
scrollbarThumbVisibility thumbVisibility
scrollbarTrackVisibility trackVisibility
scrollbarThickness thickness
scrollbarRadius radius
scrollbarNotificationPredicate notificationPredicate
scrollInteractive interactive
scrollbarOrientation scrollbarOrientation

Copy parameters from CustomScrollView

Parameter Definition ( parameter from CustomScrollView )
scrollDirection scrollDirection
reverse reverse
primary primary
physics physics
scrollBehavior scrollBehavior
shrinkWrap shrinkWrap
center center
anchor anchor
cacheExtent cacheExtent
slivers slivers
semanticChildCount semanticChildCount
dragStartBehavior dragStartBehavior
keyboardDismissBehavior keyboardDismissBehavior
restorationId restorationId
clipBehavior clipBehavior

Example

** IMPORTANT** DON'T FORGET IMPLEMENT TabController and AutoScrollController

import 'package:vertical_scrollable_tabview/vertical_scrollable_tabview.dart';
VerticalScrollableTabView(
    autoScrollController: autoScrollController,          <- Required AutoScrollController
    tabController: tabController,                        <- Required TabBarController
    listItemData: data,<- Required List<dynamic>
    verticalScrollPosition: VerticalScrollPosition.begin,
    eachItemChild: (object, index) =>
        CategorySection(category: object as Category),    <- Object and index
    slivers: [                                            <- Required slivers 
      SliverAppBar(                                       <- Required SliverAppBar 
        bottom: TabBar(
          isScrollable: true,
          controller: tabController,
          indicatorPadding: const EdgeInsets.symmetric(horizontal: 16.0),
          indicatorColor: Colors.cyan,
          labelColor: Colors.cyan,
          unselectedLabelColor: Colors.white,
          indicatorWeight: 3.0,
          tabs: data.map((e) {
            return Tab(text: e.title);
          }).toList(),
          onTap: (index) {
            VerticalScrollableTabBarStatus.setIndex(index);  <- Required
          },
        ),
      ),
    ],
  ),

for full example, please see this Demo.

Contribution

Contributions are accepted via pull requests. For more information about how to contribute to this package, please check the contribution guide.

License

This project is licensed under the MIT license, additional knowledge about the license can be found here.

vertical_scrollable_tabview's People

Contributors

wayne900204 avatar mohamedalaaser avatar enviro-apps avatar josephyaduvanshi avatar mikaelim-id avatar sejun2 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.