Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CustomiLayout to support axisDirection configuration #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/src/custom_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ class _CustomLayoutSwiper extends _SubSwiper {
required int itemCount,
Axis? scrollDirection,
required SwiperController controller,
AxisDirection? axisDirection,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

Verify the initialization and usage of the axisDirection parameter.

The parameter axisDirection is used within the _CustomLayoutSwiper class but is not assigned to a class field. Ensure that it is correctly initialized and used within the class methods to avoid potential issues.

  • lib/src/custom_layout.dart: Verify the assignment and initialization of the axisDirection parameter within the _CustomLayoutSwiper class.
Analysis chain

Verify the usage and initialization of the new parameter axisDirection.

Ensure that the new parameter is correctly used and initialized within the _CustomLayoutSwiper class.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the usage and initialization of the new parameter `axisDirection`.

# Test: Search for the usage of `axisDirection` within `_CustomLayoutSwiper` class. Expect: Proper usage and initialization.
rg --type dart 'axisDirection' lib/src/custom_layout.dart

Length of output: 248



Script:

#!/bin/bash
# Description: Verify the assignment and consistent usage of the new parameter `axisDirection` within `_CustomLayoutSwiper` class.

# Test: Search for the assignment of `axisDirection` to a class field and its usage within `_CustomLayoutSwiper` class.
ast-grep --lang dart --pattern 'class _CustomLayoutSwiper {
  $$$
  _CustomLayoutSwiper({
    $$$,
    this.axisDirection,
    $$$
  }) {
    $$$
  }
  $$$
}' lib/src/custom_layout.dart

Length of output: 187



Script:

#!/bin/bash
# Description: Verify the assignment and consistent usage of the new parameter `axisDirection` within `_CustomLayoutSwiper` class.

# Test: Search for the `axisDirection` parameter within the `_CustomLayoutSwiper` class and check its usage.
rg --type dart 'axisDirection' lib/src/custom_layout.dart

Length of output: 248

}) : super(
loop: loop,
onIndexChanged: onIndexChanged,
Expand All @@ -414,7 +415,9 @@ class _CustomLayoutSwiper extends _SubSwiper {
index: index,
itemCount: itemCount,
controller: controller,
scrollDirection: scrollDirection);
scrollDirection: scrollDirection,
axisDirection: axisDirection
);

final CustomLayoutOption option;

Expand Down
1 change: 1 addition & 0 deletions lib/src/swiper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ class _SwiperState extends _SwiperTimerMixin {
onIndexChanged: _onIndexChanged,
controller: _controller,
scrollDirection: widget.scrollDirection,
axisDirection: widget.axisDirection,
);
} else {
return const SizedBox.shrink();
Expand Down