Skip to content

Commit

Permalink
Merge pull request #20 from nrise/bug/WGJS-3972
Browse files Browse the repository at this point in the history
FadeRoute 잔상 이슈 수정
  • Loading branch information
myeonginwoo authored Feb 6, 2025
2 parents 528b73b + 3f305c1 commit be7ce99
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/src/page_route/builder/wippy_page_route_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class WippyPageRouteBuilder<T> extends PageRoute<T> {
Widget child,
) {
try {
if (Platform.isIOS) {
if (Platform.isIOS && _page.enableCupertinoTransition) {
return const CupertinoPageTransitionsBuilder().buildTransitions<T>(
this,
context,
Expand Down
6 changes: 4 additions & 2 deletions lib/src/page_route/builder/wippy_transition_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ class WippyTransitionPage<T> extends Page<T> {
this.barrierDismissible = false,
this.barrierColor,
this.barrierLabel,
this.enableCupertinoTransition = true,
super.key,
super.name,
super.arguments,
super.restorationId,
});

final bool enableCupertinoTransition;

final Widget child;

final Duration transitionDuration;
Expand All @@ -37,8 +40,7 @@ class WippyTransitionPage<T> extends Page<T> {

final String? barrierLabel;

final Widget Function(BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation, Widget child) transitionsBuilder;
final Widget Function(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) transitionsBuilder;

@override
Route<T> createRoute(BuildContext context) => WippyPageRouteBuilder<T>(this);
Expand Down
15 changes: 13 additions & 2 deletions lib/src/page_route/screen_route_fade_transition_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:quantum_dots/qds_foundation.dart';
import 'package:quantum_dots/src/page_route/builder/wippy_transition_page.dart';

class ScreenRouteFadeTransitionPage<T> extends WippyTransitionPage<T> {
Expand All @@ -13,6 +14,7 @@ class ScreenRouteFadeTransitionPage<T> extends WippyTransitionPage<T> {
transitionsBuilder: _transitionsBuilder,
transitionDuration: duration,
reverseTransitionDuration: duration,
enableCupertinoTransition: false,
);

static Widget _transitionsBuilder(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
Expand All @@ -21,12 +23,21 @@ class ScreenRouteFadeTransitionPage<T> extends WippyTransitionPage<T> {
curve: Curves.easeInOut,
);

return FadeTransition(
return Stack(
children: [
Container(
width: double.infinity,
height: double.infinity,
color: wippyWhite,
),
FadeTransition(
opacity: Tween<double>(
begin: 0.0,
end: 1.0,
).animate(curvedAnimation),
child: child,
);
),
],
);
}
}

0 comments on commit be7ce99

Please sign in to comment.