Flutter 代码中的文本溢出不起作用

Ven*_*nky 2 dart flutter flutter-layout

我试图在 Flutter 应用程序中省略文本,但我无法设置它。

我设计的视图如下

Positioned(
            bottom: 20,
            left: 10,
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Text(
                  snapshot.data.results[index].title,
                  overflow: TextOverflow.ellipsis,
                  textAlign: TextAlign.start,
                  style: TextStyle(
                    fontSize: 20.0,
                    fontWeight: FontWeight.w600,
                    color: Colors.white,
                  ),
                ),
                Text(
                  snapshot.data.results[index].release_date,
                  style: TextStyle(
                      fontSize: 18.0,
                      fontWeight: FontWeight.w400,
                      color: Colors.white,
                      letterSpacing: 1.2),
                ),
              ],
            ))
Run Code Online (Sandbox Code Playgroud)

屏幕截图省略号

A R*_*A R 7

您应该使用FlexibleExpanded小部件包裹您的文本,如下所示:

    Flexible(child:Text("Text goes here"),
Run Code Online (Sandbox Code Playgroud)

有关更多信息,请尝试链接