import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class TopCard extends StatelessWidget {
  TopCard({@required this.image, @required this.isSVG});

  final String image;
  final bool isSVG;

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {},
      child: Card(
        margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
        color: Colors.white.withOpacity(0.3),
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(10),
        ),
        child: Container(
          height: 100.0,
          padding: EdgeInsets.all(7.0),
          width: MediaQuery.of(context).size.width * 0.45,
          child: this.isSVG
              ? SvgPicture.asset(this.image)
              : Image.asset(this.image),
        ),
      ),
    );
  }
}
