Test update to 0.4.0

This commit is contained in:
Phani Pavan K
2023-04-05 19:15:46 +05:30
parent 3270f1f7a7
commit c2d73f1d45
96 changed files with 732 additions and 587 deletions

View File

@@ -1,4 +1,10 @@
cmake_minimum_required(VERSION 3.15)
# The Flutter tooling requires that developers have a version of Visual Studio
# installed that includes CMake 3.14 or later. You should not increase this
# version, as doing so will cause the plugin to fail to compile for some
# customers of the plugin.
cmake_minimum_required(VERSION 3.14)
# Project-level configuration.
set(PROJECT_NAME "modal_progress_hud_nsn")
project(${PROJECT_NAME} LANGUAGES CXX)
@@ -6,18 +12,41 @@ project(${PROJECT_NAME} LANGUAGES CXX)
# not be changed
set(PLUGIN_NAME "modal_progress_hud_nsn_plugin")
add_library(${PLUGIN_NAME} SHARED
# Any new source files that you add to the plugin should be added here.
list(APPEND PLUGIN_SOURCES
"modal_progress_hud_nsn_plugin.cpp"
"modal_progress_hud_nsn_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/modal_progress_hud_nsn/modal_progress_hud_nsn_plugin_c_api.h"
"modal_progress_hud_nsn_plugin_c_api.cpp"
${PLUGIN_SOURCES}
)
# Apply a standard set of build settings that are configured in the
# application-level CMakeLists.txt. This can be removed for plugins that want
# full control over build settings.
apply_standard_settings(${PLUGIN_NAME})
# Symbols are hidden by default to reduce the chance of accidental conflicts
# between plugins. This should not be removed; any symbols that should be
# exported should be explicitly exported with the FLUTTER_PLUGIN_EXPORT macro.
set_target_properties(${PLUGIN_NAME} PROPERTIES
CXX_VISIBILITY_PRESET hidden)
target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL)
# Source include directories and library dependencies. Add any plugin-specific
# dependencies here.
target_include_directories(${PLUGIN_NAME} INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin)
# List of absolute paths to libraries that should be bundled with the 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(modal_progress_hud_nsn_bundled_libraries
""
PARENT_SCOPE

View File

@@ -1,23 +0,0 @@
#ifndef FLUTTER_PLUGIN_MODAL_PROGRESS_HUD_NSN_PLUGIN_H_
#define FLUTTER_PLUGIN_MODAL_PROGRESS_HUD_NSN_PLUGIN_H_
#include <flutter_plugin_registrar.h>
#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 ModalProgressHudNsnPluginRegisterWithRegistrar(
FlutterDesktopPluginRegistrarRef registrar);
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // FLUTTER_PLUGIN_MODAL_PROGRESS_HUD_NSN_PLUGIN_H_

View File

