import 'package:flutter/material.dart';

showDraggableDialog(BuildContext context, Widget child) {
  showGeneralDialog(
    barrierLabel: "Label",
    barrierDismissible: false,
    barrierColor: Colors.black.withOpacity(0.2),
    transitionDuration: Duration(milliseconds: 200),
    context: context,
    pageBuilder: (context, anim1, anim2) {
      return Dismissible(
        direction: DismissDirection.vertical,
        key: const Key('key'),
        onDismissed: (_) => Navigator.of(context).pop(),
        child: child,
      );
    },
    transitionBuilder: (context, anim1, anim2, child) {
      return SlideTransition(
        position: Tween(begin: Offset(0, 1), end: Offset(0, 0)).animate(anim1),
        child: child,
      );
    },
  );
}
