From 27b847ea4b123d5bbaa6e186a913f3a736a66c9f Mon Sep 17 00:00:00 2001 From: Hari Hara Sudhan Date: Wed, 21 Dec 2022 19:05:48 +0530 Subject: [PATCH] FLUT-7164-[feature]: Modifed the pubspec file --- .../plugins/GeneratedPluginRegistrant.java | 39 ++++--- android/local.properties | 4 +- linux/flutter/generated_plugin_registrant.cc | 6 ++ linux/flutter/generated_plugin_registrant.h | 2 + linux/flutter/generated_plugins.cmake | 9 ++ macos/Flutter/GeneratedPluginRegistrant.swift | 4 + pubspec.yaml | 102 +++--------------- .../flutter/generated_plugin_registrant.cc | 6 ++ windows/flutter/generated_plugins.cmake | 10 ++ 9 files changed, 78 insertions(+), 104 deletions(-) diff --git a/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java index 5df48af7..ed1c47e3 100644 --- a/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java +++ b/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -1,27 +1,34 @@ package io.flutter.plugins; -import io.flutter.plugin.common.PluginRegistry; -import io.flutter.plugins.pathprovider.PathProviderPlugin; -import io.flutter.plugins.urllauncher.UrlLauncherPlugin; +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; /** * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. */ +@Keep public final class GeneratedPluginRegistrant { - public static void registerWith(PluginRegistry registry) { - if (alreadyRegisteredWith(registry)) { - return; + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin path_provider_android, io.flutter.plugins.pathprovider.PathProviderPlugin", e); } - PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin")); - UrlLauncherPlugin.registerWith(registry.registrarFor("io.flutter.plugins.urllauncher.UrlLauncherPlugin")); - } - - private static boolean alreadyRegisteredWith(PluginRegistry registry) { - final String key = GeneratedPluginRegistrant.class.getCanonicalName(); - if (registry.hasPlugin(key)) { - return true; + try { + flutterEngine.getPlugins().add(new com.syncfusion.flutter.pdfviewer.SyncfusionFlutterPdfViewerPlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin syncfusion_flutter_pdfviewer, com.syncfusion.flutter.pdfviewer.SyncfusionFlutterPdfViewerPlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.urllauncher.UrlLauncherPlugin()); + } catch(Exception e) { + Log.e(TAG, "Error registering plugin url_launcher_android, io.flutter.plugins.urllauncher.UrlLauncherPlugin", e); } - registry.registrarFor(key); - return false; } } diff --git a/android/local.properties b/android/local.properties index e2fa8e5c..49977887 100644 --- a/android/local.properties +++ b/android/local.properties @@ -1,4 +1,4 @@ -sdk.dir=C:\\Users\\SriramKiranSenthilku\\AppData\\Local\\Android\\sdk -flutter.sdk=C:\\src\\flutter +sdk.dir=C:\\Users\\HariharasudhanKanaga\\AppData\\Local\\Android\\Sdk +flutter.sdk=D:\\flutter_windows_3.0.5-stable\\flutter flutter.buildMode=debug flutter.versionName=18.1.42 \ No newline at end of file diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 026851fa..ae5025a8 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -2,11 +2,17 @@ // Generated file. Do not edit. // +// clang-format off + #include "generated_plugin_registrant.h" +#include #include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) desktop_window_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "DesktopWindowPlugin"); + desktop_window_plugin_register_with_registrar(desktop_window_registrar); g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); diff --git a/linux/flutter/generated_plugin_registrant.h b/linux/flutter/generated_plugin_registrant.h index 9bf74789..e0f0a47b 100644 --- a/linux/flutter/generated_plugin_registrant.h +++ b/linux/flutter/generated_plugin_registrant.h @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #ifndef GENERATED_PLUGIN_REGISTRANT_ #define GENERATED_PLUGIN_REGISTRANT_ diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 1fc8ed34..93a95322 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,9 +3,13 @@ # list(APPEND FLUTTER_PLUGIN_LIST + desktop_window url_launcher_linux ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +18,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 4618f386..167fe146 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,10 +5,14 @@ import FlutterMacOS import Foundation +import desktop_window import path_provider_macos +import syncfusion_pdfviewer_macos import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + DesktopWindowPlugin.register(with: registry.registrar(forPlugin: "DesktopWindowPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + SyncfusionFlutterPdfViewerPlugin.register(with: registry.registrar(forPlugin: "SyncfusionFlutterPdfViewerPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/pubspec.yaml b/pubspec.yaml index 2b28d744..a7f22728 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,91 +18,21 @@ dependencies: path_provider_macos: ^2.0.0 desktop_window: 0.4.0 intl: ^0.17.0 - - syncfusion_localizations: - git: - url: https://SyncfusionBuild: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@github.com/essential-studio/flutter-localizations - path: flutter_localizations/syncfusion_localizations - branch: release/20.4.0.1 - ref: release/20.4.0.1 - syncfusion_flutter_datagrid_export: - git: - url: https://SyncfusionBuild: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@github.com/essential-studio/flutter-datagrid-export - path: flutter_datagrid_export/syncfusion_flutter_datagrid_export - branch: release/20.4.0.1 - ref: release/20.4.0.1 - syncfusion_flutter_calendar: - git: - url: https://SyncfusionBuild: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@github.com/essential-studio/flutter-calendar - path: flutter_calendar/syncfusion_flutter_calendar - branch: release/20.4.0.1 - ref: release/20.4.0.1 - syncfusion_flutter_datepicker: - git: - url: https://SyncfusionBuild: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@github.com/essential-studio/flutter-datepicker - path: flutter_datepicker/syncfusion_flutter_datepicker - branch: release/20.4.0.1 - ref: release/20.4.0.1 - syncfusion_flutter_charts: - git: - url: https://SyncfusionBuild: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@github.com/essential-studio/flutter-charts - path: flutter_charts/syncfusion_flutter_charts - branch: release/20.4.0.1 - ref: release/20.4.0.1 - syncfusion_flutter_gauges: - git: - url: https://SyncfusionBuild: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@github.com/essential-studio/flutter-gauges - path: flutter_gauges/syncfusion_flutter_gauges - branch: release/20.4.0.1 - ref: release/20.4.0.1 - syncfusion_flutter_sliders: - git: - url: https://SyncfusionBuild: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@github.com/essential-studio/flutter-sliders - path: flutter_sliders/syncfusion_flutter_sliders - branch: release/20.4.0.1 - ref: release/20.4.0.1 - syncfusion_flutter_pdf: - git: - url: https://SyncfusionBuild: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@github.com/essential-studio/flutter-pdf - path: flutter_pdf/syncfusion_flutter_pdf - branch: release/20.4.0.1 - ref: release/20.4.0.1 - syncfusion_flutter_barcodes: - git: - url: https://SyncfusionBuild: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@github.com/essential-studio/flutter-barcodes - path: flutter_barcodes/syncfusion_flutter_barcodes - branch: release/20.4.0.1 - ref: release/20.4.0.1 - syncfusion_officechart: - git: - url: https://SyncfusionBuild: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@github.com/essential-studio/flutter-officechart - path: flutter_officechart/syncfusion_flutter_officechart - branch: release/20.4.0.1 - ref: release/20.4.0.1 - syncfusion_flutter_maps: - git: - url: https://SyncfusionBuild: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@github.com/essential-studio/flutter-maps - path: flutter_maps/syncfusion_flutter_maps - branch: release/20.4.0.1 - ref: release/20.4.0.1 - syncfusion_flutter_signaturepad: - git: - url: https://SyncfusionBuild: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@github.com/essential-studio/flutter-signaturepad - path: flutter_signaturepad/syncfusion_flutter_signaturepad - branch: release/20.4.0.1 - ref: release/20.4.0.1 - syncfusion_flutter_pdfviewer: - git: - url: https://SyncfusionBuild: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@github.com/essential-studio/flutter-pdfviewer - path: flutter_pdfviewer/syncfusion_flutter_pdfviewer - branch: release/20.4.0.1 - ref: release/20.4.0.1 - syncfusion_flutter_treemap: - git: - url: https://SyncfusionBuild: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@github.com/essential-studio/flutter-treemap - path: flutter_treemap/syncfusion_flutter_treemap - branch: release/20.4.0.1 - ref: release/20.4.0.1 + + syncfusion_localizations: ^20.4.38 + syncfusion_flutter_datagrid_export: ^20.4.38-beta + syncfusion_flutter_calendar: ^20.4.38 + syncfusion_flutter_datepicker: ^20.4.38 + syncfusion_flutter_charts: ^20.4.38 + syncfusion_flutter_gauges: ^20.4.38 + syncfusion_flutter_sliders: ^20.4.38 + syncfusion_flutter_pdf: ^20.4.38 + syncfusion_flutter_barcodes: ^20.4.38 + syncfusion_officechart: ^20.4.38-beta + syncfusion_flutter_maps: ^20.4.38 + syncfusion_flutter_signaturepad: ^20.4.38 + syncfusion_flutter_pdfviewer: ^20.4.38-beta + syncfusion_flutter_treemap: ^20.4.38-beta flutter: uses-material-design: true @@ -147,4 +77,4 @@ flutter: - asset: assets/fonts/Roboto-Medium.ttf - family: Roboto-Regular fonts: - - asset: assets/fonts/Roboto-Regular.ttf + - asset: assets/fonts/Roboto-Regular.ttf \ No newline at end of file diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 4f788487..b6ab973e 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,9 +6,15 @@ #include "generated_plugin_registrant.h" +#include +#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { + DesktopWindowPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("DesktopWindowPlugin")); + SyncfusionPdfviewerWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("SyncfusionPdfviewerWindowsPlugin")); UrlLauncherWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 411af46d..c955d2d7 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,9 +3,14 @@ # list(APPEND FLUTTER_PLUGIN_LIST + desktop_window + syncfusion_pdfviewer_windows url_launcher_windows ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +19,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin)