nesward_flutter_app/lib/widgets/app_bar_widget.dart

92 lines
2.4 KiB
Dart

import 'package:flutter/material.dart';
class AppBarWidget extends StatelessWidget implements PreferredSizeWidget {
const AppBarWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return AppBar(
backgroundColor: Colors.white,
elevation: 0,
leading: IconButton(
onPressed: () {},
icon: const Icon(Icons.menu, color: Colors.black),
),
title: Row(
children: [
// Image.asset('assets/logo.png', height: 30),
// const SizedBox(width: 4),
const Text(
'Nest',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Color(0xFF00C853),
),
),
const Text(
' MART & GROCERY',
style: TextStyle(
fontSize: 12,
color: Colors.grey,
),
),
],
),
actions: [
Stack(
children: [
IconButton(
onPressed: () {},
icon: const Icon(Icons.favorite_border, color: Colors.black),
),
Positioned(
top: 8,
right: 8,
child: Container(
padding: const EdgeInsets.all(2),
decoration: const BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
),
child: const Text(
'4',
style: TextStyle(color: Colors.white, fontSize: 10),
),
),
),
],
),
Stack(
children: [
IconButton(
onPressed: () {},
icon: const Icon(Icons.shopping_cart, color: Colors.black),
),
Positioned(
top: 8,
right: 8,
child: Container(
padding: const EdgeInsets.all(2),
decoration: const BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
),
child: const Text(
'2',
style: TextStyle(color: Colors.white, fontSize: 10),
),
),
),
],
),
],
);
}
// 👇 Required for AppBar compatibility
@override
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
}