fix(WFCNG-21252): Add auto close to slidable#83
Merged
Conversation
Contributor
PR Checks complete
Created with Flutter code quality action |
There was a problem hiding this comment.
Pull Request Overview
Adds automatic closing behavior for Slidable widgets so only one can be open at a time by introducing SlidableAutoCloseBehavior at the app root and new props on the slidable components.
- Wraps the entire app with
SlidableAutoCloseBehaviorviaZdsBottomBarTheme - Extends
ZdsSlidableListTilewithcloseOnScrollandgroupTagparameters - Extends
ZdsCommentwithslidableCloseOnScrollandscrollableGroupTagparameters
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/src/utils/theme/theme.dart | Imported flutter_slidable and wrapped child with SlidableAutoCloseBehavior in ZdsBottomBarTheme |
| lib/src/components/molecules/slidable_list_tile.dart | Added closeOnScroll and nullable groupTag, updated Slidable instantiation and diagnostics |
| lib/src/components/molecules/comment.dart | Added slidableCloseOnScroll and scrollableGroupTag, updated docs and diagnostics, but forgot to forward new tag |
Comments suppressed due to low confidence (3)
lib/src/components/molecules/slidable_list_tile.dart:112
- Since
groupTaghas a non-null default value ('zds-slidable-list-tile'), consider making this property non-nullable (String) for clarity.
final String? groupTag;
lib/src/components/molecules/comment.dart:113
- [nitpick] The naming of
scrollableGroupTagdiffers fromgroupTaginZdsSlidableListTile. Consider aligning the parameter name (e.g. usegroupTag) across both components for consistency.
final String? scrollableGroupTag;
lib/src/components/molecules/comment.dart:145
- The
scrollableGroupTagproperty is added but never passed intoZdsSlidableListTile. Forward it to the slidable viagroupTag: scrollableGroupTagto enable proper grouping.
closeOnScroll: slidableCloseOnScroll,
Contributor
|
Visit the preview URL for this PR (updated for commit 4a7d1db): https://zds-c9c24--pr-83-fix-wfcng-21252-5wpcc3vp.web.app (expires Wed, 11 Jun 2025 08:27:00 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 9e05e2ffbf7f11b6305259262f782e751f182319 |
DE7924
approved these changes
Jun 4, 2025
benken
approved these changes
Jun 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have added the required props that need to be passed into flutter_slidable to allow only a single comment / slidable to be open at a time according to these docs: https://github.com/letsar/flutter_slidable/wiki/FAQ#how-to-keep-only-one-slidable-open.
To facilitate this change, we need to add a SlidableAutoCloseBehavior in the widget tree, above the slidables, so I have altered ZdsBottomBarTheme as this is the only widget we have that should always wrap an app.