File tree Expand file tree Collapse file tree
bindings/dart/nativeapi_flutter Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11## 0.4.1
22
3+ * ` package:nativeapi_flutter/windowing.dart ` compiles for the web too
4+ (leanflutter/tray_manager #108 ): there ` nativeWindowOf ` and ` nativeWindow `
5+ return null, since no native window stands behind a controller.
6+
37* ` DragToMoveArea ` follows the macOS title-bar double-click preference,
48 including Minimize and None, through the native window action.
59
Original file line number Diff line number Diff line change 11// ignore_for_file: invalid_use_of_internal_member, implementation_imports
22
33import 'dart:ffi' as ffi;
4- import 'dart:ui' show Offset;
54
65import 'package:flutter/src/widgets/_window.dart' as fw;
76import 'package:flutter/src/widgets/_window_linux.dart' as fw_linux;
@@ -10,8 +9,6 @@ import 'package:flutter/src/widgets/_window_win32.dart' as fw_win32;
109
1110import 'package:nativeapi/nativeapi.dart' show Window;
1211
13- import '../conversions.dart' ;
14-
1512/// The native window behind a Flutter window controller, as a nativeapi
1613/// [Window] .
1714///
@@ -44,14 +41,3 @@ extension FlutterWindowControllerNativeWindow on fw.BaseWindowController {
4441 /// Shorthand for [nativeWindowOf] .
4542 Window ? get nativeWindow => nativeWindowOf (this );
4643}
47-
48- extension NativeWindowGeometry on Window {
49- /// Offset from the window's outer frame to its content area (title bar and
50- /// left border), in logical pixels.
51- ///
52- /// `WindowDragSession` anchors on the frame while Flutter reports positions
53- /// inside the content, so an anchor derived from a pointer position needs
54- /// this added.
55- Offset get contentInset =>
56- contentBounds.toRect ().topLeft - bounds.toRect ().topLeft;
57- }
Original file line number Diff line number Diff line change 1+ // ignore_for_file: invalid_use_of_internal_member, implementation_imports
2+
3+ import 'package:flutter/src/widgets/_window.dart' as fw;
4+
5+ import 'package:nativeapi/nativeapi.dart' show Window;
6+
7+ /// The native window behind a Flutter window controller, as a nativeapi
8+ /// [Window] .
9+ ///
10+ /// Always null on the web: there is no native window behind a controller, and
11+ /// the platform implementations (and `dart:ffi` ) do not exist there.
12+ Window ? nativeWindowOf (fw.BaseWindowController controller) => null ;
13+
14+ extension FlutterWindowControllerNativeWindow on fw.BaseWindowController {
15+ /// Shorthand for [nativeWindowOf] .
16+ Window ? get nativeWindow => nativeWindowOf (this );
17+ }
Original file line number Diff line number Diff line change 1+ import 'dart:ui' show Offset;
2+
3+ import 'package:nativeapi/nativeapi.dart' show Window;
4+
5+ import '../conversions.dart' ;
6+
7+ extension NativeWindowGeometry on Window {
8+ /// Offset from the window's outer frame to its content area (title bar and
9+ /// left border), in logical pixels.
10+ ///
11+ /// `WindowDragSession` anchors on the frame while Flutter reports positions
12+ /// inside the content, so an anchor derived from a pointer position needs
13+ /// this added.
14+ Offset get contentInset =>
15+ contentBounds.toRect ().topLeft - bounds.toRect ().topLeft;
16+ }
Original file line number Diff line number Diff line change 88/// The stable channel does not offer `flutter config --enable-windowing` : an app
99/// sets `isWindowingEnabled = true` (from
1010/// `package:flutter/src/foundation/_features.dart` ) before its binding starts.
11+ ///
12+ /// On the web, where there are no native windows, [nativeWindowOf] returns
13+ /// null, so an app that also targets the web can still import this library.
1114library ;
1215
13- export 'src/windowing/flutter_window.dart' ;
16+ export 'src/windowing/flutter_window.dart'
17+ if (dart.library.js_interop) 'src/windowing/flutter_window_web.dart' ;
18+ export 'src/windowing/window_geometry.dart' ;
You can’t perform that action at this time.
0 commit comments