nativeapi
0.6.1, released 6 days ago by leanflutter.dev
Dart bindings to native system APIs across desktop and mobile
What it does
Provides unified access to native APIs such as windows, tray icons, menus, displays, keyboard, dialogs, storage, and more, usable from both Flutter and plain Dart.
AI-written summary of version 0.6.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Need native window control in a Flutter or Dart app
- Need tray icons or system menus
- Need access to display information or keyboard events
Skip it when
- Only need high‑level Flutter widgets
- Target only mobile platforms without desktop support
Strengths
- Cross‑platform support (Android, iOS, Windows, macOS, Linux)
- Unified API surface across platforms
- Works with both Flutter and plain Dart
Weaknesses
- Work in progress, breaking changes in recent releases
- Requires Flutter 3.50 / Dart 3.14 for full functionality
- Experimental runNativeApp() still needs older Dart VM APIs
Setup
- Kind
- FFI (native library)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 2
Add dependency, import package:nativeapi/nativeapi.dart, may need platform permissions for tray or window access
import 'package:nativeapi/nativeapi.dart';
for (final display in DisplayManager.instance.getAll()) {
print('${display.name ?? ''}: ${display.size.width}x${display.size.height}');
}Alternatives
Packages that do the same job and could replace nativeapi.
- nfc_manager
A Flutter plugin providing access to NFC features on Android and iOS.
94Compare - jni_flutter
Access Flutter Android APIs from Dart.
87Compare - system_info2
Provides easy access to system information like architecture, kernel, memory, OS, CPU, and user.
85Compare - system_resources
Access system resources like CPU load and memory usage via dart:ffi.
77Compare
Works with
Packages commonly used together with nativeapi: ones it builds on, ones built on it, and its own family.
- ffinativeapi depends on itUtilities for working with Foreign Function Interface (FFI) code in Dart.
- screen_retrieverBuilt on nativeapiRead desktop screen size, work area, scale factor and cursor position on Windows, macOS and Linux.
- window_managerBuilt on nativeapiFlutter desktop window resizing, moving, showing, hiding via nativeapi.
- tray_managerBuilt on nativeapiDefine system tray icons and context menus in Flutter desktop apps.
- hotkey_managerBuilt on nativeapiRegister system-wide and in-app keyboard shortcuts on desktop and Android
- nativeapi_flutterBuilt on nativeapiFlutter integration for nativeapi, adding widgets and type conversions.
- protocol_handlerBuilt on nativeapiRegister and handle custom protocols and deep links in Flutter apps.
- flutter_fullscreenBuilt on nativeapiAPI to toggle fullscreen mode on web, desktop, and mobile Flutter apps