From 0bf10eef299b922b5ba64d0a654569148c457daa Mon Sep 17 00:00:00 2001 From: sirily11 Date: Fri, 27 Aug 2021 12:14:06 +0800 Subject: [PATCH] Update android --- .flutter-plugins-dependencies | 2 +- android/app/build.gradle | 4 +- android/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/settings_aar.gradle | 1 + lib/States/ItemProvider.dart | 4 +- .../Home/Detail/SubDetail/PositionDetail.dart | 4 +- lib/pages/Home/Homepage.dart | 4 +- lib/pages/ItemImage/NewImageScreen.dart | 2 +- plugins/menubar/.flutter-plugins-dependencies | 1 - plugins/menubar/.gitignore | 3 - plugins/menubar/LICENSE | 202 ------------- plugins/menubar/analysis_options.yaml | 1 - plugins/menubar/ios/.gitignore | 36 --- plugins/menubar/ios/Classes/MenubarPlugin.h | 4 - plugins/menubar/ios/Classes/MenubarPlugin.m | 6 - plugins/menubar/ios/menubar.podspec | 21 -- plugins/menubar/lib/menubar.dart | 15 - plugins/menubar/lib/src/menu_channel.dart | 285 ------------------ plugins/menubar/lib/src/menu_item.dart | 75 ----- .../menubar/lib/src/set_application_menu.dart | 25 -- plugins/menubar/linux/Makefile | 113 ------- plugins/menubar/linux/menubar_plugin.cc | 235 --------------- plugins/menubar/linux/menubar_plugin.h | 38 --- .../menubar/macos/Classes/FLEMenubarPlugin.h | 30 -- .../menubar/macos/Classes/FLEMenubarPlugin.m | 231 -------------- .../menubar/macos/Classes/MenubarPlugin.swift | 22 -- .../Flutter/GeneratedPluginRegistrant.swift | 12 - .../ephemeral/Flutter-Generated.xcconfig | 7 - .../ephemeral/flutter_export_environment.sh | 8 - plugins/menubar/macos/menubar.podspec | 21 -- plugins/menubar/pubspec.yaml | 20 -- pubspec.yaml | 4 +- 33 files changed, 15 insertions(+), 1425 deletions(-) create mode 100644 android/settings_aar.gradle delete mode 100644 plugins/menubar/.flutter-plugins-dependencies delete mode 100644 plugins/menubar/.gitignore delete mode 100644 plugins/menubar/LICENSE delete mode 100644 plugins/menubar/analysis_options.yaml delete mode 100644 plugins/menubar/ios/.gitignore delete mode 100644 plugins/menubar/ios/Classes/MenubarPlugin.h delete mode 100644 plugins/menubar/ios/Classes/MenubarPlugin.m delete mode 100644 plugins/menubar/ios/menubar.podspec delete mode 100644 plugins/menubar/lib/menubar.dart delete mode 100644 plugins/menubar/lib/src/menu_channel.dart delete mode 100644 plugins/menubar/lib/src/menu_item.dart delete mode 100644 plugins/menubar/lib/src/set_application_menu.dart delete mode 100644 plugins/menubar/linux/Makefile delete mode 100644 plugins/menubar/linux/menubar_plugin.cc delete mode 100644 plugins/menubar/linux/menubar_plugin.h delete mode 100644 plugins/menubar/macos/Classes/FLEMenubarPlugin.h delete mode 100644 plugins/menubar/macos/Classes/FLEMenubarPlugin.m delete mode 100644 plugins/menubar/macos/Classes/MenubarPlugin.swift delete mode 100644 plugins/menubar/macos/Flutter/GeneratedPluginRegistrant.swift delete mode 100644 plugins/menubar/macos/Flutter/ephemeral/Flutter-Generated.xcconfig delete mode 100755 plugins/menubar/macos/Flutter/ephemeral/flutter_export_environment.sh delete mode 100644 plugins/menubar/macos/menubar.podspec delete mode 100644 plugins/menubar/pubspec.yaml diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 6e3a93c..9823fb0 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"barcode_scan","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/barcode_scan-3.0.1/","dependencies":[]},{"name":"camera","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/camera-0.5.8+2/","dependencies":[]},{"name":"disk_space","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/disk_space-0.1.1/","dependencies":[]},{"name":"file_picker","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-3.0.4/","dependencies":[]},{"name":"firebase_core","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.6.0/","dependencies":[]},{"name":"google_maps_flutter","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-2.0.6/","dependencies":[]},{"name":"image_picker","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.8.3+3/","dependencies":[]},{"name":"location","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/location-4.3.0/","dependencies":[]},{"name":"package_info_plus","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.6/","dependencies":[]},{"name":"path_provider","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.2/","dependencies":[]},{"name":"permission_handler","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.1.4+2/","dependencies":[]},{"name":"printing","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/printing-5.5.0/","dependencies":[]},{"name":"share_plus","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/share_plus-2.1.4/","dependencies":[]},{"name":"shared_preferences","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+3/","dependencies":[]},{"name":"sqflite","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.0+4/","dependencies":[]},{"name":"url_launcher","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.9/","dependencies":[]}],"android":[{"name":"barcode_scan","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/barcode_scan-3.0.1/","dependencies":[]},{"name":"camera","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/camera-0.5.8+2/","dependencies":[]},{"name":"disk_space","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/disk_space-0.1.1/","dependencies":[]},{"name":"file_picker","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-3.0.4/","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"firebase_core","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.6.0/","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-2.0.2/","dependencies":[]},{"name":"google_maps_flutter","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-2.0.6/","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"image_picker","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.8.3+3/","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"location","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/location-4.3.0/","dependencies":[]},{"name":"package_info_plus","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.6/","dependencies":[]},{"name":"path_provider","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.2/","dependencies":[]},{"name":"permission_handler","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.1.4+2/","dependencies":[]},{"name":"printing","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/printing-5.5.0/","dependencies":[]},{"name":"share_plus","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/share_plus-2.1.4/","dependencies":[]},{"name":"shared_preferences","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+3/","dependencies":[]},{"name":"sqflite","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.0+4/","dependencies":[]},{"name":"url_launcher","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.9/","dependencies":[]}],"macos":[{"name":"file_selector_macos","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/file_selector_macos-0.0.4+1/","dependencies":[]},{"name":"firebase_core","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.6.0/","dependencies":[]},{"name":"location","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/location-4.3.0/","dependencies":[]},{"name":"package_info_plus_macos","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_macos-1.1.1/","dependencies":[]},{"name":"path_provider_macos","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.2/","dependencies":[]},{"name":"printing","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/printing-5.5.0/","dependencies":[]},{"name":"share_plus_macos","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/share_plus_macos-2.0.2/","dependencies":[]},{"name":"shared_preferences_macos","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+10/","dependencies":[]},{"name":"sqflite","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.0+4/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-2.0.1/","dependencies":[]}],"linux":[{"name":"file_selector_linux","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/file_selector_linux-0.0.2+1/","dependencies":[]},{"name":"path_provider_linux","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0.2/","dependencies":[]},{"name":"printing","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/printing-5.5.0/","dependencies":[]},{"name":"url_launcher_linux","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-2.0.1/","dependencies":[]}],"windows":[{"name":"file_selector_windows","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/file_selector_windows-0.0.2+1/","dependencies":[]},{"name":"path_provider_windows","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.3/","dependencies":[]},{"name":"printing","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/printing-5.5.0/","dependencies":[]},{"name":"url_launcher_windows","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-2.0.2/","dependencies":[]}],"web":[{"name":"file_picker","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-3.0.4/","dependencies":[]},{"name":"file_selector_web","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/file_selector_web-0.8.1+2/","dependencies":[]},{"name":"firebase_core_web","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-1.1.0/","dependencies":[]},{"name":"image_picker_for_web","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker_for_web-2.1.3/","dependencies":[]},{"name":"location_web","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/location_web-3.1.1/","dependencies":[]},{"name":"package_info_plus_web","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_web-1.0.4/","dependencies":[]},{"name":"printing","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/printing-5.5.0/","dependencies":[]},{"name":"share_plus_web","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/share_plus_web-2.0.4/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+7/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.4/","dependencies":[]}]},"dependencyGraph":[{"name":"barcode_scan","dependencies":[]},{"name":"camera","dependencies":[]},{"name":"disk_space","dependencies":[]},{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"file_selector","dependencies":["file_selector_web"]},{"name":"file_selector_linux","dependencies":[]},{"name":"file_selector_macos","dependencies":[]},{"name":"file_selector_web","dependencies":[]},{"name":"file_selector_windows","dependencies":[]},{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"google_maps_flutter","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"image_picker","dependencies":["flutter_plugin_android_lifecycle","image_picker_for_web"]},{"name":"image_picker_for_web","dependencies":[]},{"name":"location","dependencies":["location_web"]},{"name":"location_web","dependencies":[]},{"name":"package_info_plus","dependencies":["package_info_plus_macos","package_info_plus_web"]},{"name":"package_info_plus_macos","dependencies":[]},{"name":"package_info_plus_web","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"printing","dependencies":[]},{"name":"share_plus","dependencies":["share_plus_macos","share_plus_web"]},{"name":"share_plus_macos","dependencies":[]},{"name":"share_plus_web","dependencies":["url_launcher"]},{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2021-08-27 11:22:03.784424","version":"2.2.3"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"barcode_scan","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/barcode_scan-3.0.1/","dependencies":[]},{"name":"camera","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/camera-0.5.8+2/","dependencies":[]},{"name":"disk_space","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/disk_space-0.1.1/","dependencies":[]},{"name":"file_picker","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-3.0.4/","dependencies":[]},{"name":"firebase_core","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.6.0/","dependencies":[]},{"name":"google_maps_flutter","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-2.0.6/","dependencies":[]},{"name":"image_picker","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.8.3+3/","dependencies":[]},{"name":"location","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/location-4.3.0/","dependencies":[]},{"name":"package_info_plus","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.6/","dependencies":[]},{"name":"path_provider","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.2/","dependencies":[]},{"name":"permission_handler","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.1.4+2/","dependencies":[]},{"name":"printing","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/printing-5.5.0/","dependencies":[]},{"name":"share_plus","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/share_plus-2.1.4/","dependencies":[]},{"name":"shared_preferences","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+3/","dependencies":[]},{"name":"sqflite","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.0+4/","dependencies":[]},{"name":"url_launcher","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.9/","dependencies":[]}],"android":[{"name":"barcode_scan","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/barcode_scan-3.0.1/","dependencies":[]},{"name":"camera","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/camera-0.5.8+2/","dependencies":[]},{"name":"disk_space","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/disk_space-0.1.1/","dependencies":[]},{"name":"file_picker","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-3.0.4/","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"firebase_core","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.6.0/","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-2.0.2/","dependencies":[]},{"name":"google_maps_flutter","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-2.0.6/","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"image_picker","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.8.3+3/","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"location","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/location-4.3.0/","dependencies":[]},{"name":"package_info_plus","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.0.6/","dependencies":[]},{"name":"path_provider","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.2/","dependencies":[]},{"name":"permission_handler","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.1.4+2/","dependencies":[]},{"name":"printing","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/printing-5.5.0/","dependencies":[]},{"name":"share_plus","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/share_plus-2.1.4/","dependencies":[]},{"name":"shared_preferences","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+3/","dependencies":[]},{"name":"sqflite","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.0+4/","dependencies":[]},{"name":"url_launcher","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.9/","dependencies":[]}],"macos":[{"name":"file_selector_macos","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/file_selector_macos-0.0.4+1/","dependencies":[]},{"name":"firebase_core","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.6.0/","dependencies":[]},{"name":"location","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/location-4.3.0/","dependencies":[]},{"name":"package_info_plus_macos","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_macos-1.1.1/","dependencies":[]},{"name":"path_provider_macos","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.2/","dependencies":[]},{"name":"printing","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/printing-5.5.0/","dependencies":[]},{"name":"share_plus_macos","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/share_plus_macos-2.0.2/","dependencies":[]},{"name":"shared_preferences_macos","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+10/","dependencies":[]},{"name":"sqflite","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.0+4/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-2.0.1/","dependencies":[]}],"linux":[{"name":"file_selector_linux","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/file_selector_linux-0.0.2+1/","dependencies":[]},{"name":"path_provider_linux","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0.2/","dependencies":[]},{"name":"printing","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/printing-5.5.0/","dependencies":[]},{"name":"url_launcher_linux","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-2.0.1/","dependencies":[]}],"windows":[{"name":"file_selector_windows","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/file_selector_windows-0.0.2+1/","dependencies":[]},{"name":"path_provider_windows","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.3/","dependencies":[]},{"name":"printing","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/printing-5.5.0/","dependencies":[]},{"name":"url_launcher_windows","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-2.0.2/","dependencies":[]}],"web":[{"name":"file_picker","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-3.0.4/","dependencies":[]},{"name":"file_selector_web","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/file_selector_web-0.8.1+2/","dependencies":[]},{"name":"firebase_core_web","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core_web-1.1.0/","dependencies":[]},{"name":"image_picker_for_web","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker_for_web-2.1.3/","dependencies":[]},{"name":"location_web","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/location_web-3.1.1/","dependencies":[]},{"name":"package_info_plus_web","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_web-1.0.4/","dependencies":[]},{"name":"printing","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/printing-5.5.0/","dependencies":[]},{"name":"share_plus_web","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/share_plus_web-2.0.4/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+7/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/liqiwei/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.4/","dependencies":[]}]},"dependencyGraph":[{"name":"barcode_scan","dependencies":[]},{"name":"camera","dependencies":[]},{"name":"disk_space","dependencies":[]},{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"file_selector","dependencies":["file_selector_web"]},{"name":"file_selector_linux","dependencies":[]},{"name":"file_selector_macos","dependencies":[]},{"name":"file_selector_web","dependencies":[]},{"name":"file_selector_windows","dependencies":[]},{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"google_maps_flutter","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"image_picker","dependencies":["flutter_plugin_android_lifecycle","image_picker_for_web"]},{"name":"image_picker_for_web","dependencies":[]},{"name":"location","dependencies":["location_web"]},{"name":"location_web","dependencies":[]},{"name":"package_info_plus","dependencies":["package_info_plus_macos","package_info_plus_web"]},{"name":"package_info_plus_macos","dependencies":[]},{"name":"package_info_plus_web","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"printing","dependencies":[]},{"name":"share_plus","dependencies":["share_plus_macos","share_plus_web"]},{"name":"share_plus_macos","dependencies":[]},{"name":"share_plus_web","dependencies":["url_launcher"]},{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2021-08-27 12:02:23.735776","version":"2.2.3"} \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 880c42b..6f39fdf 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 28 + compileSdkVersion 29 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -39,7 +39,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "sirilee.storage.storage_management_system_mobile" - minSdkVersion 16 + minSdkVersion 26 targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/android/build.gradle b/android/build.gradle index 3100ad2..dc5cdbc 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' + classpath 'com.android.tools.build:gradle:4.0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 296b146..493072b 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/android/settings_aar.gradle b/android/settings_aar.gradle new file mode 100644 index 0000000..e7b4def --- /dev/null +++ b/android/settings_aar.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/lib/States/ItemProvider.dart b/lib/States/ItemProvider.dart index 91de68b..27669dc 100644 --- a/lib/States/ItemProvider.dart +++ b/lib/States/ItemProvider.dart @@ -148,7 +148,7 @@ class ItemProvider with ChangeNotifier { context: context, backgroundColor: Colors.transparent, expand: true, - builder: (context, controller) => SearchListPage( + builder: (context) => SearchListPage( items: items, ), ); @@ -157,7 +157,7 @@ class ItemProvider with ChangeNotifier { context: context, backgroundColor: Colors.transparent, expand: true, - builder: (context, controller) => SearchListPage( + builder: (context) => SearchListPage( items: items, ), ); diff --git a/lib/pages/Home/Detail/SubDetail/PositionDetail.dart b/lib/pages/Home/Detail/SubDetail/PositionDetail.dart index 9e2b580..ce2a84a 100644 --- a/lib/pages/Home/Detail/SubDetail/PositionDetail.dart +++ b/lib/pages/Home/Detail/SubDetail/PositionDetail.dart @@ -131,7 +131,7 @@ class _PositionDetailState extends State { url = await showCupertinoModalBottomSheet( context: context, expand: true, - builder: (context, c) => UploadDialog( + builder: (context) => UploadDialog( image: file, imageDestination: ImageDestination.detailPosition, ), @@ -205,7 +205,7 @@ class _PrintingWidgetState extends State { ), ), actions: [ - FlatButton( + TextButton( onPressed: () async { Navigator.pop(context); }, diff --git a/lib/pages/Home/Homepage.dart b/lib/pages/Home/Homepage.dart index 7eb2ab6..7a61ceb 100644 --- a/lib/pages/Home/Homepage.dart +++ b/lib/pages/Home/Homepage.dart @@ -101,12 +101,12 @@ class HomePageState extends State { try { await CupertinoScaffold.showCupertinoModalBottomSheet( context: context, - builder: (c, s) => CategorySelector(), + builder: (c) => CategorySelector(), ); } catch (err) { showCupertinoModalBottomSheet( context: context, - builder: (c, s) => CategorySelector(), + builder: (c) => CategorySelector(), ); } }, diff --git a/lib/pages/ItemImage/NewImageScreen.dart b/lib/pages/ItemImage/NewImageScreen.dart index 8bb2c9e..a8f87c6 100644 --- a/lib/pages/ItemImage/NewImageScreen.dart +++ b/lib/pages/ItemImage/NewImageScreen.dart @@ -29,7 +29,7 @@ class _ImageScreenState extends State { await showCupertinoModalBottomSheet( context: context, expand: true, - builder: (context, _) => UploadDialog( + builder: (context) => UploadDialog( id: widget.id, image: image, labels: labels, diff --git a/plugins/menubar/.flutter-plugins-dependencies b/plugins/menubar/.flutter-plugins-dependencies deleted file mode 100644 index d6ebd7c..0000000 --- a/plugins/menubar/.flutter-plugins-dependencies +++ /dev/null @@ -1 +0,0 @@ -{"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"menubar","dependencies":[]}]} \ No newline at end of file diff --git a/plugins/menubar/.gitignore b/plugins/menubar/.gitignore deleted file mode 100644 index 53e92cc..0000000 --- a/plugins/menubar/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.packages -.flutter-plugins -pubspec.lock diff --git a/plugins/menubar/LICENSE b/plugins/menubar/LICENSE deleted file mode 100644 index d645695..0000000 --- a/plugins/menubar/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/menubar/analysis_options.yaml b/plugins/menubar/analysis_options.yaml deleted file mode 100644 index f04c6cf..0000000 --- a/plugins/menubar/analysis_options.yaml +++ /dev/null @@ -1 +0,0 @@ -include: ../../analysis_options.yaml diff --git a/plugins/menubar/ios/.gitignore b/plugins/menubar/ios/.gitignore deleted file mode 100644 index 710ec6c..0000000 --- a/plugins/menubar/ios/.gitignore +++ /dev/null @@ -1,36 +0,0 @@ -.idea/ -.vagrant/ -.sconsign.dblite -.svn/ - -.DS_Store -*.swp -profile - -DerivedData/ -build/ -GeneratedPluginRegistrant.h -GeneratedPluginRegistrant.m - -.generated/ - -*.pbxuser -*.mode1v3 -*.mode2v3 -*.perspectivev3 - -!default.pbxuser -!default.mode1v3 -!default.mode2v3 -!default.perspectivev3 - -xcuserdata - -*.moved-aside - -*.pyc -*sync/ -Icon? -.tags* - -/Flutter/Generated.xcconfig diff --git a/plugins/menubar/ios/Classes/MenubarPlugin.h b/plugins/menubar/ios/Classes/MenubarPlugin.h deleted file mode 100644 index c6c2d70..0000000 --- a/plugins/menubar/ios/Classes/MenubarPlugin.h +++ /dev/null @@ -1,4 +0,0 @@ -#import - -@interface MenubarPlugin : NSObject -@end diff --git a/plugins/menubar/ios/Classes/MenubarPlugin.m b/plugins/menubar/ios/Classes/MenubarPlugin.m deleted file mode 100644 index 9a8bd9e..0000000 --- a/plugins/menubar/ios/Classes/MenubarPlugin.m +++ /dev/null @@ -1,6 +0,0 @@ -#import "MenubarPlugin.h" - -@implementation MenubarPlugin -+ (void)registerWithRegistrar:(NSObject*)registrar {} - -@end diff --git a/plugins/menubar/ios/menubar.podspec b/plugins/menubar/ios/menubar.podspec deleted file mode 100644 index 9985c03..0000000 --- a/plugins/menubar/ios/menubar.podspec +++ /dev/null @@ -1,21 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# -Pod::Spec.new do |s| - s.name = 'menubar' - s.version = '0.0.1' - s.summary = 'No-op implementation of menubar desktop plugin to avoid build issues on iOS' - s.description = <<-DESC -temp fake menubar plugin - DESC - s.homepage = 'https://github.com/google/flutter-desktop-embedding/tree/master/plugins/color_panel' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Desktop Embedding Developers' => 'flutter-desktop-embedding-dev@googlegroups.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.dependency 'Flutter' - - s.ios.deployment_target = '8.0' -end - diff --git a/plugins/menubar/lib/menubar.dart b/plugins/menubar/lib/menubar.dart deleted file mode 100644 index 638956b..0000000 --- a/plugins/menubar/lib/menubar.dart +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -export 'src/menu_item.dart'; -export 'src/set_application_menu.dart'; diff --git a/plugins/menubar/lib/src/menu_channel.dart b/plugins/menubar/lib/src/menu_channel.dart deleted file mode 100644 index 05490a0..0000000 --- a/plugins/menubar/lib/src/menu_channel.dart +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -import 'dart:async'; - -import 'package:flutter/services.dart'; -import 'package:flutter/widgets.dart'; - -import 'menu_item.dart'; - -/// Whether or not the menu item is a divider, as a boolean. If true, no other -/// The name of the plugin's platform channel. -const String _kMenuChannelName = 'flutter/menubar'; - -/// The method name to instruct the native plugin to set the menu. -// -/// The argument to this method will be an array of map representations -/// of menus that should be set as top-level menu items. -const String _kMenuSetMethod = 'Menubar.SetMenu'; - -/// The method name for the Dart-side callback called when a menu item is -/// selected. -// -/// The argument to this method must be the ID of the selected menu item, as -/// provided in the kIdKey field in the kMenuSetMethod call. -const String _kMenuItemSelectedCallbackMethod = 'Menubar.SelectedCallback'; - -// Keys for the map representations of menus sent to kMenuSetMethod. - -/// The ID of the menu item, as an integer. If present, this indicates that the -/// menu item should trigger a kMenuItemSelectedCallbackMethod call when -/// selected. -const String _kIdKey = 'id'; - -/// The label that should be displayed for the menu, as a string. -const String _kLabelKey = 'label'; - -/// The string corresponding to the shortcut key equivalent without modifiers. -/// -/// When menu support moves into Flutter itself, this will likely use keyId. -/// That's not useable for this plugin-based prototype however, since keyId is -/// not stable. -const String _kShortcutKeyEquivalent = 'keyEquivalent'; - -/// An alternative to _kShortcutKeyEquivalent for keys that have no string -/// equivalent. Only this or _kShortcutKeyEquivalent should be specified. -/// -/// This is a partial workaround for the lack of keyId discussed above, to -/// handle common shortcut keys that _kShortcutKeyEquivalent can't represent. -/// -/// See _ShortcutSpecialKeys for possible values. -const String _kShortcutSpecialKey = 'specialKey'; - -/// The modifier flags to apply to the shortcut key. -/// -/// The value is an int representing a flag set; see below for possible values. -const String _kShortcutKeyModifiers = 'keyModifiers'; - -/// Whether or not the menu item should be enabled, as a boolean. If not present -/// the defualt is to enabled the item. -const String _kEnabledKey = 'enabled'; - -/// Menu items that should be shown as a submenu of this item, as an array. -const String _kChildrenKey = 'children'; - -/// Whether or not the menu item is a divider, as a boolean. If true, no other -/// keys will be present. -const String _kDividerKey = 'isDivider'; - -// Values for _kShortcutKeyModifiers. -const int _shortcutModifierMeta = 1 << 0; -const int _shortcutModifierShift = 1 << 1; -const int _shortcutModifierAlt = 1 << 2; -const int _shortcutModifierControl = 1 << 3; - -/// Values for _kShortcutSpecialKey. -final _shortcutSpecialKeyValues = { - LogicalKeyboardKey.f1: 1, - LogicalKeyboardKey.f2: 2, - LogicalKeyboardKey.f3: 3, - LogicalKeyboardKey.f4: 4, - LogicalKeyboardKey.f5: 5, - LogicalKeyboardKey.f6: 6, - LogicalKeyboardKey.f7: 7, - LogicalKeyboardKey.f8: 8, - LogicalKeyboardKey.f9: 9, - LogicalKeyboardKey.f10: 10, - LogicalKeyboardKey.f11: 11, - LogicalKeyboardKey.f12: 12, - LogicalKeyboardKey.backspace: 13, - LogicalKeyboardKey.delete: 14, -}; - -/// A singleton object that handles the interaction with the menu bar platform -/// channel. -class MenuChannel { - /// Private constructor. - MenuChannel._() { - _platformChannel.setMethodCallHandler(_callbackHandler); - } - - final MethodChannel _platformChannel = const MethodChannel(_kMenuChannelName); - - /// Map from unique identifiers assigned by this class to the callbacks for - /// those menu items. - final Map _selectionCallbacks = {}; - - /// The ID to use the next time a menu item needs an ID assigned. - int _nextMenuItemId = 1; - - /// Whether or not a call to [_kMenuSetMethod] is outstanding. - /// - /// This is used to drop any menu callbacks that aren't received until - /// after a new call to setMenu, so that clients don't received unexpected - /// stale callbacks. - bool _updateInProgress; - - /// The static instance of the menu channel. - static final MenuChannel instance = new MenuChannel._(); - - /// Sets the native application menu to [menus]. - /// - /// How exactly this is handled is subject to platform interpretation. - /// For instance, special menus that are handled entirely on the native - /// side might be added to the provided menus. - Future setMenu(List menus) async { - try { - _updateInProgress = true; - await _platformChannel.invokeMethod( - _kMenuSetMethod, _channelRepresentationForMenus(menus)); - _updateInProgress = false; - } on PlatformException catch (e) { - print('Platform exception setting menu: ${e.message}'); - } - } - - /// Converts [menus] to a representation that can be sent in the arguments to - /// [_kMenuSetMethod]. - /// - /// As a side-effect, repopulates _selectionCallbacks with a mapping from - /// the IDs assigned to any menu item with a selection handler to the - /// callback that should be triggered. - List _channelRepresentationForMenus(List menus) { - _selectionCallbacks.clear(); - _nextMenuItemId = 1; - - return menus.map(_channelRepresentationForMenuItem).toList(); - } - - /// Returns a representation of [item] suitable for passing over the - /// platform channel to the native plugin. - Map _channelRepresentationForMenuItem( - AbstractMenuItem item) { - final representation = {}; - if (item is MenuDivider) { - representation[_kDividerKey] = true; - } else { - representation[_kLabelKey] = item.label; - if (item is Submenu) { - representation[_kChildrenKey] = - _channelRepresentationForMenu(item.children); - } else if (item is MenuItem) { - if (item.onClicked != null) { - representation[_kIdKey] = _storeMenuCallback(item.onClicked); - } - if (!item.enabled) { - representation[_kEnabledKey] = false; - } - if (item.shortcut != null) { - _addShortcutToRepresentation(item.shortcut, representation); - } - } else { - throw ArgumentError( - 'Unknown AbstractMenuItem type: $item (${item.runtimeType})'); - } - } - return representation; - } - - /// Returns the representation of [menu] suitable for passing over the - /// platform channel to the native plugin. - List _channelRepresentationForMenu(List menu) { - final menuItemRepresentations = []; - // Dividers are only allowed after non-divider items (see ApplicationMenu). - var skipNextDivider = true; - for (final menuItem in menu) { - final isDivider = menuItem is MenuDivider; - if (isDivider && skipNextDivider) { - continue; - } - skipNextDivider = isDivider; - menuItemRepresentations.add(_channelRepresentationForMenuItem(menuItem)); - } - // If the last item is a divider, remove it (see ApplicationMenu). - if (skipNextDivider && menuItemRepresentations.isNotEmpty) { - menuItemRepresentations.removeLast(); - } - return menuItemRepresentations; - } - - /// Populates [channelRepresentation] with the platform channel representation - /// of [shortcut], using [_kShortcutKeyEquivalent], [_kShortcutSpecialKey], - /// and/or [_kShortcutKeyModifiers]. - void _addShortcutToRepresentation( - LogicalKeySet shortcut, Map channelRepresentation) { - var hasNonModifierKey = false; - var modifiers = 0; - for (final key in shortcut.keys) { - if (key == LogicalKeyboardKey.meta) { - modifiers |= _shortcutModifierMeta; - } else if (key == LogicalKeyboardKey.shift) { - modifiers |= _shortcutModifierShift; - } else if (key == LogicalKeyboardKey.alt) { - modifiers |= _shortcutModifierAlt; - } else if (key == LogicalKeyboardKey.control) { - modifiers |= _shortcutModifierControl; - } else { - if (hasNonModifierKey) { - throw ArgumentError('Invalid menu item shortcut: $shortcut\n' - 'Menu items must have exactly one non-modifier key.'); - } - - if (key.keyLabel != null) { - channelRepresentation[_kShortcutKeyEquivalent] = key.keyLabel; - } else { - final specialKey = _shortcutSpecialKeyValues[key]; - if (specialKey == null) { - throw ArgumentError('Unsupported menu shortcut key: $key\n' - 'Please add this key to the special key mapping.'); - } - channelRepresentation[_kShortcutSpecialKey] = specialKey; - } - hasNonModifierKey = true; - } - } - - if (!hasNonModifierKey) { - throw ArgumentError('Invalid menu item shortcut: $shortcut\n' - 'Menu items must have exactly one non-modifier key.'); - } - channelRepresentation[_kShortcutKeyModifiers] = modifiers; - } - - /// Stores [callback] for use plugin callback handling, returning the ID - /// under which it was stored. - /// - /// The returned ID should be attached to the menu so that the native plugin - /// can identify the menu item selected in the callback. - int _storeMenuCallback(MenuSelectedCallback callback) { - final id = _nextMenuItemId++; - _selectionCallbacks[id] = callback; - return id; - } - - /// Mediates between the platform channel callback and the client callback. - Future _callbackHandler(MethodCall methodCall) async { - if (methodCall.method == _kMenuItemSelectedCallbackMethod) { - try { - if (_updateInProgress) { - // Drop stale callbacks. - // TODO: Evaluate whether this works in practice, or if races are - // regular occurences that clients will need to be prepared to - // handle (in which case a more complex ID system will be needed). - print( - 'Warning: Menu selection callback received during menu update.'); - return; - } - final int menuItemId = methodCall.arguments; - _selectionCallbacks[menuItemId](); - } on Exception catch (e, s) { - print('Exception in callback handler: $e\n$s'); - } - } - } -} diff --git a/plugins/menubar/lib/src/menu_item.dart b/plugins/menubar/lib/src/menu_item.dart deleted file mode 100644 index 9409b43..0000000 --- a/plugins/menubar/lib/src/menu_item.dart +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -import 'package:flutter/widgets.dart'; -import 'package:meta/meta.dart'; - -/// A callback provided to [MenuItem] to handle menu selection. -typedef MenuSelectedCallback = void Function(); - -/// The base type for an individual menu item that can be shown in a menu. -abstract class AbstractMenuItem { - /// Creates a new menu item with the give label. - const AbstractMenuItem(this.label); - - /// The displayed label for the menu item. - final String label; -} - -/// A standard menu item, with no submenus. -class MenuItem extends AbstractMenuItem { - /// Creates a new menu item with the given [label] and options. - /// - /// Note that onClicked should generally be set unless [enabled] is false, - /// or the menu item will be selectable but not do anything. - const MenuItem({ - @required String label, - this.shortcut, - this.enabled = true, - this.onClicked, - }) : super(label); - - /// The callback to call whenever the menu item is selected. - final MenuSelectedCallback onClicked; - - /// Whether or not the menu item is enabled. - final bool enabled; - - /// The shortcut/accelerator for the menu item, if any. - /// - /// Note: Currently modifiers have only Left or Right variants, so must be - /// specified with one of those. The actual left/right distinction will be - /// ignored. This part of the API is likely to change in the future. - /// - /// Example: a Save menu item would likely use: - /// LogicalKeySet(LogicalKeyboardKey.meta, LogicalKeyboardKey.keyS) - final LogicalKeySet shortcut; -} - -/// A menu item continaing a submenu. -/// -/// The item itself can't be selected, it just displays the submenu. -class Submenu extends AbstractMenuItem { - /// Creates a new submenu with the given [label] and [children]. - const Submenu({@required String label, @required this.children}) - : super(label); - - /// The menu items contained in the submenu. - final List children; -} - -/// A menu item that serves as a divider, generally drawn as a line. -class MenuDivider extends AbstractMenuItem { - /// Creates a new divider item. - const MenuDivider() : super(null); -} diff --git a/plugins/menubar/lib/src/set_application_menu.dart b/plugins/menubar/lib/src/set_application_menu.dart deleted file mode 100644 index 185c24f..0000000 --- a/plugins/menubar/lib/src/set_application_menu.dart +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -import 'dart:async'; - -import 'menu_channel.dart'; -import 'menu_item.dart'; - -/// Sets the application menu for the app based on the [menuSpec]. -/// -/// Adjacent [MenuDivider]s will be coalesced, leading and/or trailing -/// [MenuDivider]s will be removed. -Future setApplicationMenu(List menuSpec) async { - await MenuChannel.instance.setMenu(menuSpec); -} diff --git a/plugins/menubar/linux/Makefile b/plugins/menubar/linux/Makefile deleted file mode 100644 index a7aedbd..0000000 --- a/plugins/menubar/linux/Makefile +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# The name of the plugin. -# The primary source file is assumed to be $(PLUGIN_NAME).cc, with -# $(PLUGIN_NAME).h as the public header meant for inclusion by the application. -PLUGIN_NAME=menubar_plugin -# Any files other than the plugin class files that need to be compiled. -EXTRA_SOURCES= -# Extra flags (e.g., for library dependencies). -SYSTEM_LIBRARIES=gtk+-3.0 -EXTRA_CXXFLAGS= -EXTRA_CPPFLAGS=-I../../.. \ - $(patsubst -I%,-isystem%,$(shell pkg-config --cflags $(SYSTEM_LIBRARIES))) -EXTRA_LDFLAGS=$(shell pkg-config --libs $(SYSTEM_LIBRARIES)) - -# Default build type. For a release build, set BUILD=release. -# Currently this only sets NDEBUG, which is used to control the flags passed -# to the Flutter engine in the example shell, and not the complation settings -# (e.g., optimization level) of the C++ code. -BUILD=debug - -# Plugins must be provided a populated flutter/ephemeral/ dir. Normally this -# would be the ephemeral directory of the application using the plugin. -ifeq ($(strip $(FLUTTER_EPHEMERAL_DIR)),) -$(error FLUTTER_EPHEMERAL_DIR must be provided) -endif - -# Dependency locations -# Default to building in the plugin directory. -OUT_DIR=$(CURDIR)/../build/linux -# Sharing an OUT_DIR will be common, so use a subdirectory for intermediates. -PLUGIN_OUT_DIR=$(OUT_DIR)/$(PLUGIN_NAME) -OBJ_DIR=$(PLUGIN_OUT_DIR)/obj/$(BUILD) - -# Flutter library -FLUTTER_LIB_NAME=flutter_linux_glfw -FLUTTER_LIB=$(FLUTTER_EPHEMERAL_DIR)/lib$(FLUTTER_LIB_NAME).so - -# Add relevant code from the wrapper library, which is intended to be statically -# built into the plugin. -# Use abspath for the wrapper root, which can contain relative paths; the -# intermediate build files will be based on the source path, which will cause -# issues if they start with one or more '../'s. -WRAPPER_ROOT=$(abspath $(FLUTTER_EPHEMERAL_DIR)/cpp_client_wrapper_glfw) -# TODO: Once JSON codec files are merged, make a PLUGIN_CODEC variable in the -# top section. For now, using JSON codec would require changes here. -WRAPPER_SOURCES= \ - $(WRAPPER_ROOT)/engine_method_result.cc \ - $(WRAPPER_ROOT)/plugin_registrar.cc \ - $(WRAPPER_ROOT)/standard_codec.cc - -# Use abspath for extra sources, which may also contain relative paths (see -# note above about WRAPPER_ROOT). -SOURCES=$(PLUGIN_NAME).cc $(WRAPPER_SOURCES) $(abspath $(EXTRA_SOURCES)) -PUBLIC_HEADER=$(PLUGIN_NAME).h - -WRAPPER_INCLUDE_DIR=$(WRAPPER_ROOT)/include -INCLUDE_DIRS=$(FLUTTER_EPHEMERAL_DIR) $(WRAPPER_INCLUDE_DIR) - -# Build settings -CXX=clang++ -CXXFLAGS.release=-DNDEBUG -CXXFLAGS=-std=c++14 -Wall -Werror -fPIC -fvisibility=hidden \ - -DFLUTTER_PLUGIN_IMPL $(CXXFLAGS.$(BUILD)) $(EXTRA_CXXFLAGS) -CPPFLAGS=$(patsubst %,-I%,$(INCLUDE_DIRS)) $(EXTRA_CPPFLAGS) -LDFLAGS=-shared -L$(FLUTTER_EPHEMERAL_DIR) -l$(FLUTTER_LIB_NAME) $(EXTRA_LDFLAGS) - -# Final output files that will be used by applications. -LIBRARY_OUT=$(OUT_DIR)/lib$(PLUGIN_NAME).so -HEADER_OUT=$(OUT_DIR)/include/$(PUBLIC_HEADER) - -# Intermediate files. -OBJ_FILES=$(SOURCES:%.cc=$(OBJ_DIR)/%.o) -DEPENDENCY_FILES=$(OBJ_FILES:%.o=%.d) - -# Targets - -.PHONY: all -all: $(PLUGIN_NAME) - -.PHONY: $(PLUGIN_NAME) -$(PLUGIN_NAME) : $(LIBRARY_OUT) $(HEADER_OUT) - -$(LIBRARY_OUT): $(OBJ_FILES) - mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(CPPFLAGS) $^ $(LDFLAGS) -o $@ - -$(HEADER_OUT): $(PUBLIC_HEADER) - mkdir -p $(@D) - cp $< $@ - --include $(DEPENDENCY_FILES) - -$(OBJ_DIR)/%.o : %.cc - mkdir -p $(@D) - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -MMD -c $< -o $@ - -.PHONY: clean -clean: - rm -f $(LIBRARY_OUT) $(HEADER_OUT) - rm -rf $(PLUGINOUT_DIR) diff --git a/plugins/menubar/linux/menubar_plugin.cc b/plugins/menubar/linux/menubar_plugin.cc deleted file mode 100644 index 214ce85..0000000 --- a/plugins/menubar/linux/menubar_plugin.cc +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "plugins/menubar/linux/menubar_plugin.h" - -#include -#include - -#include -#include -#include - -static constexpr char kWindowTitle[] = "Flutter Menubar"; - -namespace plugins_menubar { - -namespace { - -using flutter::EncodableMap; -using flutter::EncodableValue; - -// See menu_channel.dart for documentation. -const char kChannelName[] = "flutter/menubar"; -const char kMenuSetMethod[] = "Menubar.SetMenu"; -const char kMenuItemSelectedCallbackMethod[] = "Menubar.SelectedCallback"; -const char kIdKey[] = "id"; -const char kLabelKey[] = "label"; -const char kEnabledKey[] = "enabled"; -const char kChildrenKey[] = "children"; -const char kDividerKey[] = "isDivider"; - -} - -class MenubarPlugin : public flutter::Plugin { - public: - static void RegisterWithRegistrar(flutter::PluginRegistrar *registrar); - - virtual ~MenubarPlugin(); - - private: - // Creates a plugin that communicates on the given channel. - MenubarPlugin( - std::unique_ptr> channel); - - // Called when a method is called on |channel_|; - void HandleMethodCall( - const flutter::MethodCall &method_call, - std::unique_ptr> result); - - // The MethodChannel used for communication with the Flutter engine. - std::unique_ptr> channel_; - - class Menubar; - std::unique_ptr menubar_; -}; - -// static -void MenubarPlugin::RegisterWithRegistrar(flutter::PluginRegistrar *registrar) { - auto channel = std::make_unique>( - registrar->messenger(), kChannelName, - &flutter::StandardMethodCodec::GetInstance()); - auto *channel_pointer = channel.get(); - - // Uses new instead of make_unique due to private constructor. - std::unique_ptr plugin(new MenubarPlugin(std::move(channel))); - - channel_pointer->SetMethodCallHandler( - [plugin_pointer = plugin.get()](const auto &call, auto result) { - plugin_pointer->HandleMethodCall(call, std::move(result)); - }); - - registrar->AddPlugin(std::move(plugin)); -} - -MenubarPlugin::MenubarPlugin( - std::unique_ptr> channel) - : channel_(std::move(channel)) {} - -MenubarPlugin::~MenubarPlugin() {} - -// Class containing the implementation of the Menubar widget. This is currently -// a floating GTK window, separate from the main app. This is not the optimal -// solution. -class MenubarPlugin::Menubar { - public: - explicit Menubar(MenubarPlugin *parent) { - menubar_window_ = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_position(GTK_WINDOW(menubar_window_), GTK_WIN_POS_CENTER); - gtk_window_set_default_size(GTK_WINDOW(menubar_window_), 300, 50); - gtk_window_set_title(GTK_WINDOW(menubar_window_), kWindowTitle); - - GtkWidget *vbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); - gtk_container_add(GTK_CONTAINER(menubar_window_), vbox); - - menubar_ = gtk_menu_bar_new(); - gtk_box_pack_start(GTK_BOX(vbox), menubar_, FALSE, FALSE, 0); - } - virtual ~Menubar() { - if (menubar_window_) { - gtk_widget_destroy(menubar_window_); - gtk_widget_destroy(menubar_); - } - } - - // Gets the top level menubar widget. - GtkWidget *GetRootMenuBar() { return menubar_; } - - // Triggers an action once a menubar item has been selected. - static void MenuItemSelected(GtkWidget *menuItem, gpointer *data) { - auto plugin = reinterpret_cast(data); - - plugin->channel_->InvokeMethod(kMenuItemSelectedCallbackMethod, - std::make_unique(std::stoi( - gtk_widget_get_name(menuItem)))); - } - - // Creates the menu items heirarchy from a given channel representation. - void SetMenuItems(const EncodableValue &root, flutter::Plugin *plugin, - GtkWidget *parentWidget) { - if (root.IsList()) { - // This is the base of the menu representation. It's not a menu item - // itself, so there's no need to create a widget. - for (const auto &menu : root.ListValue()) { - SetMenuItems(menu, plugin, parentWidget); - } - gtk_widget_show_all(menubar_window_); - - return; - } - - // Everything else is a map. - const EncodableMap &menu_info = root.MapValue(); - auto label_it = menu_info.find(EncodableValue(kLabelKey)); - if (label_it != menu_info.end()) { - std::string label = label_it->second.StringValue(); - - auto enabled_it = menu_info.find(EncodableValue(kEnabledKey)); - bool enabled = - enabled_it == menu_info.end() ? true : enabled_it->second.BoolValue(); - - auto children_it = menu_info.find(EncodableValue(kChildrenKey)); - if (children_it != menu_info.end()) { - // A parent menu item. Creates a widget with its label and then build - // the children. - const EncodableValue &children = children_it->second; - auto menu = gtk_menu_new(); - auto menuItem = gtk_menu_item_new_with_label(label.c_str()); - - gtk_widget_set_sensitive(menuItem, enabled); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuItem), menu); - gtk_menu_shell_append(GTK_MENU_SHELL(parentWidget), menuItem); - - SetMenuItems(children, plugin, menu); - } else { - // A leaf menu item. Only these items will have a callback. - auto menuItem = gtk_menu_item_new_with_label(label.c_str()); - gtk_widget_set_sensitive(menuItem, enabled); - - auto id_it = menu_info.find(EncodableValue(kIdKey)); - if (id_it != menu_info.end()) { - std::string idString = std::to_string(id_it->second.IntValue()); - gtk_widget_set_name(menuItem, idString.c_str()); - } - g_signal_connect(G_OBJECT(menuItem), "activate", - G_CALLBACK(MenuItemSelected), plugin); - gtk_menu_shell_append(GTK_MENU_SHELL(parentWidget), menuItem); - } - } - - auto divider_it = menu_info.find(EncodableValue(kDividerKey)); - if (divider_it != menu_info.end() && divider_it->second.BoolValue()) { - auto separator = gtk_separator_menu_item_new(); - gtk_menu_shell_append(GTK_MENU_SHELL(parentWidget), separator); - } - gtk_widget_show_all(menubar_window_); - } - - // Removes all items from the menubar. - void ClearMenuItems() { - GList *children, *iter; - - children = gtk_container_get_children(GTK_CONTAINER(menubar_)); - for (iter = children; iter != NULL; iter = g_list_next(iter)) { - gtk_widget_destroy(GTK_WIDGET(iter->data)); - } - g_list_free(children); - } - - protected: - GtkWidget *menubar_window_; - GtkWidget *menubar_; -}; - -void MenubarPlugin::HandleMethodCall( - const flutter::MethodCall &method_call, - std::unique_ptr> result) { - if (method_call.method_name().compare(kMenuSetMethod) == 0) { - if (!method_call.arguments() || method_call.arguments()->IsNull()) { - result->Error("Bad Arguments", "Null menu bar arguments received"); - return; - } - - if (menubar_ == nullptr) { - menubar_ = std::make_unique(this); - } - // The menubar will be redrawn after every interaction. Clear items to avoid - // duplication. - menubar_->ClearMenuItems(); - menubar_->SetMenuItems(*method_call.arguments(), this, - menubar_->GetRootMenuBar()); - result->Success(); - } else { - result->NotImplemented(); - } -} - -} // namespace plugins_menubar - -void MenubarPluginRegisterWithRegistrar(FlutterDesktopPluginRegistrarRef registrar) { - // The plugin registrar owns the plugin, registered callbacks, etc., so must - // remain valid for the life of the application. - static auto *plugin_registrar = new flutter::PluginRegistrar(registrar); - plugins_menubar::MenubarPlugin::RegisterWithRegistrar(plugin_registrar); -} diff --git a/plugins/menubar/linux/menubar_plugin.h b/plugins/menubar/linux/menubar_plugin.h deleted file mode 100644 index eb9d3ab..0000000 --- a/plugins/menubar/linux/menubar_plugin.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -#ifndef PLUGINS_MENUBAR_LINUX_MENUBAR_PLUGIN_H_ -#define PLUGINS_MENUBAR_LINUX_MENUBAR_PLUGIN_H_ - -// A plugin to control a native menubar. - -#include - -#ifdef FLUTTER_PLUGIN_IMPL -#define FLUTTER_PLUGIN_EXPORT __attribute__((visibility("default"))) -#else -#define FLUTTER_PLUGIN_EXPORT -#endif - -#if defined(__cplusplus) -extern "C" { -#endif - -FLUTTER_PLUGIN_EXPORT void MenubarPluginRegisterWithRegistrar( - FlutterDesktopPluginRegistrarRef registrar); - -#if defined(__cplusplus) -} // extern "C" -#endif - -#endif // PLUGINS_MENUBAR_LINUX_MENUBAR_PLUGIN_H_ diff --git a/plugins/menubar/macos/Classes/FLEMenubarPlugin.h b/plugins/menubar/macos/Classes/FLEMenubarPlugin.h deleted file mode 100644 index d549696..0000000 --- a/plugins/menubar/macos/Classes/FLEMenubarPlugin.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import - -#import - -/** - * A Flutter plugin to control the native menu bar. - */ -@interface FLEMenubarPlugin : NSObject - -/** - * The menu item that Flutter-provided menus should be inserted after. If unset, Flutter-provided - * menus will be inserted after the application menu (i.e., starting at index 1). - */ -@property(nonatomic) NSMenuItem *insertAfterMenuItem; - -@end diff --git a/plugins/menubar/macos/Classes/FLEMenubarPlugin.m b/plugins/menubar/macos/Classes/FLEMenubarPlugin.m deleted file mode 100644 index 119c58e..0000000 --- a/plugins/menubar/macos/Classes/FLEMenubarPlugin.m +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "FLEMenubarPlugin.h" - -// See menu_channel.dart for documentation. -static NSString *const kChannelName = @"flutter/menubar"; -static NSString *const kMenuSetMethod = @"Menubar.SetMenu"; -static NSString *const kMenuItemSelectedCallbackMethod = @"Menubar.SelectedCallback"; -static NSString *const kIdKey = @"id"; -static NSString *const kLabelKey = @"label"; -static NSString *const kShortcutKeyEquivalent = @"keyEquivalent"; -static NSString *const kShortcutSpecialKey = @"specialKey"; -static NSString *const kShortcutKeyModifiers = @"keyModifiers"; -static NSString *const kEnabledKey = @"enabled"; -static NSString *const kChildrenKey = @"children"; -static NSString *const kDividerKey = @"isDivider"; - -static const int kFlutterShortcutModifierMeta = 1 << 0; -static const int kFlutterShortcutModifierShift = 1 << 1; -static const int kFlutterShortcutModifierAlt = 1 << 2; -static const int kFlutterShortcutModifierControl = 1 << 3; - -// Returns the string used by NSMenuItem for the given special key. -// See _shortcutSpecialKeyValues in menu_channel.dart for values. -static NSString *KeyEquivalentCharacterForSpecialKey(int specialKey) { - unichar character; - switch (specialKey) { - case 1: - character = NSF1FunctionKey; - break; - case 2: - character = NSF2FunctionKey; - break; - case 3: - character = NSF3FunctionKey; - break; - case 4: - character = NSF4FunctionKey; - break; - case 5: - character = NSF5FunctionKey; - break; - case 6: - character = NSF6FunctionKey; - break; - case 7: - character = NSF7FunctionKey; - break; - case 8: - character = NSF8FunctionKey; - break; - case 9: - character = NSF9FunctionKey; - break; - case 10: - character = NSF10FunctionKey; - break; - case 11: - character = NSF11FunctionKey; - break; - case 12: - character = NSF12FunctionKey; - break; - case 13: - character = NSBackspaceCharacter; - break; - case 14: - character = NSDeleteCharacter; - break; - default: - return nil; - } - return [NSString stringWithCharacters:&character length:1]; -} - -// Returns the NSEventModifierFlags of |modifiers|, a value from kShortcutKeyModifiers. -static NSEventModifierFlags KeyEquivalentModifierMaskForModifiers(NSNumber *modifiers) { - int flutterModifierFlags = modifiers.intValue; - NSEventModifierFlags flags = 0; - if (flutterModifierFlags & kFlutterShortcutModifierMeta) flags |= NSEventModifierFlagCommand; - if (flutterModifierFlags & kFlutterShortcutModifierShift) flags |= NSEventModifierFlagShift; - if (flutterModifierFlags & kFlutterShortcutModifierAlt) flags |= NSEventModifierFlagOption; - if (flutterModifierFlags & kFlutterShortcutModifierControl) flags |= NSEventModifierFlagControl; - return flags; -} - -@implementation FLEMenubarPlugin { - // The channel used to communicate with Flutter. - FlutterMethodChannel *_channel; -} - -- (instancetype)initWithChannel:(FlutterMethodChannel *)channel { - self = [super init]; - if (self) { - _channel = channel; - } - return self; -} - -/** - * Removes any top-level menus added by this plugin. - */ -- (void)removeFlutterMenus { - NSMenu *mainMenu = NSApp.mainMenu; - // Remove in reverse order to simplify iteration while removing. - for (NSInteger i = mainMenu.numberOfItems - 1; i >= 0; --i) { - if ([mainMenu itemAtIndex:i].representedObject == self) { - [mainMenu removeItemAtIndex:i]; - } - } -} - -/** - * Returns the index in the application's mainMenu where Flutter menu items should be inserted. - */ -- (NSInteger)menuInsertionIndex { - NSMenu *mainMenu = NSApp.mainMenu; - NSInteger index = self.insertAfterMenuItem ? [mainMenu indexOfItem:self.insertAfterMenuItem] : -1; - // If there's no (valid) insert-after, insert after the application menu at index zero. - if (index == -1) { - index = 0; - } - return index + 1; -} - -/** - * Removes an Flutter menu items that were previously added, then builds and adds new top-level menu - * items constructed from |representation|. - */ -- (void)rebuildFlutterMenusFromRepresentation:(NSArray *)representation { - [self removeFlutterMenus]; - NSMenu *mainMenu = NSApp.mainMenu; - NSInteger insertionIndex = [self menuInsertionIndex]; - for (NSDictionary *item in representation.reverseObjectEnumerator) { - NSMenuItem *menuItem = [self menuItemFromFlutterRepresentation:item]; - menuItem.representedObject = self; - [mainMenu insertItem:menuItem atIndex:insertionIndex]; - } -} - -/** - * Constructs and returns an NSMenuItem corresponding to the item in |representation|, including - * recursively creating children if it has a submenu. - */ -- (NSMenuItem *)menuItemFromFlutterRepresentation:(NSDictionary *)representation { - if (representation[kDividerKey]) { - return [NSMenuItem separatorItem]; - } else { - NSString *title = representation[kLabelKey]; - NSNumber *boxedID = representation[kIdKey]; - - NSString *keyEquivalent = nil; - if (representation[kShortcutKeyEquivalent]) { - keyEquivalent = representation[kShortcutKeyEquivalent]; - } else if (representation[kShortcutSpecialKey]) { - int specialKey = ((NSNumber *)representation[kShortcutSpecialKey]).intValue; - keyEquivalent = KeyEquivalentCharacterForSpecialKey(specialKey); - } - - SEL action = (boxedID ? @selector(flutterMenuItemSelected:) : NULL); - NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:title - action:action - keyEquivalent:(keyEquivalent ?: @"")]; - if (keyEquivalent) { - item.keyEquivalentModifierMask = - KeyEquivalentModifierMaskForModifiers(representation[kShortcutKeyModifiers]); - } - if (boxedID) { - item.tag = boxedID.intValue; - item.target = self; - } - NSNumber *enabled = representation[kEnabledKey]; - if (enabled) { - item.enabled = enabled.boolValue; - } - - NSArray *children = representation[kChildrenKey]; - if (children) { - NSMenu *submenu = [[NSMenu alloc] initWithTitle:title]; - submenu.autoenablesItems = NO; - for (NSDictionary *child in children) { - [submenu addItem:[self menuItemFromFlutterRepresentation:child]]; - } - item.submenu = submenu; - } - return item; - } -} - -/** - * Invokes kMenuItemSelectedCallbackMethod with the senders ID. - * - * Used as the callback for all Flutter-created menu items that have IDs. - */ -- (void)flutterMenuItemSelected:(id)sender { - NSMenuItem *item = sender; - [_channel invokeMethod:kMenuItemSelectedCallbackMethod arguments:@(item.tag)]; -} - -#pragma FlutterPlugin implementation - -+ (void)registerWithRegistrar:(id)registrar { - FlutterMethodChannel *channel = [FlutterMethodChannel methodChannelWithName:kChannelName - binaryMessenger:registrar.messenger]; - FLEMenubarPlugin *instance = [[FLEMenubarPlugin alloc] initWithChannel:channel]; - [registrar addMethodCallDelegate:instance channel:channel]; -} - -- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { - if ([call.method isEqualToString:kMenuSetMethod]) { - NSArray *menus = call.arguments; - [self rebuildFlutterMenusFromRepresentation:menus]; - result(nil); - } else { - result(FlutterMethodNotImplemented); - } -} - -@end diff --git a/plugins/menubar/macos/Classes/MenubarPlugin.swift b/plugins/menubar/macos/Classes/MenubarPlugin.swift deleted file mode 100644 index 2b26db3..0000000 --- a/plugins/menubar/macos/Classes/MenubarPlugin.swift +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import FlutterMacOS -import Foundation - -public class MenubarPlugin: NSObject, FlutterPlugin { - public static func register(with registrar: FlutterPluginRegistrar) { - FLEMenubarPlugin.register(with: registrar) - } -} diff --git a/plugins/menubar/macos/Flutter/GeneratedPluginRegistrant.swift b/plugins/menubar/macos/Flutter/GeneratedPluginRegistrant.swift deleted file mode 100644 index 338cfea..0000000 --- a/plugins/menubar/macos/Flutter/GeneratedPluginRegistrant.swift +++ /dev/null @@ -1,12 +0,0 @@ -// -// Generated file. Do not edit. -// - -import FlutterMacOS -import Foundation - -import menubar - -func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - MenubarPlugin.register(with: registry.registrar(forPlugin: "MenubarPlugin")) -} diff --git a/plugins/menubar/macos/Flutter/ephemeral/Flutter-Generated.xcconfig b/plugins/menubar/macos/Flutter/ephemeral/Flutter-Generated.xcconfig deleted file mode 100644 index e3b4e13..0000000 --- a/plugins/menubar/macos/Flutter/ephemeral/Flutter-Generated.xcconfig +++ /dev/null @@ -1,7 +0,0 @@ -// This is a generated file; do not edit or check into version control. -FLUTTER_ROOT=/Users/liqiwei/Documents/flutter -FLUTTER_APPLICATION_PATH=/Users/liqiwei/Desktop/projects/django_nas_mobile/plugins/menubar -FLUTTER_BUILD_DIR=build -FLUTTER_FRAMEWORK_DIR=/Users/liqiwei/Documents/flutter/bin/cache/artifacts/engine/darwin-x64 -FLUTTER_BUILD_NAME=0.0.1 -FLUTTER_BUILD_NUMBER=0.0.1 diff --git a/plugins/menubar/macos/Flutter/ephemeral/flutter_export_environment.sh b/plugins/menubar/macos/Flutter/ephemeral/flutter_export_environment.sh deleted file mode 100755 index b5e8b4f..0000000 --- a/plugins/menubar/macos/Flutter/ephemeral/flutter_export_environment.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=/Users/liqiwei/Documents/flutter" -export "FLUTTER_APPLICATION_PATH=/Users/liqiwei/Desktop/projects/django_nas_mobile/plugins/menubar" -export "FLUTTER_BUILD_DIR=build" -export "FLUTTER_FRAMEWORK_DIR=/Users/liqiwei/Documents/flutter/bin/cache/artifacts/engine/darwin-x64" -export "FLUTTER_BUILD_NAME=0.0.1" -export "FLUTTER_BUILD_NUMBER=0.0.1" diff --git a/plugins/menubar/macos/menubar.podspec b/plugins/menubar/macos/menubar.podspec deleted file mode 100644 index dff6d5e..0000000 --- a/plugins/menubar/macos/menubar.podspec +++ /dev/null @@ -1,21 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# -Pod::Spec.new do |s| - s.name = 'menubar' - s.version = '0.0.2' - s.summary = 'Provides the ability to add menubar items with Dart callbacks.' - s.description = <<-DESC -Provides the ability to add menubar items with Dart callbacks. - DESC - s.homepage = 'https://github.com/google/flutter-desktop-embedding/tree/master/plugins/menubar' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Desktop Embedding Developers' => 'flutter-desktop-embedding-dev@googlegroups.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.dependency 'FlutterMacOS' - - s.platform = :osx - s.osx.deployment_target = '10.11' -end - diff --git a/plugins/menubar/pubspec.yaml b/plugins/menubar/pubspec.yaml deleted file mode 100644 index e7b9ebb..0000000 --- a/plugins/menubar/pubspec.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: menubar -description: Provides the ability to add native menubar items with Dart callbacks. -version: 0.0.1 -author: Flutter Desktop Embedding Developers -homepage: https://github.com/google/flutter-desktop-embedding/tree/master/plugins/menubar - -flutter: - plugin: - platforms: - linux: - pluginClass: MenubarPlugin - macos: - pluginClass: MenubarPlugin - -environment: - sdk: ">=2.1.0 <3.0.0" - -dependencies: - flutter: - sdk: flutter diff --git a/pubspec.yaml b/pubspec.yaml index 397c95c..0dfd60d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -23,7 +23,7 @@ dependencies: sdk: flutter provider: ^4.1.3 carousel_slider: ^1.3.0 - flutter_slidable: "^0.5.3" + flutter_slidable: "^0.6.0" sliding_up_panel: ^1.0.2 http: ^0.13.3 json_annotation: ^2.0.0 @@ -39,7 +39,7 @@ dependencies: google_maps_flutter: ^2.0.6 image_picker: ^0.8.3+3 flutter_staggered_grid_view: ^0.3.0 - modal_bottom_sheet: ^0.1.6+1 + modal_bottom_sheet: ^2.0.0 printing: ^5.5.0 numberpicker: ^1.1.0 firebase_core: ^1.6.0