1. Container(
    2. width: 300,
    3. constraints: BoxConstraints(
    4. minHeight: 100,
    5. maxHeight: 300
    6. ),
    7. color: Colors.grey,
    8. child: ListView(
    9. shrinkWrap: true, // 关键
    10. children: <Widget>[
    11. for(int i = 0; i < 30; i++) Text('hello world!', style: TextStyle(fontSize: 20),)
    12. ],
    13. ),
    14. ),