Skip to content

Comments

modify: fix OverlayEntry can't be removed correctly while window size changed#28

Open
Switernal wants to merge 2 commits intocb-cloud:mainfrom
Switernal:main
Open

modify: fix OverlayEntry can't be removed correctly while window size changed#28
Switernal wants to merge 2 commits intocb-cloud:mainfrom
Switernal:main

Conversation

@Switernal
Copy link

I found a problem: if I change window size on destop, the previous OverlayEntry can't be removed from Navigator.of(context).overlay correctly.

I checked and found the problem is that while window size changed, the InAppNotification will be rebuilt, and then the _VsyncProvider is rebuilt. However, the build() method of __VsyncProviderState returns a _NotificationController(), where the _NotificationState is created.

Which means, while window size changed, the previous _NotificationState is missed after InAppNotification rebuilt , with the OverlayEntry missed.

So I choose to save _NotificationController in __VsyncProviderState. Before _VsyncProvider is rebuilt, the previous OverlayEntry can removed correctly.

Also, I confirm that this package can work well with flutter 3.10.6 and dart 3.0.6, so I changed dart SDK version to '<4.0.0'.

@github-actions
Copy link

github-actions bot commented Aug 4, 2023

LCOV of commit 49388b6 during Testing #37

Summary coverage rate:
  lines......: 68.7% (134 of 195 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate:
                                            |Lines       |Functions  |Branches    
  Filename                                  |Rate     Num|Rate    Num|Rate     Num
  ================================================================================
  lib/src/vsync_provider.dart               | 100%     20|    -     0|    -      0

@github-actions
Copy link

github-actions bot commented Aug 5, 2023

LCOV of commit af9c7db during Testing #38

Summary coverage rate:
  lines......: 68.7% (134 of 195 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate:
                                            |Lines       |Functions  |Branches    
  Filename                                  |Rate     Num|Rate    Num|Rate     Num
  ================================================================================
  lib/src/vsync_provider.dart               | 100%     20|    -     0|    -      0

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