首先,在我的应用程序中,当用户绘制一些东西然后按下保存按钮时,用户用户应该在他/她的手机上看到相同的绘图,但比例更小,因为他/她可以绘制更多的绘图并保存它们,我想在一个singleChildScrollView 中显示所有这些。我已经尝试过了,但我遇到了人为错误。我想在一个屏幕上显示一个不同屏幕的网格,这样每当用户点击其中一个屏幕时,屏幕就会完全展开到屏幕上。
Builder(
builder: (context) => Column(
children: [
Expanded(
child: Container(
padding: EdgeInsets.all(0),
height: height,
color: Colors.white,
child: SingleChildScrollView(
child: Form(
key: formKey,
child: Column(
children: <Widget>[
/////////////////////////////////////////////////////////////////////////////////////////////////////
//This below is the code that I tried.
widget.drawModel != null
? Transform.scale(
scale: 0.5,
child: Scaffold(
body: Container(
constraints: BoxConstraints(
maxHeight:
MediaQuery.of(context).size.height /
2,
maxWidth:
MediaQuery.of(context).size.width / 2,
),
child: CustomPaint(
painter: Draw(
points: widget
.drawModel[
widget.drawModel.length - 1]
.points),
),
),
),
)
: SizedBox(height: 10),
///////////////////////////////////////////////////////////////////////////////////////////////////
images.length != 0
// List view for images
? Column(
children: <Widget>[
for (int i = 0; i < images.length; i++)
Padding(
padding: EdgeInsets.symmetric(
horizontal: ImageColumnPad * width),
child: Dismissible(
key: ObjectKey(images[i]),
onDismissed: (direction) {
var item = images.elementAt(i);
deleteItem(i);
Scaffold.of(context).showSnackBar(
SnackBar(
shape: RoundedRectangleBorder(),
content: Text("Item deleted",
style:
TextStyle(fontSize: 15)),
action: SnackBarAction(
label: "UNDO",
onPressed: () {
undoDeletion(i, item);
},
),
),
);
},
child: GestureDetector(
onTap: () => {
//TODO: Implement delete function here
},
child: Center(
child: Image.file(
images[i],
fit: BoxFit.contain,
),
),
),
),
),
],
)
: SizedBox(height: 2),
...
...
...