Skip to content

Commit

Permalink
Remove unnecessary comments from ChatGPT and pass textDirection
Browse files Browse the repository at this point in the history
  • Loading branch information
ulusoyca committed Jul 23, 2024
1 parent 4982dcf commit d5fab23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class _MainContentAnimatedBuilderState
sheetWidth: widget.sheetWidth,
screenWidth: screenWidth,
isForwardMove: widget.forwardMove,
isLTR: Directionality.of(context) == TextDirection.ltr,
textDirection: Directionality.of(context),
),
child: widget.child,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,13 @@ enum WoltModalSheetPageTransitionState {
required double sheetWidth,
required double screenWidth,
required bool isForwardMove,
required bool isLTR, // New parameter to determine the text direction
required TextDirection textDirection,
}) {
// Determine the direction multiplier based on isLTR and isForwardMove.
final directionMultiplier = (isLTR ? 1 : -1) * (isForwardMove ? 1 : -1);
final directionMultiplier = (textDirection == TextDirection.ltr ? 1 : -1) *
(isForwardMove ? 1 : -1);

switch (this) {
case WoltModalSheetPageTransitionState.incoming:
// Calculate the incoming begin offset using directionMultiplier.
final incomingBeginOffset =
Offset(sheetWidth * 0.3 * directionMultiplier / screenWidth, 0);

Expand All @@ -91,7 +90,6 @@ enum WoltModalSheetPageTransitionState {
);

case WoltModalSheetPageTransitionState.outgoing:
// Calculate the outgoing end offset using directionMultiplier.
final outgoingEndOffset =
Offset(sheetWidth * 0.3 * -directionMultiplier / screenWidth, 0);

Expand Down

0 comments on commit d5fab23

Please sign in to comment.