nativeapi_flutter 0.4.0 copy "nativeapi_flutter: ^0.4.0" to clipboard
nativeapi_flutter: ^0.4.0 copied to clipboard

Flutter integration for nativeapi: widgets, dart:ui conversions and the multi-window bridge on top of package:nativeapi.

nativeapi_flutter #

Flutter integration for nativeapi: unified access to native system APIs — windows, tray icons, menus, displays, keyboard, dialogs, storage and more.

nativeapi itself is plain Dart. This package is what a Flutter app depends on: it re-exports nativeapi and adds

  • widgets: DragToMoveArea, DragToResizeArea, DragOutArea, DropRegion, ContextMenuRegion;
  • ImageAsset.fromAsset(), loading a nativeapi Image from a Flutter asset;
  • conversions between nativeapi's value types and dart:ui's: point.toOffset(), size.toSize(), rectangle.toRect(), color.toColor(), and toNative() on Offset, Size, Rect, Color and Brightness;
  • package:nativeapi_flutter/windowing.dart, which bridges Flutter's experimental multi-window API to nativeapi windows.

Installation #

flutter pub add nativeapi_flutter
import 'package:nativeapi_flutter/nativeapi_flutter.dart';

final window = WindowManager.instance.getCurrent();
window?.contentSize = const Size(800, 600).toNative();
final Rect bounds = window!.bounds.toRect();

The nativeapi names that Flutter already uses are not re-exported: Brightness, Color, Display, Image and Size would shadow dart:ui's, and ModifierKey and ShortcutManager would be ambiguous. To name one of them, also depend on nativeapi and import it with a prefix:

import 'package:nativeapi/nativeapi.dart' as na;

final List<na.Display> displays = DisplayManager.instance.getAll();

License #

MIT

0
likes
160
points
--
downloads

Documentation

API reference

Publisher

verified publisherleanflutter.dev

Weekly Downloads

Flutter integration for nativeapi: widgets, dart:ui conversions and the multi-window bridge on top of package:nativeapi.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, nativeapi, path

More

Packages that depend on nativeapi_flutter