【发布时间】:2019-11-10 08:48:21
【问题描述】:
我有一个按钮,通过单击我想要弹出一个对话框的按钮,我通过使用 showDialog 并在那里调用我的对话框方法来做到这一点。但是不知道怎么用图片文字和分数排成一行。?
图片已提供,代码也给我提示好吗?
这是使用showDialog的地方
Row(
children: <Widget>[
RaisedButton(
padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 15.0),
textColor: Colors.black,
child: Text(
'LeaderBoard',
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
),
),
onPressed: () {
showDialog(
context: context,
builder: (BuildContext context) => leadDialog);
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0)),
),
我的对话框方法
import 'package:flutter/material.dart';
Dialog leadDialog = Dialog(
child: Container(
height: 300.0,
width: 360.0,
color: Colors.white,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Padding(
padding: EdgeInsets.all(15.0),
child: Text(
'Choose from Library',
style:
TextStyle(color: Colors.black, fontSize: 22.0),
),
),
],
),
),
);
预期的结果是
【问题讨论】:
-
必须看看这个,这里是创建这个的确切代码:- stackoverflow.com/a/63086354/10563627