buildUpgradeCard method
Build the UpgradeCard widget.
Implementation
Widget buildUpgradeCard(BuildContext context, Key? key) {
final appMessages = widget.upgrade.determineMessages(context);
final title = appMessages.message(HcUpgradeMessage.title);
final message = widget.upgrade.body(appMessages);
final releaseNotes = widget.upgrade.releaseNotes;
if (widget.upgrade.debugLogging) {
if (kDebugMode) {
print('hcUpgrade: UpgradeCard: will display');
print('hcUpgrade: UpgradeCard: showDialog title: $title');
print('hcUpgrade: UpgradeCard: showDialog message: $message');
print(
'hcUpgrade: UpgradeCard: shouldDisplayReleaseNotes: $shouldDisplayReleaseNotes');
print('hcUpgrade: UpgradeCard: showDialog releaseNotes: $releaseNotes');
}
}
Widget? notes;
if (shouldDisplayReleaseNotes && releaseNotes != null) {
notes = Padding(
padding: const EdgeInsets.only(top: 15.0),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(appMessages.message(HcUpgradeMessage.releaseNotes) ?? '',
style: const TextStyle(fontWeight: FontWeight.bold)),
Text(
releaseNotes,
maxLines: widget.maxLines,
overflow: widget.overflow,
),
],
));
}
return Card(
key: key,
margin: widget.margin,
child: HcAlertStyleWidget(
title: Text(title ?? ''),
content: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(message),
Padding(
padding: const EdgeInsets.only(top: 15.0),
child: Text(appMessages.message(HcUpgradeMessage.prompt) ?? '')),
if (notes != null) notes,
],
),
actions: actions(appMessages),
),
);
}