Flutter/3行在一个容器或AlertDialog中



我正在尝试制作一个带有导航窗口的警报对话框。应该有3行具有不同的图标按钮,以便在另一个网站上导航。不幸的是,我是Flutter的新手,不知道如何再做两排。有人能帮帮我吗?有可能做到吗?我的意思是,我不能再添加孩子了,可以吗?我不知道我是应该把它分成3个AlertDialog,还是这很愚蠢?

这是我第一排的布局

这是它应该看起来的样子,但有3行,而不是两行,这样我现在拥有的代码就可以复制成3行平行的

代码:

import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
void popup(BuildContext context) {
var alertDialog = AlertDialog(
backgroundColor: Color(0xffb09c84),
title: Text(''),
content: Container(
constraints: BoxConstraints(minWidth: 0, maxWidth: 300, maxHeight: 600),
padding: EdgeInsets.all(0),
width: 300.0,
height: 560.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
children: [
IconButton(
icon: FaIcon(
FontAwesomeIcons.newspaper,
size: 44.0,
),
onPressed: () {},
),
SizedBox(height: 2.0),
Container(
child: Text(
"       Zeitung",
style: TextStyle(
fontSize: 14.0,
),
),
),
],
),
Column(
children: [
IconButton(
icon: FaIcon(
FontAwesomeIcons.envelope,
size: 44.0,
),
onPressed: () {},
),
SizedBox(height: 2.0),
Container(
child: Text(
"    News",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14.0,
),
),
),
],
),
Column(
children: [
IconButton(
icon: FaIcon(
FontAwesomeIcons.creativeCommonsSampling,
color: Colors.black,
size: 44.0,
),
onPressed: () {},
),
SizedBox(
height: 3.0,
),
Container(
child: Text(
"   Vertretung",
style: TextStyle(
fontSize: 14.0,
),
),
),
],
),
],
),
),
);
showDialog(context: context, builder: (BuildContext context) => alertDialog);
}

这是您现在的代码:

Container(
constraints: BoxConstraints(minWidth: 0, maxWidth: 300, maxHeight: 600),
padding: EdgeInsets.all(0),
width: 300.0,
height: 560.0,
child: //Row(..the rest you want to copy"

在此行之前添加一列,并将Row复制三次:

Container(
constraints: BoxConstraints(minWidth: 0, maxWidth: 300, maxHeight: 600),
padding: EdgeInsets.all(0),
width: 300.0,
height: 560.0,
child: Column( children: [ 
Row1("..the rest you want to copy"),
Row2("..the rest you want to copy"),
Row3("..the rest you want to copy)" 
]), //Column
), //Container

相关内容

  • 没有找到相关文章

最新更新