### CMake Installation Rules for Application Bundle Source: https://github.com/rafalbednarczuk/curved_navigation_bar/blob/master/example/linux/CMakeLists.txt Defines installation rules for creating a relocatable application bundle. It cleans the build directory, installs the executable, and copies necessary runtime files like ICU data, Flutter library, bundled plugin libraries, and assets. The AOT library is installed only for non-Debug builds. ```cmake # === Installation === # By default, "installing" just makes a relocatable bundle in the build # directory. set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() # Start with a clean build bundle directory every time. install(CODE " file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") " COMPONENT Runtime) set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) # Install the AOT library on non-Debug builds only. if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### Full Configuration of Curved Navigation Bar in Dart Source: https://context7.com/rafalbednarczuk/curved_navigation_bar/llms.txt Provides a comprehensive example of configuring the CurvedNavigationBar widget with various customization options. This includes setting the active index, custom item icons with colors, bar colors, animation properties, height, maximum width, and defining a 'letIndexChange' callback for conditional navigation. This example requires the 'curved_navigation_bar' package. ```dart import 'package:flutter/material.dart'; import 'package:curved_navigation_bar/curved_navigation_bar.dart'; class FullyConfiguredNavBar extends StatefulWidget { @override _FullyConfiguredNavBarState createState() => _FullyConfiguredNavBarState(); } class _FullyConfiguredNavBarState extends State { int _currentPage = 1; @override Widget build(BuildContext context) { return Scaffold( bottomNavigationBar: CurvedNavigationBar( index: _currentPage, items: [ Icon(Icons.home, size: 30, color: Colors.white), Icon(Icons.search, size: 30, color: Colors.white), Icon(Icons.favorite, size: 30, color: Colors.white), Icon(Icons.settings, size: 30, color: Colors.white), ], color: Colors.deepPurple, buttonBackgroundColor: Colors.deepPurpleAccent, backgroundColor: Colors.purple[50]!, animationCurve: Curves.easeInOutCubic, animationDuration: Duration(milliseconds: 500), height: 60.0, maxWidth: 400.0, onTap: (index) { setState(() { _currentPage = index; }); print('Navigated to page: $index'); }, letIndexChange: (index) { // Return false to prevent navigation to specific indices if (index == 3 && !userIsLoggedIn()) { showLoginDialog(); return false; } return true; }, ), body: Container( color: Colors.purple[50], child: Center( child: Text( 'Page $_currentPage', style: TextStyle(fontSize: 40, fontWeight: FontWeight.bold), ), ), ), ); } bool userIsLoggedIn() => false; // Example condition void showLoginDialog() => print('Please login first'); } ``` -------------------------------- ### CMake Project Setup and Build Configuration Source: https://github.com/rafalbednarczuk/curved_navigation_bar/blob/master/example/linux/CMakeLists.txt Configures the minimum CMake version, project name, and binary name. It also sets up build type selection (Debug, Profile, Release) and ensures standard compilation features and options are applied, including optimization and NDEBUG definition for non-Debug builds. ```cmake cmake_minimum_required(VERSION 3.10) project(runner LANGUAGES CXX) set(BINARY_NAME "example") set(APPLICATION_ID "com.example.example") cmake_policy(SET CMP0063 NEW) set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") # Configure build options. if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Flutter build mode" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Profile" "Release") endif() # Compilation settings that should be applied to most targets. 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() set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") # Flutter library and tool build rules. add_subdirectory(${FLUTTER_MANAGED_DIR}) # System-level dependencies. find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") # Application build 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) # Only the install-generated bundle's copy of the executable will launch # correctly, since the resources must in the right relative locations. To avoid # people trying to run the unbundled copy, put it in a subdirectory instead of # the default top-level location. set_target_properties(${BINARY_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" ) # Generated plugin build rules, which manage building the plugins and adding # them to the application. include(flutter/generated_plugins.cmake) ``` -------------------------------- ### Basic Curved Navigation Bar Implementation in Dart Source: https://context7.com/rafalbednarczuk/curved_navigation_bar/llms.txt Demonstrates the basic usage of the CurvedNavigationBar widget in Flutter. It shows how to create a navigation bar with icons and define a simple tap handler to print the index of the tapped item. This example requires the 'curved_navigation_bar' package. ```dart import 'package:flutter/material.dart'; import 'package:curved_navigation_bar/curved_navigation_bar.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( bottomNavigationBar: CurvedNavigationBar( backgroundColor: Colors.blueAccent, items: [ Icon(Icons.add, size: 30), Icon(Icons.list, size: 30), Icon(Icons.compare_arrows, size: 30), ], onTap: (index) { print('Tapped item at index: $index'); }, ), body: Container(color: Colors.blueAccent), ), ); } } ``` -------------------------------- ### Implement Curved Navigation Bar in Flutter Source: https://github.com/rafalbednarczuk/curved_navigation_bar/blob/master/README.md This example demonstrates how to integrate the CurvedNavigationBar into your Flutter application's Scaffold. It shows how to define the navigation items and handle user taps. The `backgroundColor` and `items` are key properties for customization. ```dart Scaffold( bottomNavigationBar: CurvedNavigationBar( backgroundColor: Colors.blueAccent, items: [ Icon(Icons.add, size: 30), Icon(Icons.list, size: 30), Icon(Icons.compare_arrows, size: 30), ], onTap: (index) { //Handle button tap }, ), body: Container(color: Colors.blueAccent), ) ``` -------------------------------- ### Install curved_navigation_bar Package Source: https://context7.com/rafalbednarczuk/curved_navigation_bar/llms.txt Add the curved_navigation_bar package to your Flutter project's pubspec.yaml file to include it as a dependency. This is the first step to using the package in your application. ```yaml dependencies: curved_navigation_bar: ^1.0.6 ``` -------------------------------- ### State Management Integration with Provider/BLoC in Flutter Source: https://context7.com/rafalbednarczuk/curved_navigation_bar/llms.txt This example shows how to integrate the Curved Navigation Bar with state management solutions like Provider or BLoC. It uses an `AnimatedBuilder` to react to changes in a `NavigationController`, which manages the current index. Dependencies include 'flutter/material.dart' and 'curved_navigation_bar/curved_navigation_bar'. The input is user interaction with the navigation bar, and the output is the UI updating to display the correct page. ```dart import 'package:flutter/material.dart'; import 'package:curved_navigation_bar/curved_navigation_bar.dart'; class NavigationController extends ChangeNotifier { int _currentIndex = 0; int get currentIndex => _currentIndex; void setIndex(int index) { _currentIndex = index; notifyListeners(); } } class StateManagementExample extends StatelessWidget { final NavigationController controller = NavigationController(); @override Widget build(BuildContext context) { return AnimatedBuilder( animation: controller, builder: (context, child) { return Scaffold( bottomNavigationBar: CurvedNavigationBar( index: controller.currentIndex, items: [ Icon(Icons.home, size: 30), Icon(Icons.search, size: 30), Icon(Icons.notifications, size: 30), Icon(Icons.person, size: 30), ], backgroundColor: Colors.transparent, onTap: (index) { controller.setIndex(index); }, ), body: IndexedStack( index: controller.currentIndex, children: [ HomePage(), SearchPage(), NotificationsPage(), ProfilePage(), ], ), ); }, ); } } class HomePage extends StatelessWidget { @override Widget build(BuildContext context) => Center(child: Text('Home')); } class SearchPage extends StatelessWidget { @override Widget build(BuildContext context) => Center(child: Text('Search')); } class NotificationsPage extends StatelessWidget { @override Widget build(BuildContext context) => Center(child: Text('Notifications')); } class ProfilePage extends StatelessWidget { @override Widget build(BuildContext context) => Center(child: Text('Profile')); } ``` -------------------------------- ### Flutter: Custom Icons and Widgets in Curved Navigation Bar Source: https://context7.com/rafalbednarczuk/curved_navigation_bar/llms.txt This Dart code snippet shows how to implement a `CurvedNavigationBar` with custom widgets and colored icons. It allows for diverse item representations, such as icons with text, circular buttons, and items with notification badges. The example depends on the `curved_navigation_bar` package. ```dart import 'package:flutter/material.dart'; import 'package:curved_navigation_bar/curved_navigation_bar.dart'; class CustomIconsExample extends StatefulWidget { @override _CustomIconsExampleState createState() => _CustomIconsExampleState(); } class _CustomIconsExampleState extends State { int _selectedIndex = 0; @override Widget build(BuildContext context) { return Scaffold( bottomNavigationBar: CurvedNavigationBar( index: _selectedIndex, color: Colors.white, buttonBackgroundColor: Colors.orange, backgroundColor: Colors.orange[100]!, height: 65, items: [ Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(Icons.home, size: 25, color: Colors.orange[900]), Text('Home', style: TextStyle(fontSize: 10)), ], ), Icon(Icons.shopping_cart, size: 30, color: Colors.blue), Container( padding: EdgeInsets.all(8), decoration: BoxDecoration( color: Colors.red, shape: BoxShape.circle, ), child: Icon(Icons.favorite, size: 20, color: Colors.white), ), Stack( children: [ Icon(Icons.notifications, size: 30, color: Colors.green), Positioned( right: 0, child: Container( padding: EdgeInsets.all(2), decoration: BoxDecoration( color: Colors.red, shape: BoxShape.circle, ), child: Text('3', style: TextStyle(fontSize: 10, color: Colors.white)), ), ), ], ), Icon(Icons.person, size: 30, color: Colors.purple), ], onTap: (index) { setState(() { _selectedIndex = index; }); }, ), body: Container( color: Colors.orange[100], child: Center( child: Text( 'Selected: $_selectedIndex', style: TextStyle(fontSize: 32), ), ), ), ); } } ``` -------------------------------- ### CMake Flutter Tool Backend Custom Command Source: https://github.com/rafalbednarczuk/curved_navigation_bar/blob/master/example/linux/flutter/CMakeLists.txt Defines a custom CMake command to execute the Flutter tool backend script. This command is configured to run whenever the output files (${FLUTTER_LIBRARY}, ${FLUTTER_LIBRARY_HEADERS}) are needed. A phony target '_phony_' is used to ensure the command runs on every build, as a direct input/output listing for the Flutter tool is not available. This command sets up the necessary environment variables and invokes the tool backend script for the Linux x64 build. ```cmake # === Flutter tool backend === # _phony_ is a non-existent file to force this command to run every time, # since currently there's no way to get a full input/output list from the # flutter tool. 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" linux-x64 ${CMAKE_BUILD_TYPE} ) add_custom_target(flutter_assemble DEPENDS "${FLUTTER_LIBRARY}" ${FLUTTER_LIBRARY_HEADERS} ) ``` -------------------------------- ### CMake Flutter Library Configuration Source: https://github.com/rafalbednarczuk/curved_navigation_bar/blob/master/example/linux/flutter/CMakeLists.txt Configures the Flutter library targets for the Linux GTK build. It finds necessary system packages (PkgConfig for GTK, GLIB, GIO, BLKID), defines the Flutter library path, and sets up an INTERFACE library target named 'flutter'. This target includes necessary headers and links against the Flutter shared library and system dependencies. ```cmake # === Flutter Library === # System-level dependencies. find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) pkg_check_modules(BLKID REQUIRED IMPORTED_TARGET blkid) set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") # Published to parent scope for install step. set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) list(APPEND FLUTTER_LIBRARY_HEADERS "fl_basic_message_channel.h" "fl_binary_codec.h" "fl_binary_messenger.h" "fl_dart_project.h" "fl_engine.h" "fl_json_message_codec.h" "fl_json_method_codec.h" "fl_message_codec.h" "fl_method_call.h" "fl_method_channel.h" "fl_method_codec.h" "fl_method_response.h" "fl_plugin_registrar.h" "fl_plugin_registry.h" "fl_standard_message_codec.h" "fl_standard_method_codec.h" "fl_string_codec.h" "fl_value.h" "fl_view.h" "flutter_linux.h" ) list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") add_library(flutter INTERFACE) target_include_directories(flutter INTERFACE "${EPHEMERAL_DIR}" ) target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") target_link_libraries(flutter INTERFACE PkgConfig::GTK PkgConfig::GLIB PkgConfig::GIO PkgConfig::BLKID ) add_dependencies(flutter flutter_assemble) ``` -------------------------------- ### CMake Custom List Prepend Function Source: https://github.com/rafalbednarczuk/curved_navigation_bar/blob/master/example/linux/flutter/CMakeLists.txt Defines a custom CMake function 'list_prepend' to prepend a prefix to each element in a list. This is a fallback for older CMake versions (pre-3.10) that do not support 'list(TRANSFORM ... PREPEND ...)'. It iterates through the list and builds a new list with the prefix applied. ```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() ``` -------------------------------- ### Add Dependency to pubspec.yaml Source: https://github.com/rafalbednarczuk/curved_navigation_bar/blob/master/README.md To use the curved_navigation_bar package, add it as a dependency in your project's pubspec.yaml file. Ensure you use the latest version available on pub.dev for the most up-to-date features and bug fixes. ```yaml dependencies: curved_navigation_bar: ^1.0.6 #latest version ``` -------------------------------- ### Programmatic Navigation with GlobalKey in Flutter Source: https://context7.com/rafalbednarczuk/curved_navigation_bar/llms.txt This snippet demonstrates how to control the Curved Navigation Bar's selected page programmatically using a GlobalKey. It allows external buttons to trigger page changes within the navigation bar. Dependencies include 'flutter/material.dart' and 'curved_navigation_bar/curved_navigation_bar'. The input is the index of the desired page, and the output is the navigation bar updating to that page. ```dart import 'package:flutter/material.dart'; import 'package:curved_navigation_bar/curved_navigation_bar.dart'; class ProgrammaticNavigation extends StatefulWidget { @override _ProgrammaticNavigationState createState() => _ProgrammaticNavigationState(); } class _ProgrammaticNavigationState extends State { int _page = 0; GlobalKey _bottomNavigationKey = GlobalKey(); @override Widget build(BuildContext context) { return Scaffold( bottomNavigationBar: CurvedNavigationBar( key: _bottomNavigationKey, index: 0, items: [ Icon(Icons.add, size: 30), Icon(Icons.list, size: 30), Icon(Icons.compare_arrows, size: 30), Icon(Icons.call_split, size: 30), Icon(Icons.perm_identity, size: 30), ], color: Colors.white, buttonBackgroundColor: Colors.white, backgroundColor: Colors.blueAccent, animationCurve: Curves.easeInOut, animationDuration: Duration(milliseconds: 600), onTap: (index) { setState(() { _page = index; }); }, ), body: Container( color: Colors.blueAccent, child: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'Current Page: $_page', style: TextStyle(fontSize: 48, color: Colors.white), ), SizedBox(height: 40), ElevatedButton( child: Text('Jump to Page 1'), onPressed: () { final CurvedNavigationBarState? navBarState = _bottomNavigationKey.currentState; navBarState?.setPage(1); }, ), ElevatedButton( child: Text('Jump to Page 3'), onPressed: () { _bottomNavigationKey.currentState?.setPage(3); }, ), ElevatedButton( child: Text('Jump to Last Page'), onPressed: () { _bottomNavigationKey.currentState?.setPage(4); }, ), ], ), ), ), ); } } ``` -------------------------------- ### Register Flutter Service Worker on First Frame Source: https://github.com/rafalbednarczuk/curved_navigation_bar/blob/master/example/web/index.html This snippet registers the Flutter service worker ('flutter_service_worker.js') when the 'flutter-first-frame' event is detected. It checks for service worker support in the browser's navigator object before attempting registration. This ensures the service worker is active as early as possible in the application lifecycle. ```javascript if ('serviceWorker' in navigator) { window.addEventListener('flutter-first-frame', function () { navigator.serviceWorker.register('flutter_service_worker.js'); }); } ``` -------------------------------- ### Change Page Programmatically with Curved Navigation Bar Source: https://github.com/rafalbednarczuk/curved_navigation_bar/blob/master/README.md This snippet illustrates how to change the active navigation item programmatically. It involves using a `GlobalKey` to access the `CurvedNavigationBarState` and then calling the `setPage()` method with the desired index. This is useful for navigating based on application logic. ```dart //State class int _page = 0; GlobalKey _bottomNavigationKey = GlobalKey(); @override Widget build(BuildContext context) { return Scaffold( bottomNavigationBar: CurvedNavigationBar( key: _bottomNavigationKey, items: [ Icon(Icons.add, size: 30), Icon(Icons.list, size: 30), Icon(Icons.compare_arrows, size: 30), ], onTap: (index) { setState(() { _page = index; }); }, ), body: Container( color: Colors.blueAccent, child: Center( child: Column( children: [ Text(_page.toString(), textScaleFactor: 10.0), ElevatedButton( child: Text('Go To Page of index 1'), onPressed: () { //Page change using state does the same as clicking index 1 navigation button final CurvedNavigationBarState? navBarState = _bottomNavigationKey.currentState; navBarState?.setPage(1); }, ) ], ), ), )); } ``` -------------------------------- ### Flutter: Conditional Navigation with Curved Navigation Bar Source: https://context7.com/rafalbednarczuk/curved_navigation_bar/llms.txt This Dart code snippet demonstrates how to control navigation with `CurvedNavigationBar` in Flutter. It uses the `letIndexChange` callback to implement a check for unsaved changes before allowing navigation to a different page. If unsaved changes are detected, a dialog is shown, and navigation is blocked until changes are saved or discarded. ```dart import 'package:flutter/material.dart'; import 'package:curved_navigation_bar/curved_navigation_bar.dart'; class ConditionalNavigationExample extends StatefulWidget { @override _ConditionalNavigationExampleState createState() => _ConditionalNavigationExampleState(); } class _ConditionalNavigationExampleState extends State { int _page = 0; bool _formHasUnsavedChanges = true; GlobalKey _navKey = GlobalKey(); @override Widget build(BuildContext context) { return Scaffold( bottomNavigationBar: CurvedNavigationBar( key: _navKey, index: _page, backgroundColor: Colors.teal[50]!, color: Colors.teal, items: [ Icon(Icons.edit, size: 30, color: Colors.white), Icon(Icons.list, size: 30, color: Colors.white), Icon(Icons.settings, size: 30, color: Colors.white), ], onTap: (index) { setState(() { _page = index; }); }, letIndexChange: (index) { if (_formHasUnsavedChanges && _page == 0 && index != 0) { _showUnsavedChangesDialog(index); return false; // Prevent navigation } return true; // Allow navigation }, ), body: Container( color: Colors.teal[50], child: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text('Page $_page', style: TextStyle(fontSize: 40)), SizedBox(height: 20), if (_page == 0) ElevatedButton( child: Text('Save Changes'), onPressed: () { setState(() { _formHasUnsavedChanges = false; }); ScaffoldMessenger.of(context).showSnackBar( SnackBar(content: Text('Changes saved!')), ); }, ), ], ), ), ), ); } void _showUnsavedChangesDialog(int targetIndex) { showDialog( context: context, builder: (context) => AlertDialog( title: Text('Unsaved Changes'), content: Text('You have unsaved changes. Discard them?'), actions: [ TextButton( child: Text('Cancel'), onPressed: () => Navigator.pop(context), ), TextButton( child: Text('Discard'), onPressed: () { setState(() { _formHasUnsavedChanges = false; }); Navigator.pop(context); _navKey.currentState?.setPage(targetIndex); }, ), ], ), ); } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.