You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.3 KiB
83 lines
2.3 KiB
3 years ago
|
import 'dart:ui';
|
||
|
|
||
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
// ignore: must_be_immutable
|
||
|
class CustomAlert extends StatelessWidget {
|
||
|
|
||
|
final Widget child;
|
||
|
|
||
|
CustomAlert({
|
||
|
Key key,
|
||
|
@required this.child
|
||
|
}): super(key: key);
|
||
|
|
||
|
double deviceWidth;
|
||
|
double deviceHeight;
|
||
|
double dialogHeight;
|
||
|
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
|
||
|
Orientation orientation = MediaQuery.of(context).orientation;
|
||
|
Size screenSize = MediaQuery.of(context).size;
|
||
|
|
||
|
deviceWidth = orientation == Orientation.portrait
|
||
|
? screenSize.width
|
||
|
: screenSize.height;
|
||
|
deviceHeight = orientation == Orientation.portrait
|
||
|
? screenSize.height
|
||
|
: screenSize.width;
|
||
|
dialogHeight = deviceHeight * (0.50);
|
||
|
|
||
|
|
||
|
return MediaQuery(
|
||
|
data: MediaQueryData(),
|
||
|
child: GestureDetector(
|
||
|
// onTap: ()=>Navigator.pop(context),
|
||
|
child: BackdropFilter(
|
||
|
filter: ImageFilter.blur(
|
||
|
sigmaX: 0.5,
|
||
|
sigmaY: 0.5,
|
||
|
),
|
||
|
child: Container(
|
||
|
child: Column(
|
||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||
|
mainAxisSize: MainAxisSize.max,
|
||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||
|
children: <Widget>[
|
||
|
Expanded(
|
||
|
child: Stack(
|
||
|
children: <Widget>[
|
||
|
Center(
|
||
|
child: Container(
|
||
|
width: deviceWidth*0.9,
|
||
|
child: GestureDetector(
|
||
|
onTap: (){},
|
||
|
child: Card(
|
||
|
shape: RoundedRectangleBorder(
|
||
|
borderRadius: BorderRadius.only(
|
||
|
topLeft: Radius.circular(10.0),
|
||
|
topRight: Radius.circular(10.0),
|
||
|
bottomLeft: Radius.circular(10.0),
|
||
|
bottomRight: Radius.circular(10.0),
|
||
|
),
|
||
|
),
|
||
|
child: child,
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|