From 19ed2b3e68f074f777236875cb9c3a199eefb1a6 Mon Sep 17 00:00:00 2001 From: Flutter Painter Date: Tue, 8 Jul 2025 20:04:33 +0200 Subject: [PATCH 1/4] add the missing headers in windows --- .../example/pubspec.yaml | 2 - .../example/windows/flutter/CMakeLists.txt | 7 +- .../example/windows/runner/Runner.rc | 10 +-- .../permission_handler_windows_plugin.h | 2 +- .../permission_handler_windows_plugin.cpp | 67 ++++++++++--------- 5 files changed, 46 insertions(+), 42 deletions(-) diff --git a/permission_handler_windows/example/pubspec.yaml b/permission_handler_windows/example/pubspec.yaml index 2deb8e72c..5ac795041 100644 --- a/permission_handler_windows/example/pubspec.yaml +++ b/permission_handler_windows/example/pubspec.yaml @@ -29,5 +29,3 @@ flutter: assets: - res/images/baseflow_logo_def_light-02.png - res/images/poweredByBaseflowLogoLight@3x.png - - packages/baseflow_plugin_template/logo.png - - packages/baseflow_plugin_template/poweredByBaseflow.png diff --git a/permission_handler_windows/example/windows/flutter/CMakeLists.txt b/permission_handler_windows/example/windows/flutter/CMakeLists.txt index b2e4bd8d6..4f2af69bb 100644 --- a/permission_handler_windows/example/windows/flutter/CMakeLists.txt +++ b/permission_handler_windows/example/windows/flutter/CMakeLists.txt @@ -9,6 +9,11 @@ include(${EPHEMERAL_DIR}/generated_config.cmake) # https://github.com/flutter/flutter/issues/57146. set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") +# Set fallback configurations for older versions of the flutter tool. +if (NOT DEFINED FLUTTER_TARGET_PLATFORM) + set(FLUTTER_TARGET_PLATFORM "windows-x64") +endif() + # === Flutter Library === set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") @@ -91,7 +96,7 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E env ${FLUTTER_TOOL_ENVIRONMENT} "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" - windows-x64 $ + ${FLUTTER_TARGET_PLATFORM} $ VERBATIM ) add_custom_target(flutter_assemble DEPENDS diff --git a/permission_handler_windows/example/windows/runner/Runner.rc b/permission_handler_windows/example/windows/runner/Runner.rc index 7a7335b84..3ed928345 100644 --- a/permission_handler_windows/example/windows/runner/Runner.rc +++ b/permission_handler_windows/example/windows/runner/Runner.rc @@ -60,14 +60,14 @@ IDI_APP_ICON ICON "resources\\app_icon.ico" // Version // -#ifdef FLUTTER_BUILD_NUMBER -#define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER +#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) +#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD #else -#define VERSION_AS_NUMBER 1,0,0 +#define VERSION_AS_NUMBER 1,0,0,0 #endif -#ifdef FLUTTER_BUILD_NAME -#define VERSION_AS_STRING #FLUTTER_BUILD_NAME +#if defined(FLUTTER_VERSION) +#define VERSION_AS_STRING FLUTTER_VERSION #else #define VERSION_AS_STRING "1.0.0" #endif diff --git a/permission_handler_windows/windows/include/permission_handler_windows/permission_handler_windows_plugin.h b/permission_handler_windows/windows/include/permission_handler_windows/permission_handler_windows_plugin.h index 433198d99..b981b2be5 100644 --- a/permission_handler_windows/windows/include/permission_handler_windows/permission_handler_windows_plugin.h +++ b/permission_handler_windows/windows/include/permission_handler_windows/permission_handler_windows_plugin.h @@ -1,7 +1,7 @@ #ifndef PACKAGES_PERMISSION_HANDLER_PERMISSION_HANDLER_WINDOWS_WINDOWS_INCLUDE_PERMISSION_HANDLER_WINDOWS_PERMISSION_HANDLER_PLUGIN_H_ #define PACKAGES_PERMISSION_HANDLER_PERMISSION_HANDLER_WINDOWS_WINDOWS_INCLUDE_PERMISSION_HANDLER_WINDOWS_PERMISSION_HANDLER_PLUGIN_H_ -#include +#include #ifdef FLUTTER_PLUGIN_IMPL #define FLUTTER_PLUGIN_EXPORT __declspec(dllexport) diff --git a/permission_handler_windows/windows/permission_handler_windows_plugin.cpp b/permission_handler_windows/windows/permission_handler_windows_plugin.cpp index 4b4d6d184..061936379 100644 --- a/permission_handler_windows/windows/permission_handler_windows_plugin.cpp +++ b/permission_handler_windows/windows/permission_handler_windows_plugin.cpp @@ -32,11 +32,11 @@ using namespace winrt::Windows::Devices::Bluetooth; using namespace winrt::Windows::Devices::Radios; template -T GetArgument(const std::string arg, const EncodableValue* args, T fallback) { +T GetArgument(const std::string arg, const flutter::EncodableValue* args, T fallback) { T result {fallback}; - const auto* arguments = std::get_if(args); + const auto* arguments = std::get_if(args); if (arguments) { - auto result_it = arguments->find(EncodableValue(arg)); + auto result_it = arguments->find(flutter::EncodableValue(arg)); if (result_it != arguments->end()) { result = std::get(result_it->second); } @@ -44,9 +44,9 @@ T GetArgument(const std::string arg, const EncodableValue* args, T fallback) { return result; } -class PermissionHandlerWindowsPlugin : public Plugin { +class PermissionHandlerWindowsPlugin { public: - static void RegisterWithRegistrar(PluginRegistrar* registrar); + static void RegisterWithRegistrar(flutter::PluginRegistrar* registrar); PermissionHandlerWindowsPlugin(); @@ -57,12 +57,12 @@ class PermissionHandlerWindowsPlugin : public Plugin { PermissionHandlerWindowsPlugin& operator=(const PermissionHandlerWindowsPlugin&) = delete; // Called when a method is called on the plugin channel. - void HandleMethodCall(const MethodCall<>&, - std::unique_ptr>); + void HandleMethodCall(const flutter::MethodCall<>&, + std::unique_ptr>); private: - void IsLocationServiceEnabled(std::unique_ptr> result); - winrt::fire_and_forget IsBluetoothServiceEnabled(std::unique_ptr> result); + void IsLocationServiceEnabled(std::unique_ptr> result); + winrt::fire_and_forget IsBluetoothServiceEnabled(std::unique_ptr> result); winrt::Windows::Devices::Geolocation::Geolocator geolocator; winrt::Windows::Devices::Geolocation::Geolocator::PositionChanged_revoker m_positionChangedRevoker; @@ -70,11 +70,11 @@ class PermissionHandlerWindowsPlugin : public Plugin { // static void PermissionHandlerWindowsPlugin::RegisterWithRegistrar( - PluginRegistrar* registrar) { + flutter::PluginRegistrar* registrar) { - auto channel = std::make_unique>( + auto channel = std::make_unique>( registrar->messenger(), "flutter.baseflow.com/permissions/methods", - &StandardMethodCodec::GetInstance()); + &flutter::StandardMethodCodec::GetInstance()); std::unique_ptr plugin = std::make_unique(); @@ -83,7 +83,7 @@ void PermissionHandlerWindowsPlugin::RegisterWithRegistrar( plugin_pointer->HandleMethodCall(call, std::move(result)); }); - registrar->AddPlugin(std::move(plugin)); + // Plugin instance is managed by the channel } PermissionHandlerWindowsPlugin::PermissionHandlerWindowsPlugin(){ @@ -96,8 +96,8 @@ PermissionHandlerWindowsPlugin::PermissionHandlerWindowsPlugin(){ PermissionHandlerWindowsPlugin::~PermissionHandlerWindowsPlugin() = default; void PermissionHandlerWindowsPlugin::HandleMethodCall( - const MethodCall<>& method_call, - std::unique_ptr> result) { + const flutter::MethodCall<>& method_call, + std::unique_ptr> result) { auto methodName = method_call.method_name(); if (methodName.compare("checkServiceStatus") == 0) { @@ -114,56 +114,56 @@ void PermissionHandlerWindowsPlugin::HandleMethodCall( } if (permission == PermissionConstants::PermissionGroup::IGNORE_BATTERY_OPTIMIZATIONS) { - result->Success(EncodableValue((int)PermissionConstants::ServiceStatus::ENABLED)); + result->Success(flutter::EncodableValue((int)PermissionConstants::ServiceStatus::ENABLED)); return; } - result->Success(EncodableValue((int)PermissionConstants::ServiceStatus::NOT_APPLICABLE)); + result->Success(flutter::EncodableValue((int)PermissionConstants::ServiceStatus::NOT_APPLICABLE)); } else if (methodName.compare("checkPermissionStatus") == 0) { - result->Success(EncodableValue((int)PermissionConstants::PermissionStatus::GRANTED)); + result->Success(flutter::EncodableValue((int)PermissionConstants::PermissionStatus::GRANTED)); } else if (methodName.compare("requestPermissions") == 0) { - auto permissionsEncoded = std::get(*method_call.arguments()); + auto permissionsEncoded = std::get(*method_call.arguments()); std::vector permissions; permissions.reserve( permissionsEncoded.size() ); std::transform( permissionsEncoded.begin(), permissionsEncoded.end(), std::back_inserter( permissions ), - [](const EncodableValue& encoded) { + [](const flutter::EncodableValue& encoded) { return std::get(encoded); }); - EncodableMap requestResults; + flutter::EncodableMap requestResults; for (int i=0;iSuccess(requestResults); } else if (methodName.compare("shouldShowRequestPermissionRationale") == 0 || methodName.compare("openAppSettings")) { - result->Success(EncodableValue(false)); + result->Success(flutter::EncodableValue(false)); } else { result->NotImplemented(); } } -void PermissionHandlerWindowsPlugin::IsLocationServiceEnabled(std::unique_ptr> result) { - result->Success(EncodableValue((int)(geolocator.LocationStatus() != PositionStatus::NotAvailable +void PermissionHandlerWindowsPlugin::IsLocationServiceEnabled(std::unique_ptr> result) { + result->Success(flutter::EncodableValue((int)(geolocator.LocationStatus() != PositionStatus::NotAvailable ? PermissionConstants::ServiceStatus::ENABLED : PermissionConstants::ServiceStatus::DISABLED))); } -winrt::fire_and_forget PermissionHandlerWindowsPlugin::IsBluetoothServiceEnabled(std::unique_ptr> result) { +winrt::fire_and_forget PermissionHandlerWindowsPlugin::IsBluetoothServiceEnabled(std::unique_ptr> result) { auto btAdapter = co_await BluetoothAdapter::GetDefaultAsync(); if (btAdapter == nullptr) { - result->Success(EncodableValue((int)PermissionConstants::ServiceStatus::DISABLED)); + result->Success(flutter::EncodableValue((int)PermissionConstants::ServiceStatus::DISABLED)); co_return; } if (!btAdapter.IsCentralRoleSupported()) { - result->Success(EncodableValue((int)PermissionConstants::ServiceStatus::DISABLED)); + result->Success(flutter::EncodableValue((int)PermissionConstants::ServiceStatus::DISABLED)); co_return; } @@ -173,21 +173,22 @@ winrt::fire_and_forget PermissionHandlerWindowsPlugin::IsBluetoothServiceEnabled auto radio = radios.GetAt(i); if(radio.Kind() == RadioKind::Bluetooth) { co_await radio.SetStateAsync(RadioState::On); - result->Success(EncodableValue((int)(radio.State() == RadioState::On + result->Success(flutter::EncodableValue((int)(radio.State() == RadioState::On ? PermissionConstants::ServiceStatus::ENABLED : PermissionConstants::ServiceStatus::DISABLED))); co_return; } } - result->Success(EncodableValue((int)PermissionConstants::ServiceStatus::DISABLED)); + result->Success(flutter::EncodableValue((int)PermissionConstants::ServiceStatus::DISABLED)); } } // namespace void PermissionHandlerWindowsPluginRegisterWithRegistrar( FlutterDesktopPluginRegistrarRef registrar) { - PermissionHandlerWindowsPlugin::RegisterWithRegistrar( - PluginRegistrarManager::GetInstance() - ->GetRegistrar(registrar)); + auto plugin_registrar = + flutter::PluginRegistrarManager::GetInstance() + ->GetRegistrar(registrar); + PermissionHandlerWindowsPlugin::RegisterWithRegistrar(plugin_registrar); } From 86a6e1d233b897086a58e9ea0940cdd24088aa17 Mon Sep 17 00:00:00 2001 From: Flutter Painter Date: Tue, 8 Jul 2025 20:10:17 +0200 Subject: [PATCH 2/4] ++ version and edit changelog --- permission_handler_windows/CHANGELOG.md | 4 ++++ permission_handler_windows/pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/permission_handler_windows/CHANGELOG.md b/permission_handler_windows/CHANGELOG.md index 91c2f5049..87b81caff 100644 --- a/permission_handler_windows/CHANGELOG.md +++ b/permission_handler_windows/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.2 + +- fix missing header files issues + ## 0.2.1 * Updates the dependency on `permission_handler_platform_interface` to version 4.1.0 (SiriKit support is only available for iOS and macOS). diff --git a/permission_handler_windows/pubspec.yaml b/permission_handler_windows/pubspec.yaml index f5553e0d6..3495a07b7 100644 --- a/permission_handler_windows/pubspec.yaml +++ b/permission_handler_windows/pubspec.yaml @@ -1,6 +1,6 @@ name: permission_handler_windows description: Permission plugin for Flutter. This plugin provides the Windows API to request and check permissions. -version: 0.2.1 +version: 0.2.2 homepage: https://github.com/baseflow/flutter-permission-handler flutter: From 9ee53b9f5e45307b2564c5567374865f30e0f7c8 Mon Sep 17 00:00:00 2001 From: Flutter Painter Date: Tue, 8 Jul 2025 20:43:39 +0200 Subject: [PATCH 3/4] Added: permission_handler_windows/windows/include/permission_handler/permission_handler_plugin.h (compatibility header) Updated: permission_handler_windows/windows/CMakeLists.txt (added compatibility header to build) --- .../windows/CMakeLists.txt | 1 + .../permission_handler_plugin.h | 8 ++ test_permission_app/pubspec.yaml | 89 +++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 permission_handler_windows/windows/include/permission_handler/permission_handler_plugin.h create mode 100644 test_permission_app/pubspec.yaml diff --git a/permission_handler_windows/windows/CMakeLists.txt b/permission_handler_windows/windows/CMakeLists.txt index 79cf2ec21..d9b3fbf39 100644 --- a/permission_handler_windows/windows/CMakeLists.txt +++ b/permission_handler_windows/windows/CMakeLists.txt @@ -42,6 +42,7 @@ include_directories(BEFORE SYSTEM ${CMAKE_BINARY_DIR}/include) add_library(${PLUGIN_NAME} SHARED "include/permission_handler_windows/permission_handler_windows_plugin.h" + "include/permission_handler/permission_handler_plugin.h" "permission_handler_windows_plugin.cpp" ) apply_standard_settings(${PLUGIN_NAME}) diff --git a/permission_handler_windows/windows/include/permission_handler/permission_handler_plugin.h b/permission_handler_windows/windows/include/permission_handler/permission_handler_plugin.h new file mode 100644 index 000000000..6db6cf07b --- /dev/null +++ b/permission_handler_windows/windows/include/permission_handler/permission_handler_plugin.h @@ -0,0 +1,8 @@ +#ifndef PACKAGES_PERMISSION_HANDLER_PERMISSION_HANDLER_WINDOWS_WINDOWS_INCLUDE_PERMISSION_HANDLER_PERMISSION_HANDLER_PLUGIN_H_ +#define PACKAGES_PERMISSION_HANDLER_PERMISSION_HANDLER_WINDOWS_WINDOWS_INCLUDE_PERMISSION_HANDLER_PERMISSION_HANDLER_PLUGIN_H_ + +// Compatibility header for permission_handler_windows plugin +// This header redirects to the actual plugin header to maintain compatibility +#include "../permission_handler_windows/permission_handler_windows_plugin.h" + +#endif // PACKAGES_PERMISSION_HANDLER_PERMISSION_HANDLER_WINDOWS_WINDOWS_INCLUDE_PERMISSION_HANDLER_PERMISSION_HANDLER_PLUGIN_H_ \ No newline at end of file diff --git a/test_permission_app/pubspec.yaml b/test_permission_app/pubspec.yaml new file mode 100644 index 000000000..27c907974 --- /dev/null +++ b/test_permission_app/pubspec.yaml @@ -0,0 +1,89 @@ +name: test_permission_app +description: "A new Flutter project." +# 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 + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 + +environment: + sdk: ^3.5.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 + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.8 + permission_handler: + path: flutter-permission-handler/permission_handler + +dev_dependencies: + flutter_test: + sdk: flutter + + # 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: ^5.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/dependencies + +# 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/to/resolution-aware-images + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/to/asset-from-package + + # To add custom fonts to your application, add a fonts section here, + # in this format: + # 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/to/font-from-package \ No newline at end of file From e4029c615a6e1fcb1ddfd7c66cf6f09324de3ab3 Mon Sep 17 00:00:00 2001 From: Flutter Painter Date: Sun, 20 Jul 2025 12:08:58 +0200 Subject: [PATCH 4/4] cleaner --- permission_handler/pubspec.yaml | 3 +- .../windows/CMakeLists.txt | 2 +- .../permission_handler_plugin.h | 21 ++++- .../permission_handler_plugin.h | 23 +++++ .../permission_handler_windows_plugin.cpp | 2 +- test_permission_app/pubspec.yaml | 89 ------------------- 6 files changed, 45 insertions(+), 95 deletions(-) create mode 100644 permission_handler_windows/windows/include/permission_handler_windows/permission_handler_plugin.h delete mode 100644 test_permission_app/pubspec.yaml diff --git a/permission_handler/pubspec.yaml b/permission_handler/pubspec.yaml index 3e0861cd9..c60254654 100644 --- a/permission_handler/pubspec.yaml +++ b/permission_handler/pubspec.yaml @@ -27,7 +27,8 @@ dependencies: permission_handler_android: ^13.0.0 permission_handler_apple: ^9.4.6 permission_handler_html: ^0.1.1 - permission_handler_windows: ^0.2.1 + permission_handler_windows: + path: ../permission_handler_windows permission_handler_platform_interface: ^4.3.0 dev_dependencies: diff --git a/permission_handler_windows/windows/CMakeLists.txt b/permission_handler_windows/windows/CMakeLists.txt index d9b3fbf39..d8fc46529 100644 --- a/permission_handler_windows/windows/CMakeLists.txt +++ b/permission_handler_windows/windows/CMakeLists.txt @@ -42,7 +42,7 @@ include_directories(BEFORE SYSTEM ${CMAKE_BINARY_DIR}/include) add_library(${PLUGIN_NAME} SHARED "include/permission_handler_windows/permission_handler_windows_plugin.h" - "include/permission_handler/permission_handler_plugin.h" + "include/permission_handler_windows/permission_handler_plugin.h" "permission_handler_windows_plugin.cpp" ) apply_standard_settings(${PLUGIN_NAME}) diff --git a/permission_handler_windows/windows/include/permission_handler/permission_handler_plugin.h b/permission_handler_windows/windows/include/permission_handler/permission_handler_plugin.h index 6db6cf07b..f78876141 100644 --- a/permission_handler_windows/windows/include/permission_handler/permission_handler_plugin.h +++ b/permission_handler_windows/windows/include/permission_handler/permission_handler_plugin.h @@ -1,8 +1,23 @@ #ifndef PACKAGES_PERMISSION_HANDLER_PERMISSION_HANDLER_WINDOWS_WINDOWS_INCLUDE_PERMISSION_HANDLER_PERMISSION_HANDLER_PLUGIN_H_ #define PACKAGES_PERMISSION_HANDLER_PERMISSION_HANDLER_WINDOWS_WINDOWS_INCLUDE_PERMISSION_HANDLER_PERMISSION_HANDLER_PLUGIN_H_ -// Compatibility header for permission_handler_windows plugin -// This header redirects to the actual plugin header to maintain compatibility -#include "../permission_handler_windows/permission_handler_windows_plugin.h" +#include + +#ifdef FLUTTER_PLUGIN_IMPL +#define FLUTTER_PLUGIN_EXPORT __declspec(dllexport) +#else +#define FLUTTER_PLUGIN_EXPORT __declspec(dllimport) +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + +FLUTTER_PLUGIN_EXPORT void PermissionHandlerWindowsPluginRegisterWithRegistrar( + FlutterDesktopPluginRegistrarRef registrar); + +#if defined(__cplusplus) +} // extern "C" +#endif #endif // PACKAGES_PERMISSION_HANDLER_PERMISSION_HANDLER_WINDOWS_WINDOWS_INCLUDE_PERMISSION_HANDLER_PERMISSION_HANDLER_PLUGIN_H_ \ No newline at end of file diff --git a/permission_handler_windows/windows/include/permission_handler_windows/permission_handler_plugin.h b/permission_handler_windows/windows/include/permission_handler_windows/permission_handler_plugin.h new file mode 100644 index 000000000..69a2fa150 --- /dev/null +++ b/permission_handler_windows/windows/include/permission_handler_windows/permission_handler_plugin.h @@ -0,0 +1,23 @@ +#ifndef PACKAGES_PERMISSION_HANDLER_PERMISSION_HANDLER_WINDOWS_WINDOWS_INCLUDE_PERMISSION_HANDLER_WINDOWS_PERMISSION_HANDLER_PLUGIN_H_ +#define PACKAGES_PERMISSION_HANDLER_PERMISSION_HANDLER_WINDOWS_WINDOWS_INCLUDE_PERMISSION_HANDLER_WINDOWS_PERMISSION_HANDLER_PLUGIN_H_ + +#include + +#ifdef FLUTTER_PLUGIN_IMPL +#define FLUTTER_PLUGIN_EXPORT __declspec(dllexport) +#else +#define FLUTTER_PLUGIN_EXPORT __declspec(dllimport) +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + +FLUTTER_PLUGIN_EXPORT void PermissionHandlerWindowsPluginRegisterWithRegistrar( + FlutterDesktopPluginRegistrarRef registrar); + +#if defined(__cplusplus) +} // extern "C" +#endif + +#endif // PACKAGES_PERMISSION_HANDLER_PERMISSION_HANDLER_WINDOWS_WINDOWS_INCLUDE_PERMISSION_HANDLER_WINDOWS_PERMISSION_HANDLER_PLUGIN_H_ diff --git a/permission_handler_windows/windows/permission_handler_windows_plugin.cpp b/permission_handler_windows/windows/permission_handler_windows_plugin.cpp index 061936379..b95fdd5b0 100644 --- a/permission_handler_windows/windows/permission_handler_windows_plugin.cpp +++ b/permission_handler_windows/windows/permission_handler_windows_plugin.cpp @@ -1,4 +1,4 @@ -#include "include/permission_handler_windows/permission_handler_windows_plugin.h" +#include "include/permission_handler_windows/permission_handler_plugin.h" #include #include diff --git a/test_permission_app/pubspec.yaml b/test_permission_app/pubspec.yaml deleted file mode 100644 index 27c907974..000000000 --- a/test_permission_app/pubspec.yaml +++ /dev/null @@ -1,89 +0,0 @@ -name: test_permission_app -description: "A new Flutter project." -# 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 - -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -# In Windows, build-name is used as the major, minor, and patch parts -# of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+1 - -environment: - sdk: ^3.5.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 - - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.8 - permission_handler: - path: flutter-permission-handler/permission_handler - -dev_dependencies: - flutter_test: - sdk: flutter - - # 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: ^5.0.0 - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/dependencies - -# 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/to/resolution-aware-images - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/to/asset-from-package - - # To add custom fonts to your application, add a fonts section here, - # in this format: - # 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/to/font-from-package \ No newline at end of file