build method
- dynamic context,
- dynamic ref
Implementation
@override
Widget build(BuildContext context, WidgetRef ref) {
return Card(
margin: const EdgeInsets.symmetric(vertical: 2, horizontal: 15),
child: ListTile(
leading: isConfirmed
? Icon(
Atlas.envelope_check_thin,
color: Theme.of(context).colorScheme.success,
)
: const Icon(Atlas.envelope_minus_thin),
title: Text(emailAddress),
trailing: isConfirmed
? PopupMenuButton(
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
PopupMenuItem(
onTap: () => onUnregister(context, ref),
child: Row(
children: [
const Icon(Atlas.trash_can_thin),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Text(
L10n.of(context).remove,
style: Theme.of(context).textTheme.labelSmall,
softWrap: false,
),
),
],
),
),
],
)
: SizedBox(
child: Wrap(
children: [
IconButton(
key: Key('$emailAddress-already-confirmed-btn'),
onPressed: () => alreadyConfirmedAddress(context, ref),
icon: const Icon(Atlas.envelope_check_thin),
),
PopupMenuButton(
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
PopupMenuItem(
onTap: () => alreadyConfirmedAddress(context, ref),
child: Row(
children: [
const Icon(Atlas.envelope_check_thin),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
),
child: Text(L10n.of(context).alreadyConfirmed),
),
],
),
),
PopupMenuItem(
onTap: () => confirmationTokenAddress(context, ref),
child: Row(
children: [
const Icon(Atlas.passcode_thin),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
),
child: Text(L10n.of(context).confirmWithToken),
),
],
),
),
PopupMenuItem(
onTap: () => onUnregister(context, ref),
child: Row(
children: [
const Icon(Atlas.trash_can_thin),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
),
child: Text(
L10n.of(context).remove,
style: Theme.of(context).textTheme.labelSmall,
softWrap: false,
),
),
],
),
),
],
),
],
),
),
),
);
}