import 'package:flutter/material.dart';
import 'package:mypoint_flutter_app/resouce/base_color.dart';

class CustomBackButton extends StatelessWidget {
  final VoidCallback? onPressed;
  final Color? iconColor;
  final double? iconSize;
  final EdgeInsets? margin;

  const CustomBackButton({super.key, this.onPressed, this.iconColor, this.iconSize, this.margin});

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      height: 48,
      width: 48,
      child: Stack(
        children: [
          Center(
            child: Container(
              height: 36,
              width: 36,
              decoration: BoxDecoration(
                border: Border.all(color: BaseColor.second400, width: 1),
                borderRadius: BorderRadius.circular(6),
                color: Colors.white,
              ),
            ),
          ),
          Center(
            child: IconButton(
              icon: Icon(Icons.arrow_back_ios_rounded, color: iconColor ?? BaseColor.second600, size: iconSize ?? 24),
              onPressed:
                  onPressed ??
                  () {
                    Navigator.pop(context);
                  },
            ),
          ),
        ],
      ),
    );
  }
}
