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

A new Flutter package with a customized BottomAppBar

example/lib/main.dart

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

void main() {
  runApp(const MaterialApp(
    home: MyApp(),
  ));
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  int tabIndex = 0;

  void updateIndex(int index){
    setState((){
      tabIndex = index;
    });
  }

  @override
  Widget build(BuildContext context) {
    return  BottomNavigationBarWidget(
      onTap: (index)=> updateIndex(index),      
      selectedItemColor: Colors.amber,
      selectedItemIndex: tabIndex,
      selectedItemFontSize: 12,
      unselectedItemFontSize: 12,     
      backgroundBorderRadius: const BorderRadius.all( Radius.circular(12)), 
      outsidePadding: const EdgeInsets.symmetric(horizontal: 10),
      floatingButtonBorderColor: Colors.white,
      floatingActionButton: SizedBox(
           height: 50,
           width: 50,
           child: FittedBox(
             child: FloatingActionButton(
               backgroundColor: Colors.black,
               child: const Icon(Icons.add_rounded, size: 40),
               onPressed: () {},
             ),
           ),
         ),
      items: const[
        BottomNavigationItem(
          selectedIcon: Padding(
            padding: EdgeInsets.symmetric(horizontal: 10),
            child: Icon(Icons.home),
          ),
          unselectedIcon: Padding(
            padding: EdgeInsets.symmetric(horizontal: 10),
            child: Icon(Icons.home, color: Colors.white,),
          ),
        title: 'Hoje',
        ),
       BottomNavigationItem(
          selectedIcon: Padding(
            padding: EdgeInsets.symmetric(horizontal: 10),
            child: Icon(Icons.home),
          ),
          unselectedIcon: Padding(
            padding: EdgeInsets.symmetric(horizontal: 10),
            child: Icon(Icons.home, color: Colors.white,),
          ),
        title: 'Solicitações',
        ),
        BottomNavigationItem(
          selectedIcon: Padding(
            padding: EdgeInsets.symmetric(horizontal: 10),
            child: Icon(Icons.home),
          ),
          unselectedIcon: Padding(
            padding: EdgeInsets.symmetric(horizontal: 10),
            child: Icon(Icons.home, color: Colors.white,),
          ),
        title: 'Relatórios',
        ),
        BottomNavigationItem(
          selectedIcon: Padding(
            padding: EdgeInsets.symmetric(horizontal: 10),
            child: Icon(Icons.home),
          ),
          unselectedIcon: Padding(
            padding: EdgeInsets.symmetric(horizontal: 10),
            child: Icon(Icons.home, color: Colors.white,),
          ),
        title: 'Mais',
        ),    
    ], child: const Column());
  }
}
2
likes
120
pub points
0%
popularity

Publisher

unverified uploader

A new Flutter package with a customized BottomAppBar

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

flutter

More

Packages that depend on navigation_bar_milo