Skip to content

Preserve native Liquid Glass interactions and add selected tab symbols - #11

Open
glaucohd wants to merge 3 commits into
TechSupportz:mainfrom
glaucohd:fix/native-tap-selected-symbols
Open

Preserve native Liquid Glass interactions and add selected tab symbols#11
glaucohd wants to merge 3 commits into
TechSupportz:mainfrom
glaucohd:fix/native-tap-selected-symbols

Conversation

@glaucohd

Copy link
Copy Markdown

Problem

On iOS 26, a simple tap on a tab could fail to reach the native UITabBar, while dragging across the tabs still worked. This caused Flutter applications to change the selected page through a workaround, without preserving the native Liquid Glass interaction.

The package also accepted only one symbol per tab. Applications that wanted an outlined icon for the normal state and a filled icon for the selected state had to rebuild the entire UiKitView. Rebuilding the platform view caused a visible flash whenever the selected tab changed.

Solution

  1. Adds an EagerGestureRecognizer to forward pointer events directly to the native UIKit view, preserving native tap handling and the Liquid Glass interaction.
  2. Adds the optional selectedSymbol property to NativeGlassNavBarItem.
  3. Uses UITabBarItem.selectedImage for the selected symbol, allowing UIKit to switch icons without rebuilding the native tab bar.
  4. Updates labels, normal symbols, and selected symbols in place when tab configuration changes.

Additional fixes

  1. Validates that the tab list is not empty and that currentIndex points to an existing tab.
  2. Protects the Swift selected index lookup against negative values.
  3. Removes Dart and Swift method channel handlers when the native view is disposed.
  4. Keeps the configured fallback visible while Liquid Glass support is being resolved.
  5. Returns false when the support check encounters a MissingPluginException.

Compatibility

selectedSymbol is optional. Existing applications continue using symbol for both states, so this change is backward compatible.

Validation

  1. flutter analyze completes without issues for the changed Dart code.
  2. An iOS simulator debug build completes successfully with Xcode 26.
  3. Tap selection, drag selection, native Liquid Glass interaction, and outlined to filled icon transitions were manually verified on iOS 26.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant