build method

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

Implementation

@override
Widget build(BuildContext context, SwiperPluginConfig config) {
  Widget child;
  if (Axis.vertical == config.scrollDirection) {
    child = Column(
      key: key,
      mainAxisSize: MainAxisSize.min,
      children: <Widget>[
        Text(
          '${config.activeIndex + 1}',
          style: activeTextStyle,
        ),
        Text(
          '/',
          style: textStyle,
        ),
        Text(
          '${config.itemCount}',
          style: textStyle,
        )
      ],
    );
  } else {
    child = Row(
      key: key,
      mainAxisSize: MainAxisSize.min,
      children: <Widget>[
        Text(
          '${config.activeIndex + 1}',
          style: activeTextStyle,
        ),
        Text(
          '/${config.itemCount}',
          style: textStyle,
        )
      ],
    );
  }
  return Container(
    width: width ?? 37,
    height: height ?? 20,
    alignment: Alignment.center,
    decoration: BoxDecoration(
        color: backgroundColor ?? const Color(0x66000000),
        borderRadius: BorderRadius.circular(borderRadius ?? 10)),
    child: child,
  );
}