import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sk_base_mobile/app_theme.dart';
import 'package:sk_base_mobile/util/screen_adaper_util.dart';

class SkDialogHeader extends StatelessWidget {
  final String title;
  final Widget? leading;
  final Widget? trailing;
  const SkDialogHeader({
    super.key,
    required this.title,
    this.leading,
    this.trailing,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.symmetric(),
      decoration: const BoxDecoration(
          gradient: LinearGradient(
              colors: [AppTheme.primaryColorLight, AppTheme.primaryColor])),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          leading ??
              SizedBox(
                width: ScreenAdaper.width(100),
              ),
          Expanded(
            child: Text(
              title,
              textAlign: TextAlign.center,
              style: TextStyle(
                  fontSize: ScreenAdaper.height(30),
                  color: AppTheme.nearlyWhite,
                  fontWeight: FontWeight.w600),
            ),
          ),
          trailing ??
              Container(
                width: ScreenAdaper.width(100),
                child: IconButton(
                    onPressed: () {
                      Get.back();
                    },
                    icon: Icon(
                      Icons.close,
                      size: ScreenAdaper.sp(45),
                      color: AppTheme.nearlyWhite,
                    )),
              )
        ],
      ),
    );
  }
}
