搜尋套件、儲存庫與 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 項

原始碼儲存庫

使用此套件的專案

所在榜單