MySwiper class
Flutter built-in replacement for the old swiper dependency.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MySwiper
- Available extensions
Constructors
-
MySwiper({Key? key, required IndexedWidgetBuilder itemBuilder, required int itemCount, Object? indicatorLayout, Object? transformer, bool autoplay = false, int autoplayDelay = _kMySwiperDefaultAutoplayDelayMs, bool autoplayDisableOnInteraction = true, int duration = _kMySwiperDefaultAutoplayDurationMs, ValueChanged<
int> ? onIndexChanged, int? index, MySwiperOnTap? onTap, Object? control, bool loop = true, Curve curve = Curves.ease, Axis scrollDirection = Axis.horizontal, Object? pagination, List<Object?> ? plugins, ScrollPhysics? physics, Object? controller, Object? customLayoutOption, double? containerHeight, double? containerWidth, double viewportFraction = 1.0, double itemHeight = double.infinity, double itemWidth = double.infinity, bool outer = false, double? scale, double? fade, bool reverse = false, Object? layout}) -
const
-
MySwiper.children({required List<
Widget> children, bool autoplay = false, Object? transformer, int autoplayDelay = _kMySwiperDefaultAutoplayDelayMs, bool reverse = false, bool autoplayDisableOnInteraction = true, int duration = _kMySwiperDefaultAutoplayDurationMs, ValueChanged<int> ? onIndexChanged, int index = 0, MySwiperOnTap? onTap, bool loop = true, Curve curve = Curves.ease, Axis scrollDirection = Axis.horizontal, Object? pagination, Object? control, List<Object?> ? plugins, Object? controller, Key? key, Object? customLayoutOption, ScrollPhysics? physics, double? containerHeight, double? containerWidth, double viewportFraction = 1.0, double itemHeight = double.infinity, double itemWidth = double.infinity, bool outer = false, double? scale = 1.0, double? fade}) -
factory
-
MySwiper.list({Object? transformer, required List list, Object? customLayoutOption, required MySwiperDataBuilder builder, bool autoplay = false, int autoplayDelay = _kMySwiperDefaultAutoplayDelayMs, bool reverse = false, bool autoplayDisableOnInteraction = true, int duration = _kMySwiperDefaultAutoplayDurationMs, ValueChanged<
int> ? onIndexChanged, int index = 0, MySwiperOnTap? onTap, bool loop = true, Curve curve = Curves.ease, Axis scrollDirection = Axis.horizontal, Object? pagination, Object? control, List<Object?> ? plugins, Object? controller, Key? key, ScrollPhysics? physics, double? containerHeight, double? containerWidth, double viewportFraction = 1.0, double itemHeight = double.infinity, double itemWidth = double.infinity, bool outer = false, double? scale = 1.0, double? fade}) -
factory
Properties
- autoplay → bool
-
final
- autoplayDelay → int
-
final
- autoplayDisableOnInteraction → bool
-
final
- cardWidget → Widget
-
Available on Widget, provided by the WidgetExt extension
no setter - center → Widget
-
Available on Widget, provided by the WidgetExt extension
no setter - circleWidget → Widget
-
Available on Widget, provided by the CircleExt extension
no setter - containerHeight → double?
-
final
- containerWidth → double?
-
final
- control → Object?
-
final
- controller → Object?
-
final
- curve → Curve
-
final
- customLayoutOption → Object?
-
final
- duration → int
-
final
- editPage → Widget
-
Available on Widget, provided by the WidgetExt extension
no setter - expanded → Widget
-
Available on Widget, provided by the WidgetExt extension
no setter - fade → double?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int?
-
final
- indicatorLayout → Object?
-
final
- itemBuilder → IndexedWidgetBuilder
-
final
- itemCount → int
-
final
- itemHeight → double
-
final
- itemWidth → double
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- layout → Object?
-
final
- loop → bool
-
final
- materialRouter → Route
-
Available on Widget, provided by the WidgetExt extension
no setter - maxWidthButton → Widget
-
Available on Widget, provided by the WidgetExt extension
no setter -
onIndexChanged
→ ValueChanged<
int> ? -
final
-
onTap
→ ValueChanged<
int> ? -
final
- outer → bool
-
final
- pagination → Object?
-
final
- physics → ScrollPhysics?
-
final
-
plugins
→ List<
Object?> ? -
final
- positionedFill → Widget
-
Available on Widget, provided by the WidgetExt extension
no setter - removeScrollViewSplash → Widget
-
Available on Widget, provided by the WidgetExt extension
no setter - reverse → bool
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scale → double?
-
final
- scrollDirection → Axis
-
final
- topBorder → Widget
-
Available on Widget, provided by the WidgetExt extension
no setter - toSliverWidget → Widget
-
Available on Widget, provided by the WidgetExt extension
no setter - transformer → Object?
-
Kept as compatibility placeholders for common old Swiper constructor args.
final
- viewportFraction → double
-
final
Methods
-
addScrollbar(
{ScrollController? controller}) → Widget - 添加滚动条
-
addTap(
VoidCallback onTap) → Widget -
aspectRatio(
double v) → Widget -
bg(
Color color) → Widget -
border(
BuildContext context, {BoxDecoration? decoration, Color? borderColor, BorderRadius? borderRadius, double width = 1.0}) → Widget -
click(
VoidCallback onTap) → Widget -
clipRadius(
double radius) → Widget -
constraintBox(
BuildWidget buildWidget) → Widget -
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< MySwiper> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
disableTextScaling(
BuildContext context, ValueCopyWith< MediaQueryData> copyWith) → Widget -
ifShow(
bool show) → Widget -
ifTrue(
bool value, Widget trueWidget, [Duration? duration]) → Widget -
Available on Widget, provided by the WidgetExt extension
如果value为true, 则展示trueWidget,否则展示为本身this -
loading(
bool value) → Widget -
longClick(
{required VoidCallback onLongPress}) → Widget -
marginOnly(
{double left = 0.0, double right = 0.0, double top = 0.0, double bottom = 0.0}) → Widget -
maxHeight(
double height) → Widget -
maxWidth(
double width) → Widget -
minHeight(
double height) → Widget -
minWidth(
double width) → Widget -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
paddingOnly(
{double left = 0.0, double right = 0.0, double top = 0.0, double bottom = 0.0}) → Widget -
paddingWithObj(
EdgeInsets edgeInsets) → Widget -
sizeBox(
double w, double h) → Widget -
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
-
visible(
bool value) → Widget -
visibleOrNull(
bool value) → Widget?
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited