Closed ndonkoHenri closed 1 month ago
This pull request addresses an issue where the NavigationBarDestination.disabled
property had no visual effect. The changes implement proper handling of disabled states for both NavigationBar and CupertinoNavigationBar, improve code organization, and enhance the overall functionality of navigation components.
sequenceDiagram
participant User
participant NavigationBar
participant Destination
User->>NavigationBar: Tap destination
NavigationBar->>NavigationBar: Check disabled state
alt NavigationBar is not disabled
NavigationBar->>Destination: Check destination disabled state
alt Destination is not disabled
Destination->>NavigationBar: Allow selection
NavigationBar->>User: Update selected index
else Destination is disabled
Destination->>NavigationBar: Prevent selection
end
else NavigationBar is disabled
NavigationBar->>User: No action
end
Change | Details | Files |
---|---|---|
Implement proper handling of disabled state for NavigationBar and CupertinoNavigationBar |
|
packages/flet/lib/src/controls/navigation_bar.dart packages/flet/lib/src/controls/cupertino_navigation_bar.dart |
Refactor and improve code organization |
|
packages/flet/lib/src/controls/navigation_bar.dart packages/flet/lib/src/models/control.dart |
Enhance flexibility and consistency of navigation components |
|
packages/flet/lib/src/controls/navigation_bar.dart packages/flet/lib/src/controls/cupertino_navigation_bar.dart |
Description
Fixes #4029
Test Code
Summary by Sourcery
Fix the visual effect of the
disabled
state inNavigationBarDestination
and refactor the handling of adaptive and disabled states in navigation bar controls.Bug Fixes:
NavigationBarDestination.disabled
had no visual effect by ensuring that the disabled state is properly handled in the navigation bar controls.Enhancements: