From 86bae152c0262ce8012a50109d54f0f475585680 Mon Sep 17 00:00:00 2001 From: LiJianying Date: Thu, 12 May 2022 09:54:07 +0800 Subject: [PATCH] v0.1.6 --- CHANGELOG.md | 6 ++++- README-ZH.md | 16 +++++++++--- README.md | 13 +++++++--- example/lib/pages/home.dart | 4 +-- example/linux/flutter/generated_plugins.cmake | 8 ++++++ example/pubspec.lock | 25 +++++++------------ .../windows/flutter/generated_plugins.cmake | 8 ++++++ linux/CMakeLists.txt | 2 +- pubspec.lock | 23 ++++++----------- 9 files changed, 63 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6451314..7968c70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## 0.1.6 -* [macos] Add `setTitle` method. + +* Support Flutter 3.0 +* [macos] Implemented `setTitle` method. +* [linux] Implemented `setTitle` method. #15 +* [linux] Fix build on Ubuntu 22.04 #16 #17 ## 0.1.5 diff --git a/README-ZH.md b/README-ZH.md index 0368ea0..5fb7dee 100644 --- a/README-ZH.md +++ b/README-ZH.md @@ -8,7 +8,7 @@ [discord-image]: https://img.shields.io/discord/884679008049037342.svg [discord-url]: https://discord.gg/zPa6EZ2jqb -这个插件允许 Flutter **桌面** 应用定义系统托盘。 +这个插件允许 Flutter 桌面应用定义系统托盘。 --- @@ -54,7 +54,7 @@ ```yaml dependencies: - tray_manager: ^0.1.5 + tray_manager: ^0.1.6 ``` 或 @@ -69,10 +69,16 @@ dependencies: #### Linux requirements -- `appindicator3-0.1` +- `ayatana-appindicator3-0.1` or `appindicator3-0.1` 运行以下命令 +``` +sudo apt-get install libayatana-appindicator3-dev +``` + +或 + ``` sudo apt-get install appindicator3-0.1 libappindicator3-dev ``` @@ -80,6 +86,7 @@ sudo apt-get install appindicator3-0.1 libappindicator3-dev ### 用法 ```dart +import 'package:flutter/material.dart' hide MenuItem; import 'package:tray_manager/tray_manager.dart'; await trayManager.setIcon( @@ -139,7 +146,8 @@ class _HomePageState extends State with TrayListener { @override void onTrayIconMouseDown() { - // do something + // do something, for example pop up the menu + trayManager.popUpContextMenu(); } @override diff --git a/README.md b/README.md index 1970041..4d09df0 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [discord-image]: https://img.shields.io/discord/884679008049037342.svg [discord-url]: https://discord.gg/zPa6EZ2jqb -This plugin allows Flutter **desktop** apps to defines system tray. +This plugin allows Flutter desktop apps to defines system tray. --- @@ -54,7 +54,7 @@ Add this to your package's pubspec.yaml file: ```yaml dependencies: - tray_manager: ^0.1.5 + tray_manager: ^0.1.6 ``` Or @@ -69,10 +69,16 @@ dependencies: #### Linux requirements -- `appindicator3-0.1` +- `ayatana-appindicator3-0.1` or `appindicator3-0.1` Run the following command +``` +sudo apt-get install libayatana-appindicator3-dev +``` + +Or + ``` sudo apt-get install appindicator3-0.1 libappindicator3-dev ``` @@ -80,6 +86,7 @@ sudo apt-get install appindicator3-0.1 libappindicator3-dev ### Usage ```dart +import 'package:flutter/material.dart' hide MenuItem; import 'package:tray_manager/tray_manager.dart'; await trayManager.setIcon( diff --git a/example/lib/pages/home.dart b/example/lib/pages/home.dart index 72445ea..cd1ec22 100644 --- a/example/lib/pages/home.dart +++ b/example/lib/pages/home.dart @@ -2,8 +2,8 @@ import 'dart:async'; import 'dart:io'; import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; +import 'package:flutter/cupertino.dart' hide MenuItem; +import 'package:flutter/material.dart' hide MenuItem; import 'package:preference_list/preference_list.dart'; import 'package:tray_manager/tray_manager.dart'; diff --git a/example/linux/flutter/generated_plugins.cmake b/example/linux/flutter/generated_plugins.cmake index 19564cd..a537051 100644 --- a/example/linux/flutter/generated_plugins.cmake +++ b/example/linux/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST tray_manager ) +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}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/example/pubspec.lock b/example/pubspec.lock index 41af7a1..77079cd 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -49,7 +49,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" cupertino_icons: dependency: "direct main" description: @@ -63,7 +63,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -87,7 +87,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" menu_base: dependency: transitive description: @@ -108,7 +108,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" preference_list: dependency: "direct main" description: @@ -134,7 +134,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -169,28 +169,21 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" tray_manager: dependency: "direct main" description: path: ".." relative: true source: path - version: "0.1.5" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.1.6" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-0 <3.0.0" flutter: ">=1.20.0" diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake index be03547..6b23a5a 100644 --- a/example/windows/flutter/generated_plugins.cmake +++ b/example/windows/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST tray_manager ) +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/linux/CMakeLists.txt b/linux/CMakeLists.txt index c2bec00..f6850e0 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -32,7 +32,7 @@ else() message( FATAL_ERROR "\n" - "The `tray_manager` package requires appindicator3-0.1. See https://github.com/leanflutter/tray_manager#linux-requirements" + "The `tray_manager` package requires ayatana-appindicator3-0.1 or appindicator3-0.1. See https://github.com/leanflutter/tray_manager#linux-requirements" ) endif() diff --git a/pubspec.lock b/pubspec.lock index eb4435c..bc257f0 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -42,14 +42,14 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -73,7 +73,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" menu_base: dependency: "direct main" description: @@ -94,7 +94,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" shortid: dependency: "direct main" description: @@ -113,7 +113,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -148,21 +148,14 @@ packages: name: test_api url: "https://pub.dartlang.org" 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.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-0 <3.0.0" flutter: ">=1.20.0"