### CMake Installation Rules for Application Bundle Source: https://github.com/omidhaqi/blurbox/blob/master/example/linux/CMakeLists.txt Defines rules for installing the application, including clearing the build bundle directory, installing the main executable, Flutter data files, libraries, and native assets. It also handles the Flutter assets directory. ```cmake # === Installation === # By default, "installing" just makes a relocatable bundle in the build # directory. 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() # Start with a clean build bundle directory every time. 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) # Copy the native assets provided by the build.dart from all packages. set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") install(DIRECTORY "${NATIVE_ASSETS_DIR}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. 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 the AOT library on non-Debug builds only. if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### CMake Installation Rules for Application Bundle Source: https://github.com/omidhaqi/blurbox/blob/master/example/windows/CMakeLists.txt Configures installation rules for the application's runtime components, including the executable, data files, libraries, and native assets. It ensures files are placed correctly for execution. ```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) ``` -------------------------------- ### CMake Project Setup and Configuration Source: https://github.com/omidhaqi/blurbox/blob/master/example/windows/CMakeLists.txt Initializes the CMake project, sets the minimum version, project name, and executable name. It also handles configuration for multi-config generators and defines default build types. ```cmake cmake_minimum_required(VERSION 3.14) project(example LANGUAGES CXX) set(BINARY_NAME "example") cmake_policy(VERSION 3.14...3.25) 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() ``` -------------------------------- ### Install BlurBox via pub.dev Source: https://github.com/omidhaqi/blurbox/blob/master/README.md Instructions for adding the BlurBox package to your Flutter project's dependencies using either the pubspec.yaml file or the flutter pub add command. ```yaml dependencies: blurbox: ^0.0.6 ``` ```bash flutter pub add blurbox ``` ```dart import 'package:blurbox/blurbox.dart'; ``` -------------------------------- ### CMake Project Setup and Configuration Source: https://github.com/omidhaqi/blurbox/blob/master/example/linux/CMakeLists.txt Sets up the CMake project, defines executable name and application ID, and configures build policies and runtime paths. It also handles cross-compilation by setting sysroot paths. ```cmake cmake_minimum_required(VERSION 3.13) project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. set(BINARY_NAME "example") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID set(APPLICATION_ID "com.example.example") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. cmake_policy(SET CMP0063 NEW) # Load bundled libraries from the lib/ directory relative to the binary. set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") # Root filesystem for cross-building. 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() # Define build configuration options. 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() ``` -------------------------------- ### KaleidoscopeBlurBox Example Source: https://github.com/omidhaqi/blurbox/blob/master/README.md Demonstrates creating kaleidoscope patterns with blur. Customizable options include segments, blur intensity, color, pattern type, animation, and rotation duration. ```dart // Kaleidoscope patterns KaleidoscopeBlurBox( segments: 8, blur: 5.0, color: Colors.purple.withAlpha(50), patternType: KaleidoscopePatternType.basic, animated: true, rotationDuration: Duration(seconds: 20), borderRadius: BorderRadius.circular(16), child: Text('Kaleidoscope patterns'), ) ``` -------------------------------- ### OrganicPatternBlurBox Example Source: https://github.com/omidhaqi/blurbox/blob/master/README.md Illustrates creating organic, flowing patterns with blur effects. It allows customization of blur intensity, background blur, color, complexity, fluidity, and animation duration. ```dart // Organic, flowing patterns OrganicPatternBlurBox( blur: 10, backgrundBlur: 50, color: Colors.teal.withAlpha(100), complexity: 8, fluidity: 0.8, animationDuration: Duration(seconds: 15), borderRadius: BorderRadius.circular(16), child: Text('Organic patterns'), ) ``` -------------------------------- ### Set Runtime Output Directory for Executable in CMake Source: https://github.com/omidhaqi/blurbox/blob/master/example/linux/CMakeLists.txt Configures the executable's runtime output directory to a specific subdirectory within the binary directory. This is done to ensure correct resource loading when the application is run from its installed location. ```cmake # Only the install-generated bundle's copy of the executable will launch # correctly, since the resources must in the right relative locations. To avoid # people trying to run the unbundled copy, put it in a subdirectory instead of # the default top-level location. set_target_properties(${BINARY_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" ) ``` -------------------------------- ### Define CMake Minimum Version and Ephemeral Directory Source: https://github.com/omidhaqi/blurbox/blob/master/example/linux/flutter/CMakeLists.txt Sets the minimum required CMake version and defines a variable for the ephemeral directory, which is crucial for build artifacts. This is a standard CMake setup. ```cmake cmake_minimum_required(VERSION 3.10) set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") ``` -------------------------------- ### GeometricPatternBlurBox Example Source: https://github.com/omidhaqi/blurbox/blob/master/README.md Shows how to create blur effects with geometric patterns. This includes setting base blur, shape count, multiple colors, and shape types (circle, rectangle), along with border radius. ```dart // Geometric patterns GeometricPatternBlurBox( baseBlur: 8, shapeCount: 100, colors: [Colors.blue, Colors.purple, Colors.pink], shapeTypes: [ GeometricShapeType.circle, GeometricShapeType.rectangle, ], borderRadius: BorderRadius.circular(16), child: Text('Geometric patterns'), ) ``` -------------------------------- ### PatternedBlurBox Example Source: https://github.com/omidhaqi/blurbox/blob/master/README.md Demonstrates creating a blur effect with a decorative pattern overlay. It uses a specified blur intensity, color, pattern asset, and border radius. The child widget is placed inside the blur effect. ```dart PatternedBlurBox( blur: 8.0, color: Colors.white.withAlpha(50), patternAsset: 'assets/patterns/dots.png', patternOpacity: 0.15, borderRadius: BorderRadius.circular(15), child: Padding( padding: const EdgeInsets.all(20), child: Text('Patterned Glass Effect'), ), ) ``` -------------------------------- ### Link Libraries and Include Directories (CMake) Source: https://github.com/omidhaqi/blurbox/blob/master/example/linux/runner/CMakeLists.txt Links necessary libraries (flutter, GTK) and sets include directories for the executable target. ```cmake # 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}") ``` -------------------------------- ### List and Include Flutter Library Headers Source: https://github.com/omidhaqi/blurbox/blob/master/example/linux/flutter/CMakeLists.txt Defines a list of Flutter library header files and then uses the custom `list_prepend` function to add the directory prefix to each header. Finally, it creates an INTERFACE library target named 'flutter' and sets its include directories and links against the Flutter library and system dependencies. ```cmake 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) ``` -------------------------------- ### Define Executable and Source Files (CMake) Source: https://github.com/omidhaqi/blurbox/blob/master/example/linux/runner/CMakeLists.txt Defines the main executable target for the application and lists all the necessary source files, including generated ones. ```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" ) ``` -------------------------------- ### Find and Check GTK, GLIB, and GIO Packages Source: https://github.com/omidhaqi/blurbox/blob/master/example/linux/flutter/CMakeLists.txt Uses PkgConfig to find and check for the presence of required GTK, GLIB, and GIO libraries. This ensures that the necessary system dependencies for Flutter's Linux backend are available. ```cmake 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) ``` -------------------------------- ### Include Generated Plugin Build Rules Source: https://github.com/omidhaqi/blurbox/blob/master/example/windows/CMakeLists.txt Includes the generated CMake file that manages the building of plugins and their integration into the application. ```cmake include(flutter/generated_plugins.cmake) ``` -------------------------------- ### C++ Wrapper for Plugins (CMake) Source: https://github.com/omidhaqi/blurbox/blob/master/example/windows/flutter/CMakeLists.txt Creates a static C++ library for Flutter plugins. It includes core implementation sources and plugin-specific registrar sources. Dependencies are set to 'flutter_assemble'. ```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) ``` -------------------------------- ### Apply Standard Build Settings (CMake) Source: https://github.com/omidhaqi/blurbox/blob/master/example/linux/runner/CMakeLists.txt Applies a standard set of build settings to the executable target. This can be customized for specific project needs. ```cmake # Apply the standard set of build settings. This can be removed for applications # that need different build settings. apply_standard_settings(${BINARY_NAME}) ``` -------------------------------- ### Flutter Integration and Dependency Management in CMake Source: https://github.com/omidhaqi/blurbox/blob/master/example/linux/CMakeLists.txt Integrates Flutter build rules by adding the Flutter managed directory and system-level dependencies like GTK using PkgConfig. It also ensures the Flutter assemble target is a dependency for the main executable. ```cmake # Flutter library and tool build rules. set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) # System-level dependencies. find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) # Application build; see runner/CMakeLists.txt. add_subdirectory("runner") # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) ``` -------------------------------- ### Apply Standard Compilation Settings in CMake Source: https://github.com/omidhaqi/blurbox/blob/master/example/linux/CMakeLists.txt Defines a CMake function to apply standard compilation settings to a target, including C++ standard, warning flags, optimization levels, and debug definitions based on the build configuration. ```cmake # Compilation settings that should be applied to most targets. # # Be cautious about adding new options here, as plugins use this function by # default. In most cases, you should add new options to specific targets instead # of modifying this function. 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() ``` -------------------------------- ### Define Profile Build Mode Linker and Compiler Flags Source: https://github.com/omidhaqi/blurbox/blob/master/example/windows/CMakeLists.txt Sets linker and compiler flags for the 'Profile' build configuration, typically mirroring the 'Release' configuration settings. ```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}") ``` -------------------------------- ### Integrate Flutter and Runner Subdirectories Source: https://github.com/omidhaqi/blurbox/blob/master/example/windows/CMakeLists.txt Includes the Flutter managed directory and the runner subdirectory, essential for integrating Flutter application logic and native runner components. ```cmake set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) add_subdirectory("runner") ``` -------------------------------- ### Apply Standard Compilation Settings Function Source: https://github.com/omidhaqi/blurbox/blob/master/example/windows/CMakeLists.txt A CMake function to apply standard compilation features and options to a target, including C++ standard, warning levels, exception handling, and debug definitions. ```cmake 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() ``` -------------------------------- ### Custom Command to Build Flutter Library and Headers Source: https://github.com/omidhaqi/blurbox/blob/master/example/linux/flutter/CMakeLists.txt Defines a custom command that executes the Flutter tool backend script. This command is designed to run every time due to the use of a non-existent output file `_phony_`, ensuring the Flutter library and headers are built or updated. It sets necessary environment variables and passes build configuration arguments. ```cmake 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} ) ``` -------------------------------- ### C++ Wrapper for Runner/App (CMake) Source: https://github.com/omidhaqi/blurbox/blob/master/example/windows/flutter/CMakeLists.txt Creates a static C++ library for the Flutter runner application. It includes core implementation sources and application-specific sources. Dependencies are set to 'flutter_assemble'. ```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 Preprocessor Definitions (CMake) Source: https://github.com/omidhaqi/blurbox/blob/master/example/linux/runner/CMakeLists.txt Adds preprocessor definitions to the build process, specifically for the application ID. ```cmake # Add preprocessor definitions for the application ID. add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") ``` -------------------------------- ### Include Generated Plugin Build Rules in CMake Source: https://github.com/omidhaqi/blurbox/blob/master/example/linux/CMakeLists.txt Includes CMake script files that manage the build process for Flutter plugins and adds them to the application. This is essential for integrating plugin functionalities. ```cmake # Generated plugin build rules, which manage building the plugins and adding # them to the application. include(flutter/generated_plugins.cmake) ``` -------------------------------- ### CMake Build Configuration Source: https://github.com/omidhaqi/blurbox/blob/master/example/windows/runner/CMakeLists.txt This CMake script configures the build process for a Flutter application on Windows. It sets the minimum CMake version, defines the project name and language, and specifies the executable target with its source files. ```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" ) # 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 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}") # Disable Windows macros that collide with C++ standard library functions. target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") # 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}") # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) ``` -------------------------------- ### Flutter Library Configuration (CMake) Source: https://github.com/omidhaqi/blurbox/blob/master/example/windows/flutter/CMakeLists.txt Configures the Flutter library, including setting the library path, ICU data file, and project build directory. It also defines header files and links against the Flutter library. ```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) ``` -------------------------------- ### FollowingBlurBox for Interactive Blur Source: https://github.com/omidhaqi/blurbox/blob/master/README.md Shows how to implement blur that follows user interaction (touch/cursor) using FollowingBlurBox, with adjustable radius, blur intensity, and follow speed. ```dart FollowingBlurBox( radius: 60, blurIntensity: 12, followSpeed: 0.5, // How quickly the blur follows (0.0-1.0) color: Colors.pink.withAlpha(50), child: Container( height: 200, width: 300, child: Center( child: Text('Move your finger or cursor over me'), ), ), ) ``` -------------------------------- ### Flutter Tool Backend Command (CMake) Source: https://github.com/omidhaqi/blurbox/blob/master/example/windows/flutter/CMakeLists.txt Defines a custom command to execute the Flutter tool backend script. This command is used to generate build artifacts like the Flutter library and headers. It uses a phony output to ensure execution on every build. ```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} ) ``` -------------------------------- ### Define Flutter Library and Header Paths Source: https://github.com/omidhaqi/blurbox/blob/master/example/linux/flutter/CMakeLists.txt Sets variables for the Flutter library file (`libflutter_linux_gtk.so`) and ICU data file, sourced from the ephemeral directory. It also defines the project build directory and the AOT library path. ```cmake set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 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) ``` -------------------------------- ### Performance Tip for Scrollable Views Source: https://github.com/omidhaqi/blurbox/blob/master/README.md Provides a performance tip for using blur in scrollable views, suggesting a specific physics configuration for ListView to potentially improve rendering performance. ```dart ListView( physics: const AlwaysScrollableScrollPhysics() .applyTo(const BouncingScrollPhysics()), children: [...] ) ``` -------------------------------- ### PresetBlurBox with Predefined Styles Source: https://github.com/omidhaqi/blurbox/blob/master/README.md Illustrates using PresetBlurBox to quickly apply predefined blur styles like 'heavy' blur to a widget, including options for border radius and padding. ```dart PresetBlurBox( preset: BlurPreset.heavy, // Choose from: soft, medium, heavy, subtleShadow, frostedGlass, and more borderRadius: BorderRadius.circular(16), padding: EdgeInsets.all(20), child: Center( child: Text( 'Heavy Blur', style: TextStyle(fontSize: 24, color: Colors.white), ), ), ) ``` -------------------------------- ### Custom list_prepend Function for CMake < 3.10 Source: https://github.com/omidhaqi/blurbox/blob/master/example/linux/flutter/CMakeLists.txt Provides a custom `list_prepend` function to mimic the behavior of `list(TRANSFORM ... PREPEND ...)` which is not available in CMake version 3.10. This function prepends a given prefix to each element of 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() ``` -------------------------------- ### AnimatedBlurBox for Smooth Transitions Source: https://github.com/omidhaqi/blurbox/blob/master/README.md Demonstrates the use of AnimatedBlurBox to create smooth transitions between different blur states, controlling blur amount, duration, and curve. ```dart AnimatedBlurBox( blur: _isBlurred ? 20.0 : 0.0, // Toggle between blurred and clear begin: _isBlurred ? 0.0 : 20.0, duration: Duration(milliseconds: 800), curve: Curves.easeInOutCubic, borderRadius: BorderRadius.circular(20), child: Center( child: Text('Animated Blur Effect'), ), ) ``` -------------------------------- ### Apply Animated Blur to Widget Source: https://github.com/omidhaqi/blurbox/blob/master/README.md Demonstrates applying an animated blur effect to a widget, allowing transitions between clear and blurry states. It includes parameters for current blur, beginning blur, duration, and border radius. ```dart // Animated blur Container( child: Text('Animates between clear and blurry'), ).animatedBlurry( blur: _isBlurred ? 10.0 : 0.0, beginBlur: _isBlurred ? 0.0 : 10.0, duration: Duration(milliseconds: 500), borderRadius: BorderRadius.circular(16), ) ``` -------------------------------- ### Apply Simple Blur to Widget Source: https://github.com/omidhaqi/blurbox/blob/master/README.md Shows how to apply a simple blur effect to any widget using an extension method. This allows customization of blur intensity, color, border radius, and padding. ```dart // Simple blur Text('Blurred Text').blurry( blur: 10, color: Colors.blue.withAlpha(50), borderRadius: BorderRadius.circular(15), padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), ) ``` -------------------------------- ### Basic BlurBox Usage Source: https://github.com/omidhaqi/blurbox/blob/master/README.md Demonstrates the fundamental usage of the BlurBox widget to apply a blur effect with customizable blur amount, color, border radius, and padding to a child widget. ```dart BlurBox( blur: 5.0, // Adjust the blur amount color: Colors.white.withAlpha(30), // Semi-transparent background borderRadius: BorderRadius.circular(16), padding: EdgeInsets.all(20), child: Text('This text has a blurred background!'), ) ``` -------------------------------- ### ThemedBlurBox for Theme Adaptation Source: https://github.com/omidhaqi/blurbox/blob/master/README.md Shows how ThemedBlurBox automatically adjusts its appearance to match the application's theme, providing options for blur, border radius, padding, and elevation. ```dart ThemedBlurBox( blur: 8, borderRadius: BorderRadius.circular(16), padding: EdgeInsets.all(20), elevation: 4, child: Text('Adapts to your app theme colors'), ) ``` -------------------------------- ### BlurBox Full-Screen Background Source: https://github.com/omidhaqi/blurbox/blob/master/README.md Shows how to use BlurBox to create a full-screen blurred background effect with adjustable blur amount. ```dart BlurBox( width: double.infinity, height: double.infinity, blur: 5.0, child: const Center( child: Text( 'Blur Background!', style: TextStyle(fontSize: 24.0), ), ), ), ``` -------------------------------- ### RadialBlurBox for Radiating Blur Source: https://github.com/omidhaqi/blurbox/blob/master/README.md Demonstrates creating blur that radiates from a focal point using RadialBlurBox, with parameters for radius, falloff, quality, maximum blur, focal point position, color, border radius, and padding. ```dart RadialBlurBox( radius: 150.0, falloff: 2.0, quality: 8, maxBlur: 15, focalPoint: Alignment(0.3, -0.2), // Position of the focal point color: Colors.purple.withAlpha(50), borderRadius: BorderRadius.circular(16), padding: EdgeInsets.all(20), child: Text('Radial blur effect'), ) ``` -------------------------------- ### DirectionalBlurBox for Angular Blur Source: https://github.com/omidhaqi/blurbox/blob/master/README.md Illustrates how to use DirectionalBlurBox to create blur effects with a specified angle, allowing for directional blur with customizable blur amount, color, border radius, and padding. ```dart DirectionalBlurBox( blur: 12, angle: 45.0, // Direction of blur in degrees color: Colors.blue.withAlpha(50), borderRadius: BorderRadius.circular(16), padding: EdgeInsets.all(20), child: Text('Directional blur effect'), ) ``` -------------------------------- ### ScrollAwareBlurBox for Scroll-Based Effects Source: https://github.com/omidhaqi/blurbox/blob/master/README.md Illustrates how ScrollAwareBlurBox adjusts blur based on scroll position, requiring a ScrollController and allowing configuration of minimum/maximum blur and scroll threshold. ```dart ScrollAwareBlurBox( scrollController: _scrollController, // Your ScrollController minBlur: 0, maxBlur: 15, scrollThreshold: 300, // How far to scroll for max blur color: Colors.white.withAlpha(75), child: Text('Scroll-aware header'), ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.