diff --git a/LICENSE b/LICENSE index ef6ab69..0983ce2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 LiJianying +Copyright (c) 2023-2024 LiJianying Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README-ZH.md b/README-ZH.md index 41b7204..6caf89a 100644 --- a/README-ZH.md +++ b/README-ZH.md @@ -47,7 +47,7 @@ ```yaml dependencies: - shortcut_menu_extender: ^0.1.0 + shortcut_menu_extender: ^0.1.1 ``` ### 用法 diff --git a/README.md b/README.md index 7d62088..d2cb80e 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Add this to your package's pubspec.yaml file: ```yaml dependencies: - shortcut_menu_extender: ^0.1.0 + shortcut_menu_extender: ^0.1.1 ``` ### Usage diff --git a/analysis_options.yaml b/analysis_options.yaml deleted file mode 100644 index ad2b29d..0000000 --- a/analysis_options.yaml +++ /dev/null @@ -1,222 +0,0 @@ -linter: - rules: - ## Error Rules - - always_use_package_imports - # - avoid_dynamic_calls - - avoid_empty_else - # - avoid_print - - avoid_relative_lib_imports - # - avoid_returning_null_for_future - # - avoid_slow_async_io - # - avoid_type_to_string - - avoid_types_as_parameter_names - # - avoid_web_libraries_in_flutter - # - cancel_subscriptions - # - close_sinks - # - collection_methods_unrelated_type - # - comment_references - - control_flow_in_finally - # - diagnostic_describe_all_properties - # - discarded_futures - - empty_statements - - hash_and_equals - # - invariant_booleans - - iterable_contains_unrelated_type - - list_remove_unrelated_type - # - literal_only_boolean_expressions - # - no_adjacent_strings_in_list - - no_duplicate_case_values - # - no_logic_in_create_state - # - prefer_relative_imports - - prefer_void_to_null - # - test_types_in_equals - # - throw_in_finally - # - unnecessary_statements - - unrelated_type_equality_checks - # - unsafe_html - # - use_build_context_synchronously - # - use_key_in_widget_constructors - - valid_regexps - ## Style rules - # - always_declare_return_types - # - always_put_control_body_on_new_line - # - always_put_required_named_parameters_first - # - always_specify_types - - annotate_overrides - # - avoid_annotating_with_dynamic - # - avoid_as - # - avoid_bool_literals_in_conditional_expressions - # - avoid_catches_without_on_clauses - # - avoid_catching_errors - # - avoid_classes_with_only_static_members - # - avoid_double_and_int_checks - # - avoid_equals_and_hash_code_on_mutable_classes - # - avoid_escaping_inner_quotes - # - avoid_field_initializers_in_const_classes - # - avoid_final_parameters - - avoid_function_literals_in_foreach_calls - # - avoid_implementing_value_types - - avoid_init_to_null - # - avoid_js_rounded_ints - # - avoid_multiple_declarations_per_line - - avoid_null_checks_in_equality_operators - # - avoid_positional_boolean_parameters - # - avoid_private_typedef_functions - # - avoid_redundant_argument_values - - avoid_renaming_method_parameters - - avoid_return_types_on_setters - # - avoid_returning_null - - avoid_returning_null_for_void - # - avoid_returning_this - # - avoid_setters_without_getters - - avoid_shadowing_type_parameters - - avoid_single_cascade_in_expression_statements - # - avoid_types_on_closure_parameters - # - avoid_unnecessary_containers - # - avoid_unused_constructor_parameters - # - avoid_void_async - - await_only_futures - - camel_case_extensions - - camel_case_types - # - cascade_invocations - # - cast_nullable_to_non_nullable - # - combinators_ordering - # - conditional_uri_does_not_exist - # - constant_identifier_names - - curly_braces_in_flow_control_structures - # - dangling_library_doc_comments - # - deprecated_consistency - - directives_ordering - # - do_not_use_environment - - empty_catches - - empty_constructor_bodies - # - enable_null_safety - - eol_at_end_of_file - - exhaustive_cases - - file_names - - flutter_style_todos - - implementation_imports - # - implicit_call_tearoffs - # - join_return_with_assignment - # - leading_newlines_in_multiline_strings - # - library_annotations - - library_names - - library_prefixes - - library_private_types_in_public_api - # - lines_longer_than_80_chars - # - missing_whitespace_between_adjacent_strings - # - no_default_cases - - no_leading_underscores_for_library_prefixes - - no_leading_underscores_for_local_identifiers - # - no_runtimeType_toString - - non_constant_identifier_names - # - noop_primitive_operations - - null_check_on_nullable_type_parameter - - null_closures - # - omit_local_variable_types - # - one_member_abstracts - # - only_throw_errors - - overridden_fields - # - package_api_docs - - package_prefixed_library_names - # - parameter_assignments - - prefer_adjacent_string_concatenation - # - prefer_asserts_in_initializer_lists - # - prefer_asserts_with_message - # - prefer_bool_in_asserts - - prefer_collection_literals - - prefer_conditional_assignment - # - prefer_const_constructors - # - prefer_const_constructors_in_immutables - # - prefer_const_declarations - # - prefer_const_literals_to_create_immutables - # - prefer_constructors_over_static_methods - - prefer_contains - # - prefer_double_quotes - # - prefer_expression_function_bodies - - prefer_final_fields - # - prefer_final_in_for_each - # - prefer_final_locals - # - prefer_final_parameters - - prefer_for_elements_to_map_fromIterable - # - prefer_foreach - - prefer_function_declarations_over_variables - - prefer_generic_function_type_aliases - # - prefer_if_elements_to_conditional_expressions - - prefer_if_null_operators - - prefer_initializing_formals - - prefer_inlined_adds - # - prefer_int_literals - - prefer_interpolation_to_compose_strings - - prefer_is_empty - - prefer_is_not_empty - - prefer_is_not_operator - - prefer_iterable_whereType - # - prefer_mixin - - prefer_null_aware_method_calls - - prefer_null_aware_operators - - prefer_single_quotes - - prefer_spread_collections - - prefer_typing_uninitialized_variables - - provide_deprecation_message - # - public_member_api_docs - - recursive_getters - # - require_trailing_commas - # - sized_box_for_whitespace - # - sized_box_shrink_expand - - slash_for_doc_comments - # - sort_child_properties_last - - sort_constructors_first - - sort_unnamed_constructors_first - # - super_goes_last - # - tighten_type_of_initializing_formals - # - type_annotate_public_apis - - type_init_formals - # - unawaited_futures - # - unnecessary_await_in_return - - unnecessary_brace_in_string_interps - # - unnecessary_breaks - - unnecessary_const - - unnecessary_constructor_name - # - unnecessary_final - - unnecessary_getters_setters - # - unnecessary_lambdas - - unnecessary_late - # - unnecessary_library_directive - - unnecessary_new - - unnecessary_null_aware_assignments - # - unnecessary_null_aware_operator_on_extension_on_nullable - # - unnecessary_null_checks - - unnecessary_null_in_if_null_operators - - unnecessary_nullable_for_final_variable_declarations - - unnecessary_overrides - # - unnecessary_parenthesis - # - unnecessary_raw_strings - - unnecessary_string_escapes - - unnecessary_string_interpolations - - unnecessary_this - # - unnecessary_to_list_in_spreads - # - unreachable_from_main - # - use_colored_box - # - use_decorated_box - # - use_enums - # - use_full_hex_values_for_flutter_colors - - use_function_type_syntax_for_parameters - # - use_if_null_to_convert_nulls_to_bools - # - use_is_even_rather_than_modulo - # - use_late_for_private_fields_and_variables - # - use_named_constants - # - use_raw_strings - - use_rethrow_when_possible - # - use_setters_to_change_properties - # - use_string_buffers - # - use_string_in_part_of_directives - # - use_super_parameters - # - use_test_throws_matchers - # - use_to_and_as_if_applicable - - void_checks - ## Pub rules - - depend_on_referenced_packages - - package_names - # - secure_pubspec_urls - - sort_pub_dependencies diff --git a/packages/shortcut_menu_extender/CHANGELOG.md b/packages/shortcut_menu_extender/CHANGELOG.md index 4793b26..4603ef3 100644 --- a/packages/shortcut_menu_extender/CHANGELOG.md +++ b/packages/shortcut_menu_extender/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.1 + +* chore: Add dartdoc comments to public API + ## 0.1.0 * First release. diff --git a/packages/shortcut_menu_extender/LICENSE b/packages/shortcut_menu_extender/LICENSE index ef6ab69..0983ce2 100644 --- a/packages/shortcut_menu_extender/LICENSE +++ b/packages/shortcut_menu_extender/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 LiJianying +Copyright (c) 2023-2024 LiJianying Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/shortcut_menu_extender/analysis_options.yaml b/packages/shortcut_menu_extender/analysis_options.yaml new file mode 100644 index 0000000..095b1d6 --- /dev/null +++ b/packages/shortcut_menu_extender/analysis_options.yaml @@ -0,0 +1 @@ +include: package:mostly_reasonable_lints/flutter.yaml diff --git a/packages/shortcut_menu_extender/example/analysis_options.yaml b/packages/shortcut_menu_extender/example/analysis_options.yaml index 0d29021..095b1d6 100644 --- a/packages/shortcut_menu_extender/example/analysis_options.yaml +++ b/packages/shortcut_menu_extender/example/analysis_options.yaml @@ -1,28 +1 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. -include: package:flutter_lints/flutter.yaml - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at https://dart.dev/lints. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options +include: package:mostly_reasonable_lints/flutter.yaml diff --git a/packages/shortcut_menu_extender/example/integration_test/plugin_integration_test.dart b/packages/shortcut_menu_extender/example/integration_test/plugin_integration_test.dart index 8f641c9..08c6801 100644 --- a/packages/shortcut_menu_extender/example/integration_test/plugin_integration_test.dart +++ b/packages/shortcut_menu_extender/example/integration_test/plugin_integration_test.dart @@ -6,7 +6,6 @@ // For more information about Flutter integration tests, please see // https://docs.flutter.dev/cookbook/testing/integration/introduction - import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; diff --git a/packages/shortcut_menu_extender/example/lib/main.dart b/packages/shortcut_menu_extender/example/lib/main.dart index ff46a3a..f144eb6 100644 --- a/packages/shortcut_menu_extender/example/lib/main.dart +++ b/packages/shortcut_menu_extender/example/lib/main.dart @@ -1,8 +1,8 @@ +import 'dart:async'; import 'dart:io'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'dart:async'; - import 'package:flutter/services.dart'; import 'package:shortcut_menu_extender/shortcut_menu_extender.dart'; @@ -114,13 +114,15 @@ class _MyAppState extends State with ShortcutMenuListener { child: const Text('unregister 我的FlutterApp2'), ), Expanded( - child: ListView(children: [ - for (final entity in _entities) - ListTile( - title: Text(entity.statSync().type.toString()), - subtitle: Text(entity.path), - ), - ]), + child: ListView( + children: [ + for (final entity in _entities) + ListTile( + title: Text(entity.statSync().type.toString()), + subtitle: Text(entity.path), + ), + ], + ), ), ], ), @@ -139,7 +141,9 @@ class _MyAppState extends State with ShortcutMenuListener { } setState(() {}); } else if (key == _kShortcutMenuKeyMyFlutterApp2) { - print('key: $key, path: $path'); + if (kDebugMode) { + print('key: $key, path: $path'); + } } } } diff --git a/packages/shortcut_menu_extender/example/pubspec.lock b/packages/shortcut_menu_extender/example/pubspec.lock index 5e63c59..cda46c8 100644 --- a/packages/shortcut_menu_extender/example/pubspec.lock +++ b/packages/shortcut_menu_extender/example/pubspec.lock @@ -49,14 +49,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.18.0" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d - url: "https://pub.dev" - source: hosted - version: "1.0.6" fake_async: dependency: transitive description: @@ -77,10 +69,10 @@ packages: dependency: transitive description: name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" url: "https://pub.dev" source: hosted - version: "7.0.0" + version: "6.1.4" flutter: dependency: "direct main" description: flutter @@ -91,14 +83,6 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 - url: "https://pub.dev" - source: hosted - version: "2.0.3" flutter_test: dependency: "direct dev" description: flutter @@ -114,30 +98,14 @@ packages: description: flutter source: sdk version: "0.0.0" - leak_tracker: - dependency: transitive - description: - name: leak_tracker - sha256: "04be76c4a4bb50f14904e64749237e541e7c7bcf7ec0b196907322ab5d2fc739" - url: "https://pub.dev" - source: hosted - version: "9.0.16" - leak_tracker_testing: - dependency: transitive - description: - name: leak_tracker_testing - sha256: b06739349ec2477e943055aea30172c5c7000225f79dad4702e2ec0eda79a6ff - url: "https://pub.dev" - source: hosted - version: "1.0.5" lints: dependency: transitive description: name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "3.0.0" matcher: dependency: transitive description: @@ -150,18 +118,26 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.5.0" meta: dependency: transitive description: name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + url: "https://pub.dev" + source: hosted + version: "1.10.0" + mostly_reasonable_lints: + dependency: "direct dev" + description: + name: mostly_reasonable_lints + sha256: c61cc6b211f54188eef15e0ad7c9b00e8c001478ac253a52036ef7391b532b7c url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "0.1.1" path: dependency: transitive description: @@ -174,10 +150,10 @@ packages: dependency: transitive description: name: platform - sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59" + sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "3.1.2" plugin_platform_interface: dependency: transitive description: @@ -190,31 +166,31 @@ packages: dependency: transitive description: name: process - sha256: "266ca5be5820feefc777793d0a583acfc8c40834893c87c00c6c09e2cf58ea42" + sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" url: "https://pub.dev" source: hosted - version: "5.0.1" + version: "4.2.4" shortcut_menu_extender: dependency: "direct main" description: path: ".." relative: true source: path - version: "0.1.0" + version: "0.1.1" shortcut_menu_extender_platform_interface: dependency: "direct overridden" description: path: "../../shortcut_menu_extender_platform_interface" relative: true source: path - version: "0.1.0" + version: "0.1.1" shortcut_menu_extender_windows: dependency: "direct overridden" description: path: "../../shortcut_menu_extender_windows" relative: true source: path - version: "0.1.0" + version: "0.1.1" sky_engine: dependency: transitive description: flutter @@ -288,26 +264,26 @@ packages: dependency: transitive description: name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583 url: "https://pub.dev" source: hosted - version: "13.0.0" + version: "11.10.0" web: dependency: transitive description: name: web - sha256: edc8a9573dd8c5a83a183dae1af2b6fd4131377404706ca4e5420474784906fa + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.4.0" + version: "0.3.0" webdriver: dependency: transitive description: name: webdriver - sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e" + sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.2" win32: dependency: transitive description: @@ -325,4 +301,4 @@ packages: source: hosted version: "1.1.2" sdks: - dart: ">=3.2.0 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" diff --git a/packages/shortcut_menu_extender/example/pubspec.yaml b/packages/shortcut_menu_extender/example/pubspec.yaml index a184b6e..345619e 100644 --- a/packages/shortcut_menu_extender/example/pubspec.yaml +++ b/packages/shortcut_menu_extender/example/pubspec.yaml @@ -1,85 +1,22 @@ name: shortcut_menu_extender_example description: "Demonstrates how to use the shortcut_menu_extender plugin." -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" environment: - sdk: '>=3.2.0 <4.0.0' + sdk: ">=3.0.0 <4.0.0" -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter - shortcut_menu_extender: - # When depending on this package from a real application you should use: - # shortcut_menu_extender: ^x.y.z - # See https://dart.dev/tools/pub/dependencies#version-constraints - # The example app is bundled with the plugin so we use a path dependency on - # the parent directory to use the current plugin's version. path: ../ - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.2 - dev_dependencies: - integration_test: - sdk: flutter flutter_test: sdk: flutter + integration_test: + sdk: flutter + mostly_reasonable_lints: ^0.1.1 - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. - flutter_lints: ^2.0.0 - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. uses-material-design: true - - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages diff --git a/packages/shortcut_menu_extender/example/test/widget_test.dart b/packages/shortcut_menu_extender/example/test/widget_test.dart index 23495e1..61bbee5 100644 --- a/packages/shortcut_menu_extender/example/test/widget_test.dart +++ b/packages/shortcut_menu_extender/example/test/widget_test.dart @@ -18,8 +18,8 @@ void main() { // Verify that platform version is retrieved. expect( find.byWidgetPredicate( - (Widget widget) => widget is Text && - widget.data!.startsWith('Running on:'), + (Widget widget) => + widget is Text && widget.data!.startsWith('Running on:'), ), findsOneWidget, ); diff --git a/packages/shortcut_menu_extender/lib/src/shortcut_menu_extender.dart b/packages/shortcut_menu_extender/lib/src/shortcut_menu_extender.dart index a5a8152..2312173 100644 --- a/packages/shortcut_menu_extender/lib/src/shortcut_menu_extender.dart +++ b/packages/shortcut_menu_extender/lib/src/shortcut_menu_extender.dart @@ -1,10 +1,28 @@ import 'package:shortcut_menu_extender_platform_interface/shortcut_menu_extender_platform_interface.dart'; +/// Extending global shortcut menus. class ShortcutMenuExtender { Future getPlatformVersion() { return ShortcutMenuExtenderPlatform.instance.getPlatformVersion(); } + /// Register a shortcut menu. + /// + /// [key] is the unique identifier of the shortcut menu. + /// [name] is the name of the shortcut menu. + /// [executable] is the executable path of the shortcut menu. + /// [useDefaultIcon] is whether to use the default icon of the executable file. + /// + /// Sample usage: + /// + /// ```dart + /// shortcutMenuExtender.register( + /// 'MyFlutterApp', + /// name: 'Open With MyFlutterApp', + /// executable: Platform.resolvedExecutable, + /// useDefaultIcon: true, + /// ); + /// ``` Future register( String key, { required String name, @@ -19,14 +37,19 @@ class ShortcutMenuExtender { ); } + /// Unregister a shortcut menu. + /// + /// [key] is the unique identifier of the shortcut menu. Future unregister(String key) { return ShortcutMenuExtenderPlatform.instance.unregister(key); } + /// Add a listener to listen for shortcut menu events. void addListener(ShortcutMenuListener listener) { return ShortcutMenuExtenderPlatform.instance.addListener(listener); } + /// Remove a listener. void removeListener(ShortcutMenuListener listener) { return ShortcutMenuExtenderPlatform.instance.removeListener(listener); } diff --git a/packages/shortcut_menu_extender/pubspec.yaml b/packages/shortcut_menu_extender/pubspec.yaml index 5703223..02aa29f 100644 --- a/packages/shortcut_menu_extender/pubspec.yaml +++ b/packages/shortcut_menu_extender/pubspec.yaml @@ -1,22 +1,22 @@ name: shortcut_menu_extender description: "This plugin allows Flutter apps to Extending global shortcut menus." -version: 0.1.0 +version: 0.1.1 homepage: https://github.com/leanflutter/shortcut_menu_extender environment: - sdk: ">=3.2.0 <4.0.0" + sdk: ">=3.0.0 <4.0.0" flutter: ">=3.3.0" dependencies: flutter: sdk: flutter - shortcut_menu_extender_platform_interface: ^0.1.0 - shortcut_menu_extender_windows: ^0.1.0 + shortcut_menu_extender_platform_interface: ^0.1.1 + shortcut_menu_extender_windows: ^0.1.1 dev_dependencies: - flutter_lints: ^2.0.0 flutter_test: sdk: flutter + mostly_reasonable_lints: ^0.1.1 flutter: plugin: diff --git a/packages/shortcut_menu_extender_platform_interface/CHANGELOG.md b/packages/shortcut_menu_extender_platform_interface/CHANGELOG.md index 4793b26..4603ef3 100644 --- a/packages/shortcut_menu_extender_platform_interface/CHANGELOG.md +++ b/packages/shortcut_menu_extender_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.1 + +* chore: Add dartdoc comments to public API + ## 0.1.0 * First release. diff --git a/packages/shortcut_menu_extender_platform_interface/LICENSE b/packages/shortcut_menu_extender_platform_interface/LICENSE index ef6ab69..0983ce2 100644 --- a/packages/shortcut_menu_extender_platform_interface/LICENSE +++ b/packages/shortcut_menu_extender_platform_interface/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 LiJianying +Copyright (c) 2023-2024 LiJianying Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/shortcut_menu_extender_platform_interface/analysis_options.yaml b/packages/shortcut_menu_extender_platform_interface/analysis_options.yaml new file mode 100644 index 0000000..095b1d6 --- /dev/null +++ b/packages/shortcut_menu_extender_platform_interface/analysis_options.yaml @@ -0,0 +1 @@ +include: package:mostly_reasonable_lints/flutter.yaml diff --git a/packages/shortcut_menu_extender_platform_interface/lib/shortcut_menu_extender_platform_interface.dart b/packages/shortcut_menu_extender_platform_interface/lib/shortcut_menu_extender_platform_interface.dart index 5155f1a..e596456 100644 --- a/packages/shortcut_menu_extender_platform_interface/lib/shortcut_menu_extender_platform_interface.dart +++ b/packages/shortcut_menu_extender_platform_interface/lib/shortcut_menu_extender_platform_interface.dart @@ -1,3 +1,3 @@ -export 'src/method_channel_shortcut_menu_extender.dart'; +export 'src/shortcut_menu_extender_method_channel.dart'; export 'src/shortcut_menu_extender_platform.dart'; export 'src/shortcut_menu_listener.dart'; diff --git a/packages/shortcut_menu_extender_platform_interface/lib/src/method_channel_shortcut_menu_extender.dart b/packages/shortcut_menu_extender_platform_interface/lib/src/shortcut_menu_extender_method_channel.dart similarity index 100% rename from packages/shortcut_menu_extender_platform_interface/lib/src/method_channel_shortcut_menu_extender.dart rename to packages/shortcut_menu_extender_platform_interface/lib/src/shortcut_menu_extender_method_channel.dart diff --git a/packages/shortcut_menu_extender_platform_interface/lib/src/shortcut_menu_extender_platform.dart b/packages/shortcut_menu_extender_platform_interface/lib/src/shortcut_menu_extender_platform.dart index e689448..fb5d44d 100644 --- a/packages/shortcut_menu_extender_platform_interface/lib/src/shortcut_menu_extender_platform.dart +++ b/packages/shortcut_menu_extender_platform_interface/lib/src/shortcut_menu_extender_platform.dart @@ -1,5 +1,5 @@ import 'package:plugin_platform_interface/plugin_platform_interface.dart'; -import 'package:shortcut_menu_extender_platform_interface/src/method_channel_shortcut_menu_extender.dart'; +import 'package:shortcut_menu_extender_platform_interface/src/shortcut_menu_extender_method_channel.dart'; import 'package:shortcut_menu_extender_platform_interface/src/shortcut_menu_listener.dart'; abstract class ShortcutMenuExtenderPlatform extends PlatformInterface { diff --git a/packages/shortcut_menu_extender_platform_interface/lib/src/shortcut_menu_listener.dart b/packages/shortcut_menu_extender_platform_interface/lib/src/shortcut_menu_listener.dart index 72337cd..10afe26 100644 --- a/packages/shortcut_menu_extender_platform_interface/lib/src/shortcut_menu_listener.dart +++ b/packages/shortcut_menu_extender_platform_interface/lib/src/shortcut_menu_listener.dart @@ -1,6 +1,7 @@ mixin class ShortcutMenuListener { void onShortcutMenuClicked(String key, String path) { throw UnimplementedError( - 'onShortcutMenuClicked() has not been implemented.'); + 'onShortcutMenuClicked() has not been implemented.', + ); } } diff --git a/packages/shortcut_menu_extender_platform_interface/pubspec.yaml b/packages/shortcut_menu_extender_platform_interface/pubspec.yaml index b6fb645..856a48f 100644 --- a/packages/shortcut_menu_extender_platform_interface/pubspec.yaml +++ b/packages/shortcut_menu_extender_platform_interface/pubspec.yaml @@ -1,11 +1,11 @@ name: shortcut_menu_extender_platform_interface description: "A common platform interface for the shortcut_menu_extender plugin." -version: 0.1.0 +version: 0.1.1 homepage: https://github.com/leanflutter/shortcut_menu_extender environment: - sdk: '>=3.2.0 <4.0.0' - flutter: '>=3.3.0' + sdk: ">=3.0.0 <4.0.0" + flutter: ">=3.3.0" dependencies: flutter: @@ -13,6 +13,6 @@ dependencies: plugin_platform_interface: ^2.0.2 dev_dependencies: - flutter_lints: ^2.0.0 flutter_test: sdk: flutter + mostly_reasonable_lints: ^0.1.1 diff --git a/packages/shortcut_menu_extender_windows/CHANGELOG.md b/packages/shortcut_menu_extender_windows/CHANGELOG.md index 4793b26..4603ef3 100644 --- a/packages/shortcut_menu_extender_windows/CHANGELOG.md +++ b/packages/shortcut_menu_extender_windows/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.1 + +* chore: Add dartdoc comments to public API + ## 0.1.0 * First release. diff --git a/packages/shortcut_menu_extender_windows/LICENSE b/packages/shortcut_menu_extender_windows/LICENSE index ef6ab69..0983ce2 100644 --- a/packages/shortcut_menu_extender_windows/LICENSE +++ b/packages/shortcut_menu_extender_windows/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 LiJianying +Copyright (c) 2023-2024 LiJianying Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/shortcut_menu_extender_windows/analysis_options.yaml b/packages/shortcut_menu_extender_windows/analysis_options.yaml new file mode 100644 index 0000000..095b1d6 --- /dev/null +++ b/packages/shortcut_menu_extender_windows/analysis_options.yaml @@ -0,0 +1 @@ +include: package:mostly_reasonable_lints/flutter.yaml diff --git a/packages/shortcut_menu_extender_windows/lib/src/shortcut_menu_extender_command.dart b/packages/shortcut_menu_extender_windows/lib/src/shortcut_menu_extender_command.dart index 8763d6c..532c7d1 100644 --- a/packages/shortcut_menu_extender_windows/lib/src/shortcut_menu_extender_command.dart +++ b/packages/shortcut_menu_extender_windows/lib/src/shortcut_menu_extender_command.dart @@ -1,5 +1,3 @@ -import 'dart:math'; - import 'package:args/args.dart'; import 'package:win32_registry/win32_registry.dart'; diff --git a/packages/shortcut_menu_extender_windows/pubspec.yaml b/packages/shortcut_menu_extender_windows/pubspec.yaml index 8433079..3ddddca 100644 --- a/packages/shortcut_menu_extender_windows/pubspec.yaml +++ b/packages/shortcut_menu_extender_windows/pubspec.yaml @@ -1,10 +1,10 @@ name: shortcut_menu_extender_windows description: "The Windows implementation of shortcut_menu_extender." -version: 0.1.0 +version: 0.1.1 homepage: https://github.com/leanflutter/shortcut_menu_extender environment: - sdk: ">=3.2.0 <4.0.0" + sdk: ">=3.0.0 <4.0.0" flutter: ">=3.3.0" dependencies: @@ -12,14 +12,14 @@ dependencies: ffi: ^2.1.0 flutter: sdk: flutter - shortcut_menu_extender_platform_interface: ^0.1.0 + shortcut_menu_extender_platform_interface: ^0.1.1 win32: ^5.1.1 win32_registry: ^1.1.2 dev_dependencies: - flutter_lints: ^2.0.0 flutter_test: sdk: flutter + mostly_reasonable_lints: ^0.1.1 flutter: plugin: diff --git a/pubspec.lock b/pubspec.lock index 81c4a07..0e0600e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -81,14 +81,6 @@ packages: url: "https://pub.dev" source: hosted version: "6.1.4" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 - url: "https://pub.dev" - source: hosted - version: "2.0.3" glob: dependency: transitive description: @@ -137,14 +129,6 @@ packages: url: "https://pub.dev" source: hosted version: "4.8.1" - lints: - dependency: transitive - description: - name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" - url: "https://pub.dev" - source: hosted - version: "2.1.1" matcher: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 631da82..1cc2d53 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,8 +2,7 @@ name: shortcut_menu_extender_workspace publish_to: "none" environment: - sdk: ">=2.16.0 <4.0.0" + sdk: ">=3.0.0 <4.0.0" dev_dependencies: - flutter_lints: ^2.0.0 melos: ^3.1.0