shifting_tabbar 0.3.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 91

Shifting TabBar #

A custom tab bar widget for Flutter framework.

The design is inspired from Rally project (one of material design studies).

pub package

Getting Started #

Add the package to pubspec.yaml

dependencies:
    ...
    shifting_tabbar: ^0.3.1

Import the package #

import 'package:shifting_tabbar/shifting_tabbar.dart';

Basic Usage #

This widget is programmed to work with TabController. You just need to install and import it to your code and use it just like TabBar.

Don't forget to use DefaultTabController as an ancestor widget if you don't specify controller manually!

new ShiftingTabBar(
    tabs: [
        ShiftingTab(
            icon: Icon(Icons.directions_bike),
            text: "Test 1",
        ),
        ShiftingTab(
            icon: Icon(Icons.directions_car),
            text: "Test 2"
        ),
        ShiftingTab(
            icon: Icon(Icons.directions_transit),
            text: "Test 3"
        ),
    ],
)

See example folder in git repository for more detailed example.

0.3.1 #

  • Resolve a problem with fonts

0.3.0 #

  • New labelStyle parameter
  • New labelFlex parameter
  • New forceUpperCase parameter## 0.2.2

0.2.2 #

  • A little bug fixed

0.2.1 #

  • Minor changes in description and README

0.2.0 #

  • Some minor changes in code
  • Adding comments

0.1.0 #

  • Example code added

0.0.2 #

  • Fixed preview issue

0.0.1 #

  • Initial release

example/README.md

shifting_tabbar_example #

Demonstrates how to use the shifting_tabbar plugin.

Usage #

class MyApp extends StatelessWidget {
  build(context) {
    return MaterialApp(
      // Define a controller for TabBar and TabBarViews
      home: DefaultTabController(
        length: 5,
        child: Scaffold(
          // Use ShiftingTabBar instead of appBar
          appBar: ShiftingTabBar(
            // Specify a color to background or it will pick it from primaryColor of your app ThemeData
            color: Colors.grey,
            // You can change brightness manually to change text color style to dark and light or 
            // it will decide based on your background color
            // brightness: Brightness.dark,
            tabs: [
              // Also you should use ShiftingTab widget instead of Tab widget to get shifting animation
              ShiftingTab(
                icon: Icon(Icons.home),
                text: "Test 1",
              ),
              ShiftingTab(
                icon: Icon(Icons.directions_bike),
                text: "Test 2"
              ),
              ShiftingTab(
                icon: Icon(Icons.directions_car),
                text: "Test 3"
              ),
              ShiftingTab(
                icon: Icon(Icons.directions_transit),
                text: "Test 4"
              ),
              ShiftingTab(
                icon: Icon(Icons.directions_boat),
                text: "Test 5"
              ),
            ],
          ),
          // Other parts of the app are exacly same as default TabBar widget
          body: TabBarView(
            children: [
              Icon(Icons.home),
              Icon(Icons.directions_bike),
              Icon(Icons.directions_car),
              Icon(Icons.directions_transit),
              Icon(Icons.directions_boat),
            ],
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  shifting_tabbar: ^0.3.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:shifting_tabbar/shifting_tabbar.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
82
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
91
Learn more about scoring.

We analyzed this package on Oct 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/shifting_tabbar.dart.

Run flutter format to format lib/shifting_tabbar.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test