사용자 화면 문구·표본 데이터 · 퀘스트 참여 흐름 · HOME 진입 구획 · 미니맵 · 공통 확인 창 배치 수정
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
import '../../../core/format.dart';
|
||||
import '../../../core/theme/tokens.dart';
|
||||
import '../../../core/ui/app_icons.dart';
|
||||
import '../my_data.dart';
|
||||
import 'my_cards.dart';
|
||||
import '../../../core/i18n/app_locale.dart';
|
||||
import '../../campaign/campaign_share.dart' show shareHashtags;
|
||||
|
||||
/// 프로필 카드 오버레이 — 시안 `374:15738`(명세 `549:22058`).
|
||||
///
|
||||
@@ -17,11 +21,12 @@ class ProfileCard extends StatelessWidget {
|
||||
final void Function(String target) onShare;
|
||||
|
||||
/// 공유 대상과 시안 아이콘. 명세가 적은 순서 그대로다.
|
||||
/// 프로필 웹 주소가 아직 없어 마지막 칸은 「링크 복사」가 아니라 「문구 복사」다.
|
||||
static List<String> get shareTargets => [
|
||||
appL10n.shareInstagram,
|
||||
appL10n.shareTiktok,
|
||||
'X',
|
||||
appL10n.shareCopyLink,
|
||||
appL10n.shareCopyText,
|
||||
];
|
||||
static const _shareIcons = [
|
||||
'assets/figma/share-instagram.png',
|
||||
@@ -106,3 +111,29 @@ class ProfileCard extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// 프로필 공유 문구 — 공유 시트와 복사가 같은 문구를 쓴다.
|
||||
String profileShareText(MyProfile profile, [AppLocalizations? l10n]) => [
|
||||
(l10n ?? appL10n).myShareText(
|
||||
profile.nickname,
|
||||
'${profile.userLevel}',
|
||||
formatPop(profile.contributedPop),
|
||||
),
|
||||
shareHashtags().join(' '),
|
||||
].join('\n');
|
||||
|
||||
/// 프로필 카드 공유. 앱별 전용 SDK 없이 OS 공유 시트로 보내고(사용자가 그 안에서
|
||||
/// 인스타 · 틱톡 · X 를 고른다), 마지막 칸은 문구를 복사한다. 복사했으면 true.
|
||||
Future<bool> shareProfile(
|
||||
MyProfile profile,
|
||||
String target, {
|
||||
Future<ShareResult> Function(ShareParams)? share,
|
||||
}) async {
|
||||
final text = profileShareText(profile);
|
||||
if (target == ProfileCard.shareTargets.last) {
|
||||
await Clipboard.setData(ClipboardData(text: text));
|
||||
return true;
|
||||
}
|
||||
await (share ?? SharePlus.instance.share)(ShareParams(text: text));
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user