import 'package:driverapp/config/size_config.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';

class ActionSheetButton extends StatelessWidget {
  const ActionSheetButton({Key key, this.label, this.onTap, this.icon})
      : super(key: key);
  final String label;
  final Function onTap;
  final IconData icon;

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onTap,
      child: Container(
        height: SizeConfig.isMobilePortrait
            ? MediaQuery.of(context).size.height * 0.08
            : MediaQuery.of(context).size.height * 0.14,
        decoration: BoxDecoration(boxShadow: [
          BoxShadow(
            color: Hexcolor("#DBE5E6"),
            spreadRadius: 15,
            blurRadius: 15,
            offset: Offset(0, 7),

            // changes position of shadow
          ),
        ], borderRadius: BorderRadius.circular(15), color: Colors.white),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.start,
          children: <Widget>[
            Expanded(
              flex: 1,
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  Container(
                    width: 60,
                    height: 50,
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(10),
                      color: Theme.of(context).primaryColor,
                    ),
                    child: Center(
                      child: Icon(
                        icon,
                        size: 30,
                        color: Colors.white,
                      ),
                    ),
                  )
                ],
              ),
            ),
            Expanded(
              flex: 3,
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  Padding(
                    padding: EdgeInsets.only(top: 5.0),
                    child: Text(
                      label,
                      style: TextStyle(
                          fontSize: 22.0,
                          fontFamily: "Metropolis-Bold",
                          color: Hexcolor("##1A1818")),
                    ),
                  )
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
