[GH-ISSUE #2056] [FR] Show a toast after copying the path #827

Closed
opened 2026-03-23 20:41:36 +00:00 by mirror · 15 comments
Owner

Originally created by @LucasXu0 on GitHub (Mar 21, 2023).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/2056

Originally assigned to: @Sudhanva-Nadiger on GitHub.

Description

Screenshot 2023-03-21 at 09 59 26

Show a toast after double tapping to let the users know the path has been copied successfully.

Impact

Users who copy the data path.

Additional Context

Please refer to:

  • settings_file_customize_location_view.dart
Originally created by @LucasXu0 on GitHub (Mar 21, 2023). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/2056 Originally assigned to: @Sudhanva-Nadiger on GitHub. ### Description <img width="458" alt="Screenshot 2023-03-21 at 09 59 26" src="https://user-images.githubusercontent.com/11863087/226502094-0d96952d-339c-4a42-8280-6fea6bd7199d.png"> Show a toast after double tapping to let the users know the path has been copied successfully. ### Impact Users who copy the data path. ### Additional Context Please refer to: * `settings_file_customize_location_view.dart`
Author
Owner

@Sudhanva-Nadiger commented on GitHub (Mar 21, 2023):

And tapping doesn't seem appropriate word in desktop mode, isn't it !
I suppose, it can be double click!

<!-- gh-comment-id:1477206418 --> @Sudhanva-Nadiger commented on GitHub (Mar 21, 2023): And tapping doesn't seem appropriate word in desktop mode, isn't it ! I suppose, it can be double click!
Author
Owner

@LucasXu0 commented on GitHub (Mar 21, 2023):

@Sudhanva-Nadiger. What's the difference between double tap and double click in desktop mode?

<!-- gh-comment-id:1477386177 --> @LucasXu0 commented on GitHub (Mar 21, 2023): @Sudhanva-Nadiger. What's the difference between double tap and double click in desktop mode?
Author
Owner

@Sudhanva-Nadiger commented on GitHub (Mar 21, 2023):

Tapping is in Mobile noe ?

<!-- gh-comment-id:1477430694 --> @Sudhanva-Nadiger commented on GitHub (Mar 21, 2023): Tapping is in Mobile noe ?
Author
Owner

@bijaykumarpun commented on GitHub (Mar 21, 2023):

@Sudhanva-Nadiger @LucasXu0, I'm wondering if a single click would suffice?

<!-- gh-comment-id:1477520253 --> @bijaykumarpun commented on GitHub (Mar 21, 2023): @Sudhanva-Nadiger @LucasXu0, I'm wondering if a single click would suffice?
Author
Owner

@LucasXu0 commented on GitHub (Mar 21, 2023):

@BijayKumarPun. I think a single click would cause a misoperation.

<!-- gh-comment-id:1477697626 --> @LucasXu0 commented on GitHub (Mar 21, 2023): @BijayKumarPun. I think a single click would cause a misoperation.
Author
Owner

@Sudhanva-Nadiger commented on GitHub (Mar 21, 2023):

@LucasXu0 can I take this issue ?

<!-- gh-comment-id:1477734996 --> @Sudhanva-Nadiger commented on GitHub (Mar 21, 2023): @LucasXu0 can I take this issue ?
Author
Owner

@Sudhanva-Nadiger commented on GitHub (Mar 26, 2023):

https://user-images.githubusercontent.com/93595710/227791085-65ebf769-92fb-4b6f-b075-696f1eda18fa.mp4

HI @a-wallen

Why this approach is used?

  • since the setting UI is a dialog we can't show a snack bar or a toast above it as its already on top of every other widget
  • we can show the snack bar on the above level of dialog but before that, it had to be wrapped with a scaffold and make the background transparent which does not allow the closing of dialog on clicking outside of it. more info in this blog

how the above implementation is done?

  • Wrapped the ListTile with a stateful builder so that the whole widget tree won't rebuild when we set the state
  • whenever double tap we show the copied message for a second or so!

if any changes required or can I make a pr for this ?

<!-- gh-comment-id:1484158850 --> @Sudhanva-Nadiger commented on GitHub (Mar 26, 2023): https://user-images.githubusercontent.com/93595710/227791085-65ebf769-92fb-4b6f-b075-696f1eda18fa.mp4 HI @a-wallen ### Why this approach is used? - since the setting UI is a dialog we can't show a snack bar or a toast above it as its already on top of every other widget - we can show the snack bar on the above level of dialog but before that, it had to be wrapped with a scaffold and make the background transparent which does not allow the closing of dialog on clicking outside of it. more info in this [blog](https://medium.com/@aakashpp/flutter-snack-bar-on-dialog-ea70a3b5e028#:~:text=showSnackBar()%3B%20inside%20the%20alert,behind%20the%20alert%20dialog%20screen.) ### ### how the above implementation is done? - Wrapped the ListTile with a stateful builder so that the whole widget tree won't rebuild when we set the state - whenever double tap we show the copied message for a second or so! if any changes required or can I make a pr for this ?
Author
Owner

@Xazin commented on GitHub (Mar 26, 2023):

HI @a-wallen

Why this approach is used?

  • since the setting UI is a dialog we can't show a snack bar or a toast above it as its already on top of every other widget
  • we can show the snack bar on the above level of dialog but before that, it had to be wrapped with a scaffold and make the background transparent which does not allow the closing of dialog on clicking outside of it. more info in this blog

how the above implementation is done?

  • Wrapped the ListTile with a stateful builder so that the whole widget tree won't rebuild when we set the state
  • whenever double tap we show the copied message for a second or so!

if any changes required or can I make a pr for this ?

I believe the best way to do it, is to have a ScaffoldMessenger inside the Dialog itself, I'll make a commit in a moment showing you what I mean.

<!-- gh-comment-id:1484164994 --> @Xazin commented on GitHub (Mar 26, 2023): > HI @a-wallen > > ### Why this approach is used? > * since the setting UI is a dialog we can't show a snack bar or a toast above it as its already on top of every other widget > * we can show the snack bar on the above level of dialog but before that, it had to be wrapped with a scaffold and make the background transparent which does not allow the closing of dialog on clicking outside of it. more info in this [blog](https://medium.com/@aakashpp/flutter-snack-bar-on-dialog-ea70a3b5e028#:~:text=showSnackBar()%3B%20inside%20the%20alert,behind%20the%20alert%20dialog%20screen.) > > ### how the above implementation is done? > * Wrapped the ListTile with a stateful builder so that the whole widget tree won't rebuild when we set the state > * whenever double tap we show the copied message for a second or so! > > if any changes required or can I make a pr for this ? I believe the best way to do it, is to have a ScaffoldMessenger inside the Dialog itself, I'll make a commit in a moment showing you what I mean.
Author
Owner

@Sudhanva-Nadiger commented on GitHub (Mar 26, 2023):

Heyy !
I tried that ! When double tapped I tried to show a scaffold messenger.showSnackbar !
It did not work (as in it was appearing below the dialog box)

<!-- gh-comment-id:1484170169 --> @Sudhanva-Nadiger commented on GitHub (Mar 26, 2023): Heyy ! I tried that ! When double tapped I tried to show a scaffold messenger.showSnackbar ! It did not work (as in it was appearing below the dialog box)
Author
Owner

@Xazin commented on GitHub (Mar 26, 2023):

I just need to fix one minor thing with my setup, it's working as I anticipated.

I will tag you when it's done.

<!-- gh-comment-id:1484183800 --> @Xazin commented on GitHub (Mar 26, 2023): I just need to fix one minor thing with my setup, it's working as I anticipated. I will tag you when it's done.
Author
Owner

@Xazin commented on GitHub (Mar 26, 2023):

@Sudhanva-Nadiger #2114

<!-- gh-comment-id:1484209995 --> @Xazin commented on GitHub (Mar 26, 2023): @Sudhanva-Nadiger #2114
Author
Owner

@Sudhanva-Nadiger commented on GitHub (Mar 27, 2023):

great!

<!-- gh-comment-id:1484349728 --> @Sudhanva-Nadiger commented on GitHub (Mar 27, 2023): great!
Author
Owner

@annieappflowy commented on GitHub (Apr 3, 2023):

@Sudhanva-Nadiger , is this done?

<!-- gh-comment-id:1494352264 --> @annieappflowy commented on GitHub (Apr 3, 2023): @Sudhanva-Nadiger , is this done?
Author
Owner

@Xazin commented on GitHub (Apr 3, 2023):

@annieappflowy my PR for this was merged yes. See #2114

<!-- gh-comment-id:1494469986 --> @Xazin commented on GitHub (Apr 3, 2023): @annieappflowy my PR for this was merged yes. See #2114
Author
Owner

@a-wallen commented on GitHub (Apr 3, 2023):

@annieappflowy please review https://github.com/AppFlowy-IO/AppFlowy/pull/2151 when you get the chance. Its a PR template that will remind contributors to mark their PRs with the fixes keyword so that these issues are closed when the PR lands.

<!-- gh-comment-id:1494803726 --> @a-wallen commented on GitHub (Apr 3, 2023): @annieappflowy please review https://github.com/AppFlowy-IO/AppFlowy/pull/2151 when you get the chance. Its a PR template that will remind contributors to mark their PRs with the `fixes` keyword so that these issues are closed when the PR lands.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#827
No description provided.