multiarts

BottomBarNavigation

Jan 18th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.69 KB | None | 0 0
  1. // Crie um novo Widget bottom_bar_nav.dat
  2. import 'package:flutter/material.dart';
  3. import 'package:loja_virtual/screens/home_screen.dart';
  4.  
  5. class BottomBarNav extends StatelessWidget {
  6.  
  7.   @override
  8.   Widget build(BuildContext context) {
  9.     return BottomAppBar(
  10.       shape: CircularNotchedRectangle(),
  11.       notchMargin: 4.0,
  12. //        color: Color.fromRGBO(58, 66, 86, 1.0),
  13.       color: Colors.red[400],
  14.       child: Row(
  15.         mainAxisSize: MainAxisSize.max,
  16.         mainAxisAlignment: MainAxisAlignment.spaceBetween,
  17.         children: <Widget>[
  18.           IconButton(
  19.             icon: Icon(Icons.home, color: Colors.white),
  20.             onPressed: () {
  21.               Navigator.of(context).push(
  22.                   MaterialPageRoute(builder: (context) => HomeScreen())
  23.               );
  24.             },
  25.           ),
  26.           IconButton(
  27.             icon: Icon(Icons.format_list_bulleted, color: Colors.white),
  28.             onPressed: () {},
  29.           ),
  30.           IconButton(
  31.             icon: Icon(Icons.location_on, color: Colors.white),
  32.             onPressed: () {},
  33.           ),
  34.           IconButton(
  35.             icon: Icon(Icons.person_outline, color: Colors.white),
  36.             onPressed: () {},
  37.           ),
  38.         ],
  39.       ),
  40.     );
  41.   }
  42. }
  43.  
  44. // Em home_sreen adicione ele em cada Scaffold
  45. Scaffold(
  46.           appBar: AppBar(
  47.             title: Text("Produtos"),
  48.             centerTitle: true,
  49.           ),
  50.           body: ProductsTab(),
  51.           drawer: CustomDrawer(_pageController),
  52.           floatingActionButton: CartButton(),
  53.           floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
  54.           bottomNavigationBar: BottomBarNav(),
  55.         ),
Add Comment
Please, Sign In to add comment