Mitra Profil: drop handle subtitle on WA/TG rows
User feedback — the wa.me/... and t.me/... subtitles under "Chat WhatsApp Kami" / "Chat Telegram Kami" leaked the raw URL into the UI. Just the label now, matching how typical "contact us" menu entries read. Tap still launches the deeplink from backend config. Drop the unused `SupportHandle.displayHandle` getter that produced the scheme-stripped subtitle — no other call site. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -47,7 +47,6 @@ class ProfilScreen extends ConsumerWidget {
|
|||||||
_ProfileCard(displayName: displayName, phone: phone),
|
_ProfileCard(displayName: displayName, phone: phone),
|
||||||
const SizedBox(height: 28),
|
const SizedBox(height: 28),
|
||||||
_MenuList(
|
_MenuList(
|
||||||
handles: handlesAsync.valueOrNull,
|
|
||||||
onTapWa: () => _launchHandle(context, handlesAsync.valueOrNull?.wa),
|
onTapWa: () => _launchHandle(context, handlesAsync.valueOrNull?.wa),
|
||||||
onTapTelegram: () => _launchHandle(context, handlesAsync.valueOrNull?.telegram),
|
onTapTelegram: () => _launchHandle(context, handlesAsync.valueOrNull?.telegram),
|
||||||
onTapTerms: () => _snack(context, 'Segera tersedia'),
|
onTapTerms: () => _snack(context, 'Segera tersedia'),
|
||||||
@@ -239,14 +238,12 @@ class _ProfileCard extends StatelessWidget {
|
|||||||
|
|
||||||
// ─── Menu list — WA + Telegram + Terms + Privacy ─────────────────────────
|
// ─── Menu list — WA + Telegram + Terms + Privacy ─────────────────────────
|
||||||
class _MenuList extends StatelessWidget {
|
class _MenuList extends StatelessWidget {
|
||||||
final SupportHandles? handles;
|
|
||||||
final VoidCallback onTapWa;
|
final VoidCallback onTapWa;
|
||||||
final VoidCallback onTapTelegram;
|
final VoidCallback onTapTelegram;
|
||||||
final VoidCallback onTapTerms;
|
final VoidCallback onTapTerms;
|
||||||
final VoidCallback onTapPrivacy;
|
final VoidCallback onTapPrivacy;
|
||||||
|
|
||||||
const _MenuList({
|
const _MenuList({
|
||||||
required this.handles,
|
|
||||||
required this.onTapWa,
|
required this.onTapWa,
|
||||||
required this.onTapTelegram,
|
required this.onTapTelegram,
|
||||||
required this.onTapTerms,
|
required this.onTapTerms,
|
||||||
@@ -255,22 +252,17 @@ class _MenuList extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final waSub = handles?.wa?.displayHandle ?? '';
|
|
||||||
final tgSub = handles?.telegram?.displayHandle ?? '';
|
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
_MenuTile(
|
_MenuTile(
|
||||||
icon: Icons.chat_bubble_outline,
|
icon: Icons.chat_bubble_outline,
|
||||||
label: 'Chat WhatsApp Kami',
|
label: 'Chat WhatsApp Kami',
|
||||||
subtitle: waSub.isEmpty ? null : waSub,
|
|
||||||
onTap: onTapWa,
|
onTap: onTapWa,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
_MenuTile(
|
_MenuTile(
|
||||||
icon: Icons.send_outlined,
|
icon: Icons.send_outlined,
|
||||||
label: 'Chat Telegram Kami',
|
label: 'Chat Telegram Kami',
|
||||||
subtitle: tgSub.isEmpty ? null : tgSub,
|
|
||||||
onTap: onTapTelegram,
|
onTap: onTapTelegram,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
|
|||||||
@@ -11,16 +11,6 @@ class SupportHandle {
|
|||||||
label: json['label'] as String? ?? '',
|
label: json['label'] as String? ?? '',
|
||||||
deeplink: json['deeplink'] as String? ?? '',
|
deeplink: json['deeplink'] as String? ?? '',
|
||||||
);
|
);
|
||||||
|
|
||||||
/// Display form for the menu subtitle: strip the URL scheme so
|
|
||||||
/// "https://wa.me/6285173310010" → "wa.me/6285173310010" and
|
|
||||||
/// "https://t.me/halobestie" → "t.me/halobestie". Falls back to the
|
|
||||||
/// raw deeplink when there's no scheme to strip.
|
|
||||||
String get displayHandle {
|
|
||||||
if (deeplink.isEmpty) return '';
|
|
||||||
final stripped = deeplink.replaceFirst(RegExp(r'^https?://'), '');
|
|
||||||
return stripped;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class SupportHandles {
|
class SupportHandles {
|
||||||
|
|||||||
Reference in New Issue
Block a user