molten_navigationbar_flutter 0.0.1 copy "molten_navigationbar_flutter: ^0.0.1" to clipboard
molten_navigationbar_flutter: ^0.0.1 copied to clipboard

outdated

An animated bottom navigation bar with many parameters to tweak.

example/lib/main.dart

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

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  // a variable to store the current selected tab. can be used to control PageView
  int _selectedIndex = 0;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: Theme.of(context).copyWith(primaryColor: Colors.deepPurple[400]),
      home: Scaffold(
        body: Center(
          child: Text(
            'Selected Tab: $_selectedIndex',
            style: TextStyle(fontSize: 20, color: Colors.white),
          ),
        ),
        backgroundColor: Colors.deepPurple[400],
        // you can use the molten bar in the scaffold's bottomNavigationBar
        bottomNavigationBar: MoltenBottomNavigationBar(
          selectedIndex: _selectedIndex,
          // specify what will happen when a tab is clicked
          onTabChange: (clickedIndex) {
            setState(() {
              _selectedIndex = clickedIndex;
            });
          },
          // ansert as many tabs as you like
          tabs: [
            MoltenTab(
              icon: Icon(Icons.search),
              selectedColor: Colors.yellow,
            ),
            MoltenTab(
              icon: Icon(Icons.home),
              selectedColor: Colors.yellow,
            ),
            MoltenTab(
              icon: Icon(Icons.person),
              selectedColor: Colors.yellow,
            ),
          ],
        ),
      ),
    );
  }
}
62
likes
40
pub points
89%
popularity

Publisher

verified publisheraymanz.dev

An animated bottom navigation bar with many parameters to tweak.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on molten_navigationbar_flutter