Flutter window_manager中拖拽窗口的组件 DragToMoveArea

发布于 1 年前 作者 phonegap100 340 次浏览 最后一次编辑是 1 年前 来自 分享

Flutter 中使用window_manager 配置窗口的时候我们可以自定义窗口的顶部栏,自定义顶部栏后需要配置拖拽组件,这个时候我们就可以使用 DragToMoveArea

Flutter window_manager DragToMoveArea拖拽窗口组件

return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: const DragToMoveArea(
            child: SizedBox(
          height: 40,
          width: double.infinity,
        )),
        actions: [if (Platform.isWindows == true) const WindowButtons()],
      )
回到顶部