mirror of
https://github.com/Iconica-Development/flutter_input_library.git
synced 2025-05-18 17:03:45 +02:00
46 lines
1.4 KiB
Dart
46 lines
1.4 KiB
Dart
|
// SPDX-FileCopyrightText: 2022 Iconica
|
||
|
//
|
||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||
|
|
||
|
import 'package:flutter/material.dart';
|
||
|
import 'carousel_slider.dart';
|
||
|
|
||
|
class CarouselState {
|
||
|
/// The [CarouselOptions] to create this state
|
||
|
CarouselOptions options;
|
||
|
|
||
|
/// [pageController] is created using the properties passed to the constructor
|
||
|
/// and can be used to control the [PageView] it is passed to.
|
||
|
PageController? pageController;
|
||
|
|
||
|
/// The actual index of the [PageView].
|
||
|
///
|
||
|
/// This value can be ignored unless you know the carousel will be scrolled
|
||
|
/// backwards more then 10000 pages.
|
||
|
/// Defaults to 10000 to simulate infinite backwards scrolling.
|
||
|
int realPage = 10000;
|
||
|
|
||
|
/// The initial index of the [PageView] on [CarouselSlider] init.
|
||
|
///
|
||
|
int initialPage = 0;
|
||
|
|
||
|
/// The widgets count that should be shown at carousel
|
||
|
int? itemCount;
|
||
|
|
||
|
/// Will be called when using [pageController] to go to next page or
|
||
|
/// previous page. It will clear the autoPlay timer.
|
||
|
/// Internal use only
|
||
|
Function onResetTimer;
|
||
|
|
||
|
/// Will be called when using pageController to go to next page or
|
||
|
/// previous page. It will restart the autoPlay timer.
|
||
|
/// Internal use only
|
||
|
Function onResumeTimer;
|
||
|
|
||
|
/// The callback to set the Reason Carousel changed
|
||
|
Function(CarouselPageChangedReason) changeMode;
|
||
|
|
||
|
CarouselState(
|
||
|
this.options, this.onResetTimer, this.onResumeTimer, this.changeMode);
|
||
|
}
|