import 'package:flutter/material.dart';

class CloseBack extends StatelessWidget{

  final VoidCallbackAction? onTap;

  CloseBack({Key? key,
    this.onTap
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      behavior: HitTestBehavior.opaque,
      onTap: Feedback.wrapForTap(() {
        onTap!=null ? onTap! : Navigator.pop(context);
      }, context),
      child: Icon(Icons.close, color: Colors.white),
    );
  }
}