defaultBuilder function
Implementation
List<Widget> defaultBuilder(BuildContext context, String? title,
String? subtitle, String? description, Color? color, Color? textColor) {
final _color = color != null ? color : Theme.of(context).primaryColor;
final List<Widget> content = [];
if (title != null) {
content.add(Container(
color: _color,
child: Padding(
padding: const EdgeInsets.all(16),
child: Text(
title,
textAlign: TextAlign.center,
style: Theme.of(context)
.textTheme
.labelLarge!
.copyWith(color: textColor),
),
),
));
}
if (subtitle != null || description != null) {
content.add(Padding(
padding: const EdgeInsets.only(bottom: 16.0, top: 16),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if (subtitle != null)
Text(
subtitle,
textAlign: TextAlign.center,
style: Theme.of(context)
.textTheme
.bodyLarge!
.copyWith(color: textColor),
),
if (description != null)
Text(
description,
textAlign: TextAlign.center,
style: Theme.of(context)
.textTheme
.bodyMedium!
.copyWith(color: textColor),
),
],
),
));
}
return content;
}