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

import '../core/route_constants.dart';

class CommonAppBar extends StatelessWidget {
  const CommonAppBar({super.key, required this.isWhiteLogo, required this.isProfilePage});

  final bool isWhiteLogo;
  final bool isProfilePage;

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Image.asset(
            isWhiteLogo ? "assets/logo/logo_city_cards_white.png" :"assets/logo/logo_city_cards.png",
            scale: 4,),
        Row(
          children: [
            Container(
              padding: const EdgeInsets.all(10),
              decoration: const BoxDecoration(
                color: Colors.white,
                shape: BoxShape.circle,
              ),
              child: Image.asset(
                "assets/icons/shopping_cart.png",
                height: 20.h,
              ),
            ),
            SizedBox(width: 8.w),
            if(!isProfilePage)
             GestureDetector(
               onTap: (){
                 Navigator.pushNamed(context, RouteConstants.profile);
               },
               child: CircleAvatar(
                backgroundColor: Color(0xffFFDFDF),
                backgroundImage:
                AssetImage("assets/images/profile_img.png")),
             ),
          ],
        ),
      ],
    );
  }
}
