import 'package:common_pub/common_pub.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../generated/assets.dart';
import 'home_controller.dart';

class HomeAppBar extends GetView<HomeController> implements PreferredSizeWidget{
  const HomeAppBar({super.key, required this.tab});
  final Widget tab;

  @override
  Widget build(BuildContext context) {
    final statusBarHeight = MediaQuery.of(context).viewPadding.top;

    return SizedBox.expand(child: Container(
      padding: EdgeInsets.only(top: statusBarHeight),
      decoration: const BoxDecoration(image: DecorationImage(
          image: AssetImage(Assets.imagesBkCommonPage), fit:  BoxFit.fitWidth),
        boxShadow: [
          BoxShadow(color: Color(0x33000000), spreadRadius: 4, blurRadius: 4)
        ]
      ),
      child: Row(
        mainAxisSize: MainAxisSize.max,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          SizedBox(
              width: context.wp(70),
              height: double.infinity, child: tab),
          IconButton(onPressed: (){}, icon: const Icon(Icons.radio))
        ],
      ),
    ));
  }

  @override
  Size get preferredSize => const Size.fromHeight(kToolbarHeight) ;
}