### Installation Rules for Windows Executable Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/windows/CMakeLists.txt Configures the installation process for the application on Windows, including setting the installation prefix, copying the executable, libraries, and assets to their designated locations. ```cmake set(BUILD_BUNDLE_DIR "$") set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") install(DIRECTORY "${NATIVE_ASSETS_DIR}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" CONFIGURATIONS Profile;Release COMPONENT Runtime) ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/windows/CMakeLists.txt Initializes CMake, defines the project name, and specifies the minimum required version. It also sets the executable name for the application. ```cmake cmake_minimum_required(VERSION 3.14) project(chard LANGUAGES CXX) set(BINARY_NAME "chard") ``` -------------------------------- ### Install Application Runtime Components Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/linux/CMakeLists.txt These CMake commands define the installation rules for the application's runtime components. They specify the destination directories for the executable, ICU data, Flutter library, bundled libraries, and native assets. The installation process also ensures that the assets directory is fully re-copied on each build. ```cmake set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() install(CODE " file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") " COMPONENT Runtime) set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) install(FILES "${bundled_library}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endforeach(bundled_library) set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") install(DIRECTORY "${NATIVE_ASSETS_DIR}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### InteractiveSpiderChart Complete Theming Example (Dart) Source: https://context7.com/lilininl/linspidermonkeychard/llms.txt Provides a comprehensive example of configuring the InteractiveSpiderChart widget with all available theming options. This includes styling for grid, spokes, data polygons, gradients, points, labels, and various interactive behaviors. Requires Flutter Material and lin_spider_monkey_chart packages. ```dart import 'package:flutter/material.dart'; import 'package:lin_spider_monkey_chart/lin_spider_monkey_chart.dart'; class CompleteThemeExample extends StatelessWidget { @override Widget build(BuildContext context) { return InteractiveSpiderChart( labels: ['A', 'B', 'C', 'D', 'E', 'F'], data: [85, 70, 95, 60, 88, 75], maxValue: 100, size: Size(350, 400), theme: SpiderChartThemeData( // Grid and spoke styling gridLineColor: Colors.grey.shade300, gridDashedLineColor: Colors.grey.shade200, spokeLineColor: Colors.grey.shade100, // Data polygon styling dataLineColor: Colors.deepOrange, dataFillColor: Colors.deepOrange.withValues(alpha: 0.2), strokeWidth: 3.0, // Gradient options useGradient: true, gradientColors: [ Colors.deepOrange.withValues(alpha: 0.4), Colors.orange.withValues(alpha: 0.2), ], dataLineGradientColors: [Colors.deepOrange, Colors.orange], // Center circle styling centerCircleColor: Colors.white, // OR use gradient: // centerCircleGradientColors: [Colors.orange, Colors.deepOrange], // Data points pointSize: 5.0, pointColor: Colors.deepOrange.shade700, // Label styling labelStyle: TextStyle( fontSize: 11, color: Colors.black87, fontWeight: FontWeight.w500, ), selectedLabelStyle: TextStyle( fontSize: 13, color: Colors.deepOrange, fontWeight: FontWeight.bold, ), showSelectedLabel: true, // Label positioning labelOffsetFromChart: 15.0, labelRadiusFactor: 1.15, // Title label configuration titleLabelMode: TitleLabelMode.shown, titleLabelBehavior: TitleLabelBehavior.toggleOnTap, titleSelectedLabelStyle: TextStyle( fontSize: 18, color: Colors.black87, fontWeight: FontWeight.bold, ), titleSelectedLabelTopOffset: 5.0, // Title slide animation enableTitleSlide: true, titleSlideSpace: 60.0, titleSlideDuration: Duration(milliseconds: 450), titleSlideCurve: Curves.easeInOutCubic, // Chart positioning chartTopOffset: 10.0, // Rotation behavior rotateToTop: true, rotationDuration: Duration(milliseconds: 600), // Score bubble configuration bubbleAnchor: BubbleAnchor.dataPoint, bubbleOffset: 10.0, triangleDirection: TriangleDirection.down, autoTriangleDirection: true, // Spline curves useSpline: false, ), ); } } ``` -------------------------------- ### ChartDetailPage Widget Example (Dart) Source: https://context7.com/lilininl/linspidermonkeychard/llms.txt Demonstrates the usage of the ChartDetailPage widget for displaying a full-screen interactive chart with score bubbles. It requires the lin_spider_monkey_chart package and Flutter Material package. Input includes title, labels, data, and various styling parameters. ```dart import 'package:flutter/material.dart'; import 'package:lin_spider_monkey_chart/lin_spider_monkey_chart.dart'; class DetailPageExample extends StatelessWidget { @override Widget build(BuildContext context) { return ChartDetailPage( title: 'Competency Assessment', labels: [ 'Technical Excellence', 'Communication', 'Leadership', 'Problem Solving', 'Teamwork', 'Innovation' ], data: [88, 75, 82, 90, 85, 78], maxValue: 100, chartWidth: 350, chartHeight: 350, enableScroll: true, showTitleText: true, showChartLabels: true, initialSelectedIndex: 0, theme: SpiderChartThemeData( dataLineColor: Colors.deepPurple, dataFillColor: Colors.deepPurple.withValues(alpha: 0.2), gridLineColor: Colors.grey.shade300, spokeLineColor: Colors.grey.shade200, labelStyle: TextStyle( fontSize: 11, color: Colors.black87, fontWeight: FontWeight.w500, ), selectedLabelStyle: TextStyle( fontSize: 13, color: Colors.deepPurple, fontWeight: FontWeight.bold, ), showSelectedLabel: true, ), ); } } // Usage: Navigate to the detail page void navigateToDetail(BuildContext context) { Navigator.push( context, MaterialPageRoute(builder: (context) => DetailPageExample()), ); } ``` -------------------------------- ### SpiderChart with Gradient Fill in Flutter Source: https://context7.com/lilininl/linspidermonkeychard/llms.txt This example demonstrates how to create a SpiderChart with a radial gradient fill. It uses the `lin_spider_monkey_chart` package and customizes gradient colors for the data fill, data lines, grid lines, and center circle. Dependencies include `flutter/material.dart` and `lin_spider_monkey_chart/lin_spider_monkey_chart.dart`. ```dart import 'package:flutter/material.dart'; import 'package:lin_spider_monkey_chart/lin_spider_monkey_chart.dart'; class GradientChartExample extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( body: Center( child: SizedBox( width: 300, height: 300, child: SpiderChart( labels: ['Speed', 'Power', 'Accuracy', 'Defense', 'Agility'], data: [88, 92, 75, 68, 85], maxValue: 100, theme: SpiderChartThemeData( useGradient: true, gradientColors: [ Colors.blue.withValues(alpha: 0.6), Colors.purple.withValues(alpha: 0.3), ], dataLineGradientColors: [Colors.blue, Colors.purple], gridLineGradientColors: [ Colors.blue.withValues(alpha: 0.3), Colors.purple.withValues(alpha: 0.3), ], centerCircleGradientColors: [ Colors.blue.withValues(alpha: 0.8), Colors.purple.withValues(alpha: 0.8), ], strokeWidth: 3.0, pointSize: 5.0, pointColor: Colors.purple, ), ), ), ), ); } } ``` -------------------------------- ### SpiderChart with Spline Curves in Flutter Source: https://context7.com/lilininl/linspidermonkeychard/llms.txt This example shows how to create a SpiderChart with smooth spline curves using Catmull-Rom splines. It customizes the chart's appearance with spline usage, data line color, fill color, stroke width, point size and color, grid line color, and spoke line color. The implementation relies on `flutter/material.dart` and `lin_spider_monkey_chart/lin_spider_monkey_chart.dart`. ```dart import 'package:flutter/material.dart'; import 'package:lin_spider_monkey_chart/lin_spider_monkey_chart.dart'; class SplineChartExample extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( body: Center( child: SizedBox( width: 280, height: 280, child: SpiderChart( labels: ['Q1', 'Q2', 'Q3', 'Q4', 'Q5', 'Q6'], data: [70, 85, 60, 95, 75, 80], maxValue: 100, theme: SpiderChartThemeData( useSpline: true, dataLineColor: Colors.teal, dataFillColor: Colors.teal.withValues(alpha: 0.25), strokeWidth: 2.5, pointSize: 5.0, pointColor: Colors.teal.shade700, gridLineColor: Colors.grey.shade300, spokeLineColor: Colors.grey.shade200, ), ), ), ), ); } } ``` -------------------------------- ### Apply Standard Build Settings (CMake) Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/windows/runner/CMakeLists.txt Applies a standard set of build settings to the application target. This simplifies configuration for projects that don't require custom build optimizations or flags. ```cmake # Apply the standard set of build settings. This can be removed for applications # that need different build settings. apply_standard_settings(${BINARY_NAME}) ``` -------------------------------- ### Link Libraries and Include Directories (CMake) Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/windows/runner/CMakeLists.txt Specifies the libraries to link against (e.g., flutter, flutter_wrapper_app, dwmapi.lib) and the include directories for the project. This ensures all dependencies are correctly resolved during the build. ```cmake # Add dependency libraries and include directories. Add any application-specific # dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") ``` -------------------------------- ### Add Preprocessor Definitions for Build Version (CMake) Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/windows/runner/CMakeLists.txt Sets preprocessor definitions for the build version of the application, allowing the code to access version information at compile time. This is crucial for version management and display. ```cmake # Add preprocessor definitions for the build version. target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"" target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") ``` -------------------------------- ### Project and Build Configuration Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/linux/CMakeLists.txt This section of the CMakeLists.txt file sets up the basic project configuration, including the minimum CMake version, project name, executable name, and GTK application ID. It also defines build type defaults and opts into modern CMake behaviors. The `CMAKE_INSTALL_RPATH` is set to load bundled libraries from the `lib/` directory. ```cmake cmake_minimum_required(VERSION 3.13) project(runner LANGUAGES CXX) set(BINARY_NAME "chard") set(APPLICATION_ID "com.example.chard") cmake_policy(SET CMP0063 NEW) set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") if(FLUTTER_TARGET_PLATFORM_SYSROOT) set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) endif() if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Flutter build mode" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Profile" "Release") endif() ``` -------------------------------- ### Unicode and Standard Compilation Settings Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/windows/CMakeLists.txt Enables Unicode support and defines a function to apply standard compilation settings like C++17 standard, warning levels, and exception handling configurations to targets. ```cmake add_definitions(-DUNICODE -D_UNICODE) function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_17) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") target_compile_options(${TARGET} PRIVATE /EHsc) target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") endfunction() ``` -------------------------------- ### Subdirectory and Plugin Integration Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/windows/CMakeLists.txt Includes Flutter's managed directory and the runner subdirectory. It also integrates generated plugin build rules, ensuring plugins are built and linked correctly. ```cmake set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) add_subdirectory("runner") include(flutter/generated_plugins.cmake) ``` -------------------------------- ### Define Executable and Source Files (CMake) Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/windows/runner/CMakeLists.txt Defines the main executable target for the application and lists all source files, resource files, and manifest files required for compilation. This is a core part of the build configuration. ```cmake cmake_minimum_required(VERSION 3.14) project(runner LANGUAGES CXX) # Define the application target. To change its name, change BINARY_NAME in the # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer # work. # # Any new source files that you add to the application should be added here. add_executable(${BINARY_NAME} WIN32 "flutter_window.cpp" "main.cpp" "utils.cpp" "win32_window.cpp" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" "Runner.rc" "runner.exe.manifest" ) ``` -------------------------------- ### CMake: Find and check PkgConfig modules for GTK, GLIB, and GIO Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/linux/flutter/CMakeLists.txt This section uses PkgConfig to find and check for the required GTK, GLIB, and GIO libraries. It ensures that these system-level dependencies are available before proceeding with the build. ```cmake # System-level dependencies. find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) ``` -------------------------------- ### Define Executable and Link Libraries in CMake Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/linux/runner/CMakeLists.txt This snippet defines the main executable for the C++ runner and links essential libraries. It specifies source files, applies standard build settings, adds application ID as a preprocessor definition, and links the 'flutter' and 'PkgConfig::GTK' libraries. It also sets include directories. ```cmake cmake_minimum_required(VERSION 3.13) project(runner LANGUAGES CXX) # Define the application target. To change its name, change BINARY_NAME in the # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer # work. # # Any new source files that you add to the application should be added here. add_executable(${BINARY_NAME} "main.cc" "my_application.cc" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" ) # Apply the standard set of build settings. This can be removed for applications # that need different build settings. apply_standard_settings(${BINARY_NAME}) # Add preprocessor definitions for the application ID. add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") # Add dependency libraries. Add any application-specific dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter) target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") ``` -------------------------------- ### Profile Build Mode Settings Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/windows/CMakeLists.txt Defines linker and compiler flags for the Profile build mode, typically mirroring the Release build settings to ensure consistent performance characteristics. ```cmake set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") ``` -------------------------------- ### Include Flutter and Plugin Build Rules Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/linux/CMakeLists.txt This CMake configuration includes the necessary rules for building Flutter and its plugins. It loads the managed Flutter directory and generated plugin CMake files. It also sets up system-level dependencies using PkgConfig and ensures the application executable depends on the Flutter assembly. ```cmake set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) add_subdirectory("runner") add_dependencies(${BINARY_NAME} flutter_assemble) set_target_properties(${BINARY_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" ) include(flutter/generated_plugins.cmake) ``` -------------------------------- ### CMake: Define Flutter Tool Backend Custom Command Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/windows/flutter/CMakeLists.txt This snippet sets up a custom CMake command to invoke the Flutter tool backend. It defines a phony output file to ensure the command runs every time and specifies the output files expected from the Flutter tool. This command is crucial for assembling Flutter resources and libraries. ```cmake # === Flutter tool backend === # _phony_ is a non-existent file to force this command to run every time, # since currently there's no way to get a full input/output list from the # flutter tool. set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) add_custom_command( OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} ${CPP_WRAPPER_SOURCES_APP} ${PHONY_OUTPUT} COMMAND ${CMAKE_COMMAND} -E env ${FLUTTER_TOOL_ENVIRONMENT} "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" ${FLUTTER_TARGET_PLATFORM} $ VERBATIM ) add_custom_target(flutter_assemble DEPENDS "${FLUTTER_LIBRARY}" ${FLUTTER_LIBRARY_HEADERS} ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} ${CPP_WRAPPER_SOURCES_APP} ) ``` -------------------------------- ### CMake: Define list_prepend function Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/linux/flutter/CMakeLists.txt This function mimics the `list(TRANSFORM ... PREPEND ...)` functionality, which is not available in CMake version 3.10. It prepends a given prefix to each element in a list. ```cmake function(list_prepend LIST_NAME PREFIX) set(NEW_LIST "") foreach(element ${${LIST_NAME}}) list(APPEND NEW_LIST "${PREFIX}${element}") endforeach(element) set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) endfunction() ``` -------------------------------- ### CMake: Custom command for Flutter tool backend Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/linux/flutter/CMakeLists.txt This custom command executes the Flutter tool backend script to build the Flutter library and headers. It uses a phony target to ensure the command runs on every build, as tracking all inputs/outputs is complex. ```cmake # _phony_ is a non-existent file to force this command to run every time, # since currently there's no way to get a full input/output list from the # flutter tool. add_custom_command( OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/_phony_ COMMAND ${CMAKE_COMMAND} -E env ${FLUTTER_TOOL_ENVIRONMENT} "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} VERBATIM ) add_custom_target(flutter_assemble DEPENDS "${FLUTTER_LIBRARY}" ${FLUTTER_LIBRARY_HEADERS} ) ``` -------------------------------- ### CMake: Configure Flutter library and headers Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/linux/flutter/CMakeLists.txt This part defines the Flutter library path and includes a list of Flutter header files. It then creates an interface library named 'flutter' and sets up include directories and link libraries. ```cmake set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") # Published to parent scope for install step. set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) list(APPEND FLUTTER_LIBRARY_HEADERS "fl_basic_message_channel.h" "fl_binary_codec.h" "fl_binary_messenger.h" "fl_dart_project.h" "fl_engine.h" "fl_json_message_codec.h" "fl_json_method_codec.h" "fl_message_codec.h" "fl_method_call.h" "fl_method_channel.h" "fl_method_codec.h" "fl_method_response.h" "fl_plugin_registrar.h" "fl_plugin_registry.h" "fl_standard_message_codec.h" "fl_standard_method_codec.h" "fl_string_codec.h" "fl_value.h" "fl_view.h" "flutter_linux.h" ) list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") add_library(flutter INTERFACE) target_include_directories(flutter INTERFACE "${EPHEMERAL_DIR}" ) target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") target_link_libraries(flutter INTERFACE PkgConfig::GTK PkgConfig::GLIB PkgConfig::GIO ) add_dependencies(flutter flutter_assemble) ``` -------------------------------- ### CMake: Build Flutter C++ Wrapper for Plugins Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/windows/flutter/CMakeLists.txt This snippet defines a static library for the Flutter C++ wrapper used by plugins. It includes core implementation sources and plugin-specific sources, sets independent code positioning, and configures visibility to hidden. It links against the Flutter library and includes necessary header directories. ```cmake # === Wrapper === list(APPEND CPP_WRAPPER_SOURCES_CORE "core_implementations.cc" "standard_codec.cc" ) list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") list(APPEND CPP_WRAPPER_SOURCES_PLUGIN "plugin_registrar.cc" ) list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") list(APPEND CPP_WRAPPER_SOURCES_APP "flutter_engine.cc" "flutter_view_controller.cc" ) list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") # Wrapper sources needed for a plugin. add_library(flutter_wrapper_plugin STATIC ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} ) apply_standard_settings(flutter_wrapper_plugin) set_target_properties(flutter_wrapper_plugin PROPERTIES POSITION_INDEPENDENT_CODE ON) set_target_properties(flutter_wrapper_plugin PROPERTIES CXX_VISIBILITY_PRESET hidden) target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) target_include_directories(flutter_wrapper_plugin PUBLIC "${WRAPPER_ROOT}/include" ) add_dependencies(flutter_wrapper_plugin flutter_assemble) ``` -------------------------------- ### CMake: Configure Flutter Library and Headers Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/windows/flutter/CMakeLists.txt This snippet configures the Flutter library by setting its path, headers, and linking it to the main application. It includes generated configuration files and defines paths for essential Flutter components like the DLL and ICU data file. ```cmake cmake_minimum_required(VERSION 3.14) set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") # Configuration provided via flutter tool. include(${EPHEMERAL_DIR}/generated_config.cmake) # TODO: Move the rest of this into files in ephemeral. See # 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") # Published to parent scope for install step. set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) list(APPEND FLUTTER_LIBRARY_HEADERS "flutter_export.h" "flutter_windows.h" "flutter_messenger.h" "flutter_plugin_registrar.h" "flutter_texture_registrar.h" ) list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") add_library(flutter INTERFACE) target_include_directories(flutter INTERFACE "${EPHEMERAL_DIR}" ) target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") add_dependencies(flutter flutter_assemble) ``` -------------------------------- ### CMake Build Configuration Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/windows/CMakeLists.txt Configures build types (Debug, Profile, Release) based on whether the generator supports multi-configuration builds. Sets the default build type if not already defined. ```cmake get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(IS_MULTICONFIG) set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" CACHE STRING "" FORCE) else() if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Flutter build mode" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Profile" "Release") endif() endif() ``` -------------------------------- ### CMake: Build Flutter C++ Wrapper for Runner Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/windows/flutter/CMakeLists.txt This snippet defines a static library for the Flutter C++ wrapper used by the application runner. It incorporates core implementation and application-specific sources, links against the Flutter library, and specifies include directories for the wrapper. It also ensures the library has independent code positioning. ```cmake # Wrapper sources needed for the runner. add_library(flutter_wrapper_app STATIC ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_APP} ) apply_standard_settings(flutter_wrapper_app) target_link_libraries(flutter_wrapper_app PUBLIC flutter) target_include_directories(flutter_wrapper_app PUBLIC "${WRAPPER_ROOT}/include" ) add_dependencies(flutter_wrapper_app flutter_assemble) ``` -------------------------------- ### Add Flutter Tool Build Dependency (CMake) Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/windows/runner/CMakeLists.txt Ensures that the Flutter tool's assembly process is completed before the main application target is built. This is a critical step for Flutter projects. ```cmake # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) ``` -------------------------------- ### Define Standard Compilation Settings Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/linux/CMakeLists.txt This CMake function sets standard compilation features and options for a given target. It includes C++14 standard, enables Wall and Werror, optimizes for non-Debug builds, and defines NDEBUG for release builds. It's intended to be applied to most targets. ```cmake function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_14) target_compile_options(${TARGET} PRIVATE -Wall -Werror) target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") endfunction() ``` -------------------------------- ### Display Charts in a Grid with ChartGridCard (Dart) Source: https://context7.com/lilininl/linspidermonkeychard/llms.txt This snippet shows how to use the ChartGridCard widget to display multiple charts in a responsive grid layout. It takes a list of chart data, each with titles, labels, and data points, and renders them using Flutter's GridView. The widget supports custom themes and tap interactions. ```dart import 'package:flutter/material.dart'; import 'package:lin_spider_monkey_chart/lin_spider_monkey_chart.dart'; class GridCardExample extends StatelessWidget { final List> chartData = [ { 'title': 'Technical Skills', 'subtitle': '6 Competencies', 'labels': ['Code', 'Debug', 'Design', 'Test', 'Deploy', 'Doc'], 'data': [90, 85, 75, 88, 80, 70], 'color': Colors.blue, }, { 'title': 'Soft Skills', 'subtitle': '5 Competencies', 'labels': ['Comm', 'Lead', 'Team', 'Time', 'Adapt'], 'data': [85, 78, 92, 80, 88], 'color': Colors.purple, }, { 'title': 'Sales Skills', 'subtitle': '5 Competencies', 'labels': ['Neg', 'Prod', 'Close', 'Cust', 'Prosp'], 'data': [95, 85, 78, 92, 68], 'color': Colors.green, }, { 'title': 'Management', 'subtitle': '4 Competencies', 'labels': ['Plan', 'Org', 'Dir', 'Ctrl'], 'data': [88, 82, 85, 78], 'color': Colors.orange, }, ]; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text('Chart Grid Cards')), body: Padding( padding: EdgeInsets.all(16), child: GridView.builder( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, crossAxisSpacing: 16, mainAxisSpacing: 16, childAspectRatio: 0.9, ), itemCount: chartData.length, itemBuilder: (context, index) { final item = chartData[index]; return ChartGridCard( title: item['title'], subtitle: item['subtitle'], labels: List.from(item['labels']), data: List.from(item['data']), theme: SpiderChartThemeData( dataLineColor: item['color'], dataFillColor: (item['color'] as Color).withValues(alpha: 0.2), ), backgroundColor: Colors.white, showChartLabels: false, onTap: () { print('${item['title']} tapped!'); }, ); }, ), ), ); } } ``` -------------------------------- ### Interactive Spider Chart in Flutter Source: https://github.com/lilininl/linspidermonkeychard/blob/main/README.md Displays an interactive radar chart with rotation and score bubble features using InteractiveSpiderChart. Requires labels, data, maxValue, size, and a theme. The theme can control rotation behavior and score bubble visibility. ```dart import 'package:lin_spider_monkey_chart/lin_spider_monkey_chart.dart'; InteractiveSpiderChart( labels: ['A', 'B', 'C', 'D', 'E'], data: [80, 70, 90, 60, 85], maxValue: 100, // Size of the interactive area size: Size(300, 400), // Theme with interactive specific settings theme: SpiderChartThemeData( rotateToTop: true, // Rotate the selected point to the top rotationDuration: Duration(milliseconds: 800), // Animation duration showSelectedLabel: true, // Highlight the selected label bubbleOffset: 10, // Distance of the score bubble from the chart ), ) ``` -------------------------------- ### Create Interactive Spider Chart with Flutter Source: https://context7.com/lilininl/linspidermonkeychard/llms.txt Implements an interactive spider/radar chart using InteractiveSpiderChart. This widget supports touch interactions, rotation, and displays score bubbles. It is ideal for dynamic data presentation where user interaction is desired. ```dart import 'package:flutter/material.dart'; import 'package:lin_spider_monkey_chart/lin_spider_monkey_chart.dart'; class InteractiveChartExample extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text('Interactive Spider Chart')), body: Center( child: Padding( padding: EdgeInsets.all(24.0), child: InteractiveSpiderChart( labels: ['Communication', 'Leadership', 'Technical', 'Creative', 'Strategic'], data: [85, 70, 90, 65, 75], maxValue: 100, size: Size(350, 350), initialSelectedIndex: 0, theme: SpiderChartThemeData( rotateToTop: true, rotationDuration: Duration(milliseconds: 800), showSelectedLabel: true, selectedLabelStyle: TextStyle( color: Colors.purple, fontSize: 14, fontWeight: FontWeight.bold, ), dataLineColor: Colors.purple, dataFillColor: Colors.purple.withValues(alpha: 0.2), bubbleAnchor: BubbleAnchor.label, triangleDirection: TriangleDirection.down, autoTriangleDirection: true, labelOffsetFromChart: 15.0, labelRadiusFactor: 1.2, ), ), ), ), ); } } ``` -------------------------------- ### Basic Spider Chart in Flutter Source: https://github.com/lilininl/linspidermonkeychard/blob/main/README.md Renders a basic radar chart using the SpiderChart widget. It requires labels, data values, and an optional maxValue and theme for customization. Ensure the data length matches the labels length. ```dart import 'package:lin_spider_monkey_chart/lin_spider_monkey_chart.dart'; SpiderChart( // Labels for each dimension of the chart labels: ['Integrity', 'Learning', 'Accountability', 'Teamwork', 'Innovation'], // Data values corresponding to each label (must be same length as labels) data: [80, 65, 90, 75, 85], // Maximum value for the chart scale (default is 100) maxValue: 100, // Custom theme configuration theme: SpiderChartThemeData( dataLineColor: Colors.blue, // Color of the polygon outline dataFillColor: Colors.blue.withValues(alpha: 0.2), // Color of the polygon fill labelStyle: TextStyle(fontSize: 12, color: Colors.black87), // Style for labels ), ) ``` -------------------------------- ### ChartCompactRow Widget in Flutter Source: https://github.com/lilininl/linspidermonkeychard/blob/main/README.md Displays a compact radar chart in a row format using ChartCompactRow. Ideal for summaries or dense lists, it shows a title, a score, and the chart data. An onTap callback is available for interaction. ```dart import 'package:lin_spider_monkey_chart/lin_spider_monkey_chart.dart'; ChartCompactRow( title: 'Core Values', score: 79.0, // Displayed score labels: ['Int', 'Lrn', 'Acc', 'Team', 'Inn'], data: [80, 65, 90, 75, 85], onTap: () { // Handle tap event }, ) ``` -------------------------------- ### Disable Windows Macros Collision (CMake) Source: https://github.com/lilininl/linspidermonkeychard/blob/main/example/windows/runner/CMakeLists.txt Disables Windows-specific macros like NOMINMAX to prevent naming conflicts with standard C++ library functions, ensuring cleaner code and avoiding potential errors. ```cmake # Disable Windows macros that collide with C++ standard library functions. target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") ``` -------------------------------- ### Customizing Spider Chart Theme in Flutter Source: https://github.com/lilininl/linspidermonkeychard/blob/main/README.md Defines extensive theming options for spider charts using SpiderChartThemeData. Allows customization of grid lines, data polygon appearance, points, labels, and interactive elements. ```dart SpiderChartThemeData( // Grid and Axis lines gridLineColor: Colors.grey[300]!, gridDashedLineColor: Colors.grey[200]!, spokeLineColor: Colors.grey[300]!, // Data Polygon dataLineColor: Colors.blue, dataFillColor: Colors.blue.withValues(alpha: 0.2), strokeWidth: 3.0, // Points pointSize: 4.0, pointColor: Colors.blue, // Labels labelOffsetFromChart: 15.0, // Distance of labels from the chart labelStyle: TextStyle(color: Colors.black, fontSize: 10), selectedLabelStyle: TextStyle(color: Colors.blue, fontWeight: FontWeight.bold), // Interactivity rotateToTop: true, showSelectedLabel: true, ) ``` -------------------------------- ### Display Title Label on Interactive Spider Chart in Flutter Source: https://context7.com/lilininl/linspidermonkeychard/llms.txt Enhances an interactive spider/radar chart to display a selected label as a title above the chart with a slide animation using InteractiveSpiderChart. This feature improves data clarity by providing context for the selected data point. ```dart import 'package:flutter/material.dart'; import 'package:lin_spider_monkey_chart/lin_spider_monkey_chart.dart'; class TitleLabelChartExample extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text('Chart with Title Label')), body: Center( child: InteractiveSpiderChart( labels: ['Design', 'Development', 'Testing', 'Documentation', 'Deployment'], data: [95, 85, 78, 82, 88], maxValue: 100, size: Size(300, 400), theme: SpiderChartThemeData( titleLabelMode: TitleLabelMode.shown, titleLabelBehavior: TitleLabelBehavior.toggleOnTap, titleSelectedLabelStyle: TextStyle( color: Colors.black87, fontSize: 20, fontWeight: FontWeight.bold, ), enableTitleSlide: true, titleSlideSpace: 60.0, titleSlideDuration: Duration(milliseconds: 450), titleSlideCurve: Curves.easeInOutCubic, titleSelectedLabelTopOffset: 10.0, chartTopOffset: 20.0, rotateToTop: true, dataLineColor: Colors.indigo, dataFillColor: Colors.indigo.withValues(alpha: 0.15), ), ), ), ); } } ``` -------------------------------- ### ChartGridCard Widget in Flutter Source: https://github.com/lilininl/linspidermonkeychard/blob/main/README.md Presents a spider chart within a grid layout using the ChartGridCard widget. It includes a title, subtitle, chart data, and an onTap callback. The appearance can be customized via SpiderChartThemeData. ```dart import 'package:lin_spider_monkey_chart/lin_spider_monkey_chart.dart'; ChartGridCard( title: 'Sales Skills', subtitle: '5 Competencies', labels: ['Neg', 'Prod', 'Close', 'Cust', 'Prosp'], data: [95, 85, 78, 92, 68], onTap: () { // Handle tap event }, theme: SpiderChartThemeData( dataLineColor: Colors.purple, dataFillColor: Colors.purple.withValues(alpha: 0.2), ), ) ``` -------------------------------- ### ChartListCard Widget in Flutter Source: https://github.com/lilininl/linspidermonkeychard/blob/main/README.md Integrates a spider chart into a list item using the ChartListCard widget. This widget displays a title, score, date, and the chart itself. It accepts chart data and theme, and provides an onTap callback. ```dart import 'package:lin_spider_monkey_chart/lin_spider_monkey_chart.dart'; ChartListCard( title: 'Performance Review', scoreText: 'Avg: 85%', dateText: 'Nov 24, 2025', labels: ['A', 'B', 'C', 'D', 'E'], data: [80, 70, 90, 60, 85], onTap: () { // Handle tap event }, theme: SpiderChartThemeData( dataLineColor: Colors.teal, dataFillColor: Colors.teal.withValues(alpha: 0.2), ), ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.