CustomNavigationBarItem.chats constructor
Constructs a CustomNavigationBarItem for a HomeTab.chats.
Implementation
CustomNavigationBarItem.chats({
Key? key,
String unread = '0',
bool danger = true,
GlobalKey? selector,
void Function(bool)? onMute,
}) : this._(
key: key,
tab: HomeTab.chats,
badge: unread == '' || unread == '0' ? null : unread,
danger: danger,
child: ContextMenuRegion(
key: const Key('ChatsButton'),
selector: selector,
alignment: Alignment.bottomCenter,
margin: const EdgeInsets.only(bottom: 16),
actions: [
if (danger)
ContextMenuTile(
key: const Key('MuteChatsButton'),
asset: SvgIcons.unmuted22,
label: 'btn_mute_chats'.l10n,
onPressed: (_) => onMute?.call(false),
)
else
ContextMenuTile(
key: const Key('UnmuteChatsButton'),
asset: SvgIcons.muted22,
label: 'btn_unmute_chats'.l10n,
onPressed: (_) => onMute?.call(true),
),
],
child: SafeAnimatedSwitcher(
key: selector,
duration: const Duration(milliseconds: 200),
child:
danger
? const SvgIcon(SvgIcons.chats, key: Key('Unmuted'))
: const SvgIcon(SvgIcons.chatsMuted, key: Key('Muted')),
),
),
);