import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:test_sa/views/app_style/colors.dart';
import 'package:test_sa/views/app_style/sizing.dart';

class LandPageItem extends StatelessWidget {
  final String text;
  final IconData icon;
  final VoidCallback onPressed;
  final String svgPath;
  const LandPageItem({Key key, this.svgPath, this.text, this.icon, this.onPressed}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onPressed,
      child: Container(
        padding: const EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28),
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(15),
          boxShadow: [
            BoxShadow(
              color: const Color(0xff000000).withOpacity(.15),
              blurRadius: 26,
              offset: const Offset(0, -3),
            ),
          ],
        ),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            if (icon != null)
              Icon(
                icon,
                color: AColors.primaryColor,
                size: 42 * AppStyle.getScaleFactor(context),
              ),
            if (svgPath != null)
              SvgPicture.asset(
                svgPath,
                width: 42 * AppStyle.getScaleFactor(context),
                height: 42 * AppStyle.getScaleFactor(context),
                color: AColors.primaryColor,
              ),
            Text(text, style: const TextStyle(color: AColors.grey3A)),
          ],
        ),
      ),
    );
  }
}
