6 4 月 2026, 周一


使用 SelectionArea 包裹住路由显示的内容 (例如 Scaffold),Flutter 会替你处理好一切,你便可以享受到这项强力的新特性。

  Widget build(BuildContext context) {
    return SelectionArea(
      child: Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
        ),
        body: Column(
          children: const <Widget>[
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              'You have pushed the button this many times:',
            ),
          ],
        ),
      ),
    );
  }
Avatar photo

sion932