wemersonrv

CustomAppBar

Jun 29th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
  2. const CustomAppBar({
  3. Key key,
  4. }) : super(key: key);
  5.  
  6. @override
  7. Widget build(BuildContext context) {
  8. List _buttons = [
  9. {
  10. "image": "toolbar_home",
  11. "label": "Home",
  12. "tap": () {
  13. print("HOME tapped");
  14. }
  15. },
  16. {
  17. "image": "consultas_home",
  18. "label": "Consultas",
  19. "tap": () {
  20. print("Consultas tapped");
  21. }
  22. }
  23. ];
  24.  
  25. return Container(
  26. color: Color.fromARGB(255, 23, 170, 191),
  27. child: Row(
  28. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  29. children: _buttons.map((item) {
  30. return ImageButton(
  31. image: "assets/images/${item.image}.png",
  32. imageActive: "assets/images/${item.image}_active.png",
  33. label: item.label,
  34. active: false, // Pegar do BLOC depois
  35. onTap: item.tap,
  36. );
  37. }).toList(),
  38. ),
  39. );
  40. }
  41.  
  42. @override
  43. Size get preferredSize => Size.fromHeight(92);
  44. }
Advertisement
Add Comment
Please, Sign In to add comment