#flutter
Вопрос:
У меня есть собственный каталог предупреждений с эффектом стекла:
void showAlert(BuildContext context) {
showGeneralDialog(
barrierLabel: "Label",
barrierDismissible: false,
barrierColor: Colors.white.withOpacity(0.0),
transitionDuration: Duration(milliseconds: 600),
context: context,
pageBuilder: (context, anim1, anim2) {
return Align(
alignment: Alignment.bottomCenter,
child: ClipRect(
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 5.0, sigmaY: 5.0),
child: Container(
height: 280,
child: SizedBox.expand(
child: Dialog(
title: Text("Warning!",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20,
color: Colors.white,
)),
content: Text(
"Text.",
style: TextStyle(
fontFamily: 'Century Gothic',
fontSize: 17,
color: Colors.white,
)),
actions: [
TextButton(
child: new Text("OK",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 19,
color: Colors.white,
)),
onPressed: () {
Navigator.of(context).pop();
},
),
],
),
),
margin: EdgeInsets.only(bottom: 150, left: 12, right: 12),
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.05),
boxShadow: [
BoxShadow(
color: Colors.white.withOpacity(0.05),
blurRadius: 6.0,
),
],
borderRadius: BorderRadius.circular(20.0),
border: Border.all(color: Color(0xFF00ccff), width: 2),
),
),
)));
},
transitionBuilder: (context, anim1, anim2, child) {
return SlideTransition(
position:
Tween(begin: Offset(0, 1), end: Offset(0, 0)).animate(anim1),
child: child,
);
},
);
}
}
но этот эффект присутствует в AlertDialog и сбоку, и снизу, но сверху его нет. Но мне нужен этот эффект в AlertDialog, не перегибайте палку. Я пытаюсь использовать фоновый фильтр почти везде, но результат один и тот же или его нет. Как я могу создать эффект стекла в области AlertDialog? Большое спасибо.