### Configure Installation Paths Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/windows/CMakeLists.txt Sets up the installation directory and ensures the install step is default for Visual Studio compatibility. ```cmake # === Installation === # Support files are copied into place next to the executable, so that it can # run in place. This is done instead of making a separate bundle (as on Linux) # so that building and running from within Visual Studio will work. set(BUILD_BUNDLE_DIR "$") # Make the "install" step default, as it's required to run. 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 Application Executable Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/CMakeLists.txt Installs the application executable to the specified runtime destination within the installation prefix. This is part of the bundle creation process. ```cmake install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) ``` -------------------------------- ### Install Flutter Library Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/CMakeLists.txt Installs the main Flutter library file to the library directory within the installation bundle. This is essential for the application's runtime. ```cmake install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Install Targets and Assets Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/windows/CMakeLists.txt Defines installation rules for the executable, Flutter data, libraries, native assets, and assets directory. ```cmake 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() # Copy the native assets provided by the build.dart from all packages. set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") 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. install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" CONFIGURATIONS Profile;Release COMPONENT Runtime) ``` -------------------------------- ### Install Bundled Plugin Libraries Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/CMakeLists.txt Installs all bundled libraries from plugins into the library directory of the installation bundle. This ensures that plugins have their required shared libraries available at runtime. ```cmake foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) install(FILES "${bundled_library}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endforeach(bundled_library) ``` -------------------------------- ### Setup Flutter interface library Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/flutter/CMakeLists.txt Creates an interface library for Flutter and links the necessary system dependencies and include directories. ```cmake 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) ``` -------------------------------- ### Configure Flutter Asset Installation Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/CMakeLists.txt Removes existing asset directories and installs the current build's assets to the runtime bundle. ```cmake 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 Native Assets Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/CMakeLists.txt Copies native assets provided by packages into the library directory of the installation bundle. This ensures that any platform-specific assets are correctly deployed. ```cmake set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") install(DIRECTORY "${NATIVE_ASSETS_DIR}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Install ICU Data File Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/CMakeLists.txt Installs the ICU data file, which is necessary for internationalization and localization, to the data directory within the installation bundle. ```cmake install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Install DropdownSearch Package Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/README.md Add this line to your pubspec.yaml file to include the dropdown_search package in your Flutter project. ```yaml dropdown_search: ``` -------------------------------- ### Import DropdownSearch Package Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/README.md Import the DropdownSearch package into your Dart file to start using its widgets. ```dart import 'package:dropdown_search/dropdown_search.dart'; ``` -------------------------------- ### Conditionally Install AOT Library Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/CMakeLists.txt Deploys the AOT library only when the build type is not set to Debug. ```cmake # 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() ``` -------------------------------- ### Bottom Sheet Popup Mode Source: https://context7.com/salim-lachdhaf/dropdown_search/llms.txt Configures the dropdown to use a bottom sheet for its selection popup. This example shows custom styling for the popup title and disables specific items. ```dart DropdownSearch( items: (filter, loadProps) => List.generate(30, (i) => i + 1), decoratorProps: DropDownDecoratorProps( decoration: InputDecoration( labelText: "Select a number", hintText: "Choose an option", ), ), popupProps: PopupProps.bottomSheet( title: Container( decoration: BoxDecoration(color: Colors.deepPurple), alignment: Alignment.center, padding: EdgeInsets.symmetric(vertical: 16), child: Text( 'Numbers 1..30', style: TextStyle(fontSize: 21, fontWeight: FontWeight.bold, color: Colors.white70), ), ), disabledItemFn: (int i) => i <= 3, // Disable items 1-3 bottomSheetProps: BottomSheetProps( clipBehavior: Clip.antiAlias, shape: OutlineInputBorder( borderSide: BorderSide(width: 0), borderRadius: BorderRadius.only( topLeft: Radius.circular(25), topRight: Radius.circular(25), ), ), ), ), ) ``` -------------------------------- ### Configure Flutter system dependencies Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/flutter/CMakeLists.txt Locates required GTK, GLIB, and GIO libraries using PkgConfig and sets up the Flutter library path. ```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") # 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) ``` -------------------------------- ### Link Libraries and Include Directories Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/windows/runner/CMakeLists.txt Specifies the libraries to link against and the directories to search for include files. Add any application-specific dependencies here. ```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}") ``` -------------------------------- ### Apply Standard Build Settings Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/windows/runner/CMakeLists.txt Applies a standard set of build settings to the application target. This can be customized for projects with specific build requirements. ```cmake # Apply the standard set of build settings. This can be removed for applications # that need different build settings. apply_standard_settings(${BINARY_NAME}) ``` -------------------------------- ### Create a Basic Single Selection Dropdown Source: https://context7.com/salim-lachdhaf/dropdown_search/llms.txt Initializes a simple dropdown with static string items using the default menu popup style. ```dart import 'package:dropdown_search/dropdown_search.dart'; DropdownSearch( items: (filter, loadProps) => ["Item 1", "Item 2", "Item 3", "Item 4"], popupProps: PopupProps.menu( fit: FlexFit.loose, ), ) ``` -------------------------------- ### Adaptive Dropdown UI Configuration Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/README.md Configure adaptive platform UI for DropdownSearch, allowing different popup modes for Material and Cupertino platforms. ```dart AdaptiveDropdownSearch( popupProps: AdaptivePopupProps( cupertinoProps: CupertinoPopupProps.bottomSheet(), materialProps: PopupProps.dialog() ), ) ``` -------------------------------- ### Implement Adaptive Platform UI Source: https://context7.com/salim-lachdhaf/dropdown_search/llms.txt Uses AdaptiveDropdownSearch to automatically switch between Material and Cupertino styles based on the current platform. ```dart AdaptiveDropdownSearch( context: context, items: (filter, loadProps) => ["Option A", "Option B", "Option C"], popupProps: AdaptivePopupProps( cupertinoProps: CupertinoPopupProps.bottomSheet(), materialProps: PopupProps.dialog(), ), ) // Multi-selection adaptive dropdown AdaptiveDropdownSearch.multiSelection( context: context, items: (filter, loadProps) => ["Red", "Green", "Blue", "Yellow"], popupProps: AdaptiveMultiSelectionPopupProps( cupertinoProps: CupertinoMultiSelectionPopupProps.modalBottomSheet(), materialProps: MultiSelectionPopupProps.menu(), ), ) ``` -------------------------------- ### Create a Basic Multi-Selection Dropdown Source: https://context7.com/salim-lachdhaf/dropdown_search/llms.txt Configures a dropdown that allows selecting multiple items, which are then displayed as chips. ```dart DropdownSearch.multiSelection( items: (filter, loadProps) => [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ], popupProps: MultiSelectionPopupProps.menu( fit: FlexFit.loose, ), ) ``` -------------------------------- ### Apply Standard Compilation Settings Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/CMakeLists.txt Applies standard compilation features and options to a target. It enables C++14, sets warning flags, and optimizes based on the build configuration. ```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() ``` -------------------------------- ### Configure CMake Project and Build Modes Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/windows/CMakeLists.txt Sets the project name, minimum CMake version, and defines build configuration types for Debug, Profile, and Release modes. ```cmake cmake_minimum_required(VERSION 3.14) project(example 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") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. cmake_policy(VERSION 3.14...3.25) # Define build configuration option. 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() ``` -------------------------------- ### Include Flutter Subdirectories and Plugins Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/windows/CMakeLists.txt Adds the Flutter managed directory and generated plugins to the build process. ```cmake # Flutter library and tool build rules. set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) # Application build; see runner/CMakeLists.txt. add_subdirectory("runner") # Generated plugin build rules, which manage building the plugins and adding # them to the application. include(flutter/generated_plugins.cmake) ``` -------------------------------- ### Define Application Executable Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/CMakeLists.txt Defines the main executable target for the application, listing its source files. New source files should be added here. ```cmake add_executable(${BINARY_NAME} "main.cc" "my_application.cc" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" ) ``` -------------------------------- ### Set Runtime Output Directory Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/CMakeLists.txt Configures the runtime output directory for the executable. This is set to a subdirectory to prevent users from running the unbundled copy, as resources need to be in specific relative locations. ```cmake set_target_properties(${BINARY_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" ) ``` -------------------------------- ### Create Custom Container with Action Buttons Source: https://context7.com/salim-lachdhaf/dropdown_search/llms.txt Wraps the dropdown popup in a custom container to add UI elements like 'Select All' or 'Clear' buttons. Requires a GlobalKey to control the dropdown programmatically. ```dart final _dropdownKey = GlobalKey>(); DropdownSearch.multiSelection( key: _dropdownKey, items: (filter, loadProps) => List.generate(30, (index) => "Item $index"), popupProps: MultiSelectionPopupProps.dialog( showSearchBox: true, containerBuilder: (ctx, popupWidget) { return Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Padding( padding: EdgeInsets.all(8), child: OutlinedButton( onPressed: () => _dropdownKey.currentState?.closeDropDownSearch(), child: const Text('Cancel'), ), ), Padding( padding: EdgeInsets.all(8), child: OutlinedButton( onPressed: () => _dropdownKey.currentState?.popupSelectAllItems(), child: const Text('Select All'), ), ), Padding( padding: EdgeInsets.all(8), child: OutlinedButton( onPressed: () => _dropdownKey.currentState?.popupDeselectAllItems(), child: const Text('Clear'), ), ), ], ), Expanded(child: popupWidget), ], ); }, ), ) ``` -------------------------------- ### Implement Multi-Selection Bottom Sheet Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/README.md Configures a multi-selection dropdown using a bottom sheet with search functionality and suggested items. ```dart DropdownSearch.multiSelection( items: (filter, s) => getData(filter), compareFn: (i, s) => i.isEqual(s), popupProps: PopupPropsMultiSelection.bottomSheet( bottomSheetProps: BottomSheetProps(backgroundColor: Colors.blueGrey[50]), showSearchBox: true, itemBuilder: userModelPopupItem, suggestedItemProps: SuggestedItemProps( showSuggestedItems: true, suggestedItems: (us) { return us.where((e) => e.name.contains("Mrs")).toList(); }, ), ), ), ``` -------------------------------- ### Define Flutter library headers Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/flutter/CMakeLists.txt Lists the required Flutter Linux header files and applies the prepend function to their paths. ```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/") ``` -------------------------------- ### Link Application Dependencies Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/CMakeLists.txt Links the application executable against the Flutter library and the GTK+ library. Additional application-specific dependencies can be added here. ```cmake target_link_libraries(${BINARY_NAME} PRIVATE flutter) target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) ``` -------------------------------- ### Define list_prepend helper function Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/flutter/CMakeLists.txt Provides a workaround for list manipulation in CMake 3.10 by prepending a 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() ``` -------------------------------- ### Dropdown with Icon and Text Items and Custom Decorator Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/README.md Configures a DropdownSearch with tuple data (IconData, String) for items. Features a custom decorator with a specific background color and border radius, and a custom dropdown builder for a ListTile. ```dart DropdownSearch<(IconData, String)>( selectedItem: (Icons.person, 'Your Profile'), compareFn: (item1, item2) => item1.$1 == item2.$2, items: (f, cs) => [ (Icons.person, 'Your Profile'), (Icons.settings, 'Setting'), (Icons.lock_open_rounded, 'Change Password'), (Icons.power_settings_new_rounded, 'Logout'), ], decoratorProps: DropDownDecoratorProps( decoration: InputDecoration( contentPadding: EdgeInsets.symmetric(vertical: 6), filled: true, fillColor: Color(0xFF1eb98f), border: OutlineInputBorder( borderSide: BorderSide(color: Colors.transparent), borderRadius: BorderRadius.circular(8), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.transparent), borderRadius: BorderRadius.circular(8), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.transparent), borderRadius: BorderRadius.circular(8), ), ), ), dropdownBuilder: (context, selectedItem) { return ListTile( leading: Icon(selectedItem!.$1, color: Colors.white), title: Text( selectedItem.$2, style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold), ), ); }, popupProps: PopupProps.menu( itemBuilder: (context, item, isDisabled, isSelected) { return ListTile( contentPadding: EdgeInsets.symmetric(vertical: 8, horizontal: 12), leading: Icon(item.$1, color: Colors.white), title: Text( item.$2, style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold), ), ); }, fit: FlexFit.loose, menuProps: MenuProps( backgroundColor: Colors.transparent, elevation: 0, margin: EdgeInsets.only(top: 16), ), containerBuilder: (ctx, popupWidget) { return Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.end, children: [ Padding( padding: const EdgeInsets.only(right: 12), child: Image.asset( 'assets/images/arrow-up.png', color: Color(0xFF1eb98f), height: 14, ), ), Flexible( child: Container( decoration: BoxDecoration( color: Color(0xFF1eb98f), shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), ), child: popupWidget, ), ), ], ); }, ), ) ``` -------------------------------- ### Apply Standard Compilation Settings Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/windows/CMakeLists.txt Defines a function to apply standard C++17 features, compiler warnings, and definitions to a target. ```cmake # Use Unicode for all projects. add_definitions(-DUNICODE -D_UNICODE) # 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_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() ``` -------------------------------- ### Define Executable Target Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/windows/runner/CMakeLists.txt Defines the main executable for the application, including all necessary source files and generated files. Ensure BINARY_NAME is consistent with top-level CMakeLists.txt for `flutter run` compatibility. ```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" ) ``` -------------------------------- ### Handle Dropdown Events with Callbacks Source: https://context7.com/salim-lachdhaf/dropdown_search/llms.txt Implement callbacks to manage selection changes, control popup behavior, and handle clearing and focus events. This allows for dynamic user interactions and validation logic within the dropdown. ```dart DropdownSearch( items: (filter, loadProps) => ["Option A", "Option B", "Option C"], onSelected: (String? selectedItem) { print('Selected: $selectedItem'); }, onBeforeChange: (String? prevItem, String? nextItem) async { // Return false to prevent the change if (nextItem == "Option B") { final confirm = await showDialog( context: context, builder: (ctx) => AlertDialog( title: Text('Confirm'), content: Text('Are you sure you want to select Option B?'), actions: [ TextButton(onPressed: () => Navigator.pop(ctx, false), child: Text('Cancel')), TextButton(onPressed: () => Navigator.pop(ctx, true), child: Text('Confirm')), ], ), ); return confirm ?? false; } return true; }, onBeforePopupOpening: (String? currentItem) async { print('About to open popup. Current: $currentItem'); return true; // Return false to prevent opening }, onBeforeClear: (String? currentItem) async { return true; // Return false to prevent clearing }, onClear: () { print('Selection cleared'); }, onFocusChange: (bool hasFocus) { print('Focus changed: $hasFocus'); }, popupProps: PopupProps.menu( onDisplayed: () => print('Popup displayed'), onDismissed: () => print('Popup dismissed'), onItemsLoaded: (items) => print('Loaded ${items.length} items'), ), ) ``` -------------------------------- ### Basic DropdownSearch with Menu Popup Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/README.md A simple DropdownSearch for string items. Uses a menu popup with a disabled item function and loose flex fit. ```dart DropdownSearch( items: (f, cs) => ["Item 1", 'Item 2', 'Item 3', 'Item 4'], popupProps: PopupProps.menu( disabledItemFn: (item) => item == 'Item 3', fit: FlexFit.loose ), ) ``` -------------------------------- ### Manage Dropdown State Programmatically Source: https://context7.com/salim-lachdhaf/dropdown_search/llms.txt Use GlobalKey to trigger actions like opening, closing, clearing, or updating selections from external widgets. ```dart final _dropdownKey = GlobalKey>(); Column( children: [ DropdownSearch.multiSelection( key: _dropdownKey, items: (filter, loadProps) => ["A", "B", "C", "D", "E"], selectedItems: ["A", "C"], ), Row( children: [ ElevatedButton( onPressed: () => _dropdownKey.currentState?.openDropDownSearch(), child: Text('Open'), ), ElevatedButton( onPressed: () => _dropdownKey.currentState?.closeDropDownSearch(), child: Text('Close'), ), ElevatedButton( onPressed: () => _dropdownKey.currentState?.changeSelectedItems(["B", "D"]), child: Text('Set B, D'), ), ElevatedButton( onPressed: () => _dropdownKey.currentState?.clear(), child: Text('Clear'), ), ElevatedButton( onPressed: () { final items = _dropdownKey.currentState?.getSelectedItems; print('Selected: $items'); }, child: Text('Get Selected'), ), ], ), ], ) ``` -------------------------------- ### Display Suggested Items in Dropdown Source: https://context7.com/salim-lachdhaf/dropdown_search/llms.txt Configures a multi-selection dropdown to show suggested items at the top of the list using the suggestionsProps property. ```dart DropdownSearch.multiSelection( items: (filter, loadProps) => fetchUsers(filter), compareFn: (i, s) => i.isEqual(s), popupProps: MultiSelectionPopupProps.bottomSheet( showSearchBox: true, bottomSheetProps: BottomSheetProps(backgroundColor: Colors.blueGrey[50]), itemBuilder: (context, item, isDisabled, isSelected) { return ListTile( leading: CircleAvatar(child: Text(item.name[0])), title: Text(item.name), selected: isSelected, ); }, suggestionsProps: SuggestionsProps( showSuggestions: true, items: (users) => users.where((e) => e.name.contains("Mrs")).toList(), ), ), ) ``` -------------------------------- ### Autocomplete Mode Source: https://context7.com/salim-lachdhaf/dropdown_search/llms.txt Sets up the dropdown to function as an autocomplete input. Typing in the field filters the list and displays suggestions in an overlay, with custom item building and alignment. ```dart DropdownSearch( items: (filter, loadProps) => ['Item 1', 'Item 2', 'Item 3', 'Item 4'], popupProps: PopupProps.autocomplete( autoCompleteProps: AutocompleteProps( groupId: UniqueKey(), align: MenuAlign.bottomStart, ), fit: FlexFit.loose, constraints: BoxConstraints(maxHeight: 250), itemBuilder: (context, item, isDisabled, isSelected) { return Padding( padding: const EdgeInsets.symmetric(vertical: 12.0), child: Text( item, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18), textAlign: TextAlign.center, ), ); }, ), decoratorProps: DropDownDecoratorProps( textAlign: TextAlign.center, decoration: InputDecoration( hintText: 'Start typing...', border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)), ), ), ) ``` -------------------------------- ### Implement Async Data Loading with Custom Model Source: https://context7.com/salim-lachdhaf/dropdown_search/llms.txt Loads data from an API using a custom model and provides a custom item builder for the dropdown list. ```dart class UserModel { final String id; final String name; final DateTime createdAt; UserModel({required this.id, required this.name, required this.createdAt}); bool isEqual(UserModel other) => id == other.id; @override String toString() => name; } Future> fetchUsers(String filter) async { final response = await http.get(Uri.parse('https://api.example.com/users?q=$filter')); return (jsonDecode(response.body) as List) .map((json) => UserModel( id: json['id'], name: json['name'], createdAt: DateTime.parse(json['createdAt']), )) .toList(); } DropdownSearch( items: (filter, loadProps) => fetchUsers(filter), compareFn: (item, selectedItem) => item.id == selectedItem.id, itemAsString: (user) => user.name, popupProps: PopupProps.menu( showSearchBox: true, disableFilter: true, // Let backend handle filtering showSelectedItems: true, itemBuilder: (context, item, isDisabled, isSelected) { return ListTile( leading: CircleAvatar(child: Text(item.name[0])), title: Text(item.name), selected: isSelected, ); }, ), suffixProps: DropdownSuffixProps( clearButtonProps: ClearButtonProps(isVisible: true), ), ) ``` -------------------------------- ### Add Flutter Version Preprocessor Definitions Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/windows/runner/CMakeLists.txt Adds preprocessor definitions for the Flutter version, allowing the application to access version information during compilation. ```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}") ``` -------------------------------- ### Create Dialog with Custom Title Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/README.md Displays a dropdown selection dialog featuring a custom header and specific shape constraints. ```dart DropdownSearch( items: (f, cs) => List.generate(30, (i) => i + 1), decoratorProps: DropDownDecoratorProps( decoration: InputDecoration(labelText: "Dialog with title", hintText: "Select an Int"), ), popupProps: PopupProps.dialog( title: Container( decoration: BoxDecoration(color: Colors.deepPurple), alignment: Alignment.center, padding: EdgeInsets.symmetric(vertical: 16), child: Text( 'Numbers 1..30', style: TextStyle(fontSize: 21, fontWeight: FontWeight.bold, color: Colors.white70), ), ), dialogProps: DialogProps( clipBehavior: Clip.antiAlias, shape: OutlineInputBorder( borderSide: BorderSide(width: 0), borderRadius: BorderRadius.circular(25), ), ), ), ), ``` -------------------------------- ### Custom Item Rendering with Tuple Data Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/README.md Uses a tuple for item data (String, Color) and customizes the item builder and dropdown builder to display colored text and icons. Includes specific popup menu alignment and loose fit. ```dart DropdownSearch<(String, Color)>( clickProps: ClickProps(borderRadius: BorderRadius.circular(20)), mode: Mode.CUSTOM, items: (f, cs) => [ ("Red", Colors.red), ("Black", Colors.black), ("Yellow", Colors.yellow), ('Blue', Colors.blue), ], compareFn: (item1, item2) => item1.$1 == item2.$1, popupProps: PopupProps.menu( menuProps: MenuProps(align: MenuAlign.bottomCenter), fit: FlexFit.loose, itemBuilder: (context, item, isDisabled, isSelected) => Padding( padding: const EdgeInsets.all(8.0), child: Text(item.$1, style: TextStyle(color: item.$2, fontSize: 16)), ), ), dropdownBuilder: (ctx, selectedItem) => Icon(Icons.face, color: selectedItem?.$2, size: 54), ) ``` -------------------------------- ### Infinite Scroll with Lazy Loading Source: https://context7.com/salim-lachdhaf/dropdown_search/llms.txt Implements infinite scrolling for large datasets, featuring pagination, custom loading indicators, and error handling with a retry mechanism. Requires a GlobalKey for state management. ```dart Future> fetchPaginatedData(String filter, int skip, int take) async { await Future.delayed(Duration(seconds: 1)); // Simulate API delay final allItems = List.generate(500, (i) => i + 1) .where((item) => filter.isEmpty || item.toString().contains(filter)) .toList(); return allItems.skip(skip).take(take).toList(); } final _dropdownKey = GlobalKey> (); DropdownSearch.multiSelection( key: _dropdownKey, items: (filter, loadProps) => fetchPaginatedData(filter, loadProps!.skip, loadProps.take), decoratorProps: DropDownDecoratorProps( decoration: InputDecoration( border: OutlineInputBorder(), labelText: 'Infinite Scroll', ), ), popupProps: MultiSelectionPopupProps.dialog( showSearchBox: true, infiniteScrollProps: InfiniteScrollProps( loadProps: LoadProps(skip: 0, take: 10), loadingMoreBuilder: (context, loadedItems) { return Center(child: CircularProgressIndicator()); }, errorBuilder: (context, searchEntry, exception, loadProps) { return Column( mainAxisSize: MainAxisSize.min, children: [ Text('Error: $exception'), TextButton.icon( onPressed: () { _dropdownKey.currentState?.getPopupState ?.loadMoreItems(searchEntry, loadProps.skip); }, icon: Icon(Icons.sync), label: Text('Retry'), ), ], ); }, ), ), ) ``` -------------------------------- ### Configure Dialog Popup Mode with Custom Title Source: https://context7.com/salim-lachdhaf/dropdown_search/llms.txt Displays the dropdown in a dialog with a custom header and specific shape styling. ```dart DropdownSearch( items: (filter, loadProps) => List.generate(30, (i) => i + 1), decoratorProps: DropDownDecoratorProps( decoration: InputDecoration( labelText: "Select a number", hintText: "Choose from 1-30", ), ), popupProps: PopupProps.dialog( title: Container( decoration: BoxDecoration(color: Colors.deepPurple), alignment: Alignment.center, padding: EdgeInsets.symmetric(vertical: 16), child: Text( 'Numbers 1..30', style: TextStyle( fontSize: 21, fontWeight: FontWeight.bold, color: Colors.white70, ), ), ), dialogProps: DialogProps( clipBehavior: Clip.antiAlias, shape: OutlineInputBorder( borderSide: BorderSide(width: 0), borderRadius: BorderRadius.circular(25), ), ), ), ) ``` -------------------------------- ### Define Profile Build Flags Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/windows/CMakeLists.txt Configures linker and compiler flags for the Profile build mode by inheriting from Release settings. ```cmake # Define settings for the Profile build mode. 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}") ``` -------------------------------- ### Define Flutter assembly build command Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/flutter/CMakeLists.txt Configures the custom command and target to invoke the Flutter tool backend script during the build process. ```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} ) ``` -------------------------------- ### Configure DropdownSearch Popup Menu Appearance Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/README.md Defines custom borders and item styling for a menu-based dropdown popup. ```dart border: OutlineInputBorder( borderSide: BorderSide(color: Colors.transparent), borderRadius: BorderRadius.circular(12), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.transparent), borderRadius: BorderRadius.circular(12), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.transparent), borderRadius: BorderRadius.circular(12), ), hintText: 'Please select...', hintStyle: TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.grey), ), ), popupProps: PopupProps.menu( itemBuilder: (context, item, isDisabled, isSelected) { return Padding( padding: const EdgeInsets.symmetric(vertical: 12.0), child: Text( item, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18), textAlign: TextAlign.center, ), ); }, constraints: BoxConstraints(maxHeight: 160), menuProps: MenuProps( margin: EdgeInsets.only(top: 12), shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12))), ), ), ), ``` -------------------------------- ### Create Multi-Level Nested Items Source: https://context7.com/salim-lachdhaf/dropdown_search/llms.txt Implement hierarchical data structures using custom item builders and GlobalKey to trigger state updates for expansion/collapse. ```dart class MultiLevelItem { final String label; final List children; bool isExpanded; MultiLevelItem({required this.label, this.children = const [], this.isExpanded = false}); @override String toString() => label; } final _dropdownKey = GlobalKey>(); final items = [ MultiLevelItem(label: "Category 1"), MultiLevelItem(label: "Category 2"), MultiLevelItem( label: "Category 3", children: [ MultiLevelItem(label: "Sub 3-1"), MultiLevelItem(label: "Sub 3-2"), MultiLevelItem(label: "Sub 3-3"), ], ), ]; DropdownSearch( key: _dropdownKey, items: (filter, loadProps) => items, compareFn: (i1, i2) => i1.label == i2.label, popupProps: PopupProps.dialog( showSelectedItems: true, interceptCallBacks: true, // Required for custom item handling itemBuilder: (ctx, item, isDisabled, isSelected) { return ListTile( selected: isSelected, title: Text(item.label), trailing: item.children.isEmpty ? null : IconButton( icon: Icon(item.isExpanded ? Icons.arrow_drop_down : Icons.arrow_right), onPressed: () { item.isExpanded = !item.isExpanded; _dropdownKey.currentState?.updatePopupState(); }, ), subtitle: item.children.isNotEmpty && item.isExpanded ? SizedBox( height: item.children.length * 50, child: ListView( children: item.children.map((child) => ListTile( title: Text(child.label), onTap: () => _dropdownKey.currentState?.popupValidate([child]), )).toList(), ), ) : null, onTap: () => _dropdownKey.currentState?.popupValidate([item]), ); }, ), ) ``` -------------------------------- ### Set Executable Name Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/CMakeLists.txt Sets the on-disk name for the application's executable. This can be changed to alter the application's filename. ```cmake set(BINARY_NAME "example") ``` -------------------------------- ### Custom Dropdown Builder with Tuple Types Source: https://context7.com/salim-lachdhaf/dropdown_search/llms.txt Demonstrates creating a custom dropdown display using Dart 3 records (tuples) for items. It features color-coded text items and a custom dropdown builder that displays an icon with a color based on the selected item. ```dart DropdownSearch<(String, Color)>( clickProps: ClickProps(borderRadius: BorderRadius.circular(20)), mode: Mode.custom, items: (filter, loadProps) => [ ("Red", Colors.red), ("Black", Colors.black), ("Yellow", Colors.yellow), ("Blue", Colors.blue), ], compareFn: (item1, item2) => item1.$1 == item2.$1, popupProps: PopupProps.menu( menuProps: MenuProps(align: MenuAlign.bottomCenter), fit: FlexFit.loose, itemBuilder: (context, item, isDisabled, isSelected) => Padding( padding: const EdgeInsets.all(8.0), child: Text(item.$1, style: TextStyle(color: item.$2, fontSize: 16)), ), ), dropdownBuilder: (ctx, selectedItem) => Icon(Icons.face, color: selectedItem?.$2, size: 54), ) ``` -------------------------------- ### Find GTK Dependency Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/CMakeLists.txt Checks for the GTK+ 3.0 library using PkgConfig and makes its imported target available for linking. ```cmake find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) ``` -------------------------------- ### Implement Cupertino Style Dropdown Source: https://context7.com/salim-lachdhaf/dropdown_search/llms.txt Use CupertinoDropdownSearch for iOS-styled selection components. Supports both single and multi-selection modes with modal or dialog popups. ```dart CupertinoDropdownSearch( items: (filter, loadProps) => ["Apple", "Banana", "Cherry", "Date"], popupProps: CupertinoPopupProps.modalBottomSheet( showSearchBox: true, modalBottomSheetProps: CupertinoModalBottomSheetProps( backgroundColor: CupertinoColors.systemBackground, ), ), ) // Multi-selection Cupertino dropdown CupertinoDropdownSearch.multiSelection( items: (filter, loadProps) => ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"], selectedItems: ["Monday", "Wednesday"], popupProps: CupertinoMultiSelectionPopupProps.dialog( showSearchBox: true, ), ) ``` -------------------------------- ### Add Flutter Assemble Dependency Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/windows/runner/CMakeLists.txt Ensures that the Flutter tool's assembly process is completed before the application target is built. This is a mandatory step. ```cmake # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) ``` -------------------------------- ### Enable Infinite Scroll with API Data Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/README.md Implement infinite scrolling for dropdown items by providing an items callback that fetches data from an API with skip and take parameters. ```dart DropdownSearch( items: (filter, loadProps) => _getDataFromAPI(filter, loadProps!.skip, loadProps!.take), popupProps: PopupProps.dialog( infiniteScrollProps: InfiniteScrollProps( loadProps: LoadProps(skip: 0, take: 10), ), ), ) ``` -------------------------------- ### Customize Dropdown Appearance with Decorator and Suffix Props Source: https://context7.com/salim-lachdhaf/dropdown_search/llms.txt Customize the dropdown's visual appearance, including suffix icons for clearing and opening/closing, and decorator properties for input styling. This is useful for creating a branded and user-friendly selection interface. ```dart DropdownSearch( items: (filter, loadProps) => ['Item 1', 'Item 2', 'Item 3'], suffixProps: DropdownSuffixProps( clearButtonProps: ClearButtonProps( isVisible: true, icon: Icon(Icons.clear_rounded), ), dropdownButtonProps: DropdownButtonProps( iconClosed: Icon(Icons.keyboard_arrow_down), iconOpened: Icon(Icons.keyboard_arrow_up), ), ), decoratorProps: DropDownDecoratorProps( textAlign: TextAlign.center, decoration: InputDecoration( contentPadding: EdgeInsets.symmetric(vertical: 20, horizontal: 12), filled: true, fillColor: Colors.white, border: OutlineInputBorder( borderSide: BorderSide(color: Colors.transparent), borderRadius: BorderRadius.circular(12), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.blue, width: 2), borderRadius: BorderRadius.circular(12), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.grey.shade300), borderRadius: BorderRadius.circular(12), ), hintText: 'Please select...', hintStyle: TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.grey), ), ), popupProps: PopupProps.menu( fit: FlexFit.loose, menuProps: MenuProps( margin: EdgeInsets.only(top: 12), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), ), ), ) ``` -------------------------------- ### Multi-Selection Dropdown with Custom Mode Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/README.md Demonstrates multi-selection with a custom mode. The dropdown displays an icon instead of the selected item text. ```dart DropdownSearch.multiSelection( mode: Mode.CUSTOM, items: (f, cs) => ["Monday", 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'], dropdownBuilder: (ctx, selectedItem) => Icon(Icons.calendar_month_outlined, size: 54), ) ``` -------------------------------- ### Implement Form Validation with DropdownSearch Source: https://context7.com/salim-lachdhaf/dropdown_search/llms.txt Integrates single and multi-selection dropdowns with Flutter's Form widget for validation. Requires a GlobalKey to trigger validation and saving. ```dart final _formKey = GlobalKey(); Form( key: _formKey, autovalidateMode: AutovalidateMode.onUserInteraction, child: Column( children: [ DropdownSearch( items: (filter, loadProps) => [1, 2, 3, 4, 5, 6, 7], autoValidateMode: AutovalidateMode.onUserInteraction, validator: (int? value) { if (value == null) return 'This field is required'; if (value >= 5) return 'Value must be less than 5'; return null; }, suffixProps: DropdownSuffixProps( clearButtonProps: ClearButtonProps(isVisible: true), ), ), SizedBox(height: 16), DropdownSearch.multiSelection( items: (filter, loadProps) => [1, 2, 3, 4, 5, 6, 7], validator: (List? items) { if (items == null || items.isEmpty) return 'At least one item required'; if (items.length > 3) return 'Maximum 3 items allowed'; return null; }, ), ElevatedButton( onPressed: () { if (_formKey.currentState!.validate()) { _formKey.currentState!.save(); } }, child: Text('Submit'), ), ], ), ) ``` -------------------------------- ### Set Application ID Source: https://github.com/salim-lachdhaf/dropdown_search/blob/master/example/linux/CMakeLists.txt Defines the unique GTK application identifier. This is crucial for GTK-based applications to register and identify themselves. ```cmake set(APPLICATION_ID "com.dropdownsearch.example.example") ```