fluffychat/lib/pangea/common/widgets/full_width_dialog.dart
2026-02-05 15:52:25 -05:00

49 lines
1.4 KiB
Dart

import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:fluffychat/config/themes.dart';
class FullWidthDialog extends StatelessWidget {
final Widget dialogContent;
final double maxWidth;
final double maxHeight;
final Color? backgroundColor;
const FullWidthDialog({
required this.dialogContent,
required this.maxWidth,
required this.maxHeight,
this.backgroundColor,
super.key,
});
@override
Widget build(BuildContext context) {
final isColumnMode = FluffyThemes.isColumnMode(context);
final content = AnimatedSize(
duration: FluffyThemes.animationDuration,
child: ConstrainedBox(
constraints: isColumnMode
? BoxConstraints(maxWidth: maxWidth, maxHeight: maxHeight)
: BoxConstraints(
maxWidth: MediaQuery.widthOf(context),
maxHeight: MediaQuery.heightOf(context),
),
child: ClipRRect(
borderRadius: isColumnMode
? BorderRadius.circular(20.0)
: BorderRadius.zero,
child: dialogContent,
),
),
);
return BackdropFilter(
filter: ImageFilter.blur(sigmaX: 2.5, sigmaY: 2.5),
child: isColumnMode
? Dialog(backgroundColor: backgroundColor, child: content)
: Dialog.fullscreen(backgroundColor: backgroundColor, child: content),
);
}
}