import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:flutter/material.dart';

class ArrowBack extends StatelessWidget {
  final Function? onTap;
  final Color? color;

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

  @override
  Widget build(BuildContext context) {
    final resolvedColor = color ?? AppColors.whiteColor;
    // ProjectViewModel projectViewModel = Provider.of(context);
    return GestureDetector(
      behavior: HitTestBehavior.opaque,
      onTap: Feedback.wrapForTap(() {
        onTap != null ? onTap!() : Navigator.maybePop(context);
      }, context),
      child: Icon(
        Icons.arrow_back_ios,
        color: resolvedColor,
      ),
    );
  }
}
