fancy_bar 1.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 90

Pub

FancyBar #

A fancy yet beautiful animated widget for your Flutter apps

|---------|----------| |FancyBar Gif |

|---------|----------| |FancyBar Gif |

Customization (Optional) #

FancyBar #

items - navigation items, required more than one item and less than six

selectedIndex - the current item index. Use this to change the selected item. Default to zero

onItemSelected - required to listen when a item is tapped it provide the selected item's index

type - You can pass the required Fancy Bar type. Available FancyV1, FancyV2

FancyItem #

icon - the widget of this item. Your can pass any widget as param.

title - the text that will appear next to the icon when this item is selected.

textColor - the active item's text color

Getting Started #

Add the plugin:

dependencies:
  fancy_bar: ^1.2.0

Basic Usage #

Adding the widget

bottomNavigationBar: FancyBottomBar(
        type: FancyType.FancyV2,   // Fancy Bar Type
        items: [
          FancyItem(
            textColor: Colors.orange,
            title: 'Home',
            icon: Icon(Icons.home),
          ),
          FancyItem(
            textColor: Colors.red,
            title: 'Trending',
            icon: Icon(Icons.trending_up),
          ),
          FancyItem(
            textColor: Colors.green,
            title: 'Search',
            icon: Icon(Icons.search),
          ),
          FancyItem(
            textColor: Colors.brown,
            title: 'Settings',
            icon: Icon(Icons.settings),
          ),
        ],
        onItemSelected: (index) {
          print(index);
        },
      ),

Catch me up on LinkedIn @Leo Elstin

πŸ’™ to CodeπŸ‘¨πŸ½β€πŸ’» Flutter Expert β€’ Dart Kotlin Swift Node Js β€’ Android β€’ Full Stack Mobile Developer

[1.2.0] #

  • Added new Fancy Animation Version2
  • you can pass the FancyType enum in type argument
  • to change animation type.

[1.0.3] #

  • Added example project in /example/#

[1.0.2-dev.1.] #

  • Added example project in /example/#

[1.0.2]

  • Added example project in /example/

[1.0.1] #

  • Updated the ReadMe.md

[1.0.0] #

  • Updated the description and readme.
  • Stable version released.
  • Improved the comments to understand the code better.

[0.0.1] - TODO: Add release date. #

  • Initial release.

example/lib/main.dart

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      bottomNavigationBar: FancyBottomBar(
        items: [
          FancyItem(
            textColor: Colors.orange,
            title: 'Home',
            icon: Icon(Icons.home),
          ),
          FancyItem(
            textColor: Colors.red,
            title: 'Trending',
            icon: Icon(Icons.trending_up),
          ),
          FancyItem(
            textColor: Colors.green,
            title: 'Search',
            icon: Icon(Icons.search),
          ),
          FancyItem(
            textColor: Colors.brown,
            title: 'Settings',
            icon: Icon(Icons.settings),
          ),
        ],
        onItemSelected: (index) {
          print(index);
        },
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.display1,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  fancy_bar: ^1.2.0

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:fancy_bar/fancy_bar.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
80
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]
90
Learn more about scoring.

We analyzed this package on Apr 3, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test