renderTab method

Widget renderTab(
  1. ScrollController scrollController,
  2. Widget? widgetTitle,
  3. String? title,
  4. int? maxLineTitle,
  5. TextStyle? styleTitle,
  6. TextAlign? textAlignTitle,
  7. TextOverflow? textOverFlowTitle,
  8. EdgeInsets? marginTitle,
  9. Widget? widgetDescription,
  10. String? description,
  11. int? maxLineTextDescription,
  12. TextStyle? styleDescription,
  13. TextAlign? textAlignDescription,
  14. TextOverflow? textOverFlowDescription,
  15. EdgeInsets? marginDescription,
  16. String? pathImage,
  17. double? widthImage,
  18. double? heightImage,
  19. BoxFit? foregroundImageFit,
  20. Widget? centerWidget,
  21. void onCenterItemPress()?,
  22. Color? backgroundColor,
  23. Color? colorBegin,
  24. Color? colorEnd,
  25. AlignmentGeometry? directionColorBegin,
  26. AlignmentGeometry? directionColorEnd,
  27. String? backgroundImage,
  28. BoxFit? backgroundImageFit,
  29. String? backgroundNetworkImage,
  30. double? backgroundOpacity,
  31. Color? backgroundOpacityColor,
  32. BlendMode? backgroundBlendMode,
)

Implementation

Widget renderTab(
  ScrollController scrollController,

  // Title
  Widget? widgetTitle,
  String? title,
  int? maxLineTitle,
  TextStyle? styleTitle,
  TextAlign? textAlignTitle,
  TextOverflow? textOverFlowTitle,
  EdgeInsets? marginTitle,

  // Description
  Widget? widgetDescription,
  String? description,
  int? maxLineTextDescription,
  TextStyle? styleDescription,
  TextAlign? textAlignDescription,
  TextOverflow? textOverFlowDescription,
  EdgeInsets? marginDescription,

  // Image
  String? pathImage,
  double? widthImage,
  double? heightImage,
  BoxFit? foregroundImageFit,

  // Center Widget
  Widget? centerWidget,
  void Function()? onCenterItemPress,

  // Background color
  Color? backgroundColor,
  Color? colorBegin,
  Color? colorEnd,
  AlignmentGeometry? directionColorBegin,
  AlignmentGeometry? directionColorEnd,

  // Background image
  String? backgroundImage,
  BoxFit? backgroundImageFit,
  String? backgroundNetworkImage,
  double? backgroundOpacity,
  Color? backgroundOpacityColor,
  BlendMode? backgroundBlendMode,
) {
  final listView = ListView(
    controller: scrollController,
    children: <Widget>[
      Container(
        // Title
        margin: marginTitle ??
            const EdgeInsets.only(
                top: 70.0, bottom: 50.0, left: 20.0, right: 20.0),
        child: widgetTitle ??
            Text(
              title ?? '',
              style: styleTitle ??
                  const TextStyle(
                    color: Colors.white,
                    fontWeight: FontWeight.bold,
                    fontSize: 30.0,
                  ),
              maxLines: maxLineTitle ?? 1,
              textAlign: textAlignTitle ?? TextAlign.center,
              overflow: textOverFlowTitle ?? TextOverflow.ellipsis,
            ),
      ),

      // Image or Center widget
      GestureDetector(
        onTap: onCenterItemPress,
        child: pathImage != null
            ? Image.asset(
                pathImage,
                width: widthImage ?? 200.0,
                height: heightImage ?? 200.0,
                fit: foregroundImageFit ?? BoxFit.contain,
              )
            : Center(child: centerWidget ?? Container()),
      ),

      // Description
      Container(
        margin: marginDescription ??
            const EdgeInsets.fromLTRB(20.0, 50.0, 20.0, 50.0),
        child: widgetDescription ??
            Text(
              description ?? '',
              style: styleDescription ??
                  const TextStyle(color: Colors.white, fontSize: 18.0),
              textAlign: textAlignDescription ?? TextAlign.center,
              maxLines: maxLineTextDescription ?? 100,
              overflow: textOverFlowDescription ?? TextOverflow.ellipsis,
            ),
      ),
    ],
  );
  return Container(
    width: double.infinity,
    height: double.infinity,
    decoration: backgroundImage == null && backgroundNetworkImage == null
        ? BoxDecoration(
            gradient: LinearGradient(
              colors: backgroundColor != null
                  ? [backgroundColor, backgroundColor]
                  : [
                      colorBegin ?? Colors.transparent,
                      colorEnd ?? Colors.transparent,
                    ],
              begin: directionColorBegin ?? Alignment.topLeft,
              end: directionColorEnd ?? Alignment.bottomRight,
            ),
          )
        : BoxDecoration(
            image: DecorationImage(
            image: backgroundImage != null
                ? AssetImage(backgroundImage)
                : NetworkImage(backgroundNetworkImage!) as ImageProvider,
            fit: backgroundImageFit ?? BoxFit.cover,
            colorFilter: ColorFilter.mode(
              backgroundOpacityColor != null
                  ? backgroundOpacityColor
                      .withOpacity(backgroundOpacity ?? 0.5)
                  : Colors.black.withOpacity(backgroundOpacity ?? 0.5),
              backgroundBlendMode ?? BlendMode.darken,
            ),
          )),
    child: Container(
      margin: EdgeInsets.only(
        top: widget.navPosition == IntroSliderNavPosition.top ? 60 : 0,
        bottom: widget.navPosition == IntroSliderNavPosition.bottom ? 60 : 0,
      ),
      child: verticalScrollbarBehavior != ScrollbarBehavior.HIDE
          ? Platform.isIOS
              ? CupertinoScrollbar(
                  controller: scrollController,
                  thumbVisibility: verticalScrollbarBehavior ==
                      ScrollbarBehavior.SHOW_ALWAYS,
                  child: listView,
                )
              : Scrollbar(
                  controller: scrollController,
                  thumbVisibility: verticalScrollbarBehavior ==
                      ScrollbarBehavior.SHOW_ALWAYS,
                  child: listView,
                )
          : listView,
    ),
  );
}