renderTab method
Widget
renderTab(
- ScrollController scrollController,
- Widget? widgetTitle,
- String? title,
- int? maxLineTitle,
- TextStyle? styleTitle,
- TextAlign? textAlignTitle,
- TextOverflow? textOverFlowTitle,
- EdgeInsets? marginTitle,
- Widget? widgetDescription,
- String? description,
- int? maxLineTextDescription,
- TextStyle? styleDescription,
- TextAlign? textAlignDescription,
- TextOverflow? textOverFlowDescription,
- EdgeInsets? marginDescription,
- String? pathImage,
- double? widthImage,
- double? heightImage,
- BoxFit? foregroundImageFit,
- Widget? centerWidget,
- void onCenterItemPress()?,
- Color? backgroundColor,
- Color? colorBegin,
- Color? colorEnd,
- AlignmentGeometry? directionColorBegin,
- AlignmentGeometry? directionColorEnd,
- String? backgroundImage,
- BoxFit? backgroundImageFit,
- String? backgroundNetworkImage,
- double? backgroundOpacity,
- Color? backgroundOpacityColor,
- 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,
),
);
}