• Source
    1. import 'package:flutter/material.dart';
    2.  
    3. class SafeAreaPage extends StatefulWidget {
    4. @override
    5. State<StatefulWidget> createState() => SafeAreaPageState();
    6. }
    7.  
    8. class SafeAreaPageState extends State<SafeAreaPage> {
    9. @override
    10. Widget build(BuildContext context) {
    11. return Scaffold(
    12. appBar: new AppBar(
    13. title: Text('SafeArea'),
    14. ),
    15. body: SafeArea(
    16. child: ListView(
    17. padding: EdgeInsets.all(8),
    18. children: List.generate(
    19. 50,
    20. (i) => Text(
    21. '這是第 ${i + 1} 行資訊',
    22. style: TextStyle(fontSize: 22),
    23. )),
    24. ),
    25. ),
    26. );
    27. }
    28. }
    29.