Skip to content

fix(WFCNG-21252): Add auto close to slidable#83

Merged
thelukewalton merged 2 commits into
mainfrom
fix/WFCNG-21252
Jun 4, 2025
Merged

fix(WFCNG-21252): Add auto close to slidable#83
thelukewalton merged 2 commits into
mainfrom
fix/WFCNG-21252

Conversation

@thelukewalton
Copy link
Copy Markdown
Collaborator

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.

@thelukewalton thelukewalton requested a review from benken as a code owner June 3, 2025 15:33
@thelukewalton thelukewalton requested review from DE7924, benken and Copilot and removed request for benken June 3, 2025 15:33
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2025

PR Checks complete

  • ✅ - Linting / Formatting
  • ✅ - Static analysis passed
  • ✅ - All tests passed
  • ✅ - Branch is not behind

Created with Flutter code quality action

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SlidableAutoCloseBehavior via ZdsBottomBarTheme
  • Extends ZdsSlidableListTile with closeOnScroll and groupTag parameters
  • Extends ZdsComment with slidableCloseOnScroll and scrollableGroupTag parameters

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 groupTag has 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 scrollableGroupTag differs from groupTag in ZdsSlidableListTile. Consider aligning the parameter name (e.g. use groupTag) across both components for consistency.
final String? scrollableGroupTag;

lib/src/components/molecules/comment.dart:145

  • The scrollableGroupTag property is added but never passed into ZdsSlidableListTile. Forward it to the slidable via groupTag: scrollableGroupTag to enable proper grouping.
closeOnScroll: slidableCloseOnScroll,

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2025

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

@thelukewalton thelukewalton merged commit 0c3533c into main Jun 4, 2025
6 checks passed
@thelukewalton thelukewalton deleted the fix/WFCNG-21252 branch June 4, 2025 10:24
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.

4 participants