mirrored_repositories/Pretty-Ui/Eden/lib/core/common
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../../utils/app_colors.dart';

class PrimaryContainer extends StatelessWidget {
  final Widget child;
  final EdgeInsets? padding;
  final EdgeInsets? margin;
  final Color? color;
  final double? width;
  final double? height;
  const PrimaryContainer({
    required this.child,
    this.padding,
    this.margin,
    this.color,
    this.width,
    this.height,
    Key? key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    bool isDarkMode(BuildContext context) =>
        Theme.of(context).brightness == Brightness.dark;
    return Container(
      width: width,
      height: height,
      padding: padding,
      margin: margin,
      decoration: BoxDecoration(
        color: color ?? (isDarkMode(context) ? Colors.black : AppColors.kWhite),
        boxShadow: [
          if (isDarkMode(context))
            AppColors.darkShadow
          else
            AppColors.defaultShadow,
        ],
        borderRadius: BorderRadius.circular(10.r),
      ),
      child: child,
    );
  }
}
