buildTitleWidget function
Widget
buildTitleWidget(
- BuildContext context,
- DialogType dialogType,
- Color? primaryColor,
- Widget? customCenterWidget,
- double height,
- double width,
- String? centerImage,
- ShapeBorder? shape,
title for dialog
Implementation
Widget buildTitleWidget(
BuildContext context,
DialogType dialogType,
Color? primaryColor,
Widget? customCenterWidget,
double height,
double width,
String? centerImage,
ShapeBorder? shape,
) {
if (customCenterWidget != null) {
return Container(
child: customCenterWidget,
constraints: BoxConstraints(maxHeight: height, maxWidth: width),
);
} else {
if (centerImage != null) {
return Image.network(
centerImage,
height: height,
width: width,
fit: BoxFit.cover,
errorBuilder: (_, object, stack) {
log(object.toString());
return defaultPlaceHolder(
context,
dialogType,
height,
width,
primaryColor,
shape: shape,
);
},
loadingBuilder: (_, child, loadingProgress) {
if (loadingProgress == null) {
return child;
}
return defaultPlaceHolder(
context,
dialogType,
height,
width,
primaryColor,
shape: shape,
child: Loader(
value: loadingProgress.expectedTotalBytes != null
? loadingProgress.cumulativeBytesLoaded /
loadingProgress.expectedTotalBytes!
: null,
),
);
},
);
} else {
return defaultPlaceHolder(
context,
dialogType,
height,
width,
primaryColor,
shape: shape,
);
}
}
}