Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
- const CustomAppBar({
- Key key,
- }) : super(key: key);
- @override
- Widget build(BuildContext context) {
- List _buttons = [
- {
- "image": "toolbar_home",
- "label": "Home",
- "tap": () {
- print("HOME tapped");
- }
- },
- {
- "image": "consultas_home",
- "label": "Consultas",
- "tap": () {
- print("Consultas tapped");
- }
- }
- ];
- return Container(
- color: Color.fromARGB(255, 23, 170, 191),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: _buttons.map((item) {
- return ImageButton(
- image: "assets/images/${item.image}.png",
- imageActive: "assets/images/${item.image}_active.png",
- label: item.label,
- active: false, // Pegar do BLOC depois
- onTap: item.tap,
- );
- }).toList(),
- ),
- );
- }
- @override
- Size get preferredSize => Size.fromHeight(92);
- }
Advertisement
Add Comment
Please, Sign In to add comment