From 99c45c430377c56404506841ccf382f140cec0c6 Mon Sep 17 00:00:00 2001 From: Bent Hillerkus <29630575+benthillerkus@users.noreply.github.com> Date: Thu, 23 Feb 2023 03:37:40 +0100 Subject: [PATCH] chore!: update deps BREAKING CHANGE: bumps minimum Flutter version to 3.7 and Dart to 2.19 Release-As: 1.3.0 --- .vscode/launch.json | 60 ------ example/add_many/.vscode/launch.json | 25 +++ example/add_many/lib/main.dart | 4 +- example/add_many/pubspec.lock | 124 +++++++----- example/add_many/pubspec.yaml | 2 +- .../windows/flutter/generated_plugins.cmake | 8 + example/select_image/.vscode/launch.json | 25 +++ example/select_image/lib/main.dart | 15 +- .../lib/view/element_selector/selectable.dart | 4 +- example/select_image/pubspec.lock | 188 +++++++++++------- example/select_image/pubspec.yaml | 10 +- .../flutter/generated_plugin_registrant.cc | 3 + .../windows/flutter/generated_plugins.cmake | 1 + example/skeleton_example/.vscode/launch.json | 25 +++ example/skeleton_example/pubspec.lock | 131 ++++++------ example/skeleton_example/pubspec.yaml | 2 +- .../windows/flutter/generated_plugins.cmake | 8 + example/widgets_api/.vscode/launch.json | 25 +++ example/widgets_api/pubspec.lock | 128 ++++++------ example/widgets_api/pubspec.yaml | 2 +- .../windows/flutter/generated_plugins.cmake | 8 + lib/src/imperative.dart | 4 +- lib/src/interaction.dart | 60 +++--- lib/src/widgets.dart | 28 +-- pubspec.yaml | 10 +- 25 files changed, 525 insertions(+), 375 deletions(-) delete mode 100644 .vscode/launch.json create mode 100644 example/add_many/.vscode/launch.json create mode 100644 example/select_image/.vscode/launch.json create mode 100644 example/skeleton_example/.vscode/launch.json create mode 100644 example/widgets_api/.vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 9786bc8..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "add_many", - "cwd": "example\\add_many", - "request": "launch", - "type": "dart" - }, - { - "name": "add_many (release mode)", - "cwd": "example\\add_many", - "request": "launch", - "type": "dart", - "flutterMode": "release" - }, - { - "name": "select_image", - "cwd": "example\\select_image", - "request": "launch", - "type": "dart" - }, - { - "name": "select_image (release mode)", - "cwd": "example\\select_image", - "request": "launch", - "type": "dart", - "flutterMode": "release" - }, - { - "name": "widgets_api", - "cwd": "example\\widgets_api", - "request": "launch", - "type": "dart" - }, - { - "name": "widgets_api (release mode)", - "cwd": "example\\widgets_api", - "request": "launch", - "type": "dart", - "flutterMode": "release" - }, - { - "name": "skeleton_example", - "cwd": "example\\skeleton_example", - "request": "launch", - "type": "dart" - }, - { - "name": "skeleton_example (release mode)", - "cwd": "example\\skeleton_example", - "request": "launch", - "type": "dart", - "flutterMode": "release" - } - ] -} \ No newline at end of file diff --git a/example/add_many/.vscode/launch.json b/example/add_many/.vscode/launch.json new file mode 100644 index 0000000..a8387ee --- /dev/null +++ b/example/add_many/.vscode/launch.json @@ -0,0 +1,25 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "add_many", + "request": "launch", + "type": "dart" + }, + { + "name": "add_many (profile mode)", + "request": "launch", + "type": "dart", + "flutterMode": "profile" + }, + { + "name": "add_many (release mode)", + "request": "launch", + "type": "dart", + "flutterMode": "release" + } + ] +} \ No newline at end of file diff --git a/example/add_many/lib/main.dart b/example/add_many/lib/main.dart index e9ac5dd..0207f62 100644 --- a/example/add_many/lib/main.dart +++ b/example/add_many/lib/main.dart @@ -95,11 +95,11 @@ class _MyAppState extends State { scale: _icons.isEmpty ? 0 : sqrt(sqrt(_icons.length + 1)), curve: Curves.easeOutBack, child: SizedBox( + width: 32, + height: 32, child: CustomPaint( painter: DebugGraphic(_icons.length), ), - width: 32, - height: 32, ), ), ), diff --git a/example/add_many/pubspec.lock b/example/add_many/pubspec.lock index ebe2cc7..e7bf9f6 100644 --- a/example/add_many/pubspec.lock +++ b/example/add_many/pubspec.lock @@ -5,58 +5,57 @@ packages: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.10.0" betrayal: dependency: "direct main" description: path: "../.." relative: true source: path - version: "1.2.2" + version: "1.2.5" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.2.1" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.17.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -66,56 +65,71 @@ packages: dependency: "direct dev" description: name: flutter_lints - url: "https://pub.dartlang.org" + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + js: + dependency: transitive + description: + name: js + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" + source: hosted + version: "0.6.5" lints: dependency: transitive description: name: lints - url: "https://pub.dartlang.org" + sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.0.1" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "293ae2d49fd79d4c04944c3a26dfd313382d5f52e821ec57119230ae16031ad4" + url: "https://pub.dev" source: hosted version: "1.0.2" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.13" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.8.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.8.2" sky_engine: dependency: transitive description: flutter @@ -125,58 +139,58 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + url: "https://pub.dev" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.16" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.4" sdks: - dart: ">=2.16.1 <3.0.0" + dart: ">=2.18.0 <3.0.0" flutter: ">=2.5.0" diff --git a/example/add_many/pubspec.yaml b/example/add_many/pubspec.yaml index 5ac8a0d..8aa903f 100644 --- a/example/add_many/pubspec.yaml +++ b/example/add_many/pubspec.yaml @@ -21,7 +21,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.0 flutter: uses-material-design: true diff --git a/example/add_many/windows/flutter/generated_plugins.cmake b/example/add_many/windows/flutter/generated_plugins.cmake index 173878d..acd77a6 100644 --- a/example/add_many/windows/flutter/generated_plugins.cmake +++ b/example/add_many/windows/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST betrayal ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/example/select_image/.vscode/launch.json b/example/select_image/.vscode/launch.json new file mode 100644 index 0000000..5dd5c5a --- /dev/null +++ b/example/select_image/.vscode/launch.json @@ -0,0 +1,25 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "select_image", + "request": "launch", + "type": "dart" + }, + { + "name": "select_image (profile mode)", + "request": "launch", + "type": "dart", + "flutterMode": "profile" + }, + { + "name": "select_image (release mode)", + "request": "launch", + "type": "dart", + "flutterMode": "release" + } + ] +} \ No newline at end of file diff --git a/example/select_image/lib/main.dart b/example/select_image/lib/main.dart index b79cf7c..852f179 100644 --- a/example/select_image/lib/main.dart +++ b/example/select_image/lib/main.dart @@ -7,7 +7,7 @@ import 'package:contextual_menu/contextual_menu.dart'; import 'package:select_image/view/view.dart'; import 'package:file_picker/file_picker.dart'; import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart' hide MenuItem; +import 'package:flutter/material.dart'; import 'package:image/image.dart' as img; import 'package:window_manager/window_manager.dart'; @@ -15,8 +15,7 @@ void main() async { WidgetsFlutterBinding.ensureInitialized(); await windowManager.ensureInitialized(); - WindowOptions windowOptions = WindowOptions( - backgroundColor: Colors.green, + WindowOptions windowOptions = const WindowOptions( skipTaskbar: false, ); windowManager.waitUntilReadyToShow(windowOptions, windowManager.show); @@ -129,13 +128,13 @@ class _HomeScreenState extends State { iconSource = TrayIconImageDelegate.fromPath(path: path); break; case "png": - var resized = await compute((Tuple arg) { + final resized = await compute((Tuple arg) { final path = arg.first; final size = arg.second; - var org = img.decodePng(File(path).readAsBytesSync()); - var resized = img.copyResize(org!, - height: size.height.toInt(), - width: size.width.toInt(), + final org = img.decodePng(File(path).readAsBytesSync()); + final resized = img.copyResize(org!, + height: size.height.round(), + width: size.width.round(), interpolation: img.Interpolation.average); return resized.getBytes().buffer; }, Tuple(path, TrayIcon.preferredImageSize)); diff --git a/example/select_image/lib/view/element_selector/selectable.dart b/example/select_image/lib/view/element_selector/selectable.dart index 5898227..a211414 100644 --- a/example/select_image/lib/view/element_selector/selectable.dart +++ b/example/select_image/lib/view/element_selector/selectable.dart @@ -157,7 +157,7 @@ class _SelectableState extends State with TickerProviderStateMixin { offset: Offset( 0, widget.dimension / 2 + - (theme.textTheme.caption?.fontSize ?? 14) / 2 + + (theme.textTheme.bodySmall?.fontSize ?? 14) / 2 + 8), child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [ const Opacity( @@ -177,7 +177,7 @@ class _SelectableState extends State with TickerProviderStateMixin { child: EditableText( readOnly: !_isSelected, textAlign: TextAlign.center, - style: theme.textTheme.caption!, + style: theme.textTheme.bodySmall!, showSelectionHandles: true, textScaleFactor: 1.5, keyboardAppearance: theme.brightness, diff --git a/example/select_image/pubspec.lock b/example/select_image/pubspec.lock index c5baf37..ea62433 100644 --- a/example/select_image/pubspec.lock +++ b/example/select_image/pubspec.lock @@ -5,93 +5,97 @@ packages: dependency: transitive description: name: archive - url: "https://pub.dartlang.org" + sha256: eb33140ede1b4039f4ad631f7bf3cfa58e24514e8bf87184bc32f17541af87fc + url: "https://pub.dev" source: hosted version: "3.3.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.10.0" betrayal: dependency: "direct main" description: path: "../.." relative: true source: path - version: "1.2.3" + version: "1.2.5" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + url: "https://pub.dev" source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" + version: "1.2.1" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.0" contextual_menu: dependency: "direct main" description: name: contextual_menu - url: "https://pub.dartlang.org" + sha256: "169f31af8cd090deb3ce92af65d170e6059af638b614263ad685165b07fe6bbf" + url: "https://pub.dev" source: hosted - version: "0.1.1" + version: "0.1.2" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: cf75650c66c0316274e21d7c43d3dea246273af5955bd94e8184837cd577575c + url: "https://pub.dev" source: hosted version: "3.0.1" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 + url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "2.0.1" file_picker: dependency: "direct main" description: name: file_picker - url: "https://pub.dartlang.org" + sha256: d090ae03df98b0247b82e5928f44d1b959867049d18d73635e2e0bc3f49542b9 + url: "https://pub.dev" source: hosted - version: "4.5.1" + version: "5.2.5" flutter: dependency: "direct main" description: flutter @@ -101,16 +105,18 @@ packages: dependency: "direct dev" description: name: flutter_lints - url: "https://pub.dartlang.org" + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" + sha256: "60fc7b78455b94e6de2333d2f95196d32cf5c22f4b0b0520a628804cb463503b" + url: "https://pub.dev" source: hosted - version: "2.0.5" + version: "2.0.7" flutter_test: dependency: "direct dev" description: flutter @@ -125,79 +131,98 @@ packages: dependency: "direct main" description: name: image - url: "https://pub.dartlang.org" + sha256: "8e9d133755c3e84c73288363e6343157c383a0c6c56fc51afcc5d4d7180306d6" + url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "3.3.0" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "0.6.5" lints: dependency: transitive description: name: lints - url: "https://pub.dartlang.org" + sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.0.1" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" + url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.1.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.13" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.4" + version: "0.2.0" menu_base: dependency: transitive description: name: menu_base - url: "https://pub.dartlang.org" + sha256: "820368014a171bd1241030278e6c2617354f492f5c703d7b7d4570a6b8b84405" + url: "https://pub.dev" source: hosted - version: "0.1.0" + version: "0.1.1" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.8.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.8.2" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.dartlang.org" + sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4" + url: "https://pub.dev" source: hosted - version: "4.4.0" + version: "5.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: "075f927ebbab4262ace8d0b283929ac5410c0ac4e7fc123c76429564facfb757" + url: "https://pub.dev" source: hosted version: "2.1.2" + screen_retriever: + dependency: transitive + description: + name: screen_retriever + sha256: "4931f226ca158123ccd765325e9fbf360bfed0af9b460a10f960f9bb13d58323" + url: "https://pub.dev" + source: hosted + version: "0.1.6" sky_engine: dependency: transitive description: flutter @@ -207,79 +232,90 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + url: "https://pub.dev" source: hosted - version: "0.4.9" + version: "0.4.16" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee" + url: "https://pub.dev" source: hosted version: "1.3.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + sha256: c9ebe7ee4ab0c2194e65d3a07d8c54c5d00bb001b76081c4a04cdb8448b59e46 + url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "3.1.3" window_manager: dependency: "direct main" description: name: window_manager - url: "https://pub.dartlang.org" + sha256: "5bdd29dc5f1f3185fc90696373a571d77968e03e5e820fb1ecdbdade3f5d8fff" + url: "https://pub.dev" source: hosted - version: "0.2.3" + version: "0.3.0" xml: dependency: transitive description: name: xml - url: "https://pub.dartlang.org" + sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5" + url: "https://pub.dev" source: hosted - version: "5.3.1" + version: "6.2.2" sdks: - dart: ">=2.17.0-0 <3.0.0" - flutter: ">=2.5.0" + dart: ">=2.19.0 <3.0.0" + flutter: ">=3.7.0" diff --git a/example/select_image/pubspec.yaml b/example/select_image/pubspec.yaml index a6d2acd..1aad83c 100644 --- a/example/select_image/pubspec.yaml +++ b/example/select_image/pubspec.yaml @@ -17,15 +17,15 @@ dependencies: # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. path: ../../ - file_picker: ^4.5.1 - image: ^3.1.3 - contextual_menu: ^0.1.1 - window_manager: ^0.2.3 + file_picker: ^5.2.5 + image: ^3.3.0 + contextual_menu: ^0.1.2 + window_manager: ^0.3.0 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/example/select_image/windows/flutter/generated_plugin_registrant.cc b/example/select_image/windows/flutter/generated_plugin_registrant.cc index 4c023f3..67aaa39 100644 --- a/example/select_image/windows/flutter/generated_plugin_registrant.cc +++ b/example/select_image/windows/flutter/generated_plugin_registrant.cc @@ -8,6 +8,7 @@ #include #include +#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { @@ -15,6 +16,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("BetrayalPlugin")); ContextualMenuPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("ContextualMenuPlugin")); + ScreenRetrieverPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ScreenRetrieverPlugin")); WindowManagerPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("WindowManagerPlugin")); } diff --git a/example/select_image/windows/flutter/generated_plugins.cmake b/example/select_image/windows/flutter/generated_plugins.cmake index f66a67e..7801d6d 100644 --- a/example/select_image/windows/flutter/generated_plugins.cmake +++ b/example/select_image/windows/flutter/generated_plugins.cmake @@ -5,6 +5,7 @@ list(APPEND FLUTTER_PLUGIN_LIST betrayal contextual_menu + screen_retriever window_manager ) diff --git a/example/skeleton_example/.vscode/launch.json b/example/skeleton_example/.vscode/launch.json new file mode 100644 index 0000000..8c24370 --- /dev/null +++ b/example/skeleton_example/.vscode/launch.json @@ -0,0 +1,25 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "skeleton_example", + "request": "launch", + "type": "dart" + }, + { + "name": "skeleton_example (profile mode)", + "request": "launch", + "type": "dart", + "flutterMode": "profile" + }, + { + "name": "skeleton_example (release mode)", + "request": "launch", + "type": "dart", + "flutterMode": "release" + } + ] +} \ No newline at end of file diff --git a/example/skeleton_example/pubspec.lock b/example/skeleton_example/pubspec.lock index 2cf0f5a..e2d0f06 100644 --- a/example/skeleton_example/pubspec.lock +++ b/example/skeleton_example/pubspec.lock @@ -5,58 +5,57 @@ packages: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.10.0" betrayal: dependency: "direct main" description: path: "../.." relative: true source: path - version: "1.2.2" + version: "1.2.5" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.2.1" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.17.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -66,9 +65,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - url: "https://pub.dartlang.org" + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_localizations: dependency: "direct main" description: flutter @@ -83,51 +83,66 @@ packages: dependency: transitive description: name: intl - url: "https://pub.dartlang.org" + sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + url: "https://pub.dev" source: hosted version: "0.17.0" + js: + dependency: transitive + description: + name: js + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" + source: hosted + version: "0.6.5" lints: dependency: transitive description: name: lints - url: "https://pub.dartlang.org" + sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.0.1" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" + url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.1.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.13" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.8.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.8.2" sky_engine: dependency: transitive description: flutter @@ -137,58 +152,58 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + url: "https://pub.dev" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.16" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.4" sdks: - dart: ">=2.16.2 <3.0.0" - flutter: ">=2.5.0" + dart: ">=2.19.0 <3.0.0" + flutter: ">=3.7.0" diff --git a/example/skeleton_example/pubspec.yaml b/example/skeleton_example/pubspec.yaml index 5eb6285..39ab50a 100644 --- a/example/skeleton_example/pubspec.yaml +++ b/example/skeleton_example/pubspec.yaml @@ -26,7 +26,7 @@ dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/example/skeleton_example/windows/flutter/generated_plugins.cmake b/example/skeleton_example/windows/flutter/generated_plugins.cmake index 173878d..acd77a6 100644 --- a/example/skeleton_example/windows/flutter/generated_plugins.cmake +++ b/example/skeleton_example/windows/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST betrayal ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/example/widgets_api/.vscode/launch.json b/example/widgets_api/.vscode/launch.json new file mode 100644 index 0000000..235962d --- /dev/null +++ b/example/widgets_api/.vscode/launch.json @@ -0,0 +1,25 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "widgets_api", + "request": "launch", + "type": "dart" + }, + { + "name": "widgets_api (profile mode)", + "request": "launch", + "type": "dart", + "flutterMode": "profile" + }, + { + "name": "widgets_api (release mode)", + "request": "launch", + "type": "dart", + "flutterMode": "release" + } + ] +} \ No newline at end of file diff --git a/example/widgets_api/pubspec.lock b/example/widgets_api/pubspec.lock index 894a7ec..c2650b1 100644 --- a/example/widgets_api/pubspec.lock +++ b/example/widgets_api/pubspec.lock @@ -5,58 +5,57 @@ packages: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.10.0" betrayal: dependency: "direct main" description: path: "../.." relative: true source: path - version: "1.2.2" + version: "1.2.5" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.2.1" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.17.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -66,56 +65,71 @@ packages: dependency: "direct dev" description: name: flutter_lints - url: "https://pub.dartlang.org" + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + js: + dependency: transitive + description: + name: js + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" + source: hosted + version: "0.6.5" lints: dependency: transitive description: name: lints - url: "https://pub.dartlang.org" + sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.0.1" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" + url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.1.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.13" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.8.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.8.2" sky_engine: dependency: transitive description: flutter @@ -125,58 +139,58 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + url: "https://pub.dev" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.16" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.4" sdks: - dart: ">=2.16.2 <3.0.0" - flutter: ">=2.5.0" + dart: ">=2.19.0 <3.0.0" + flutter: ">=3.7.0" diff --git a/example/widgets_api/pubspec.yaml b/example/widgets_api/pubspec.yaml index d3d5d1c..b3a985b 100644 --- a/example/widgets_api/pubspec.yaml +++ b/example/widgets_api/pubspec.yaml @@ -22,7 +22,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/example/widgets_api/windows/flutter/generated_plugins.cmake b/example/widgets_api/windows/flutter/generated_plugins.cmake index 173878d..acd77a6 100644 --- a/example/widgets_api/windows/flutter/generated_plugins.cmake +++ b/example/widgets_api/windows/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST betrayal ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/lib/src/imperative.dart b/lib/src/imperative.dart index 53e0b62..daded8d 100644 --- a/lib/src/imperative.dart +++ b/lib/src/imperative.dart @@ -85,7 +85,7 @@ class TrayIcon { if (kDebugMode) _plugin._noop(); } - final __callbacks = {}; + final __callbacks = {}; @override String toString() => @@ -156,7 +156,7 @@ class TrayIcon { void _ensureIsActive() { if (!_isActive) { throw StateError( - 'TrayIcon is not active anymore.\n\nIt was disposed at:\n${_disposedAt.toString()}\nCurrent StackTrace:'); + 'TrayIcon is not active anymore.\n\nIt was disposed at:\n$_disposedAt\nCurrent StackTrace:'); } } diff --git a/lib/src/interaction.dart b/lib/src/interaction.dart index 3b14c55..111033e 100644 --- a/lib/src/interaction.dart +++ b/lib/src/interaction.dart @@ -1,3 +1,5 @@ +// ignore_for_file: no_leading_underscores_for_local_identifiers + part of 'plugin.dart'; /// A data class to store events fired by native code. @@ -36,7 +38,9 @@ class _TrayIconInteraction { } } -typedef _EventCallback = void Function(Offset position)?; +/// A callback run upon interacting with a tray icon. +/// It can use the mouse `position` to spawn menus (for example). +typedef EventCallback = void Function(Offset position)?; /// Gives the [TrayIcon] the ability to react to [WinEvent]s. /// @@ -53,7 +57,7 @@ extension InteractionHandling on TrayIcon { /// /// It would be possible to also expose the [hWnd] and [WinEvent] as well (See [_TrayIconInteraction]). /// {@endtemplate} - set onTap(_EventCallback onTap) => + set onTap(EventCallback onTap) => _manageEventSubscription(WinEvent.select, onTap); /// {@template betrayal.interaction_handling.get} @@ -61,97 +65,97 @@ extension InteractionHandling on TrayIcon { /// /// If `null`, this [WinEvent] can be skipped. /// {@endtemplate} - _EventCallback get onTap => _callbacks[WinEvent.select]; + EventCallback get onTap => _callbacks[WinEvent.select]; /// {@macro betrayal.interaction_handling.set} - set onSecondaryTap(_EventCallback onSecondaryTap) => + set onSecondaryTap(EventCallback onSecondaryTap) => _manageEventSubscription(WinEvent.contextMenu, onSecondaryTap); /// {@macro betrayal.interaction_handling.get} - _EventCallback get onSecondaryTap => _callbacks[WinEvent.contextMenu]; + EventCallback get onSecondaryTap => _callbacks[WinEvent.contextMenu]; /// {@macro betrayal.interaction_handling.set} - set onTapDown(_EventCallback onTapDown) => + set onTapDown(EventCallback onTapDown) => _manageEventSubscription(WinEvent.leftButtonDown, onTapDown); /// {@macro betrayal.interaction_handling.get} - _EventCallback get onTapDown => _callbacks[WinEvent.leftButtonDown]; + EventCallback get onTapDown => _callbacks[WinEvent.leftButtonDown]; /// {@macro betrayal.interaction_handling.set} - set onSecondaryTapDown(_EventCallback onSecondaryTapDown) => + set onSecondaryTapDown(EventCallback onSecondaryTapDown) => _manageEventSubscription(WinEvent.rightButtonDown, onSecondaryTapDown); /// {@macro betrayal.interaction_handling.get} - _EventCallback get onSecondaryTapDown => _callbacks[WinEvent.rightButtonDown]; + EventCallback get onSecondaryTapDown => _callbacks[WinEvent.rightButtonDown]; /// {@macro betrayal.interaction_handling.set} - set onTertiaryTapDown(_EventCallback onTertiaryTapDown) => + set onTertiaryTapDown(EventCallback onTertiaryTapDown) => _manageEventSubscription(WinEvent.middleButtonDown, onTertiaryTapDown); /// {@macro betrayal.interaction_handling.get} - _EventCallback get onTertiaryTapDown => _callbacks[WinEvent.middleButtonDown]; + EventCallback get onTertiaryTapDown => _callbacks[WinEvent.middleButtonDown]; /// {@macro betrayal.interaction_handling.set} - set onTapUp(_EventCallback onTapUp) => + set onTapUp(EventCallback onTapUp) => _manageEventSubscription(WinEvent.leftButtonUp, onTapUp); /// {@macro betrayal.interaction_handling.get} - _EventCallback get onTapUp => _callbacks[WinEvent.leftButtonUp]; + EventCallback get onTapUp => _callbacks[WinEvent.leftButtonUp]; /// {@macro betrayal.interaction_handling.set} - set onSecondaryTapUp(_EventCallback onSecondaryTapUp) => + set onSecondaryTapUp(EventCallback onSecondaryTapUp) => _manageEventSubscription(WinEvent.rightButtonUp, onSecondaryTapUp); /// {@macro betrayal.interaction_handling.get} - _EventCallback get onSecondaryTapUp => _callbacks[WinEvent.rightButtonUp]; + EventCallback get onSecondaryTapUp => _callbacks[WinEvent.rightButtonUp]; /// {@macro betrayal.interaction_handling.set} - set onTertiaryTapUp(_EventCallback onTertiaryTapUp) => + set onTertiaryTapUp(EventCallback onTertiaryTapUp) => _manageEventSubscription(WinEvent.middleButtonUp, onTertiaryTapUp); /// {@macro betrayal.interaction_handling.get} - _EventCallback get onTertiaryTapUp => _callbacks[WinEvent.middleButtonUp]; + EventCallback get onTertiaryTapUp => _callbacks[WinEvent.middleButtonUp]; /// {@macro betrayal.interaction_handling.set} - set onDoubleTap(_EventCallback onDoubleTap) => + set onDoubleTap(EventCallback onDoubleTap) => _manageEventSubscription(WinEvent.select, onDoubleTap); /// {@macro betrayal.interaction_handling.get} - _EventCallback get onDoubleTap => _callbacks[WinEvent.select]; + EventCallback get onDoubleTap => _callbacks[WinEvent.select]; /// {@macro betrayal.interaction_handling.set} - set onSecondaryDoubleTap(_EventCallback onSecondaryDoubleTap) => + set onSecondaryDoubleTap(EventCallback onSecondaryDoubleTap) => _manageEventSubscription( WinEvent.rightButtonDoubleClick, onSecondaryDoubleTap); /// {@macro betrayal.interaction_handling.get} - _EventCallback get onSecondaryDoubleTap => + EventCallback get onSecondaryDoubleTap => _callbacks[WinEvent.rightButtonDoubleClick]; /// {@macro betrayal.interaction_handling.set} - set onTertiaryDoubleTap(_EventCallback onTertiaryDoubleTap) => + set onTertiaryDoubleTap(EventCallback onTertiaryDoubleTap) => _manageEventSubscription( WinEvent.middleButtonDoubleClick, onSecondaryDoubleTap); /// {@macro betrayal.interaction_handling.get} - _EventCallback get onTertiaryDoubleTap => + EventCallback get onTertiaryDoubleTap => _callbacks[WinEvent.middleButtonDoubleClick]; /// {@macro betrayal.interaction_handling.set} - set onPointerMove(_EventCallback onPointerMove) => + set onPointerMove(EventCallback onPointerMove) => _manageEventSubscription(WinEvent.mouseMove, onPointerMove); /// {@macro betrayal.interaction_handling.get} - _EventCallback get onPointerMove => _callbacks[WinEvent.mouseMove]; + EventCallback get onPointerMove => _callbacks[WinEvent.mouseMove]; - set _callbacks(Map _callbacks) { + set _callbacks(Map _callbacks) { _callbacks.forEach(_manageEventSubscription); } - Map get _callbacks => __callbacks; + Map get _callbacks => __callbacks; Future _manageEventSubscription( - WinEvent event, _EventCallback callback) async { + WinEvent event, EventCallback callback) async { _ensureIsActive(); await _makeRealIfNeeded(); final oldCallback = __callbacks[event]; diff --git a/lib/src/widgets.dart b/lib/src/widgets.dart index bfca54d..0d27657 100644 --- a/lib/src/widgets.dart +++ b/lib/src/widgets.dart @@ -40,7 +40,7 @@ class TrayIconWidget extends StatefulWidget { late final TrayIconImageDelegate? _delegate; - late final Map _callbacks; + late final Map _callbacks; /// Manages a [TrayIcon] as a [StatefulWidget]. /// @@ -61,18 +61,18 @@ class TrayIconWidget extends StatefulWidget { this.visible = true, this.addToContext = true, this.tooltip, - _EventCallback onTap, - _EventCallback onSecondaryTap, - _EventCallback onTapDown, - _EventCallback onSecondaryTapDown, - _EventCallback onTertiaryTapDown, - _EventCallback onTapUp, - _EventCallback onSecondaryTapUp, - _EventCallback onTertiaryTapUp, - _EventCallback onDoubleTap, - _EventCallback onSecondaryDoubleTap, - _EventCallback onTertiaryDoubleTap, - _EventCallback onPointerMove, + EventCallback onTap, + EventCallback onSecondaryTap, + EventCallback onTapDown, + EventCallback onSecondaryTapDown, + EventCallback onTertiaryTapDown, + EventCallback onTapUp, + EventCallback onSecondaryTapUp, + EventCallback onTertiaryTapUp, + EventCallback onDoubleTap, + EventCallback onSecondaryDoubleTap, + EventCallback onTertiaryDoubleTap, + EventCallback onPointerMove, TrayIconImageDelegate? imageDelegate, ByteBuffer? imagePixels, String? imageAsset, @@ -141,7 +141,7 @@ class _TrayIconWidgetState extends State { @override Widget build(BuildContext context) => widget.addToContext - ? _TrayIconHeritage(child: widget.child, icon: _icon) + ? _TrayIconHeritage(icon: _icon, child: widget.child) : widget.child; @override diff --git a/pubspec.yaml b/pubspec.yaml index 835210b..6ccdc3c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -9,17 +9,17 @@ issue_tracker: https://github.com/benthillerkus/betrayal/issues documentation: https://github.com/benthillerkus/betrayal/tree/main/example environment: - sdk: ">=2.16.1 <3.0.0" - flutter: ">=2.5.0" + sdk: ">=2.19.0 <3.0.0" + flutter: ">=3.7.0" dependencies: flutter: sdk: flutter - logging: ^1.0.0 - path: ^1.8.0 + logging: ^1.1.1 + path: ^1.8.2 dev_dependencies: - flutter_lints: ">=1.0.0 <3.0.0" + flutter_lints: ^2.0.1 flutter_test: sdk: flutter