build method

  1. @override
Widget build(
  1. BuildContext context,
  2. SwiperPluginConfig? config
)
override

Implementation

@override
Widget build(BuildContext context, SwiperPluginConfig? config) {
  final themeData = Theme.of(context);
  final activeColor = this.activeColor ?? themeData.primaryColor;
  final color = this.color ?? themeData.scaffoldBackgroundColor;

  if (Axis.vertical == config!.scrollDirection) {
    return Column(
      key: key,
      mainAxisSize: MainAxisSize.min,
      children: <Widget>[
        Text(
          '${config.activeIndex! + 1}',
          style: TextStyle(color: activeColor, fontSize: activeFontSize),
        ),
        Text(
          '/',
          style: TextStyle(color: color, fontSize: fontSize),
        ),
        Text(
          '${config.itemCount}',
          style: TextStyle(color: color, fontSize: fontSize),
        )
      ],
    );
  } else {
    return Row(
      key: key,
      mainAxisSize: MainAxisSize.min,
      children: <Widget>[
        Text(
          '${config.activeIndex! + 1}',
          style: TextStyle(color: activeColor, fontSize: activeFontSize),
        ),
        Text(
          ' / ${config.itemCount}',
          style: TextStyle(color: color, fontSize: fontSize),
        )
      ],
    );
  }
}