Closed sanjidbillah closed 2 years ago
@sanjidbillah awesome, thank you very much for your contribution! I'll check it in detail asap.
@sanjidbillah Nice Try, but it doesn't work, when setting it to fade transition I am still getting the same:
I have minimized all my upcoming comments as I misunderstood some things, but now I think this PR is great.
This is FadeTransition
And this is ScaleTransition
@prateekmedia Can you give me your example code with device information?
You should try like this. I used flutter default animation transition widget.
showPopover(
context: context,
transition: PopoverTransition.fadeTransition,
transitionDuration: const Duration(seconds: 2),
bodyBuilder: (context) => const ListItems(),
onPop: () => print('Popover was popped!'),
direction: PopoverDirection.bottom,
width: 200,
height: 400,
arrowHeight: 15,
arrowWidth: 30,
);
@sanjidbillah My platform is linux and the code I used to achieve Fade transition of the popover widget is here
To achieve I didn't send the scale values to Popover widget so it doesn't scale and then using FadeTransition as the parent of the popover.
@sanjidbillah Also I used below code:
showPopover(
context: context,
barrierColor: Colors.transparent,
shadow: [
BoxShadow(
color: context.borderColor,
blurRadius: 6,
),
],
bodyBuilder: (_) => bodyHere,
width: 200,
height: null,
backgroundColor: Theme.of(context).cardColor,
)
@prateekmedia I used same FadeTransition
widget.
Did you check with my code? i already checked it works.
If you try with my code then give me the code i will check it.
You gave me your code not my example code.
Also i want know did you use real device or simulator give the device information.
In short I wanted the popover to not scale but fade in when coming on screen.
@prateekmedia got it. If @minikin allow me to change ScaleTransition I will change it. I am waiting for code review response.
I think he will if you are talking about fixing #48, regarding your current code If you feel it's useful then you can rename it to something like,
backgroundTransition: PopoverBackgroundTransition.fadeTransition,
@prateekmedia Right, But now i am thinking i will keep scale only for ScaleTransition.
@prateekmedia Right, But now i am thinking i will keep scale only for ScaleTransition.
Do you mean for background or popover?
@prateekmedia For popover.
@prateekmedia For popover.
Ok, but you should remove fix for #48
from description as this is not the fix for it. Thanks.
It will be fixed soon
@prateekmedia Please check i have fixed all transition.
PR looks great but I have an issue. Issue: The transition for background and popover doesn't need to be same like I can want to have background transitioning with fade but the popover as Scale.
Probable solution:
Add backgroundTransition
property to popover and set its default value to
fade, you may ask why fade, its because the package uses FadeTransition for
background by default so this will be breaking change if its Scale for
background.
TL;DR Separate transition for background as
backgroundTransition: PopoverTransition.fadeTransition,
@prateekmedia Brother i have made this change as you wish. Please run it again. I changed after watching your example video. background transitioning with fade but the popover as Scale. It was in the previous PR, Now you are telling me to go back to the previous PR again? I think we need to wait until @minikin code review. Otherwise it can become an unncessary problem.
@sanjidbillah @prateekmedia What I'd like to propose is to think about how we can implement generic abstraction about transition animation. And do not limit our users to PopoverTransition type. We can provide ScaleTransition
as the default option.
@minikin Something like a transitionBuilder
property
@minikin @prateekmedia Please check new PR. I have added popoverBuilder now user can use any animation also i set ScaleTransition
as default.
I keep PopoverTransition Type. User can disable popover Transition by PopoverTransition.none
by default it will use ScaleTransition
.
If you keep ScaleTransition for every animation i will remove it just let me know.
@minikin Any update on this?
@minikin Any reason why this PR is not merged?
@minikin Can you review the changes and comment
I tried but i found a similar open issue here. @minikin any suggestion?
Merging #50 (7633a93) into main (4299350) will decrease coverage by
0.59%
. The diff coverage is62.50%
.
@@ Coverage Diff @@
## main #50 +/- ##
==========================================
- Coverage 90.98% 90.39% -0.60%
==========================================
Files 10 10
Lines 455 458 +3
==========================================
Hits 414 414
- Misses 41 44 +3
Impacted Files | Coverage Δ | |
---|---|---|
lib/src/utils/popover_utils.dart | 100.00% <ø> (ø) |
|
lib/src/popover.dart | 65.00% <50.00%> (-12.78%) |
:arrow_down: |
lib/src/popover_context.dart | 100.00% <100.00%> (ø) |
|
lib/src/popover_item.dart | 80.88% <100.00%> (+0.28%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
@sanjidbillah We just need to update an example with a more applicable custom transition, and we'll be ready to merge.
@minikin I think I am not good at documentation but I will try -_-
I have added animation transition.
ScaleTransition
as default. If i need change anything let me know. fix for #48