搜尋套件、儲存庫與 APP 分類

套件詳情v1.2.1

fullscreen_window

一個 Flutter 外掛程式可讓您的視窗全螢幕顯示。

AndroidiOSWebWindowsLinux
近 30 天下載
3.7萬
喜歡數
30
Pub 分數
140

安裝套件

flutter pub add fullscreen_window

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

fullscreen_window 套件是一個 Flutter 外掛程式,讓開發者能在多個平台(包含 Windows、Linux 與 macOS)上控制視窗全螢幕模式。它提供簡單的 API 來切換全螢幕狀態、管理視窗大小以及處理顯示模式。雖然此外掛程式主要設計用於桌面環境,也支援 Android、iOS 與 Web,但各平台功能可能有所不同。該外掛程式對於需要沉浸式體驗的應用程式非常實用,例如媒體播放器、遊戲或 kiosk 式應用。它與 Flutter 現有的 UI 架構無縫整合,並由社群維護。

適用情境

  • 沉浸式媒體播放
  • Kiosk 應用程式
  • 遊戲開發
  • 全螢幕簡報
  • 桌面應用優化

主要特色

  • 切換全螢幕模式
  • 跨平台支援
  • 視窗大小管理
  • 平台特定行為處理
  • 簡單的 API 結合

適合對象

  • 桌面應用程式開發者
  • 媒體與遊戲應用
  • 互動式自助服務終端
  • 簡報軟體
  • 需要全螢幕控制的應用

使用建議

  • 行動裝置與網頁端功能受限
  • 平台特定的特殊處理
  • 需要桌面環境
  • 可能與系統 UI 發生衝突
  • 不適用於所有應用類型

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

fullscreen_window

This plugin makes your window fullscreen.

Platform Support

Windows Linux Web Android iOS
✔️ ✔️ ✔️ ✔️ ✔️
  • Web is tested on Chrome / Edge (in Windows)
  • Not tested on iOS, but I think it should work because just use the pure Flutter API and works on Android.

Quick Start

Installation

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

dependencies:
  fullscreen_window: ^1.2.0

Or

dependencies:
  fullscreen_window:
    git:
      url: https://github.com/jakky1/fullscreen_window.git
      ref: master
Functions
import 'package:fullscreen_window/fullscreen_window.dart';

FullScreenWindow.setFullScreen(true);    // enter fullscreen
FullScreenWindow.setFullScreen(false);   // exit fullscreen
Size screen_logical_size = await FullScreenWindow.getScreenSize(context);
Size screen_physical_size = await FullScreenWindow.getScreenSize(null);
Example
import 'package:flutter/material.dart';
import 'package:fullscreen_window/fullscreen_window.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  String screenSizeText = "";

  void setFullScreen(bool isFullScreen) {
    FullScreenWindow.setFullScreen(isFullScreen);
  }

  void showScreenSize(BuildContext context) async {
    Size logicalSize = await FullScreenWindow.getScreenSize(context);
    Size physicalSize = await FullScreenWindow.getScreenSize(null);
    setState(() {
      screenSizeText = "Screen size (logical pixel): ${logicalSize.width} x ${logicalSize.height}\n";
      screenSizeText += "Screen size (physical pixel): ${physicalSize.width} x ${physicalSize.height}\n";
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('FullScreen example app'),
        ),
        body: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              ElevatedButton(
                onPressed: () => setFullScreen(true), 
                child: const Text("Enter FullScreen"),
              ),

              const SizedBox(height: 10),
              ElevatedButton(
                onPressed: () => setFullScreen(false), 
                child: const Text("Exit FullScreen"),
              ),

              const SizedBox(height: 10),
              Builder(builder: (context) => ElevatedButton(
                onPressed: () => showScreenSize(context), 
                child: const Text("Show screen size"),
              )),

              const SizedBox(height: 10),
              if (screenSizeText.isNotEmpty) Text(screenSizeText),
            ]),
          ),
      ),
    );
  }
}

所屬分類

依賴

依賴清單 2 項

  • plugin_platform_interface^2.0.2
  • web^1.0.0

原始碼儲存庫

使用此套件的專案