搜索插件、代码仓与 APP 分类

插件详情v0.6.0

window_manager

此插件允许 Flutter 桌面应用程序调整窗口大小和重新定位窗口。

macOSWindowsLinux
近 30 天下载
93.2万
喜欢数
1130
Pub 分数
160

安装插件

flutter pub add window_manager

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

window_manager 是一个专为 macOS、Windows 和 Linux 上的桌面应用程序设计的 Flutter 插件。它使开发者能够以编程方式控制窗口属性,如大小、位置和可见性。通过此包,用户可以动态调整窗口大小和重新定位窗口,从而提升桌面优先的 Flutter 应用程序的用户体验。该插件提供了一个简单的 API 来管理窗口行为,无需编写原生代码。该插件与 Flutter 的 UI 框架无缝集成,并支持跨平台的响应式窗口管理。

适合场景

  • 通过程序调整窗口大小
  • 重新定位应用程序窗口
  • 管理窗口可见性
  • 创建浮动或可拖动的窗口
  • 实现自定义窗口行为

主要特点

  • 跨平台支持(macOS、Windows、Linux)
  • 用于窗口操作的简单 API
  • 支持窗口调整大小和定位
  • 无需原生平台代码
  • 与 Flutter UI 的无缝集成

适合对象

  • 以桌面为先的 Flutter 应用
  • 需要动态窗口控制的应用
  • 面向多个桌面平台的开发者
  • 自定义窗口布局
  • 高级桌面用户体验功能

使用建议

  • 需要 Flutter 3.0 或更高版本
  • 仅限桌面平台
  • 可能需要平台特定的配置
  • 不适用于移动或Web应用
  • 行为在不同操作系统之间可能略有差异

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

⚠️ Migration Notice: This plugin is being migrated to libnativeapi/nativeapi-flutter

The new version is based on a unified C++ core library (libnativeapi/nativeapi), providing more complete and consistent cross-platform native API support.

window_manager

pub version Pub Monthly Downloads All Contributors

This plugin provides comprehensive window management capabilities for Flutter desktop applications, enabling full control over window size, position, appearance, close behavior, and listening to events.


English | 简体中文


Platform Support

Linux macOS Windows
✔️ ✔️ ✔️

Documentation

Quick Start

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  window_manager: ^0.5.1
Usage
import 'package:flutter/material.dart';
import 'package:window_manager/window_manager.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  // Must add this line.
  await windowManager.ensureInitialized();

  WindowOptions windowOptions = WindowOptions(
    size: Size(800, 600),
    center: true,
    backgroundColor: Colors.transparent,
    skipTaskbar: false,
    titleBarStyle: TitleBarStyle.hidden,
  );
  windowManager.waitUntilReadyToShow(windowOptions, () async {
    await windowManager.show();
    await windowManager.focus();
  });

  runApp(MyApp());
}

Please see the example app of this plugin for a full example.

Related Articles

Who's using it?

  • Airclap - Send any file to any device. cross platform, ultra fast and easy to use.
  • AuthPass - Password Manager based on Flutter for all platforms. Keepass 2.x (kdbx 3.x) compatible.
  • Biyi (比译) - A convenient translation and dictionary app written in dart / Flutter.
  • BlueBubbles - BlueBubbles is an ecosystem of apps bringing iMessage to Android, Windows, and Linux
  • LunaSea - A self-hosted controller for mobile and macOS built using the Flutter framework.
  • Linwood Butterfly - Open source note taking app written in Flutter
  • RustDesk - Yet another remote desktop software, written in Rust. Works out of the box, no configuration required.
  • Ubuntu Desktop Installer - This project is a modern implementation of the Ubuntu Desktop installer.
  • UniControlHub - Seamlessly bridge your Desktop and Mobile devices
  • EyesCare - A light-weight application following 20 rule adherence for optimum eye health

Contributors

LiJianying
LiJianying

💻
 A Arif A S
A Arif A S

💻
J-P Nurmi
J-P Nurmi

💻
Dixeran
Dixeran

💻
nikitatg
nikitatg

💻
Kristen McWilliam
Kristen McWilliam

💻
Kingtous
Kingtous

💻
Prome
Prome

💻
Bin
Bin

💻
youxiachai
youxiachai

💻
Allen Xu
Allen Xu

💻
CodeDoctor
CodeDoctor

💻
Jean-Christophe Binet
Jean-Christophe Binet

💻
Jon Salmon
Jon Salmon

💻
Karol Wrótniak
Karol Wrótniak

💻
LAIIIHZ
LAIIIHZ

💻
Mikhail Kulesh
Mikhail Kulesh

💻
Prateek Sunal
Prateek Sunal

💻
Ricardo Boss
Ricardo Boss

💻
Add your contributions

License

MIT

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目

所在榜单