Skip to content

Commit 1d588ba

Browse files
committed
fix: always allow navigation to voicemail screen regardless of feature support
Previously the settings tile was disabled with reduced opacity when voicemail was not configured, which was confusing. Now the tile is always tappable and the voicemail screen shows a placeholder explaining the reason.
1 parent aa87655 commit 1d588ba

1 file changed

Lines changed: 9 additions & 20 deletions

File tree

lib/features/settings/view/settings_screen.dart

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -136,27 +136,16 @@ class SettingsScreen extends StatelessWidget {
136136
onTap: () => _onItemTap(context, item),
137137
),
138138
] else if (item.flavor == SettingsFlavor.voicemail) ...[
139-
BlocBuilder<VoicemailCubit, VoicemailState>(
140-
builder: (context, voicemailState) {
141-
return SettingsTile(
142-
title: context.parseL10n(item.titleL10n),
143-
icon: item.icon,
144-
iconColor: item.iconColor ?? effectiveStyle?.leadingIconsColor,
145-
trailing: !voicemailState.isFeatureNotSupported ? UnreadBadge(count: state.unreadVoicemailCount) : null,
146-
textStyle: effectiveStyle?.itemTextStyle,
147-
showSeparator: showSeparators,
148-
onTap: () => !voicemailState.isFeatureNotSupported ? _onItemTap(context, item) : {
149-
ScaffoldMessenger.of(
150-
context,
151-
).showSnackBar(SnackBar(content: Text(context.l10n.voicemail_Snackbar_notConfigured)))
152-
},
153-
enabled: !voicemailState.isFeatureNotSupported,
154-
opacity: voicemailState.isFeatureNotSupported ? 0.4 : 1.0,
155-
);
156-
},
139+
SettingsTile(
140+
title: context.parseL10n(item.titleL10n),
141+
icon: item.icon,
142+
iconColor: item.iconColor ?? effectiveStyle?.leadingIconsColor,
143+
trailing: UnreadBadge(count: state.unreadVoicemailCount),
144+
textStyle: effectiveStyle?.itemTextStyle,
145+
showSeparator: showSeparators,
146+
onTap: () => _onItemTap(context, item),
157147
),
158-
]
159-
else
148+
] else
160149
SettingsTile(
161150
title: context.parseL10n(item.titleL10n),
162151
icon: item.icon,

0 commit comments

Comments
 (0)