| 1 | import 'dart:ui'; |
| 2 | import 'package:cake_wallet/utils/responsive_layout_util.dart'; |
| 3 | import 'package:flutter/material.dart'; |
| 4 | |
| 5 | class AlertBackground extends StatelessWidget { |
| 6 | const AlertBackground({Key? key, required this.child, this.dismissible = false}); |
| 7 | |
| 8 | final Widget child; |
| 9 | final bool dismissible; |
| 10 | |
| 11 | @override |
| 12 | Widget build(BuildContext context) { |
| 13 | return Scaffold( |
| 14 | resizeToAvoidBottomInset: false, |
| 15 | backgroundColor: Colors.transparent, |
| 16 | body: GestureDetector( |
| 17 | behavior: HitTestBehavior.opaque, |
| 18 | onTap: dismissible ? () => Navigator.of(context).pop() : null, |
| 19 | child: BackdropFilter( |
| 20 | filter: ImageFilter.blur(sigmaX: 3, sigmaY: 3), |
| 21 | child: Container( |
| 22 | decoration: BoxDecoration(color: Theme.of(context).colorScheme.surface.withAlpha(200)), |
| 23 | child: Center( |
| 24 | child: GestureDetector( |
| 25 | onTap: () {}, |
| 26 | child: ConstrainedBox( |
| 27 | constraints: |
| 28 | BoxConstraints(maxWidth: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint), |
| 29 | child: child, |
| 30 | ), |
| 31 | ), |
| 32 | ), |
| 33 | ), |
| 34 | ), |
| 35 | ), |
| 36 | ); |
| 37 | } |
| 38 | } |