Skip to content
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 example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -171,10 +171,12 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand All @@ -185,6 +187,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down
2 changes: 2 additions & 0 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,7 @@
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
29 changes: 14 additions & 15 deletions lib/carousel_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ abstract class CarouselController {

Future<Null> get onReady;

Future<void> nextPage({Duration? duration, Curve? curve});
Future<void> nextPage({Duration duration, Curve curve});

Future<void> previousPage({Duration? duration, Curve? curve});
Future<void> previousPage({Duration duration, Curve curve});

void jumpToPage(int page);

Expand Down Expand Up @@ -52,16 +52,16 @@ class CarouselControllerImpl implements CarouselController {
/// The animation lasts for the given duration and follows the given curve.
/// The returned [Future] resolves when the animation completes.
Future<void> nextPage(
{Duration? duration = const Duration(milliseconds: 300),
Curve? curve = Curves.linear}) async {
final bool isNeedResetTimer = _state!.options.pauseAutoPlayOnManualNavigate;
{Duration duration = const Duration(milliseconds: 300),
Curve curve = Curves.linear}) async {
final bool isNeedResetTimer = _state?.options.pauseAutoPlayOnManualNavigate ?? false;
if (isNeedResetTimer) {
_state!.onResetTimer();
_state?.onResetTimer();
}
_setModeController();
await _state!.pageController!.nextPage(duration: duration!, curve: curve!);
await _state?.pageController?.nextPage(duration: duration, curve: curve);
if (isNeedResetTimer) {
_state!.onResumeTimer();
_state?.onResumeTimer();
}
}

Expand All @@ -70,17 +70,16 @@ class CarouselControllerImpl implements CarouselController {
/// The animation lasts for the given duration and follows the given curve.
/// The returned [Future] resolves when the animation completes.
Future<void> previousPage(
{Duration? duration = const Duration(milliseconds: 300),
Curve? curve = Curves.linear}) async {
final bool isNeedResetTimer = _state!.options.pauseAutoPlayOnManualNavigate;
{Duration duration = const Duration(milliseconds: 300),
Curve curve = Curves.linear}) async {
final bool isNeedResetTimer = _state?.options.pauseAutoPlayOnManualNavigate ?? false;
if (isNeedResetTimer) {
_state!.onResetTimer();
_state?.onResetTimer();
}
_setModeController();
await _state!.pageController!
.previousPage(duration: duration!, curve: curve!);
await _state?.pageController?.previousPage(duration: duration, curve: curve);
if (isNeedResetTimer) {
_state!.onResumeTimer();
_state?.onResumeTimer();
}
}

Expand Down