flutter 让内容显示在安全的可见区域

  @override
  Widget build(BuildContext context) {
    return Scaffold(
//      appBar: AppBar(
//        title: Text("Sample App"),
//      ),
      body: new Column(
        children: <Widget>[
          Text(textToShow),
        ],
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _updateText,
        tooltip: 'Update Text',
        child: Icon(Icons.update),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
//      appBar: AppBar(
//        title: Text("Sample App"),
//      ),
      body: SafeArea(
          child: new Column(
        children: <Widget>[
          Text(textToShow),
        ],
      )),
      floatingActionButton: FloatingActionButton(
        onPressed: _updateText,
        tooltip: 'Update Text',
        child: Icon(Icons.update),
      ),
    );
  }

posted on 2018-11-01 05:08  --LP--  阅读(1537)  评论(0)    收藏  举报

导航