### Run Example App Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/CONTRIBUTING.md Command to run the example application after setting up the project and installing dependencies. This allows you to test the project's functionality. ```bash cd example flutter run ``` -------------------------------- ### Flutter Reel Configuration Example Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/README.md Demonstrates the creation of a ReelModel with multi-format video support and the setup of advanced streaming and caching configurations for a Flutter application. ```dart final multiFormatReel = ReelModel( id: 'multi_1', videoSource: VideoSource( format: VideoFormat.hls, // Primary format urls: { VideoFormat.hls: 'https://example.com/video.m3u8', VideoFormat.dash: 'https://example.com/video.mpd', VideoFormat.mp4: 'https://example.com/video.mp4', }, ), thumbnailUrl: 'https://example.com/thumb.jpg', duration: Duration(minutes: 3), user: ReelUser( id: 'user1', username: 'creator', profilePictureUrl: 'https://example.com/avatar.jpg', ), caption: 'Multi-format video with fallback support', ); final streamingConfig = StreamingConfig( preferredFormat: PreferredStreamingFormat.hls, enableAdaptiveBitrate: true, enableLowLatency: false, maxBitrate: 5000000, // 5 Mbps minBitrate: 500000, // 500 Kbps enableSubtitleSelection: true, enableAudioTrackSelection: true, enableQualitySelection: true, enableFallback: true, fallbackFormats: [VideoFormat.dash, VideoFormat.mp4], networkTimeout: Duration(seconds: 30), maxRetryAttempts: 3, enableDRM: false, ); final config = ReelConfig( enableCaching: true, cacheConfig: CacheConfig( maxCacheSize: 500 * 1024 * 1024, // 500MB maxCacheAge: Duration(days: 7), ), videoPlayerConfig: VideoPlayerConfig( useBetterPlayer: true, enableHardwareAcceleration: true, enablePictureInPicture: true, streamingConfig: streamingConfig, ), preloadConfig: PreloadConfig( preloadCount: 2, preloadRadius: 1, ), ); ``` -------------------------------- ### Install Dependencies Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/CONTRIBUTING.md Commands to install project dependencies for the main Flutter Awesome Reels project and its example app using Flutter's package manager. Ensures all necessary packages are downloaded. ```bash flutter pub get cd example flutter pub get ``` -------------------------------- ### Install Flutter Package Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/README.md Executes the Flutter package manager command to fetch and install the dependencies listed in pubspec.yaml, including flutter_awesome_reels. ```bash flutter pub get ``` -------------------------------- ### Installation Rules Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/CMakeLists.txt Defines the installation process for the application on Windows. It sets up the installation directory to be adjacent to the executable, installs the main executable, Flutter ICU data, Flutter library, bundled plugin libraries, native assets, and the Flutter assets directory. It also conditionally installs the AOT library for non-Debug builds. ```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(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) ``` -------------------------------- ### Dart Style Guide Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/CONTRIBUTING.md Reference to the official Dart Style Guide, which provides best practices for writing clean, readable, and maintainable Dart code. ```dart https://dart.dev/guides/language/effective-dart/style ``` -------------------------------- ### Ephemeral Directory Setup Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/flutter/CMakeLists.txt Defines the path to the ephemeral directory, which contains generated build artifacts and configuration files for the Flutter project. ```cmake set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") ``` -------------------------------- ### Project Setup and Build Configuration Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/CMakeLists.txt Configures the CMake minimum version, project name, binary name, and handles multi-configuration generator settings. It also defines build modes like Debug, Profile, and Release, and sets specific linker and compiler flags for the Profile mode. ```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() # 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}") ``` -------------------------------- ### Format Code Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/CONTRIBUTING.md Command to format Dart code according to the standard Dart style guide. This ensures code consistency across the project. ```bash flutter format ``` -------------------------------- ### ReelModel Creation for MP4 Streaming Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/README.md Provides an example of creating a ReelModel for standard MP4 format, ensuring universal compatibility and straightforward implementation for video playback. ```dart ReelModel.mp4( id: 'mp4_video', mp4Url: 'https://example.com/video.mp4', // ... other properties ); ``` -------------------------------- ### Publishing Build Variables Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/flutter/CMakeLists.txt Exports essential build variables to the parent CMake scope, making them available for installation or other build targets. Includes the Flutter library, ICU data file, project build directory, and AOT library. ```cmake 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) ``` -------------------------------- ### Clone Repository Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/CONTRIBUTING.md Instructions to fork the Flutter Awesome Reels repository and clone it locally using Git. This is the first step to setting up your development environment. ```bash # Click the "Fork" button on GitHub, then clone your fork git clone https://github.com/your-username/flutter_awesome_reels.git cd flutter_awesome_reels ``` -------------------------------- ### Flutter DevTools Overview Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/CONTRIBUTING.md Link to the Flutter DevTools documentation, a suite of performance and debugging tools for Flutter applications. Essential for profiling and identifying bottlenecks. ```dart https://docs.flutter.dev/development/tools/devtools/overview ``` -------------------------------- ### Flutter Wrapper Plugin Library Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/flutter/CMakeLists.txt Creates a static library for the Flutter C++ wrapper intended for plugins. It includes core and plugin-specific sources and links against the main Flutter library. ```cmake 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) ``` -------------------------------- ### Initialize and Display Video Reels in Flutter Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/README.md This Dart code demonstrates the basic integration of the `flutter_awesome_reels` package. It sets up a `StatefulWidget` to manage a `ReelController`, initializes it with a list of `ReelModel` objects containing various video sources (MPD, M3U8, MP4), and configures the `AwesomeReels` widget with custom options and event callbacks for user interactions like liking, sharing, and video completion. ```dart import 'package:flutter/material.dart'; import 'package:flutter_awesome_reels/flutter_awesome_reels.dart'; class MyReelsPage extends StatefulWidget { @override _MyReelsPageState createState() => _MyReelsPageState(); } class _MyReelsPageState extends State { late ReelController _controller; @override void initState() { super.initState(); // Create reels with different streaming formats final reels = [ ReelModel( id: '4', videoSource: VideoSource( url: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd', ), user: const ReelUser( id: 'u2', username: 'bob', displayName: 'Bob Builder', isFollowing: true, ), likesCount: 200, commentsCount: 30, sharesCount: 10, tags: ['adventure', 'travel'], audio: const ReelAudio(title: 'Adventure Tune'), duration: const Duration(seconds: 20), isLiked: true, views: 2500, location: 'Mountains', ), ReelModel( id: '1', videoSource: VideoSource( url: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8', ), user: const ReelUser( id: 'u3', username: 'charlie', displayName: 'Charlie Chaplin', ), likesCount: 4325, commentsCount: 45, sharesCount: 20, tags: ['comedy', 'classic'], audio: const ReelAudio(title: 'Classic Comedy'), duration: const Duration(seconds: 15), isLiked: false, views: 5000, location: 'Hollywood', ), ReelModel( id: '3', videoSource: VideoSource( url: 'https://www.sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4', ), user: const ReelUser( id: 'u1', username: 'alice', displayName: 'Alice in Wonderland', ), likesCount: 120, commentsCount: 15, sharesCount: 5, tags: ['fun', 'bunny'], audio: const ReelAudio(title: 'Sample Music'), duration: const Duration(seconds: 10), isLiked: false, views: 1000, location: 'Wonderland', ), ]; _controller = ReelController(); _controller.initialize(reels: reels, config: ReelConfig()); } @override Widget build(BuildContext context) { return Scaffold( body: AwesomeReels( reels: _controller.reels, controller: _controller, config: ReelConfig( showDownloadButton: false, enablePullToRefresh: true, ), onReelChanged: (index) { debugPrint('Reel changed to index: $index'); }, onReelLiked: (reel) { _showSnackBar( '\u001b[${reel.isLiked ? 'Liked' : 'Unliked'} ${reel.user?.displayName}\'s reel'); }, onReelShared: (reel) { _showSnackBar('Shared ${reel.user?.displayName}\'s reel'); }, onReelCommented: (reel) { // Show comment dialog or navigate to comments page }, onUserFollowed: (user) { _showSnackBar( '${user.isFollowing ? 'Following' : 'Unfollowed'} ${user.displayName}'); }, onUserBlocked: (user) { _showSnackBar('Blocked ${user.displayName}'); }, onVideoCompleted: (reel) { debugPrint('Video completed: ${reel.id}'); }, onVideoError: (reel, error) { _showSnackBar('Error playing video: $error'); }, // New event callbacks onPress: (reel) { debugPrint('Pressed: ${reel.id}'); }, onLongPress: (reel) { debugPrint('Long pressed: ${reel.id}'); }, ), ); } void _showSnackBar(String message) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text(message), duration: const Duration(seconds: 2), backgroundColor: Colors.grey[800], ), ); } @override void dispose() { _controller.dispose(); super.dispose(); } } ``` -------------------------------- ### C++ Wrapper Plugin Sources Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/flutter/CMakeLists.txt Defines the source files specific to the C++ client wrapper for plugin registration, enabling plugins to interact with the Flutter engine. ```cmake list(APPEND CPP_WRAPPER_SOURCES_PLUGIN "plugin_registrar.cc" ) list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") ``` -------------------------------- ### Flutter Wrapper Application Library Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/flutter/CMakeLists.txt Creates a static library for the Flutter C++ wrapper intended for the application runner. It includes core and application-specific sources and links against the main Flutter library. ```cmake 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) ``` -------------------------------- ### C++ Wrapper Core Sources Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/flutter/CMakeLists.txt Defines the core source files for the C++ client wrapper, including implementations for core functionalities and codecs. ```cmake list(APPEND CPP_WRAPPER_SOURCES_CORE "core_implementations.cc" "standard_codec.cc" ) list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") ``` -------------------------------- ### Run Tests Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/CONTRIBUTING.md Command to execute all unit and widget tests within the Flutter project. It's crucial to ensure your changes do not break existing functionality. ```bash flutter test ``` -------------------------------- ### C++ Client Wrapper Root Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/flutter/CMakeLists.txt Sets the root directory for the C++ client wrapper, which provides native integration for Flutter plugins and the engine. ```cmake set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") ``` -------------------------------- ### Open Xcode Project Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md Opens the Flutter project's Xcode workspace to allow for asset customization. This command is typically run from the root directory of the Flutter project. ```shell open ios/Runner.xcworkspace ``` -------------------------------- ### C++ Wrapper Application Sources Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/flutter/CMakeLists.txt Defines the source files for the C++ client wrapper used in the main application runner, including engine and view controller implementations. ```cmake list(APPEND CPP_WRAPPER_SOURCES_APP "flutter_engine.cc" "flutter_view_controller.cc" ) list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") ``` -------------------------------- ### Configure Flutter Windows Application Build with CMake Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/runner/CMakeLists.txt This CMake script configures the build process for a Flutter application on Windows. It defines the executable target, includes necessary source files and libraries, and sets preprocessor definitions for version information. It ensures proper integration with the Flutter build system. ```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) ``` -------------------------------- ### Compilation Settings and Helper Function Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/CMakeLists.txt Applies standard compilation settings, including enabling Unicode support, setting warning levels, enabling C++ exceptions, and defining the `_DEBUG` macro for Debug configurations. A helper function `APPLY_STANDARD_SETTINGS` is defined to apply these settings to targets. ```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() ``` -------------------------------- ### ReelModel Creation for DASH Streaming Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/README.md Shows how to instantiate a ReelModel for DASH (Dynamic Adaptive Streaming) format, optimized for high-quality streaming and wide codec support, particularly on Android. ```dart ReelModel.dash( id: 'dash_video', dashUrl: 'https://example.com/manifest.mpd', // ... other properties ); ``` -------------------------------- ### Flutter Library Definition Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/flutter/CMakeLists.txt Defines the path to the main Flutter library DLL for Windows. This is a core component for running Flutter applications. ```cmake set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") ``` -------------------------------- ### ReelConfig Properties Documentation Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/README.md Details the configurable properties for ReelConfig, including caching, preloading, and video player settings, to customize reel playback behavior. ```APIDOC ReelConfig: enableCaching: bool - Enable video caching for improved performance. - Default: `true` cacheConfig: CacheConfig - Configuration object for caching behavior. - Contains `maxCacheSize` and `maxCacheAge`. - Default: `CacheConfig()` preloadConfig: PreloadConfig - Settings for preloading upcoming reels. - Contains `preloadCount` and `preloadRadius`. - Default: `PreloadConfig()` videoPlayerConfig: VideoPlayerConfig - Configuration for the underlying video player. - Includes options like `useBetterPlayer`, `enableHardwareAcceleration`, `enablePictureInPicture`, and `streamingConfig`. - Default: `VideoPlayerConfig()` progressIndicatorConfig: ProgressIndicatorConfig - Configuration for the progress indicator displayed during playback. - (Details not provided in source) ``` -------------------------------- ### Commit Changes Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/CONTRIBUTING.md Steps to stage all changes and commit them with a descriptive message. Using conventional commit messages is recommended for clarity. ```bash git add . git commit -m "feat: add long-press pause functionality" ``` -------------------------------- ### Flutter and Plugin Integration Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/CMakeLists.txt Integrates the Flutter framework and its generated plugins into the build. It adds the Flutter managed directory as a subdirectory and includes the generated plugins CMake script to link them into the application. ```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) ``` -------------------------------- ### Flutter Library Headers Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/flutter/CMakeLists.txt Lists and prepends the Flutter library header files with the ephemeral directory path. These headers are necessary for integrating with the Flutter engine. ```cmake 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 Flutter Awesome Reels Dependency Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/README.md Specifies the flutter_awesome_reels package as a dependency in your Flutter project's pubspec.yaml file to include its functionality. ```yaml dependencies: flutter_awesome_reels: ^0.0.3 ``` -------------------------------- ### Push Branch Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/CONTRIBUTING.md Command to push the newly created feature branch to your remote repository. This prepares your changes for a Pull Request. ```bash git push origin feature/your-feature-name ``` -------------------------------- ### Include Generated Configuration Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/flutter/CMakeLists.txt Includes a generated CMake configuration file, typically containing project-specific settings or build targets provided by the Flutter tool. ```cmake include(${EPHEMERAL_DIR}/generated_config.cmake) ``` -------------------------------- ### ReelModel Creation for HLS Streaming Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/README.md Illustrates how to create a ReelModel instance specifically for HLS (HTTP Live Streaming) format, suitable for adaptive streaming on iOS and other platforms. ```dart ReelModel.hls( id: 'hls_video', hlsUrl: 'https://example.com/playlist.m3u8', // ... other properties ); ``` -------------------------------- ### Flutter Tool Backend Custom Command Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/flutter/CMakeLists.txt A custom CMake command that invokes the Flutter tool backend script. It's configured to run every time by using a phony output file, ensuring build artifacts are generated or updated. ```cmake 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 ) ``` -------------------------------- ### Create Feature Branch Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/CONTRIBUTING.md Command to create a new Git branch for a feature or bug fix. Following a consistent branch naming convention helps organize contributions. ```bash git checkout -b feature/your-feature-name ``` -------------------------------- ### Fallback Target Platform Configuration Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/flutter/CMakeLists.txt Sets a default Flutter target platform if it's not already defined. This ensures a fallback configuration for older or incomplete build environments. ```cmake if (NOT DEFINED FLUTTER_TARGET_PLATFORM) set(FLUTTER_TARGET_PLATFORM "windows-x64") endif() ``` -------------------------------- ### CMake Minimum Requirement Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/flutter/CMakeLists.txt Specifies the minimum version of CMake required to process this build script. Ensures compatibility with necessary CMake features. ```cmake cmake_minimum_required(VERSION 3.14) ``` -------------------------------- ### Flutter Assemble Custom Target Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/example/windows/flutter/CMakeLists.txt Defines a custom target 'flutter_assemble' that depends on the Flutter library, its headers, and all C++ wrapper source files. This target orchestrates the assembly of Flutter build artifacts. ```cmake add_custom_target(flutter_assemble DEPENDS "${FLUTTER_LIBRARY}" ${FLUTTER_LIBRARY_HEADERS} ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} ${CPP_WRAPPER_SOURCES_APP} ) ``` -------------------------------- ### Analyze Code Source: https://github.com/wailashraf71/flutter_awesome_reels/blob/main/CONTRIBUTING.md Command to analyze Dart code for potential issues, errors, and style violations. This helps maintain code quality and catch bugs early. ```bash flutter analyze ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.