MenuButton.tab constructor
MenuButton.tab( - ProfileTab tab, {
- Key? key,
- bool inverted = false,
- void onPressed()?,
})
Implementation
MenuButton.tab(
ProfileTab tab, {
Key? key,
this.inverted = false,
this.onPressed,
}) : icon = null,
title = tab.l10n,
subtitle = switch (tab) {
ProfileTab.public => 'label_public_section_hint'.l10n,
ProfileTab.signing => 'label_login_section_hint'.l10n,
ProfileTab.link => 'label_your_direct_link'.l10n,
ProfileTab.media => 'label_media_section_hint'.l10n,
ProfileTab.welcome => 'label_welcome_message_hint'.l10n,
ProfileTab.notifications => 'label_mute_or_unmute_chats'.l10n,
ProfileTab.storage => 'label_set_cache_limits'.l10n,
ProfileTab.confidential => 'label_blocked_users'.l10n,
ProfileTab.interface => 'label_language_and_background'.l10n,
ProfileTab.devices => 'label_active_sessions'.l10n,
ProfileTab.download => 'label_ios_android_windows_macos_linux'.l10n,
ProfileTab.danger => 'label_delete_account'.l10n,
ProfileTab.legal => 'label_terms_and_privacy_policy'.l10n,
ProfileTab.support => null,
ProfileTab.logout => null,
},
leading = switch (tab) {
ProfileTab.public => const SvgIcon(SvgIcons.menuProfile),
ProfileTab.signing => const SvgIcon(SvgIcons.menuSigning),
ProfileTab.link => const SvgIcon(SvgIcons.menuLink),
ProfileTab.interface => const SvgIcon(SvgIcons.menuBackground),
ProfileTab.media => const SvgIcon(SvgIcons.menuMedia),
ProfileTab.welcome => const SvgIcon(SvgIcons.menuWelcome),
ProfileTab.notifications => const SvgIcon(SvgIcons.menuNotifications),
ProfileTab.storage => const SvgIcon(SvgIcons.menuStorage),
ProfileTab.confidential => const SvgIcon(SvgIcons.menuConfidentiality),
ProfileTab.devices => const SvgIcon(SvgIcons.menuDevices),
ProfileTab.download => const SvgIcon(SvgIcons.menuDownload),
ProfileTab.danger => const SvgIcon(SvgIcons.menuDanger),
ProfileTab.legal => const SvgIcon(SvgIcons.menuLegal),
ProfileTab.support => const SvgIcon(SvgIcons.menuSupport),
ProfileTab.logout => const SvgIcon(SvgIcons.menuLogout),
},
super(
key:
key ??
switch (tab) {
ProfileTab.public => const Key('PublicInformation'),
ProfileTab.signing => const Key('Signing'),
ProfileTab.link => const Key('Link'),
ProfileTab.interface => const Key('Interface'),
ProfileTab.media => const Key('Media'),
ProfileTab.welcome => const Key('WelcomeMessage'),
ProfileTab.notifications => const Key('Notifications'),
ProfileTab.storage => const Key('Storage'),
ProfileTab.confidential => const Key('Blocklist'),
ProfileTab.devices => const Key('Devices'),
ProfileTab.download => const Key('Download'),
ProfileTab.danger => const Key('DangerZone'),
ProfileTab.legal => const Key('Legal'),
ProfileTab.support => const Key('Support'),
ProfileTab.logout => const Key('LogoutButton'),
},
);