Future<void>
showBadgePopup(
)
Implementation
Future<void> showBadgePopup(BuildContext context, UserBadge badge) {
return showDialog<void>(
context: context,
builder: (context) => AlertDialog(
icon: Icon(
badgeIconFromKey(badge.badgeIconKey),
size: 48,
color: Colors.amber,
),
title: Text(badge.badgeName ?? 'Badge Earned!'),
content: badge.badgeDescription != null
? Text(badge.badgeDescription!, textAlign: TextAlign.center)
: null,
actions: [
FilledButton(
onPressed: () => Navigator.pop(context),
child: const Text('Awesome!'),
),
],
actionsAlignment: MainAxisAlignment.center,
),
);
}