小编ale*_*exc的帖子

为什么我会收到错误:RenderBox 未布局:RenderViewport#a3518 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE

我不断收到此错误:“ RenderBox 未布局:RenderViewport#a3518 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': 断言失败:第 1785 行 pos 12 : 'hasSize' " 当我运行此代码时:

(我需要的是在“FutureBuilder”之前有“Container”,在“FutureBuilder”之后有“RaishedButton”,因为“FutureBuilder”可以运行多次,而我只需要一个容器和一个RaishedButton)。

请帮帮我!

@override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: new AppBar(
        title: new Text(
          'OrderLunch',
          style: TextStyle(
            fontSize: 26.0,
            fontWeight: FontWeight.bold,
          ),
        ),
        centerTitle: true,
      ),
      body: Container(
        height: 595,
        width: 800,///not accurate
        decoration: BoxDecoration(
          image: DecorationImage(
            image: AssetImage('assets/portocale.jpg'),
          ),
          borderRadius: BorderRadius.all(Radius.circular(8.0)),
        ),
        child: Column(
          children: [
            Container(
              decoration: BoxDecoration(
                border: Border.all(
                  width: 3.5,
                  color: Colors.blue[400],
                ),
                borderRadius: BorderRadius.all(
                  Radius.circular(20),
                ),
                color: Colors.white, …
Run Code Online (Sandbox Code Playgroud)

flutter

7
推荐指数
2
解决办法
2万
查看次数

标签 统计

flutter ×1