Search packages, repositories and app categories

Package detailsv0.3.1

screen_retriever

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

macOSWindowsLinux
30-day downloads
1.2M
Likes
74
Pub points
160

Install package

flutter pub add screen_retriever

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The screen_retriever package enables Flutter desktop applications to access detailed information about connected displays, including screen dimensions, resolution, and primary display details. It also provides real-time cursor position tracking across multiple monitors. Designed for macOS, Windows, and Linux, it offers a lightweight solution for developers building multi-screen aware apps, such as custom UIs, productivity tools, or media players that require precise screen layout handling. The plugin integrates seamlessly with Flutter's desktop ecosystem.

Use cases

  • Multi-monitor application layouts
  • Cursor position tracking
  • Display resolution detection
  • Desktop UI customization
  • Screen-aware media playback
  • Window positioning utilities

Key features

  • Cross-platform desktop support
  • Real-time cursor tracking
  • Display metadata retrieval
  • Lightweight and efficient
  • Simple API integration
  • Supports multiple screens

Suitable for

  • Desktop app developers
  • Multi-screen UI designers
  • Productivity tool creators
  • Media player developers
  • Custom window managers

Considerations

  • Requires desktop platform targeting
  • Limited to macOS, Windows, and Linux
  • No mobile or web support
  • May need permission handling on some systems
  • Performance impact in high-frequency updates

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

⚠️ 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

Categories

Dependencies

Dependency list 3 items

Source repository

Projects using this package