使用ListTile ThreeLines时会颤动,我不知道如何使用ThreeLine
import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: Scaffold( appBar: AppBar( title: Text('ddd'), ), body:Container( child: Column( children:[ ListTile( isThreeLine: true, leading: Icon(Icons.event_note), title: Text('Title 1'), // subtitle: Text('Title2'), subtitle: Column( children: [ Text('Titile2'), Text('Title 3'), Text('Title 4'), Text('and so on') ], ), ) ], ), ) , ), ); } }
当我删除isThreeLines时,代码确定
ListTile
谢谢
从文档:
字幕的值是可选的,它将占用为额外的一行文本分配的空间,如果isThreeLine为true,则为两行。
这基本上意味着subtitle
所述的ListTile
被给予更多的空间以具有文本,其长度超过一行: