### CMake Project Setup and Configuration Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/linux/CMakeLists.txt Sets up the CMake project, defines executable name and application ID, and configures modern CMake behaviors. It also specifies the installation path for bundled libraries. ```cmake cmake_minimum_required(VERSION 3.10) project(runner LANGUAGES CXX) set(BINARY_NAME "untitled") set(APPLICATION_ID "com.example.untitled") cmake_policy(SET CMP0063 NEW) set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") ``` -------------------------------- ### Installation Configuration for Application Bundle Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/linux/CMakeLists.txt Configures the installation process to create a relocatable application bundle, including clearing the bundle directory, installing the executable, data, libraries, and assets. ```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(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) ``` -------------------------------- ### Installation Rules Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/windows/CMakeLists.txt Configures the installation process, setting the installation prefix relative to the executable's directory, and installing the main executable, ICU data, Flutter library, bundled plugin libraries, and assets. It also handles the AOT library installation for specific build configurations. ```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(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) ``` -------------------------------- ### Flutter Library Setup Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/linux/flutter/CMakeLists.txt Configures the Flutter library for Linux GTK. It finds necessary packages (GTK, GLIB, GIO), sets the Flutter library path, and defines include directories and link libraries for the `flutter` interface target. ```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) 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) 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) ``` -------------------------------- ### Example Usage of SuperLargeTitle Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/README.md Demonstrates how to use the SuperLargeTitle widget in a Flutter application, showcasing the customization of its parameters like enabled, largeTitle, actions, and textStyle. ```dart SuperLargeTitle( enabled: true, // default value is true largeTitle: "Super Human", actions: [ IconButton( icon: Icon(Icons.settings), onPressed: () { // Handle settings button press }, ), IconButton( icon: Icon(Icons.search), onPressed: () { // Handle search button press }, ), ], textStyle: TextStyle( color: Colors.blue, fontSize: 40.0, fontWeight: FontWeight.bold, ), ) ``` -------------------------------- ### Basic SuperScaffold Usage Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/README.md An example demonstrating the basic usage of SuperScaffold with SuperAppBar, SuperLargeTitle, SuperSearchBar, and SuperAppBarBottom. ```dart Scaffold( backgroundColor: Theme.of(context).scaffoldBackgroundColor, body: SuperScaffold( appBar: SuperAppBar( title: Text("Hello SuperScaffold"), largeTitle: SuperLargeTitle( enabled: true, largeTitle: "Welcome", ), searchBar: SuperSearchBar( enabled: true, onChanged: (query) { // Search Bar Changes }, onSubmitted: (query) { // On Search Bar submitted }, searchResult: /* ... */, // Add other search bar properties as needed ), bottom: SuperAppBarBottom( enabled: true, height: 40, child: YourCustomBottomWidget(), // Any widget of yours ), ), body: SingleChildScrollView( // You can use CustomScrollView or any Widget desired child: Column( children: [ Card( // Playground card // Add your onTap logic for Playground card ), Card( // List of example cards // Add your ListView.separated logic for example cards ), ], ), ), ); ``` -------------------------------- ### Install AOT Library (Non-Debug Builds) Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/linux/CMakeLists.txt This CMake snippet conditionally installs the AOT library to the runtime destination only when the build type is not 'Debug'. It ensures that performance-critical libraries are included in release builds. ```cmake if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### SuperAppBarBottom Widget Example Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/README.md An example demonstrating how to use the SuperAppBarBottom widget to add custom content to the bottom of the SuperAppBar. It shows how to set the child widget, height, enabled state, and color. ```dart SuperAppBarBottom( child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ IconButton( icon: Icon(Icons.home), onPressed: () { // Handle home button press }, ), IconButton( icon: Icon(Icons.notifications), onPressed: () { // Handle notifications button press }, ), IconButton( icon: Icon(Icons.person), onPressed: () { // Handle profile button press }, ), ], ), height: 50.0, enabled: true, color: Colors.blue, ) ``` -------------------------------- ### SuperSearchBar Example Usage Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/README.md Demonstrates how to use the SuperSearchBar widget in a Flutter application, including setting properties like `enabled`, `resultBehavior`, and defining callback functions for `onChanged` and `onSubmitted` events. ```dart SuperSearchBar( enabled: true, resultBehavior: SearchBarResultBehavior.visibleOnInput, onChanged: (query) { // Handle changes in the search bar print("Search bar changed: $query"); }, onSubmitted: (query) { // Handle submission of the search bar print("Search bar submitted: $query"); }, ) ``` -------------------------------- ### Flutter Super Cupertino Navigation Bar Examples Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/README.md Demonstrates various configurations of the Super Cupertino Navigation Bar, including floated large titles, pinned large titles, normal navigation bars, and combinations with search bars and bottom app bars. ```dart /* This section provides links to example GIFs and images showcasing the different functionalities of the Super Cupertino Navigation Bar. Refer to the project's GitHub repository for the actual code implementation of these examples. Examples include: - Floated Large Title - Pinned Large Title - Only Large Title - Normal Navbar Floated - Normal Navbar Pinned - Only Navbar - Large Title, SearchBar and Bottom - Large Title and Bottom */ // Example GIF URLs: // https://raw.githubusercontent.com/kspo/super_cupertino_navigation_bar/main/screenshots/intro.gif // https://raw.githubusercontent.com/kspo/super_cupertino_navigation_bar/main/screenshots/intro_1.gif // https://raw.githubusercontent.com/kspo/super_cupertino_navigation_bar/main/screenshots/intro_2.gif // https://raw.githubusercontent.com/kspo/super_cupertino_navigation_bar/main/screenshots/intro_33.gif // https://raw.githubusercontent.com/kspo/super_cupertino_navigation_bar/main/screenshots/intro_4.gif // https://raw.githubusercontent.com/kspo/super_cupertino_navigation_bar/main/screenshots/intro_6.png // https://raw.githubusercontent.com/kspo/super_cupertino_navigation_bar/main/screenshots/intro_9.gif // https://raw.githubusercontent.com/kspo/super_cupertino_navigation_bar/main/screenshots/intro_10.gif // https://raw.githubusercontent.com/kspo/super_cupertino_navigation_bar/main/screenshots/cheers.gif // For detailed code, please visit: https://github.com/kspo/super_cupertino_navigation_bar/tree/main/example/lib/samples ``` -------------------------------- ### Application Target Definition and Linking Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/linux/CMakeLists.txt Defines the main executable target, includes source files, applies standard settings, and links necessary libraries like Flutter and GTK+. ```cmake add_executable(${BINARY_NAME} "main.cc" "my_application.cc" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" ) apply_standard_settings(${BINARY_NAME}) target_link_libraries(${BINARY_NAME} PRIVATE flutter) target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) add_dependencies(${BINARY_NAME} flutter_assemble) ``` -------------------------------- ### Flutter Integration and System Dependencies Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/linux/CMakeLists.txt Integrates Flutter build rules by adding the Flutter managed directory as a subdirectory and finds PkgConfig and GTK+ 3.0 for system-level dependencies. ```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_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") ``` -------------------------------- ### Project and Build Configuration Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/windows/CMakeLists.txt Sets up the minimum CMake version, project name, executable name, and manages build type configurations for multi-config and single-config generators. It also defines linker and compiler flags for the 'Profile' build mode. ```cmake cmake_minimum_required(VERSION 3.14) project(untitled LANGUAGES CXX) set(BINARY_NAME "untitled") 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() 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}") add_definitions(-DUNICODE -D_UNICODE) ``` -------------------------------- ### Generated Plugin Rules Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/linux/CMakeLists.txt Includes the CMake script for managing generated plugin builds and integrating them with the application. ```cmake include(flutter/generated_plugins.cmake) ``` -------------------------------- ### Runtime Output Directory Configuration Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/linux/CMakeLists.txt Sets the runtime output directory for the executable to a subdirectory to prevent direct execution of unbundled copies, ensuring proper resource loading. ```cmake set_target_properties(${BINARY_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" ) ``` -------------------------------- ### Standard Compilation Settings Function Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/windows/CMakeLists.txt Defines a reusable CMake function `APPLY_STANDARD_SETTINGS` to apply common compilation features, options, and definitions to targets, promoting consistency across the build. ```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() ``` -------------------------------- ### C++ Wrapper Plugin Configuration Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/windows/flutter/CMakeLists.txt Defines a static library for the C++ wrapper used by Flutter plugins. It includes core implementation files and plugin-specific sources, sets visibility to hidden, and links against the Flutter library. ```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) ``` -------------------------------- ### Cross-Building Configuration Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/linux/CMakeLists.txt Configures CMake for cross-building by setting the sysroot and adjusting find root path modes based on the FLUTTER_TARGET_PLATFORM_SYSROOT variable. ```cmake 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() ``` -------------------------------- ### Flutter Tool Backend Integration Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/linux/flutter/CMakeLists.txt Defines a custom CMake command to execute the Flutter tool backend script. This command generates the Flutter library and header files. It's set up to run every time by using a phony output file, as direct input/output tracking for the tool is not available. ```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 Application Configuration Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/windows/flutter/CMakeLists.txt Defines a static library for the C++ wrapper used by the Flutter application runner. It includes core implementation files and application-specific sources, linking against the Flutter library. ```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) ``` -------------------------------- ### Flutter Tool Backend Integration Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/windows/flutter/CMakeLists.txt Sets up a custom command to integrate with the Flutter tool backend. This command is designed to run the tool_backend.bat script, which is crucial for Flutter's build process, especially for generating necessary artifacts like DLLs and headers. ```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" windows-x64 $ VERBATIM ) add_custom_target(flutter_assemble DEPENDS "${FLUTTER_LIBRARY}" ${FLUTTER_LIBRARY_HEADERS} ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} ${CPP_WRAPPER_SOURCES_APP} ) ``` -------------------------------- ### Flutter and Plugin Integration Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/windows/CMakeLists.txt Includes the Flutter managed directory and generated plugin CMake files, essential for building the Flutter application and its associated plugins. ```cmake set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) add_subdirectory("runner") include(flutter/generated_plugins.cmake) ``` -------------------------------- ### Flutter Web Service Worker Configuration Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/web/index.html This snippet configures the service worker for a Flutter web application. It loads the main Dart entry point and initializes the Flutter engine. ```javascript const serviceWorkerVersion = null; window.addEventListener('load', function(ev) { // Download main.dart.js _flutter.loader.loadEntrypoint({ serviceWorker: { serviceWorkerVersion: serviceWorkerVersion, }, onEntrypointLoaded: function(engineInitializer) { engineInitializer.initializeEngine().then(function(appRunner) { appRunner.runApp(); }); } }); }); ``` -------------------------------- ### Customize Launch Screen Assets Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md Instructions for customizing the launch screen assets by replacing image files directly or using Xcode. ```bash open ios/Runner.xcworkspace ``` -------------------------------- ### CMake Build Configuration Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/windows/runner/CMakeLists.txt Configures the CMake build for a Windows Flutter application. It defines the main executable, links necessary libraries (including Flutter and Windows-specific ones), and sets preprocessor definitions for version information. ```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) ``` -------------------------------- ### Standard Compilation Settings Function Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/linux/CMakeLists.txt Defines a CMake function to apply standard compilation features and options, including C++14 standard, warning flags, optimization levels, and NDEBUG definition. ```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() ``` -------------------------------- ### Flutter Library Configuration Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/windows/flutter/CMakeLists.txt Configures the Flutter library by setting include directories and linking against the Flutter dynamic library. It also defines dependencies on the flutter_assemble target. ```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") # === 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) ``` -------------------------------- ### Add Dependency Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/README.md Instructions to add the super_cupertino_navigation_bar package to your Flutter project's pubspec.yaml file. ```yaml dependencies: super_cupertino_navigation_bar: latest_version ``` -------------------------------- ### CMake List Prepend Function Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/linux/flutter/CMakeLists.txt Defines a CMake function `list_prepend` to add a prefix to each element of a list. This is a workaround for older CMake versions (pre-3.10) that lack the `list(TRANSFORM ... PREPEND ...)` command. ```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() ``` -------------------------------- ### Import Package Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/README.md How to import the Super Cupertino Navigation Bar package into your Dart files. ```dart import 'package:super_cupertino_navigation_bar/super_cupertino_navigation_bar.dart'; ``` -------------------------------- ### Build Type Configuration Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/example/linux/CMakeLists.txt Sets the default build type to 'Debug' if not already defined, ensuring consistent build modes for the Flutter application. ```cmake 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() ``` -------------------------------- ### SuperSearchBar Parameters Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/README.md Defines the configurable parameters for the SuperSearchBar widget. This includes text styling, icons, actions, scroll and animation behaviors, and callback functions for user interactions. ```APIDOC SuperSearchBar: cancelButtonText: The text displayed on the cancel button. Default: "Cancel" cancelTextStyle: The style of the cancel button's text. Default: TextStyle(color: CupertinoColors.systemBlue) placeholderTextStyle: The style of the placeholder text. Default: TextStyle(color: CupertinoColors.systemGrey) placeholderText: The placeholder text displayed in the search bar. Default: "Search" prefixIcon: The icon displayed as a prefix in the search bar. Default: Icon(CupertinoIcons.search) actions: Additional actions displayed in the search bar. Type `SuperAction`. Default: [] scrollBehavior: The scroll behavior of the search bar. Default: SearchBarScrollBehavior.floated height: The height of the search bar. Default: 35.0 padding: The padding of the search bar. Default: EdgeInsets.symmetric(horizontal: 15.0) animationBehavior: The animation behavior of the search bar. Default: SearchBarAnimationBehavior.top animationDuration: The duration of the search bar animation. Default: Duration(milliseconds: 250) searchResult: The widget displayed as a search result. Default: Text(".", style: TextStyle(color: Colors.transparent)) resultBehavior: The visibility behavior of the search result. Default: SearchBarResultBehavior.visibleOnFocus enabled: Whether the search bar is enabled or disabled. Default: true textStyle: The style of the text entered in the search bar. Default: TextStyle() onChanged: Callback function triggered when the text in the search bar changes. onFocused: Callback function triggered when the search bar gains or loses focus. onSubmitted: Callback function triggered when the user submits the search bar. searchController: The `TextEditingController` for controlling the text in the search bar. searchFocusNode: The `FocusNode` for controlling the focus state of the search bar. backgroundColor: The background color of the search bar. Default: CupertinoColors.tertiarySystemFill resultColor: The color of the search result. ``` -------------------------------- ### SuperLargeTitle Widget Parameters Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/README.md Defines the configurable parameters for the SuperLargeTitle widget, including enabling/disabling the large title, setting its text, adding actions, customizing text style, height, and padding. ```APIDOC SuperLargeTitle: enabled: bool Whether the large title is enabled or disabled. Default: true largeTitle: String The text to be displayed as the large title. Default: "Hello Super Human" actions: List? A list of additional widgets or actions to be displayed next to the large title. Default: null textStyle: TextStyle? The style of the large title text. Default: See default values below height: double? The height of the large title. Default: kToolbarHeight padding: EdgeInsetsGeometry? The padding around the large title. Default: EdgeInsets.symmetric(horizontal: 15.0) ``` -------------------------------- ### SuperAction Parameters Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/README.md Defines the parameters for the SuperAction widget, which allows for additional actions within the search bar. It includes a child widget and a behavior property to control its visibility. ```APIDOC SuperAction: child: The widget to be displayed. behavior: The behavior of the widget based on `SuperActionBehavior`. Default: `visibleOnFocus` ``` -------------------------------- ### SuperLargeTitle Widget Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/README.md The SuperLargeTitle widget is a Flutter component designed for displaying large and prominent titles within an application. It allows for customization of the title's appearance and layout. -------------------------------- ### SearchBarAnimationBehavior Enum Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/README.md Defines the possible animation behaviors for the search bar, specifying whether it animates from the top or maintains a steady position. ```dart enum SearchBarAnimationBehavior { top, steady, } ``` -------------------------------- ### SuperAppBar Widget Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/README.md The SuperAppBar widget is a customizable Flutter AppBar that includes features like a search bar, large title support, and various styling options. It extends the default AppBar functionality to provide a richer user interface. ```dart SuperAppBar( title: Text("My App"), actions: const [Icon(Icons.search), Icon(Icons.more_vert)], previousPageTitle: "Home", searchBar: SuperSearchBar(), largeTitle: SuperLargeTitle(), bottom: SuperAppBarBottom(), backgroundColor: Colors.black, bottomBorder: const BorderSide(color: Colors.grey, width: 1), shadowColor: Colors.grey, ); ``` -------------------------------- ### SuperActionBehavior Enum Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/README.md Defines the behavior of the action elements in the app bar. They can be always visible, visible on focus, or visible on unfocus. ```dart enum SuperActionBehavior { alwaysVisible, visibleOnFocus, visibleOnUnFocus, } ``` -------------------------------- ### SearchBarResultBehavior Enum Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/README.md Defines the behavior of the search bar results visibility. It can be visible on focus, visible on input, or never visible. ```dart enum SearchBarResultBehavior { visibleOnFocus, visibleOnInput, neverVisible, } ``` -------------------------------- ### SearchBarScrollBehavior Enum Source: https://github.com/kspo/super_cupertino_navigation_bar/blob/main/README.md Defines the possible scroll behaviors for the search bar, allowing it to be either pinned or floated. ```dart enum SearchBarScrollBehavior { pinned, floated, } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.