call method

void call(
  1. BuildContext context, {
  2. required String title,
  3. TextStyle? style,
  4. EdgeInsetsGeometry? spacing,
  5. EdgeInsetsGeometry? padding,
  6. required Widget child,
})

Implementation

void call(
  BuildContext context, {
  required String title,
  TextStyle? style,
  EdgeInsetsGeometry? spacing,
  EdgeInsetsGeometry? padding,
  required Widget child,
}) {
  showModalBottomSheet(
    context: context,
    enableDrag: true,
    isScrollControlled: true,
    backgroundColor: Colors.transparent,
    elevation: 16,
    builder: (context) {
      return AnimatedContainer(
        decoration: const BoxDecoration(
          borderRadius: BorderRadius.only(
            topLeft: Radius.circular(4),
            topRight: Radius.circular(4),
          ),
          color: Colors.white,
        ),
        margin: const EdgeInsets.only(top: 10),
        padding: padding ??
            const EdgeInsets.only(
              top: 16,
              bottom: 58,
            ),
        duration: const Duration(milliseconds: 300),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Container(
              height: 6,
              width: 40,
              margin: spacing ?? const EdgeInsets.only(bottom: 16.0),
              decoration: BoxDecoration(
                color: const Color(0xFFEAEAEA),
                borderRadius: BorderRadius.circular(4.0),
              ),
            ),
            Text(
              title,
              style: style ??
                  const TextStyle(
                    color: Color(0xFF212124),
                    fontSize: 16,
                    fontWeight: FontWeight.w500,
                  ),
            ),
            child
          ],
        ),
      );
    },
  );
}