diff --git a/packages/share_plus/share_plus/example/ios/Flutter/Flutter.podspec b/packages/share_plus/share_plus/example/ios/Flutter/Flutter.podspec deleted file mode 100644 index 663d5b2985..0000000000 --- a/packages/share_plus/share_plus/example/ios/Flutter/Flutter.podspec +++ /dev/null @@ -1,18 +0,0 @@ -# -# NOTE: This podspec is NOT to be published. It is only used as a local source! -# This is a generated file; do not edit or check into version control. -# - -Pod::Spec.new do |s| - s.name = 'Flutter' - s.version = '1.0.0' - s.summary = 'High-performance, high-fidelity mobile apps.' - s.homepage = 'https://flutter.io' - s.license = { :type => 'MIT' } - s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } - s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } - s.ios.deployment_target = '9.0' - # Framework linking is handled by Flutter tooling, not CocoaPods. - # Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs. - s.vendored_frameworks = 'path/to/nothing' -end diff --git a/packages/share_plus/share_plus/example/lib/main.dart b/packages/share_plus/share_plus/example/lib/main.dart index 3972e617e1..c46eba0e3e 100644 --- a/packages/share_plus/share_plus/example/lib/main.dart +++ b/packages/share_plus/share_plus/example/lib/main.dart @@ -5,10 +5,11 @@ // ignore_for_file: public_member_api_docs import 'dart:io'; + import 'package:file_selector/file_selector.dart'; import 'package:flutter/material.dart'; -import 'package:share_plus/share_plus.dart'; import 'package:image_picker/image_picker.dart'; +import 'package:share_plus/share_plus.dart'; import 'image_previews.dart'; @@ -164,6 +165,7 @@ class DemoAppState extends State { void _onShareWithResult(BuildContext context) async { final box = context.findRenderObject() as RenderBox?; + final scaffoldMessenger = ScaffoldMessenger.of(context); ShareResult result; if (imagePaths.isNotEmpty) { final files = []; @@ -179,7 +181,7 @@ class DemoAppState extends State { subject: subject, sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size); } - ScaffoldMessenger.of(context).showSnackBar(SnackBar( + scaffoldMessenger.showSnackBar(SnackBar( content: Text("Share result: ${result.status}"), )); } diff --git a/packages/share_plus/share_plus/example/pubspec.yaml b/packages/share_plus/share_plus/example/pubspec.yaml index 91503512b3..4d029287dc 100644 --- a/packages/share_plus/share_plus/example/pubspec.yaml +++ b/packages/share_plus/share_plus/example/pubspec.yaml @@ -10,25 +10,17 @@ dependencies: file_selector: ^0.9.2+1 dependency_overrides: - share_plus_linux: - path: ../../share_plus_linux - share_plus_macos: - path: ../../share_plus_macos share_plus_platform_interface: path: ../../share_plus_platform_interface - share_plus_web: - path: ../../share_plus_web - share_plus_windows: - path: ../../share_plus_windows dev_dependencies: flutter_driver: sdk: flutter + flutter_test: + sdk: flutter integration_test: sdk: flutter flutter_lints: ^2.0.1 - flutter_test: - sdk: flutter flutter: uses-material-design: true diff --git a/packages/share_plus/share_plus/lib/share_plus.dart b/packages/share_plus/share_plus/lib/share_plus.dart index 754888ad91..52d667f27f 100644 --- a/packages/share_plus/share_plus/lib/share_plus.dart +++ b/packages/share_plus/share_plus/lib/share_plus.dart @@ -11,6 +11,10 @@ import 'package:share_plus_platform_interface/share_plus_platform_interface.dart export 'package:share_plus_platform_interface/share_plus_platform_interface.dart' show ShareResult, ShareResultStatus; +export 'src/share_plus_linux.dart'; +export 'src/share_plus_windows.dart' + if (dart.library.html) 'src/share_plus_web.dart'; + /// Plugin for summoning a platform share sheet. class Share { static SharePlatform get _platform => SharePlatform.instance; diff --git a/packages/share_plus/share_plus_linux/lib/share_plus_linux.dart b/packages/share_plus/share_plus/lib/src/share_plus_linux.dart similarity index 94% rename from packages/share_plus/share_plus_linux/lib/share_plus_linux.dart rename to packages/share_plus/share_plus/lib/src/share_plus_linux.dart index 9a3c4daac6..6080fc81a7 100644 --- a/packages/share_plus/share_plus_linux/lib/share_plus_linux.dart +++ b/packages/share_plus/share_plus/lib/src/share_plus_linux.dart @@ -2,16 +2,16 @@ library share_plus_linux; import 'dart:ui'; -import 'package:cross_file/cross_file.dart'; -import 'package:url_launcher/url_launcher.dart'; +import 'package:cross_file/cross_file.dart'; import 'package:share_plus_platform_interface/share_plus_platform_interface.dart'; +import 'package:url_launcher/url_launcher.dart'; /// The Linux implementation of SharePlatform. -class ShareLinux extends SharePlatform { +class SharePlusLinuxPlugin extends SharePlatform { /// Register this dart class as the platform implementation for linux static void registerWith() { - SharePlatform.instance = ShareLinux(); + SharePlatform.instance = SharePlusLinuxPlugin(); } /// Share text. diff --git a/packages/share_plus/share_plus_macos/lib/share_plus_macos.dart b/packages/share_plus/share_plus/lib/src/share_plus_macos.dart similarity index 100% rename from packages/share_plus/share_plus_macos/lib/share_plus_macos.dart rename to packages/share_plus/share_plus/lib/src/share_plus_macos.dart diff --git a/packages/share_plus/share_plus_web/lib/share_plus_web.dart b/packages/share_plus/share_plus/lib/src/share_plus_web.dart similarity index 95% rename from packages/share_plus/share_plus_web/lib/share_plus_web.dart rename to packages/share_plus/share_plus/lib/src/share_plus_web.dart index afb301b6f0..956cd29d9d 100644 --- a/packages/share_plus/share_plus_web/lib/share_plus_web.dart +++ b/packages/share_plus/share_plus/lib/src/share_plus_web.dart @@ -9,16 +9,16 @@ import 'package:share_plus_platform_interface/share_plus_platform_interface.dart import 'package:url_launcher/url_launcher.dart'; /// The web implementation of [SharePlatform]. -class SharePlusPlugin extends SharePlatform { +class SharePlusWebPlugin extends SharePlatform { /// Registers this class as the default instance of [SharePlatform]. static void registerWith(Registrar registrar) { - SharePlatform.instance = SharePlusPlugin(); + SharePlatform.instance = SharePlusWebPlugin(); } final html.Navigator _navigator; /// A constructor that allows tests to override the window object used by the plugin. - SharePlusPlugin({@visibleForTesting html.Navigator? debugNavigator}) + SharePlusWebPlugin({@visibleForTesting html.Navigator? debugNavigator}) : _navigator = debugNavigator ?? html.window.navigator; /// Share text diff --git a/packages/share_plus/share_plus_windows/lib/share_plus_windows.dart b/packages/share_plus/share_plus/lib/src/share_plus_windows.dart similarity index 92% rename from packages/share_plus/share_plus_windows/lib/share_plus_windows.dart rename to packages/share_plus/share_plus/lib/src/share_plus_windows.dart index f4b857fa69..9ee66de60e 100644 --- a/packages/share_plus/share_plus_windows/lib/share_plus_windows.dart +++ b/packages/share_plus/share_plus/lib/src/share_plus_windows.dart @@ -2,20 +2,20 @@ library share_plus_windows; import 'dart:ui'; -import 'package:cross_file/cross_file.dart'; -import 'package:url_launcher/url_launcher.dart'; -import 'package:share_plus_windows/src/version_helper.dart'; +import 'package:cross_file/cross_file.dart'; +import 'package:share_plus/src/windows_version_helper.dart'; import 'package:share_plus_platform_interface/share_plus_platform_interface.dart'; +import 'package:url_launcher/url_launcher.dart'; /// The fallback Windows implementation of [SharePlatform], for older Windows versions. /// -class ShareWindows extends SharePlatform { +class SharePlusWindowsPlugin extends SharePlatform { /// If the modern Share UI i.e. `DataTransferManager` is not available, then use this Dart class instead of platform specific implementation. /// static void registerWith() { if (!VersionHelper.instance.isWindows10RS5OrGreater) { - SharePlatform.instance = ShareWindows(); + SharePlatform.instance = SharePlusWindowsPlugin(); } } diff --git a/packages/share_plus/share_plus_windows/lib/src/version_helper.dart b/packages/share_plus/share_plus/lib/src/windows_version_helper.dart similarity index 100% rename from packages/share_plus/share_plus_windows/lib/src/version_helper.dart rename to packages/share_plus/share_plus/lib/src/windows_version_helper.dart diff --git a/packages/share_plus/share_plus_macos/macos/Classes/SharePlusMacosPlugin.swift b/packages/share_plus/share_plus/macos/Classes/SharePlusMacosPlugin.swift similarity index 100% rename from packages/share_plus/share_plus_macos/macos/Classes/SharePlusMacosPlugin.swift rename to packages/share_plus/share_plus/macos/Classes/SharePlusMacosPlugin.swift diff --git a/packages/share_plus/share_plus/macos/share_plus.podspec b/packages/share_plus/share_plus/macos/share_plus.podspec index 92827e005c..af109e9dfb 100644 --- a/packages/share_plus/share_plus/macos/share_plus.podspec +++ b/packages/share_plus/share_plus/macos/share_plus.podspec @@ -15,6 +15,7 @@ https://github.com/flutter/flutter/issues/46618 s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' + s.dependency 'FlutterMacOS' s.platform = :osx s.osx.deployment_target = '10.11' diff --git a/packages/share_plus/share_plus/pubspec.yaml b/packages/share_plus/share_plus/pubspec.yaml index 2163a41386..5d8f298237 100644 --- a/packages/share_plus/share_plus/pubspec.yaml +++ b/packages/share_plus/share_plus/pubspec.yaml @@ -14,13 +14,15 @@ flutter: ios: pluginClass: FLTSharePlusPlugin linux: - default_package: share_plus_linux + dartPluginClass: SharePlusLinuxPlugin macos: - default_package: share_plus_macos + pluginClass: SharePlusMacosPlugin web: - default_package: share_plus_web + pluginClass: SharePlusWebPlugin + fileName: src/share_plus_web.dart windows: - default_package: share_plus_windows + dartPluginClass: SharePlusWindowsPlugin + pluginClass: SharePlusWindowsPluginCApi dependencies: cross_file: ^0.3.3+2 @@ -28,16 +30,19 @@ dependencies: mime: ^1.0.2 flutter: sdk: flutter + flutter_web_plugins: + sdk: flutter share_plus_platform_interface: ^3.1.1 - share_plus_linux: ^3.0.1 - share_plus_macos: ^3.0.1 - share_plus_windows: ^4.0.0 - share_plus_web: ^3.1.0 + file: ^6.0.0 + url_launcher: ^6.1.2 + ffi: ^2.0.1 + win32: ^3.0.0 dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^2.0.1 + url_launcher_platform_interface: ^2.0.2 environment: sdk: ">=2.12.0 <3.0.0" diff --git a/packages/share_plus/share_plus_linux/test/share_plus_linux_test.dart b/packages/share_plus/share_plus/test/share_plus_linux_test.dart similarity index 81% rename from packages/share_plus/share_plus_linux/test/share_plus_linux_test.dart rename to packages/share_plus/share_plus/test/share_plus_linux_test.dart index 1b990673ed..b5b02ad073 100644 --- a/packages/share_plus/share_plus_linux/test/share_plus_linux_test.dart +++ b/packages/share_plus/share_plus/test/share_plus_linux_test.dart @@ -1,19 +1,19 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:share_plus_linux/share_plus_linux.dart'; +import 'package:share_plus/share_plus.dart'; import 'package:share_plus_platform_interface/share_plus_platform_interface.dart'; -import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; import 'package:url_launcher_platform_interface/link.dart'; +import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; void main() { test('registered instance', () { - ShareLinux.registerWith(); - expect(SharePlatform.instance, isA()); + SharePlusLinuxPlugin.registerWith(); + expect(SharePlatform.instance, isA()); }); test('url encoding is correct for &', () async { final mock = MockUrlLauncherPlatform(); UrlLauncherPlatform.instance = mock; - await ShareLinux().share('foo&bar', subject: 'bar&foo'); + await SharePlusLinuxPlugin().share('foo&bar', subject: 'bar&foo'); expect(mock.url, 'mailto:?subject=bar%26foo&body=foo%26bar'); }); @@ -23,7 +23,7 @@ void main() { final mock = MockUrlLauncherPlatform(); UrlLauncherPlatform.instance = mock; - await ShareLinux().share('foo bar', subject: 'bar foo'); + await SharePlusLinuxPlugin().share('foo bar', subject: 'bar foo'); expect(mock.url, 'mailto:?subject=bar%20foo&body=foo%20bar'); }); @@ -33,7 +33,8 @@ void main() { mock.canLaunchMockValue = false; UrlLauncherPlatform.instance = mock; - expect(() async => await ShareLinux().share('foo bar'), throwsException); + expect(() async => await SharePlusLinuxPlugin().share('foo bar'), + throwsException); }); } diff --git a/packages/share_plus/share_plus_windows/test/share_plus_windows_test.dart b/packages/share_plus/share_plus/test/share_plus_windows_test.dart similarity index 81% rename from packages/share_plus/share_plus_windows/test/share_plus_windows_test.dart rename to packages/share_plus/share_plus/test/share_plus_windows_test.dart index fffa7c93e4..b27469c31b 100644 --- a/packages/share_plus/share_plus_windows/test/share_plus_windows_test.dart +++ b/packages/share_plus/share_plus/test/share_plus_windows_test.dart @@ -1,18 +1,17 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:share_plus_windows/share_plus_windows.dart'; -import 'package:share_plus_windows/src/version_helper.dart'; -import 'package:share_plus_platform_interface/share_plus_platform_interface.dart'; +import 'package:share_plus/src/share_plus_windows.dart'; +import 'package:share_plus/src/windows_version_helper.dart'; import 'package:share_plus_platform_interface/method_channel/method_channel_share.dart'; - -import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; +import 'package:share_plus_platform_interface/share_plus_platform_interface.dart'; import 'package:url_launcher_platform_interface/link.dart'; +import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; void main() { test( 'registered instance', () { - ShareWindows.registerWith(); - expect(SharePlatform.instance, isA()); + SharePlusWindowsPlugin.registerWith(); + expect(SharePlatform.instance, isA()); }, skip: VersionHelper.instance.isWindows10RS5OrGreater, ); @@ -20,7 +19,7 @@ void main() { test( 'registered instance', () { - ShareWindows.registerWith(); + SharePlusWindowsPlugin.registerWith(); expect(SharePlatform.instance, isA()); }, skip: !VersionHelper.instance.isWindows10RS5OrGreater, @@ -34,7 +33,7 @@ void main() { final mock = MockUrlLauncherPlatform(); UrlLauncherPlatform.instance = mock; - await ShareWindows().share('foo&bar', subject: 'bar&foo'); + await SharePlusWindowsPlugin().share('foo&bar', subject: 'bar&foo'); expect(mock.url, 'mailto:?subject=bar%26foo&body=foo%26bar'); }, @@ -48,7 +47,7 @@ void main() { final mock = MockUrlLauncherPlatform(); UrlLauncherPlatform.instance = mock; - await ShareWindows().share('foo bar', subject: 'bar foo'); + await SharePlusWindowsPlugin().share('foo bar', subject: 'bar foo'); expect(mock.url, 'mailto:?subject=bar%20foo&body=foo%20bar'); }, @@ -62,8 +61,8 @@ void main() { mock.canLaunchMockValue = false; UrlLauncherPlatform.instance = mock; - expect( - () async => await ShareWindows().share('foo bar'), throwsException); + expect(() async => await SharePlusWindowsPlugin().share('foo bar'), + throwsException); }, skip: VersionHelper.instance.isWindows10RS5OrGreater, ); diff --git a/packages/share_plus/share_plus_windows/windows/.gitignore b/packages/share_plus/share_plus/windows/.gitignore similarity index 100% rename from packages/share_plus/share_plus_windows/windows/.gitignore rename to packages/share_plus/share_plus/windows/.gitignore diff --git a/packages/share_plus/share_plus_windows/windows/CMakeLists.txt b/packages/share_plus/share_plus/windows/CMakeLists.txt similarity index 87% rename from packages/share_plus/share_plus_windows/windows/CMakeLists.txt rename to packages/share_plus/share_plus/windows/CMakeLists.txt index d218cc0e2d..de33928673 100644 --- a/packages/share_plus/share_plus_windows/windows/CMakeLists.txt +++ b/packages/share_plus/share_plus/windows/CMakeLists.txt @@ -5,24 +5,24 @@ cmake_minimum_required(VERSION 3.14) # Project-level configuration. -set(PROJECT_NAME "share_plus_windows") +set(PROJECT_NAME "share_plus") project(${PROJECT_NAME} LANGUAGES CXX) # This value is used when generating builds using this plugin, so it must # not be changed -set(PLUGIN_NAME "share_plus_windows_plugin") +set(PLUGIN_NAME "share_plus_plugin") # Any new source files that you add to the plugin should be added here. list(APPEND PLUGIN_SOURCES - "share_plus_windows_plugin.cpp" + "share_plus_plugin.cpp" "share_plus_windows_plugin.h" ) # Define the plugin library target. Its name must not be changed (see comment # on PLUGIN_NAME above). add_library(${PLUGIN_NAME} SHARED - "include/share_plus_windows/share_plus_windows_plugin_c_api.h" - "share_plus_windows_plugin_c_api.cpp" + "include/share_plus/share_plus_windows_plugin_c_api.h" + "share_plus_plugin_c_api.cpp" ${PLUGIN_SOURCES} ) @@ -47,7 +47,7 @@ target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin) # List of absolute paths to libraries that should be bundled with the plugin. # This list could contain prebuilt libraries, or libraries created by an # external build triggered from this build file. -set(share_plus_windows_bundled_libraries +set(share_plus_bundled_libraries "" PARENT_SCOPE ) diff --git a/packages/share_plus/share_plus_windows/windows/include/share_plus_windows/share_plus_windows_plugin_c_api.h b/packages/share_plus/share_plus/windows/include/share_plus/share_plus_windows_plugin_c_api.h similarity index 86% rename from packages/share_plus/share_plus_windows/windows/include/share_plus_windows/share_plus_windows_plugin_c_api.h rename to packages/share_plus/share_plus/windows/include/share_plus/share_plus_windows_plugin_c_api.h index a5d43111eb..760ce9a727 100644 --- a/packages/share_plus/share_plus_windows/windows/include/share_plus_windows/share_plus_windows_plugin_c_api.h +++ b/packages/share_plus/share_plus/windows/include/share_plus/share_plus_windows_plugin_c_api.h @@ -17,7 +17,7 @@ FLUTTER_PLUGIN_EXPORT void SharePlusWindowsPluginCApiRegisterWithRegistrar( FlutterDesktopPluginRegistrarRef registrar); #if defined(__cplusplus) -} // extern "C" +} // extern "C" #endif -#endif // FLUTTER_PLUGIN_SHARE_PLUS_WINDOWS_PLUGIN_C_API_H_ +#endif // FLUTTER_PLUGIN_SHARE_PLUS_WINDOWS_PLUGIN_C_API_H_ diff --git a/packages/share_plus/share_plus_windows/windows/share_plus_windows_plugin.cpp b/packages/share_plus/share_plus/windows/share_plus_plugin.cpp similarity index 90% rename from packages/share_plus/share_plus_windows/windows/share_plus_windows_plugin.cpp rename to packages/share_plus/share_plus/windows/share_plus_plugin.cpp index 08e4d37603..686cde4985 100644 --- a/packages/share_plus/share_plus_windows/windows/share_plus_windows_plugin.cpp +++ b/packages/share_plus/share_plus/windows/share_plus_plugin.cpp @@ -9,14 +9,14 @@ namespace share_plus_windows { void SharePlusWindowsPlugin::RegisterWithRegistrar( - flutter::PluginRegistrarWindows* registrar) { + flutter::PluginRegistrarWindows *registrar) { auto channel = std::make_unique>( registrar->messenger(), kSharePlusChannelName, &flutter::StandardMethodCodec::GetInstance()); auto plugin = std::make_unique(registrar); channel->SetMethodCallHandler( - [plugin_pointer = plugin.get()](const auto& call, auto result) { + [plugin_pointer = plugin.get()](const auto &call, auto result) { plugin_pointer->HandleMethodCall(call, std::move(result)); }); @@ -24,7 +24,7 @@ void SharePlusWindowsPlugin::RegisterWithRegistrar( } SharePlusWindowsPlugin::SharePlusWindowsPlugin( - flutter::PluginRegistrarWindows* registrar) + flutter::PluginRegistrarWindows *registrar) : registrar_(registrar) {} SharePlusWindowsPlugin::~SharePlusWindowsPlugin() { @@ -55,8 +55,7 @@ SharePlusWindowsPlugin::GetDataTransferManager() { } HRESULT SharePlusWindowsPlugin::GetStorageFileFromPath( - wchar_t* path, - WindowsStorage::IStorageFile** file) { + wchar_t *path, WindowsStorage::IStorageFile **file) { using Microsoft::WRL::Wrappers::HStringReference; WRL::ComPtr factory = nullptr; HRESULT hr = S_OK; @@ -68,7 +67,7 @@ HRESULT SharePlusWindowsPlugin::GetStorageFileFromPath( } if (SUCCEEDED(hr)) { WRL::ComPtr< - WindowsFoundation::IAsyncOperation> + WindowsFoundation::IAsyncOperation> async_operation; hr = factory->GetFileFromPathAsync(HStringReference(path).Get(), &async_operation); @@ -92,7 +91,7 @@ HRESULT SharePlusWindowsPlugin::GetStorageFileFromPath( } void SharePlusWindowsPlugin::HandleMethodCall( - const flutter::MethodCall& method_call, + const flutter::MethodCall &method_call, std::unique_ptr> result) { if (method_call.method_name().compare(kShare) == 0 || method_call.method_name().compare(kShareWithResult) == 0) { @@ -109,9 +108,9 @@ void SharePlusWindowsPlugin::HandleMethodCall( share_subject_ = *subject_value; } auto callback = WRL::Callback>( - [&](auto&&, DataTransfer::IDataRequestedEventArgs* e) { + DataTransfer::DataTransferManager *, + DataTransfer::DataRequestedEventArgs *>>( + [&](auto &&, DataTransfer::IDataRequestedEventArgs *e) { using Microsoft::WRL::Wrappers::HStringReference; WRL::ComPtr request; e->get_Request(&request); @@ -165,21 +164,21 @@ void SharePlusWindowsPlugin::HandleMethodCall( if (auto paths = std::get_if( &args[flutter::EncodableValue("paths")])) { paths_.clear(); - for (auto& path : *paths) { + for (auto &path : *paths) { paths_.emplace_back(std::get(path)); } } if (auto mime_types = std::get_if( &args[flutter::EncodableValue("mimeTypes")])) { mime_types_.clear(); - for (auto& mime_type : *mime_types) { + for (auto &mime_type : *mime_types) { mime_types_.emplace_back(std::get(mime_type)); } } auto callback = WRL::Callback>( - [&](auto&&, DataTransfer::IDataRequestedEventArgs* e) { + DataTransfer::DataTransferManager *, + DataTransfer::DataRequestedEventArgs *>>( + [&](auto &&, DataTransfer::IDataRequestedEventArgs *e) { using Microsoft::WRL::Wrappers::HStringReference; WRL::ComPtr request; e->get_Request(&request); @@ -220,15 +219,15 @@ void SharePlusWindowsPlugin::HandleMethodCall( data->SetText(HStringReference(text.c_str()).Get()); } // Add files to the data. - Vector storage_items; - for (const std::string& path : paths_) { + Vector storage_items; + for (const std::string &path : paths_) { auto str = Utf16FromUtf8(path); - wchar_t* ptr = const_cast(str.c_str()); - WindowsStorage::IStorageFile* file = nullptr; + wchar_t *ptr = const_cast(str.c_str()); + WindowsStorage::IStorageFile *file = nullptr; if (SUCCEEDED(GetStorageFileFromPath(ptr, &file)) && file != nullptr) { storage_items.Append( - reinterpret_cast(file)); + reinterpret_cast(file)); } } data->SetStorageItemsReadOnly(&storage_items); @@ -267,4 +266,4 @@ std::wstring SharePlusWindowsPlugin::Utf16FromUtf8(std::string string) { return result; } -} // namespace share_plus_windows +} // namespace share_plus_windows diff --git a/packages/share_plus/share_plus_windows/windows/share_plus_windows_plugin_c_api.cpp b/packages/share_plus/share_plus/windows/share_plus_plugin_c_api.cpp similarity index 84% rename from packages/share_plus/share_plus_windows/windows/share_plus_windows_plugin_c_api.cpp rename to packages/share_plus/share_plus/windows/share_plus_plugin_c_api.cpp index 8237a1b8fb..b33c00f915 100644 --- a/packages/share_plus/share_plus_windows/windows/share_plus_windows_plugin_c_api.cpp +++ b/packages/share_plus/share_plus/windows/share_plus_plugin_c_api.cpp @@ -1,4 +1,4 @@ -#include "include/share_plus_windows/share_plus_windows_plugin_c_api.h" +#include "include/share_plus/share_plus_windows_plugin_c_api.h" #include diff --git a/packages/share_plus/share_plus_windows/windows/share_plus_windows_plugin.h b/packages/share_plus/share_plus/windows/share_plus_windows_plugin.h similarity index 82% rename from packages/share_plus/share_plus_windows/windows/share_plus_windows_plugin.h rename to packages/share_plus/share_plus/windows/share_plus_windows_plugin.h index b96f9b3b0c..83d201c829 100644 --- a/packages/share_plus/share_plus_windows/windows/share_plus_windows_plugin.h +++ b/packages/share_plus/share_plus/windows/share_plus_windows_plugin.h @@ -27,17 +27,17 @@ namespace DataTransfer = ABI::Windows::ApplicationModel::DataTransfer; namespace share_plus_windows { class SharePlusWindowsPlugin : public flutter::Plugin { - public: - static void RegisterWithRegistrar(flutter::PluginRegistrarWindows* registrar); +public: + static void RegisterWithRegistrar(flutter::PluginRegistrarWindows *registrar); - SharePlusWindowsPlugin(flutter::PluginRegistrarWindows* registrar); + SharePlusWindowsPlugin(flutter::PluginRegistrarWindows *registrar); virtual ~SharePlusWindowsPlugin(); - SharePlusWindowsPlugin(const SharePlusWindowsPlugin&) = delete; - SharePlusWindowsPlugin& operator=(const SharePlusWindowsPlugin&) = delete; + SharePlusWindowsPlugin(const SharePlusWindowsPlugin &) = delete; + SharePlusWindowsPlugin &operator=(const SharePlusWindowsPlugin &) = delete; - private: +private: static constexpr auto kSharePlusChannelName = "dev.fluttercommunity.plus/share"; @@ -54,15 +54,15 @@ class SharePlusWindowsPlugin : public flutter::Plugin { WRL::ComPtr GetDataTransferManager(); void HandleMethodCall( - const flutter::MethodCall& method_call, + const flutter::MethodCall &method_call, std::unique_ptr> result); - static HRESULT GetStorageFileFromPath(wchar_t* path, - WindowsStorage::IStorageFile** file); + static HRESULT GetStorageFileFromPath(wchar_t *path, + WindowsStorage::IStorageFile **file); static std::wstring SharePlusWindowsPlugin::Utf16FromUtf8(std::string string); - flutter::PluginRegistrarWindows* registrar_ = nullptr; + flutter::PluginRegistrarWindows *registrar_ = nullptr; WRL::ComPtr data_transfer_manager_interop_ = nullptr; WRL::ComPtr data_transfer_manager_ = @@ -78,6 +78,6 @@ class SharePlusWindowsPlugin : public flutter::Plugin { std::vector mime_types_ = {}; }; -} // namespace share_plus_windows +} // namespace share_plus_windows -#endif // FLUTTER_PLUGIN_SHARE_PLUS_WINDOWS_PLUGIN_H_ +#endif // FLUTTER_PLUGIN_SHARE_PLUS_WINDOWS_PLUGIN_H_ diff --git a/packages/share_plus/share_plus_windows/windows/vector.h b/packages/share_plus/share_plus/windows/vector.h similarity index 79% rename from packages/share_plus/share_plus_windows/windows/vector.h rename to packages/share_plus/share_plus/windows/vector.h index c33319b5f5..105e42c222 100644 --- a/packages/share_plus/share_plus_windows/windows/vector.h +++ b/packages/share_plus/share_plus/windows/vector.h @@ -3,13 +3,13 @@ #pragma once -#include +#include "winstring.h" #include +#include #include #include #include #include -#include "winstring.h" #include #include @@ -35,10 +35,10 @@ using namespace Microsoft::WRL::Wrappers; class HResultException { HRESULT m_Hr; - protected: +protected: explicit HResultException(HRESULT hr) : m_Hr(hr) {} - public: +public: HRESULT GetHr() const { return m_Hr; } __declspec(noreturn) friend void ThrowHR(HRESULT); @@ -65,8 +65,8 @@ __declspec(noreturn) __declspec(noinline) inline void ThrowHR(HRESULT hr, ThrowHR(hr); } -__declspec(noreturn) __declspec( - noinline) inline void ThrowHR(HRESULT hr, wchar_t const* message) { +__declspec(noreturn) __declspec(noinline) inline void ThrowHR( + HRESULT hr, wchar_t const *message) { using ::Microsoft::WRL::Wrappers::HStringReference; ThrowHR(hr, HStringReference(message).Get()); @@ -87,13 +87,12 @@ inline void ThrowIfFailed(HRESULT hr) { // Throws if the given pointer is null. // template -inline void ThrowIfNullPointer(T* ptr, HRESULT hrToThrow) { +inline void ThrowIfNullPointer(T *ptr, HRESULT hrToThrow) { if (ptr == nullptr) ThrowHR(hrToThrow); } -template -inline void ThrowIfNegative(T value) { +template inline void ThrowIfNegative(T value) { if (value < 0) ThrowHR(E_INVALIDARG); } @@ -109,8 +108,7 @@ inline void ThrowIfZeroOrNegative(uint32_t n) { // expected to be used at the beginning of methods to validate pointer // parameters that are marked as [in]. // -template -inline void CheckInPointer(T* ptr) { +template inline void CheckInPointer(T *ptr) { ThrowIfNullPointer(ptr, E_INVALIDARG); } @@ -119,8 +117,7 @@ inline void CheckInPointer(T* ptr) { // it to null. This is expected to be used at the beginning of methods to // validate out pointer parameters that are marked as [out]. // -template -inline void CheckAndClearOutPointer(T** ptr) { +template inline void CheckAndClearOutPointer(T **ptr) { CheckInPointer(ptr); *ptr = nullptr; } @@ -148,17 +145,16 @@ inline void CheckMakeResult(bool result) { __declspec(noinline) inline HRESULT ThrownExceptionToHResult() { try { throw; - } catch (HResultException const& e) { + } catch (HResultException const &e) { return e.GetHr(); - } catch (std::bad_alloc const&) { + } catch (std::bad_alloc const &) { return E_OUTOFMEMORY; } catch (...) { return E_UNEXPECTED; } } -template -HRESULT ExceptionBoundary(CALLABLE&& fn) { +template HRESULT ExceptionBoundary(CALLABLE &&fn) { try { fn(); return S_OK; @@ -171,83 +167,78 @@ HRESULT ExceptionBoundary(CALLABLE&& fn) { // collection. This default implementation is for value types. The same template // is specialized with more interesting versions for reference counted pointer // types and strings. -template -struct ElementTraits { +template struct ElementTraits { typedef T ElementType; - static ElementType Wrap(T const& value) { return value; } + static ElementType Wrap(T const &value) { return value; } - static void Unwrap(ElementType const& value, _Out_ T* result) { + static void Unwrap(ElementType const &value, _Out_ T *result) { *result = value; } - static bool Equals(T const& value1, T const& value2) { + static bool Equals(T const &value1, T const &value2) { return value1 == value2; } - static void CopyTo(T const& in, ElementType* out) { *out = in; } + static void CopyTo(T const &in, ElementType *out) { *out = in; } }; // Specialized element traits for reference counted pointer types. -template -struct ElementTraits { +template struct ElementTraits { typedef Microsoft::WRL::ComPtr ElementType; - static ElementType Wrap(T* value) { return Microsoft::WRL::ComPtr(value); } + static ElementType Wrap(T *value) { return Microsoft::WRL::ComPtr(value); } - static void Unwrap(ElementType const& value, _Out_ T** result) { + static void Unwrap(ElementType const &value, _Out_ T **result) { ThrowIfFailed(value.CopyTo(result)); } - static bool Equals(Microsoft::WRL::ComPtr const& value1, T* value2) { + static bool Equals(Microsoft::WRL::ComPtr const &value1, T *value2) { return value1.Get() == value2; } - static void CopyTo(Microsoft::WRL::ComPtr const& in, ElementType* out) { + static void CopyTo(Microsoft::WRL::ComPtr const &in, ElementType *out) { in.CopyTo(out->GetAddressOf()); } }; // Specialized element traits for strings. -template <> -struct ElementTraits { +template <> struct ElementTraits { typedef HString ElementType; - static ElementType Wrap(HSTRING const& value) { + static ElementType Wrap(HSTRING const &value) { HString hstringValue; hstringValue.Set(value); return hstringValue; } - static void Unwrap(ElementType const& value, _Out_ HSTRING* result) { + static void Unwrap(ElementType const &value, _Out_ HSTRING *result) { value.CopyTo(result); } - static bool Equals(HString const& value1, HSTRING const& value2) { + static bool Equals(HString const &value1, HSTRING const &value2) { int compareResult; ThrowIfFailed( WindowsCompareStringOrdinal(value1.Get(), value2, &compareResult)); return compareResult == 0; } - static void CopyTo(HString const& in, ElementType* out) { + static void CopyTo(HString const &in, ElementType *out) { in.CopyTo(out->GetAddressOf()); } }; // Vector traits describe how the collection itself is implemented. // This default version just uses an STL vector. -template -struct DefaultVectorTraits : public ElementTraits { +template struct DefaultVectorTraits : public ElementTraits { typedef std::vector InternalVectorType; - static unsigned GetSize(InternalVectorType const& vector) { + static unsigned GetSize(InternalVectorType const &vector) { return (unsigned)vector.size(); }; - static void GetAt(InternalVectorType const& vector, - unsigned index, - ElementType* element) { + static void GetAt(InternalVectorType const &vector, unsigned index, + ElementType *element) { if (index >= vector.size()) ThrowHR(E_BOUNDS); @@ -255,34 +246,33 @@ struct DefaultVectorTraits : public ElementTraits { return; } - static void SetAt(InternalVectorType& vector, unsigned index, T const& item) { + static void SetAt(InternalVectorType &vector, unsigned index, T const &item) { if (index >= vector.size()) ThrowHR(E_BOUNDS); vector[index] = Wrap(item); } - static void InsertAt(InternalVectorType& vector, - unsigned index, - T const& item) { + static void InsertAt(InternalVectorType &vector, unsigned index, + T const &item) { if (index > vector.size()) ThrowHR(E_BOUNDS); vector.insert(vector.begin() + index, Wrap(item)); } - static void RemoveAt(InternalVectorType& vector, unsigned index) { + static void RemoveAt(InternalVectorType &vector, unsigned index) { if (index >= vector.size()) ThrowHR(E_BOUNDS); vector.erase(vector.begin() + index); } - static void Append(InternalVectorType& vector, T const& item) { + static void Append(InternalVectorType &vector, T const &item) { vector.push_back(Wrap(item)); } - static void Clear(InternalVectorType& vector) { vector.clear(); } + static void Clear(InternalVectorType &vector) { vector.clear(); } }; // Implements the WinRT IVector interface. @@ -293,7 +283,7 @@ class Vector : public Microsoft::WRL::RuntimeClass< ABI::Windows::Foundation::Collections::IIterable> { InspectableClass(IVector::z_get_rc_name_impl(), BaseTrust); - public: +public: // T_abi is often the same as T, but if T is a runtime class, T_abi will be // the corresponding interface. typedef typename ABI::Windows::Foundation::Internal::GetAbiType< @@ -302,22 +292,21 @@ class Vector : public Microsoft::WRL::RuntimeClass< // Specialize our traits class to use the ABI version of the type. typedef Traits Traits; - private: +private: // Fields. typename Traits::InternalVectorType mVector; bool isFixedSize; bool isChanged; - public: +public: // Constructs an empty vector. Vector() : isFixedSize(false), isChanged(false) {} // Constructs a vector of the specified size. template - Vector(bool isFixedSize, Args&&... args) - : mVector(std::forward(args)...), - isFixedSize(isFixedSize), + Vector(bool isFixedSize, Args &&...args) + : mVector(std::forward(args)...), isFixedSize(isFixedSize), isChanged(false) {} // Checks whether this vector is fixed or resizable. @@ -332,9 +321,9 @@ class Vector : public Microsoft::WRL::RuntimeClass< // Expose direct access to the internal STL collection. This lets C++ owners // bypass the ExceptionBoundary overhead of the public WinRT API surface. - typename Traits::InternalVectorType& InternalVector() { return mVector; } + typename Traits::InternalVectorType &InternalVector() { return mVector; } - virtual HRESULT STDMETHODCALLTYPE get_Size(_Out_ unsigned* size) { + virtual HRESULT STDMETHODCALLTYPE get_Size(_Out_ unsigned *size) { return ExceptionBoundary([&] { CheckInPointer(size); @@ -343,7 +332,7 @@ class Vector : public Microsoft::WRL::RuntimeClass< }; virtual HRESULT STDMETHODCALLTYPE GetAt(_In_opt_ unsigned index, - _Out_ T_abi* item) { + _Out_ T_abi *item) { return ExceptionBoundary([&] { CheckInPointer(item); ZeroMemory(item, sizeof(*item)); @@ -355,8 +344,8 @@ class Vector : public Microsoft::WRL::RuntimeClass< } virtual HRESULT STDMETHODCALLTYPE IndexOf(_In_opt_ T_abi value, - _Out_ unsigned* index, - _Out_ boolean* found) { + _Out_ unsigned *index, + _Out_ boolean *found) { return ExceptionBoundary([&] { CheckInPointer(index); CheckInPointer(found); @@ -439,7 +428,7 @@ class Vector : public Microsoft::WRL::RuntimeClass< } virtual HRESULT STDMETHODCALLTYPE ReplaceAll(_In_ unsigned count, - _In_reads_(count) T_abi* value) { + _In_reads_(count) T_abi *value) { return ExceptionBoundary([&] { CheckInPointer(value); @@ -464,7 +453,7 @@ class Vector : public Microsoft::WRL::RuntimeClass< virtual HRESULT STDMETHODCALLTYPE GetView( _Outptr_result_maybenull_ - ABI::Windows::Foundation::Collections::IVectorView** view) { + ABI::Windows::Foundation::Collections::IVectorView **view) { return ExceptionBoundary([&] { CheckAndClearOutPointer(view); @@ -477,7 +466,7 @@ class Vector : public Microsoft::WRL::RuntimeClass< virtual HRESULT STDMETHODCALLTYPE First( _Outptr_result_maybenull_ - ABI::Windows::Foundation::Collections::IIterator** first) { + ABI::Windows::Foundation::Collections::IIterator **first) { return ExceptionBoundary([&] { CheckAndClearOutPointer(first); @@ -499,29 +488,29 @@ class VectorView : public Microsoft::WRL::RuntimeClass< // Fields. Microsoft::WRL::ComPtr mVector; - public: +public: // Constructor wraps around an existing Vector. - VectorView(TVector* vector) : mVector(vector) {} + VectorView(TVector *vector) : mVector(vector) {} - virtual HRESULT STDMETHODCALLTYPE get_Size(_Out_ unsigned* size) { + virtual HRESULT STDMETHODCALLTYPE get_Size(_Out_ unsigned *size) { return mVector->get_Size(size); }; virtual HRESULT STDMETHODCALLTYPE GetAt(_In_opt_ unsigned index, - _Out_ typename TVector::T_abi* item) { + _Out_ typename TVector::T_abi *item) { return mVector->GetAt(index, item); } virtual HRESULT STDMETHODCALLTYPE IndexOf(_In_opt_ typename TVector::T_abi value, - _Out_ unsigned* index, - _Out_ boolean* found) { + _Out_ unsigned *index, + _Out_ boolean *found) { return mVector->IndexOf(value, index, found); } virtual HRESULT STDMETHODCALLTYPE First( _Outptr_result_maybenull_ - ABI::Windows::Foundation::Collections::IIterator** first) { + ABI::Windows::Foundation::Collections::IIterator **first) { return mVector->First(first); } }; @@ -537,16 +526,16 @@ class VectorIterator Microsoft::WRL::ComPtr mVector; unsigned mPosition; - public: +public: // Constructor wraps around an existing Vector. - VectorIterator(TVector* vector) : mVector(vector), mPosition(0) {} + VectorIterator(TVector *vector) : mVector(vector), mPosition(0) {} virtual HRESULT STDMETHODCALLTYPE - get_Current(_Out_ typename TVector::T_abi* current) { + get_Current(_Out_ typename TVector::T_abi *current) { return mVector->GetAt(mPosition, current); } - virtual HRESULT STDMETHODCALLTYPE get_HasCurrent(_Out_ boolean* hasCurrent) { + virtual HRESULT STDMETHODCALLTYPE get_HasCurrent(_Out_ boolean *hasCurrent) { return ExceptionBoundary([&] { CheckInPointer(hasCurrent); @@ -555,7 +544,7 @@ class VectorIterator }); } - virtual HRESULT STDMETHODCALLTYPE MoveNext(_Out_ boolean* hasCurrent) { + virtual HRESULT STDMETHODCALLTYPE MoveNext(_Out_ boolean *hasCurrent) { return ExceptionBoundary([&] { CheckInPointer(hasCurrent); diff --git a/packages/share_plus/share_plus_linux/.gitignore b/packages/share_plus/share_plus_linux/.gitignore deleted file mode 100644 index 88ce490e47..0000000000 --- a/packages/share_plus/share_plus_linux/.gitignore +++ /dev/null @@ -1,47 +0,0 @@ -.DS_Store -.atom/ -.idea/ -.vscode/ - -.packages -.pub/ -.dart_tool/ -pubspec.lock -flutter_export_environment.sh - -examples/all_plugins/pubspec.yaml - -Podfile -Podfile.lock -Pods/ -.symlinks/ -**/Flutter/App.framework/ -**/Flutter/ephemeral/ -**/Flutter/Flutter.framework/ -**/Flutter/Generated.xcconfig -**/Flutter/flutter_assets/ - -ServiceDefinitions.json -xcuserdata/ -**/DerivedData/ - -local.properties -keystore.properties -.gradle/ -gradlew -gradlew.bat -gradle-wrapper.jar -.flutter-plugins-dependencies -*.iml - -generated_plugin_registrant.dart -GeneratedPluginRegistrant.h -GeneratedPluginRegistrant.m -GeneratedPluginRegistrant.java -GeneratedPluginRegistrant.swift -build/ -.flutter-plugins - -.project -.classpath -.settings diff --git a/packages/share_plus/share_plus_linux/.metadata b/packages/share_plus/share_plus_linux/.metadata deleted file mode 100644 index c05ad03edc..0000000000 --- a/packages/share_plus/share_plus_linux/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: 9d7bdb5903bc7149b415bf268fa3c6413355e7ad - channel: master - -project_type: package diff --git a/packages/share_plus/share_plus_linux/CHANGELOG.md b/packages/share_plus/share_plus_linux/CHANGELOG.md deleted file mode 100644 index b290bcece5..0000000000 --- a/packages/share_plus/share_plus_linux/CHANGELOG.md +++ /dev/null @@ -1,35 +0,0 @@ -## 3.0.1 - - - **FIX**: Share.shareXFiles resulting in stack-overflow on Windows & Linux (#1186). - -## 3.0.0 - -- Version bump - -## 2.0.4 - -- Fixes: sharing in isolated sandboxes like Flatpak - -## 2.0.3 - -- Hotfix on 2.0.2, improved solution. - -## 2.0.2 - -- Fixes: share URL is constructed incorrectly #235 - -## 2.0.1 - -- Improve documentation - -## 2.0.0 - -- Migrated to null safety - -## 1.1.0 - -- Transfer to plus-plugins monorepo - -## 1.0.0 - -- Initial Linux support. diff --git a/packages/share_plus/share_plus_linux/LICENSE b/packages/share_plus/share_plus_linux/LICENSE deleted file mode 100644 index 484084f72d..0000000000 --- a/packages/share_plus/share_plus_linux/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 The Flutter Community Plus Plugin Authors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/share_plus/share_plus_linux/README.md b/packages/share_plus/share_plus_linux/README.md deleted file mode 100644 index ec7a901ef6..0000000000 --- a/packages/share_plus/share_plus_linux/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Share Plus Linux - -[![Flutter Community: share_plus_linux](https://fluttercommunity.dev/_github/header/share_plus_linux)](https://github.com/fluttercommunity/community) - -[![pub package](https://img.shields.io/pub/v/share_plus_linux.svg)](https://pub.dev/packages/share_plus_linux) - -The Linux implementation of [`share_plus`](https://pub.dev/packages/share_plus). - -## Usage - -This package is already included as part of the `share_plus` package dependency, and will -be included when using `share_plus` as normal. diff --git a/packages/share_plus/share_plus_linux/pubspec.yaml b/packages/share_plus/share_plus_linux/pubspec.yaml deleted file mode 100644 index 2f7d043889..0000000000 --- a/packages/share_plus/share_plus_linux/pubspec.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: share_plus_linux -description: Linux implementation of the share_plus plugin -version: 3.0.1 -homepage: https://plus.fluttercommunity.dev/ -repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/ - -environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.20.0" - -dependencies: - cross_file: ^0.3.3+2 - share_plus_platform_interface: ^3.0.2 - file: ^6.0.0 - flutter: - sdk: flutter - meta: ^1.3.0 - url_launcher: ^6.1.2 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ^2.0.1 - url_launcher_platform_interface: ^2.0.2 - -flutter: - plugin: - implements: share_plus - platforms: - linux: - dartPluginClass: ShareLinux - pluginClass: none diff --git a/packages/share_plus/share_plus_macos/.gitignore b/packages/share_plus/share_plus_macos/.gitignore deleted file mode 100644 index e9dc58d3d6..0000000000 --- a/packages/share_plus/share_plus_macos/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.DS_Store -.dart_tool/ - -.packages -.pub/ - -build/ diff --git a/packages/share_plus/share_plus_macos/.metadata b/packages/share_plus/share_plus_macos/.metadata deleted file mode 100644 index d3466449fc..0000000000 --- a/packages/share_plus/share_plus_macos/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: 79b49b9e1057f90ebf797725233c6b311722de69 - channel: beta - -project_type: plugin diff --git a/packages/share_plus/share_plus_macos/CHANGELOG.md b/packages/share_plus/share_plus_macos/CHANGELOG.md deleted file mode 100644 index 4fdba95b01..0000000000 --- a/packages/share_plus/share_plus_macos/CHANGELOG.md +++ /dev/null @@ -1,20 +0,0 @@ -## 3.0.1 - -- Update lints -- Fix analyzer warnings - -## 3.0.0 - -- Add *WithResult methods to get feedback on user action - -## 2.0.2 - -- Obtain Flutter view from the registrar - -## 2.0.1 - -- Improve documentation - -## 2.0.0 - -- Initial null-safe macOS support diff --git a/packages/share_plus/share_plus_macos/LICENSE b/packages/share_plus/share_plus_macos/LICENSE deleted file mode 100644 index 176a661f7e..0000000000 --- a/packages/share_plus/share_plus_macos/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2017, the Flutter project authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/share_plus/share_plus_macos/README.md b/packages/share_plus/share_plus_macos/README.md deleted file mode 100644 index 7ec7b77e2b..0000000000 --- a/packages/share_plus/share_plus_macos/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Share Plus macOS - -[![Flutter Community: share_plus_macos](https://fluttercommunity.dev/_github/header/share_plus_macos)](https://github.com/fluttercommunity/community) - -[![pub package](https://img.shields.io/pub/v/share_plus_macos.svg)](https://pub.dev/packages/share_plus_macos) - -The macOS implementation of [`share_plus`](https://pub.dev/packages/share_plus). - -## Usage - -This package is already included as part of the `share_plus` package dependency, and will -be included when using `share_plus` as normal. diff --git a/packages/share_plus/share_plus_macos/macos/share_plus_macos.podspec b/packages/share_plus/share_plus_macos/macos/share_plus_macos.podspec deleted file mode 100644 index 126418706f..0000000000 --- a/packages/share_plus/share_plus_macos/macos/share_plus_macos.podspec +++ /dev/null @@ -1,22 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint share_plus_macos.podspec` to validate before publishing. -# -Pod::Spec.new do |s| - s.name = 'share_plus_macos' - s.version = '0.0.1' - s.summary = 'Share Plus for macOS' - s.description = <<-DESC -A Flutter plugin for sharing text and files. - DESC - s.homepage = 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/share_plus_macos' - s.license = { :file => '../LICENSE' } - s.author = { 'Flutter Community' => 'authors@fluttercommunity.dev' } - s.source = { :path => 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/share_plus_macos' } - s.source_files = 'Classes/**/*' - s.dependency 'FlutterMacOS' - - s.platform = :osx, '10.11' - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } - s.swift_version = '5.0' -end diff --git a/packages/share_plus/share_plus_macos/pubspec.yaml b/packages/share_plus/share_plus_macos/pubspec.yaml deleted file mode 100644 index 6fcfe981b5..0000000000 --- a/packages/share_plus/share_plus_macos/pubspec.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: share_plus_macos -description: MacOS implementation of the share_plus plugin -version: 3.0.1 -homepage: https://plus.fluttercommunity.dev/ -repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/ - -environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.20.0" - -dependencies: - share_plus_platform_interface: ^3.0.2 - flutter: - sdk: flutter - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ^2.0.1 - -flutter: - plugin: - platforms: - macos: - pluginClass: SharePlusMacosPlugin diff --git a/packages/share_plus/share_plus_web/CHANGELOG.md b/packages/share_plus/share_plus_web/CHANGELOG.md deleted file mode 100644 index cc7dfbb07b..0000000000 --- a/packages/share_plus/share_plus_web/CHANGELOG.md +++ /dev/null @@ -1,39 +0,0 @@ -## 3.1.0 - -- Add `shareXFiles` implementations -- Deprecate `shareFiles*` implementations -- Enable `shareXFiles` implementations on Web - -## 3.0.1 - -- Update dependencies -- Fix analyzer warnings -- Update `urlLauncher` and replace deprecated `launch` calls - -## 3.0.0 - -- Bump dependencies - -## 2.0.4 - -- Hotfix on 2.0.3, improved solution. - -## 2.0.3 - -- Fix #235: share URL is constructed incorrectly - -## 2.0.2 - -- Fix #201: avoid call to "tomail:" when canceling "Share" - -## 2.0.1 - -- Improve documentation - -## 2.0.0 - -- Migrated to null safety - -## 0.1.0 - -- Initial open-source release. diff --git a/packages/share_plus/share_plus_web/LICENSE b/packages/share_plus/share_plus_web/LICENSE deleted file mode 100644 index c89293372c..0000000000 --- a/packages/share_plus/share_plus_web/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/share_plus/share_plus_web/README.md b/packages/share_plus/share_plus_web/README.md deleted file mode 100644 index acfaba99b8..0000000000 --- a/packages/share_plus/share_plus_web/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Share Plus Web - -[![Flutter Community: share_plus_web](https://fluttercommunity.dev/_github/header/share_plus_web)](https://github.com/fluttercommunity/community) - -[![pub package](https://img.shields.io/pub/v/share_plus_web.svg)](https://pub.dev/packages/share_plus_web) - -The Web implementation of [`share_plus`](https://pub.dev/packages/share_plus). - -## Usage - -This package is already included as part of the `share_plus` package dependency, and will -be included when using `share_plus` as normal. diff --git a/packages/share_plus/share_plus_web/pubspec.yaml b/packages/share_plus/share_plus_web/pubspec.yaml deleted file mode 100644 index 133ad3c41c..0000000000 --- a/packages/share_plus/share_plus_web/pubspec.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: share_plus_web -description: Web platform implementation of share_plus -homepage: https://plus.fluttercommunity.dev/ -repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/ -version: 3.1.0 - -flutter: - plugin: - platforms: - web: - pluginClass: SharePlusPlugin - fileName: share_plus_web.dart - -dependencies: - cross_file: ^0.3.3+2 - share_plus_platform_interface: ^3.0.2 - url_launcher: ^6.1.2 - flutter: - sdk: flutter - flutter_web_plugins: - sdk: flutter - meta: ^1.7.0 - mime: ^1.0.0 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ^2.0.1 - -environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.20.0" diff --git a/packages/share_plus/share_plus_windows/.clang-format b/packages/share_plus/share_plus_windows/.clang-format deleted file mode 100644 index 3c73f32a33..0000000000 --- a/packages/share_plus/share_plus_windows/.clang-format +++ /dev/null @@ -1,12 +0,0 @@ -# Defines the Chromium style for automatic reformatting. -# http://clang.llvm.org/docs/ClangFormatStyleOptions.html -BasedOnStyle: Chromium -# This defaults to 'Auto'. Explicitly set it for a while, so that -# 'vector >' in existing files gets formatted to -# 'vector>'. ('Auto' means that clang-format will only use -# 'int>>' if the file already contains at least one such instance.) -Standard: Cpp11 -SortIncludes: true ---- -Language: ObjC -ColumnLimit: 100 diff --git a/packages/share_plus/share_plus_windows/.gitignore b/packages/share_plus/share_plus_windows/.gitignore deleted file mode 100644 index 1985397a2c..0000000000 --- a/packages/share_plus/share_plus_windows/.gitignore +++ /dev/null @@ -1,74 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.packages -.pub-cache/ -.pub/ -build/ - -# Android related -**/android/**/gradle-wrapper.jar -**/android/.gradle -**/android/captures/ -**/android/gradlew -**/android/gradlew.bat -**/android/local.properties -**/android/**/GeneratedPluginRegistrant.java - -# iOS/XCode related -**/ios/**/*.mode1v3 -**/ios/**/*.mode2v3 -**/ios/**/*.moved-aside -**/ios/**/*.pbxuser -**/ios/**/*.perspectivev3 -**/ios/**/*sync/ -**/ios/**/.sconsign.dblite -**/ios/**/.tags* -**/ios/**/.vagrant/ -**/ios/**/DerivedData/ -**/ios/**/Icon? -**/ios/**/Pods/ -**/ios/**/.symlinks/ -**/ios/**/profile -**/ios/**/xcuserdata -**/ios/.generated/ -**/ios/Flutter/App.framework -**/ios/Flutter/Flutter.framework -**/ios/Flutter/Flutter.podspec -**/ios/Flutter/Generated.xcconfig -**/ios/Flutter/app.flx -**/ios/Flutter/app.zip -**/ios/Flutter/flutter_assets/ -**/ios/Flutter/flutter_export_environment.sh -**/ios/ServiceDefinitions.json -**/ios/Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!**/ios/**/default.mode1v3 -!**/ios/**/default.mode2v3 -!**/ios/**/default.pbxuser -!**/ios/**/default.perspectivev3 diff --git a/packages/share_plus/share_plus_windows/.metadata b/packages/share_plus/share_plus_windows/.metadata deleted file mode 100644 index c05ad03edc..0000000000 --- a/packages/share_plus/share_plus_windows/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: 9d7bdb5903bc7149b415bf268fa3c6413355e7ad - channel: master - -project_type: package diff --git a/packages/share_plus/share_plus_windows/CHANGELOG.md b/packages/share_plus/share_plus_windows/CHANGELOG.md deleted file mode 100644 index cd4dd89e54..0000000000 --- a/packages/share_plus/share_plus_windows/CHANGELOG.md +++ /dev/null @@ -1,40 +0,0 @@ -## 4.0.0 - -> Note: This release has breaking changes. - - - **FIX**: Share.shareXFiles resulting in stack-overflow on Windows & Linux (#1186). - - **BREAKING** **FEAT**: Native share UI for Windows (#1158). - -## 3.0.1 - -- Update dependencies -- Fix analyzer warnings -- Update `urlLauncher` and replace deprecated `launch` calls - -## 3.0.0 - -- Bump dependencies - -## 2.0.3 - -- Hotfix on 2.0.2, improved solution. - -## 2.0.2 - -- Fixes: share URL is constructed incorrectly #235 - -## 2.0.1 - -- Improve documentation - -## 2.0.0 - -- Migrated to null safety - -## 0.1.0 - -- Transfer to plus-plugins monorepo - -## 0.0.1 - -- Initial Windows support. diff --git a/packages/share_plus/share_plus_windows/LICENSE b/packages/share_plus/share_plus_windows/LICENSE deleted file mode 100644 index 484084f72d..0000000000 --- a/packages/share_plus/share_plus_windows/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 The Flutter Community Plus Plugin Authors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/share_plus/share_plus_windows/README.md b/packages/share_plus/share_plus_windows/README.md deleted file mode 100644 index 9a8710f76b..0000000000 --- a/packages/share_plus/share_plus_windows/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Share Plus Windows - -[![Flutter Community: share_plus_windows](https://fluttercommunity.dev/_github/header/share_plus_windows)](https://github.com/fluttercommunity/community) - -[![pub package](https://img.shields.io/pub/v/share_plus_windows.svg)](https://pub.dev/packages/share_plus_windows) - -The Windows implementation of [`share_plus`](https://pub.dev/packages/share_plus). - -## Usage - -This package is already included as part of the `share_plus` package dependency, and will -be included when using `share_plus` as normal. diff --git a/packages/share_plus/share_plus_windows/pubspec.yaml b/packages/share_plus/share_plus_windows/pubspec.yaml deleted file mode 100644 index a148de70d7..0000000000 --- a/packages/share_plus/share_plus_windows/pubspec.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: share_plus_windows -description: Windows implementation of the share_plus plugin -version: 4.0.0 -homepage: https://plus.fluttercommunity.dev/ -repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/ - -environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.20.0" - -dependencies: - cross_file: ^0.3.3+2 - share_plus_platform_interface: ^3.0.2 - flutter: - sdk: flutter - meta: ^1.7.0 - url_launcher: ^6.1.2 - ffi: ^2.0.1 - win32: ^3.0.0 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ^2.0.1 - url_launcher_platform_interface: ^2.0.2 - -flutter: - plugin: - implements: share_plus - platforms: - windows: - dartPluginClass: ShareWindows - pluginClass: SharePlusWindowsPluginCApi