パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.3.1

screen_retriever

このプラグインにより、Flutter デスクトップアプリは画面サイズ、ディスプレイ、カーソルの位置などの情報を取得できます。

macOSWindowsLinux
30日間ダウンロード
116万
いいね数
74
Pub ポイント
160

パッケージをインストール

flutter pub add screen_retriever

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

screen_retriever パッケージは、Flutter デスクトップアプリケーションが接続されたディスプレイの詳細情報(画面サイズ、解像度、プライマリディスプレイの詳細など)にアクセスできるようにします。また、複数のモニターにわたるリアルタイムのカーソル位置追跡も提供します。macOS、Windows、Linux 向けに設計されており、カスタムUI、生産性ツール、または正確な画面レイアウト処理を必要とするメディアプレーヤーなどのマルチスクリーン対応アプリを開発する開発者向けに軽量なソリューションを提供します。このプラグインは Flutter のデスクトップエコシステムとシームレスに統合されます。

用途

  • マルチモニタアプリケーションレイアウト
  • カーソル位置の追跡
  • 表示解像度検出
  • デスクトップUIのカスタマイズ
  • 画面に応じたメディア再生
  • ウィンドウ位置設定ユーティリティ

主な機能

  • クロスプラットフォームデスクトップサポート
  • リアルタイムカーソル追跡
  • メタデータ取得の表示
  • 軽量で効率的
  • シンプルな API インテグレーション
  • 複数の画面をサポート

適している対象

  • デスクトップアプリ開発者
  • マルチスクリーンUIデザイナー
  • 生産性ツールの作成者
  • メディアプレーヤー開発者
  • カスタムウィンドウマネージャ

注意事項

  • デスクトッププラットフォームのターゲティングが必要
  • macOS、Windows、Linuxに限定
  • モバイルまたは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. r

screen_retriever

pub version

This plugin allows Flutter desktop apps to Retrieve information about screen size, displays, cursor position, etc.



English | 简体中文


Platform Support

Linux macOS Windows
✔️ ✔️ ✔️

Documentation

Quick Start

Installation

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

dependencies:
  screen_retriever: ^0.2.0

Or

dependencies:
  screen_retriever:
    git:
      url: https://github.com/leanflutter/screen_retriever.git
      path: packages/screen_retriever
      ref: main
Usage
Display? _primaryDisplay;
List<Display> _displayList = [];

void _init() async {
  _primaryDisplay = await screenRetriever.getPrimaryDisplay();
  _displayList = await screenRetriever.getAllDisplays();
  setState(() {});
}
Listening events
class HomePage extends StatefulWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> with ScreenListener {
  @override
  void initState() {
    screenRetriever.addListener(this);
    super.initState();
  }

  @override
  void dispose() {
    screenRetriever.removeListener(this);
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    // ...
  }

  @override
  void onScreenEvent(String eventName) {
    String log = 'Event received: $eventName)';
    print(log);
  }
}

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

Who's using it?

  • Biyi (比译) - A convenient translation and dictionary app.
  • FastForge - An efficient tool for rapid application development and prototyping.

API

ScreenRetriever
Method Description Linux macOS Windows
getCursorScreenPoint Returns Offset - The current absolute position of the mouse pointer. ✔️ ✔️ ✔️
getPrimaryDisplay Returns Display - The primary display. ✔️ ✔️ ✔️
getAllDisplays Returns List<Display> - An array of displays that are currently available. ✔️ ✔️ ✔️

Contributors ✨

Thanks goes to these wonderful people (emoji key):

LiJianying
LiJianying

💻
Christian Padilla
Christian Padilla

💻
J-P Nurmi
J-P Nurmi

💻
Kingtous
Kingtous

💻
fufesou
fufesou

💻
lukasz-lukasz-lukasz
lukasz-lukasz-lukasz

💻
Add your contributions

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT

カテゴリー

依存関係

依存関係一覧 3 件

ソースリポジトリ

このパッケージを使用しているプロジェクト