@@ -1,5 +1,5 @@
#ifndef FLUTTER_PLUGIN_MODAL_PROGRESS_BAR_HUD_NSN_PLUGIN_H_
#define FLUTTER_PLUGIN_MODAL_PROGRESS_BAR_HUD_NSN_PLUGIN_H_
#ifndef FLUTTER_PLUGIN_MODAL_PROGRESS_HUD_NSN_PLUGIN_C_API_H_
#define FLUTTER_PLUGIN_MODAL_PROGRESS_HUD_NSN_PLUGIN_C_API_H_
#include <flutter_plugin_registrar.h>
@@ -13,11 +13,11 @@
extern "C" {
#endif
FLUTTER_PLUGIN_EXPORT void ModalProgressBarHudNsnPluginRegisterWithRegistrar(
FLUTTER_PLUGIN_EXPORT void ModalProgressHudNsnPluginCApiRegisterWithRegistrar(
FlutterDesktopPluginRegistrarRef registrar);
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // FLUTTER_PLUGIN_MODAL_PROGRESS_BAR_HUD_NSN_PLUGIN_H_
#endif // FLUTTER_PLUGIN_MODAL_PROGRESS_HUD_NSN_PLUGIN_C_API_H_

View File

@@ -1,82 +0,0 @@
#include "include/modal_progress_bar_hud_nsn/modal_progress_bar_hud_nsn_plugin.h"
// This must be included before many other Windows headers.
#include <windows.h>
// For getPlatformVersion; remove unless needed for your plugin implementation.
#include <VersionHelpers.h>
#include <flutter/method_channel.h>
#include <flutter/plugin_registrar_windows.h>
#include <flutter/standard_method_codec.h>
#include <map>
#include <memory>
#include <sstream>
namespace {
class ModalProgressBarHudNsnPlugin : public flutter::Plugin {
public:
static void RegisterWithRegistrar(flutter::PluginRegistrarWindows *registrar);
ModalProgressBarHudNsnPlugin();
virtual ~ModalProgressBarHudNsnPlugin();
private:
// Called when a method is called on this plugin's channel from Dart.
void HandleMethodCall(
const flutter::MethodCall<flutter::EncodableValue> &method_call,
std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
};
// static
void ModalProgressBarHudNsnPlugin::RegisterWithRegistrar(
flutter::PluginRegistrarWindows *registrar) {
auto channel =
std::make_unique<flutter::MethodChannel<flutter::EncodableValue>>(
registrar->messenger(), "modal_progress_bar_hud_nsn",
&flutter::StandardMethodCodec::GetInstance());
auto plugin = std::make_unique<ModalProgressBarHudNsnPlugin>();
channel->SetMethodCallHandler(
[plugin_pointer = plugin.get()](const auto &call, auto result) {
plugin_pointer->HandleMethodCall(call, std::move(result));
});
registrar->AddPlugin(std::move(plugin));
}
ModalProgressBarHudNsnPlugin::ModalProgressBarHudNsnPlugin() {}
ModalProgressBarHudNsnPlugin::~ModalProgressBarHudNsnPlugin() {}
void ModalProgressBarHudNsnPlugin::HandleMethodCall(
const flutter::MethodCall<flutter::EncodableValue> &method_call,
std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
if (method_call.method_name().compare("getPlatformVersion") == 0) {
std::ostringstream version_stream;
version_stream << "Windows ";
if (IsWindows10OrGreater()) {
version_stream << "10+";
} else if (IsWindows8OrGreater()) {
version_stream << "8";
} else if (IsWindows7OrGreater()) {
version_stream << "7";
}
result->Success(flutter::EncodableValue(version_stream.str()));
} else {
result->NotImplemented();
}
}
} // namespace
void ModalProgressBarHudNsnPluginRegisterWithRegistrar(
FlutterDesktopPluginRegistrarRef registrar) {
ModalProgressBarHudNsnPlugin::RegisterWithRegistrar(
flutter::PluginRegistrarManager::GetInstance()
->GetRegistrar<flutter::PluginRegistrarWindows>(registrar));
}

View File

@@ -1,4 +1,4 @@
#include "include/modal_progress_hud_nsn/modal_progress_hud_nsn_plugin.h"
#include "modal_progress_hud_nsn_plugin.h"
// This must be included before many other Windows headers.
#include <windows.h>
@@ -10,26 +10,10 @@
#include <flutter/plugin_registrar_windows.h>
#include <flutter/standard_method_codec.h>
#include <map>
#include <memory>
#include <sstream>
namespace {
class ModalProgressHudNsnPlugin : public flutter::Plugin {
public:
static void RegisterWithRegistrar(flutter::PluginRegistrarWindows *registrar);
ModalProgressHudNsnPlugin();
virtual ~ModalProgressHudNsnPlugin();
private:
// Called when a method is called on this plugin's channel from Dart.
void HandleMethodCall(
const flutter::MethodCall<flutter::EncodableValue> &method_call,
std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
};
namespace modal_progress_hud_nsn {
// static
void ModalProgressHudNsnPlugin::RegisterWithRegistrar(
@@ -72,11 +56,4 @@ void ModalProgressHudNsnPlugin::HandleMethodCall(
}
}
} // namespace
void ModalProgressHudNsnPluginRegisterWithRegistrar(
FlutterDesktopPluginRegistrarRef registrar) {
ModalProgressHudNsnPlugin::RegisterWithRegistrar(
flutter::PluginRegistrarManager::GetInstance()
->GetRegistrar<flutter::PluginRegistrarWindows>(registrar));
}
} // namespace modal_progress_hud_nsn

View File

@@ -0,0 +1,32 @@
#ifndef FLUTTER_PLUGIN_MODAL_PROGRESS_HUD_NSN_PLUGIN_H_
#define FLUTTER_PLUGIN_MODAL_PROGRESS_HUD_NSN_PLUGIN_H_
#include <flutter/method_channel.h>
#include <flutter/plugin_registrar_windows.h>
#include <memory>
namespace modal_progress_hud_nsn {
class ModalProgressHudNsnPlugin : public flutter::Plugin {
public:
static void RegisterWithRegistrar(flutter::PluginRegistrarWindows *registrar);
ModalProgressHudNsnPlugin();
virtual ~ModalProgressHudNsnPlugin();
// Disallow copy and assign.
ModalProgressHudNsnPlugin(const ModalProgressHudNsnPlugin&) = delete;
ModalProgressHudNsnPlugin& operator=(const ModalProgressHudNsnPlugin&) = delete;
private:
// Called when a method is called on this plugin's channel from Dart.
void HandleMethodCall(
const flutter::MethodCall<flutter::EncodableValue> &method_call,
std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
};
} // namespace modal_progress_hud_nsn
#endif // FLUTTER_PLUGIN_MODAL_PROGRESS_HUD_NSN_PLUGIN_H_

View File

@@ -0,0 +1,12 @@
#include "include/modal_progress_hud_nsn/modal_progress_hud_nsn_plugin_c_api.h"
#include <flutter/plugin_registrar_windows.h>
#include "modal_progress_hud_nsn_plugin.h"
void ModalProgressHudNsnPluginCApiRegisterWithRegistrar(
FlutterDesktopPluginRegistrarRef registrar) {
modal_progress_hud_nsn::ModalProgressHudNsnPlugin::RegisterWithRegistrar(
flutter::PluginRegistrarManager::GetInstance()
->GetRegistrar<flutter::PluginRegistrarWindows>(registrar));
}