dot_navigation_bar 1.0.0 copy "dot_navigation_bar: ^1.0.0" to clipboard
dot_navigation_bar: ^1.0.0 copied to clipboard

outdated

Simple smooth animations, providing a nice and cleanUI/UX Bottom Nav Bar.

example/lib/main.dart

import 'package:dot_navigation_bar/dot_navigation_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(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: Home(),
    );
  }
}

class Home extends StatefulWidget {
  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {
  var _selectedTab = _SelectedTab.home;

  void _handleIndexChanged(int i) {
    setState(() {
      _selectedTab = _SelectedTab.values[i];
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      extendBody: true,
      body: Container(
        child: Image.asset("lib/img/1.png"),
      ),
      bottomNavigationBar: DotNavigationBar(
        currentIndex: _SelectedTab.values.indexOf(_selectedTab),
        dotIndicatorColor: Colors.white,
        unselectedItemColor: Colors.grey[300],
        onTap: _handleIndexChanged,
        items: [
          /// Home
          DotNavigationBarItem(
            icon: Icon(Icons.home),
            selectedColor: Color(0xff73544C),
          ),

          /// Likes
          DotNavigationBarItem(
            icon: Icon(Icons.favorite),
            selectedColor: Color(0xff73544C),
          ),

          /// Search
          DotNavigationBarItem(
            icon: Icon(Icons.search),
            selectedColor: Color(0xff73544C),
          ),

          /// Profile
          DotNavigationBarItem(
            icon: Icon(Icons.person),
             selectedColor: Color(0xff73544C),
          ),
        ],
      ),
    );
  }
}

enum _SelectedTab { home, favorite, search, person }
374
likes
0
pub points
95%
popularity

Publisher

unverified uploader

Simple smooth animations, providing a nice and cleanUI/UX Bottom Nav Bar.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on dot_navigation_bar