import 'package:didvan/config/design_config.dart';
import 'package:flutter/material.dart';

class DidvanCard extends StatelessWidget {
  final Widget? child;
  final EdgeInsets? padding;
  final EdgeInsets? margin;
  final bool enableBorder;
  final VoidCallback? onTap;
  const DidvanCard({
    Key? key,
    this.child,
    this.padding = const EdgeInsets.all(16),
    this.margin,
    this.enableBorder = true,
    this.onTap,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        padding: padding,
        margin: margin,
        decoration: BoxDecoration(
          borderRadius: DesignConfig.highBorderRadius,
          color: Theme.of(context).colorScheme.surface,
          border: enableBorder ? DesignConfig.cardBorder : null,
        ),
        child: child,
      ),
    );
  }
}
