[英]Show Flutter dialog only on part of the screen
我们知道一切都是Widget,所以我们可以利用这个属性来创建我们自己的Dialog。 有一些可能性可以做你想做的事,但这在很大程度上取决于你的应用程序的动态。 我认为它会这样做:
调用对话框如下:
showDialog(
context: context,
barrierDismissible: false,
child: DialogFeelingCalendar(),
);
它使用小部件进行个性化。 像这样:
class DialogFeelingCalendar extends StatefulWidget {
@override
_DialogFeelingCalendarState createState() => _DialogFeelingCalendarState();
}
class _DialogFeelingCalendarState extends State<DialogFeelingCalendar> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
title: Text(
"Title",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
body: SafeArea(
child: Center(
child: Container(
color: Colors.white,
height: 50,
width: 50,
),
),
)
);
}
}
我希望您可以自定义它以供您使用。 如果您需要更多详细信息,请告诉我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.