screen_retriever
0.4.0, released 8 days ago by leanflutter.dev
Read desktop screen size, work area, scale factor and cursor position on Windows, macOS and Linux.
What it does
Provides a synchronous API to query primary and all displays, their geometry, scale, orientation and other properties. It also streams display add/remove/change events and cursor location.
AI-written summary of version 0.4.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to adapt UI layout to multiple monitors or high‑DPI screens
- You need to know the cursor position for custom pointer handling
- You want to react to display configuration changes at runtime
Skip it when
- You target mobile platforms only
- You need a cross‑platform solution that also works on web
Strengths
- Works on all three desktop platforms with a single API
- No native code required in your app – uses nativeapi under the hood
- Synchronous calls make it easy to use in init code
- Provides live updates via listeners
Weaknesses
- Only supports desktop, no mobile or web
- Relies on nativeapi version compatibility
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Add dependency, ensure GTK3/X11/Xi dev packages on Linux; requires Flutter 3.50+
import 'package:screen_retriever/screen_retriever.dart';
final dm = DisplayManager.instance;
final primary = dm.getPrimary();
print('Primary ${primary?.name} size ${primary?.size.toSize()}');
final cursor = dm.getCursorPosition();
print('Cursor at ${cursor.toOffset()}');Alternatives
Packages that do the same job and could replace screen_retriever.
Works with
Packages commonly used together with screen_retriever: ones it builds on, ones built on it, and its own family.
- plugin_platform_interfacescreen_retriever depends on itReusable base class for platform interfaces of Flutter federated plugins.
- nativeapiscreen_retriever depends on itDart bindings to native system APIs across desktop and mobile
- nativeapi_flutterscreen_retriever depends on itFlutter integration for nativeapi, adding widgets and type conversions.
- window_managerSame familyFlutter desktop window resizing, moving, showing, hiding via nativeapi.
- tray_managerSame familyDefine system tray icons and context menus in Flutter desktop apps.
- hotkey_managerSame familyRegister system-wide and in-app keyboard shortcuts on desktop and Android
- protocol_handlerSame familyRegister and handle custom protocols and deep links in Flutter apps.
- flutter_screen_captureBuilt on screen_retrieverCapture the whole screen, a region, or a pixel color on macOS and Windows.