번역 평가 버튼 · 내 퀘스트 검토 버튼 · MY 질문 상세 · MY 완료 퀘스트 수 · 행성/성운 칸 · 라운지 빈 상태 수정
This commit is contained in:
@@ -9,7 +9,10 @@ import '../../core/ui/app_icons.dart';
|
||||
import '../auth/auth.dart';
|
||||
import '../auth/auth_repository.dart';
|
||||
import '../campaign/campaign_data.dart' show CampaignRepository;
|
||||
import '../galaxy/galaxy_data.dart';
|
||||
import '../galaxy/galaxy_home_screen.dart' show GalaxyHomeScreen;
|
||||
import '../inside/inside_data.dart' show InsideRepository;
|
||||
import '../translation/translation_data.dart' show TranslationRepository;
|
||||
import 'my_data.dart';
|
||||
import 'my_lists_screen.dart';
|
||||
import 'profile_edit_screen.dart';
|
||||
@@ -31,16 +34,24 @@ class MyScreen extends StatefulWidget {
|
||||
this.auth,
|
||||
this.campaigns,
|
||||
this.insides,
|
||||
this.translation,
|
||||
this.galaxy = const SampleGalaxyRepository(),
|
||||
});
|
||||
|
||||
final MyRepository repository;
|
||||
|
||||
/// 「행성/성운」 칸 — GALAXY 「내 행성」과 같은 가입 목록(`users/{uid}/memberships`)을 읽는다.
|
||||
final GalaxyRepository galaxy;
|
||||
|
||||
/// 「내 캠페인」이 읽는 저장소. null 이면 표본.
|
||||
final CampaignRepository? campaigns;
|
||||
|
||||
/// 「내 인사이드」가 읽는 저장소. null 이면 표본.
|
||||
final InsideRepository? insides;
|
||||
|
||||
/// 내 질문 상세의 번역 원천.
|
||||
final TranslationRepository? translation;
|
||||
|
||||
/// 설정 > SNS 연동으로 그대로 내려간다. null 이면 설정 화면이 표본을 쓴다.
|
||||
final AccountLinker? linker;
|
||||
|
||||
@@ -58,6 +69,7 @@ class MyScreen extends StatefulWidget {
|
||||
class _MyScreenState extends State<MyScreen> {
|
||||
MyProfile? _profile;
|
||||
FocusStatus? _focus;
|
||||
List<PlanetNode> _planets = const [];
|
||||
bool _claiming = false;
|
||||
|
||||
@override
|
||||
@@ -70,10 +82,16 @@ class _MyScreenState extends State<MyScreen> {
|
||||
final profile = await widget.repository.profile();
|
||||
// 구독 조회 실패로 MY 전체가 멈추지 않게 한다 — 카드만 빠진다.
|
||||
final focus = await widget.repository.focus().catchError((_) => null);
|
||||
// 행성 목록 실패도 칸만 비운다.
|
||||
final planets = await widget.galaxy
|
||||
.load()
|
||||
.then((s) => s.memberships.take(3).toList())
|
||||
.catchError((_) => const <PlanetNode>[]);
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_profile = profile;
|
||||
_focus = focus;
|
||||
_planets = planets;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -214,11 +232,9 @@ class _MyScreenState extends State<MyScreen> {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
for (final (i, img) in const [
|
||||
'assets/figma/my-planet-1.png',
|
||||
'assets/figma/my-planet-2.png',
|
||||
'assets/figma/my-planet-3.png',
|
||||
].indexed) ...[
|
||||
// 시안 세 칸 — 가입하거나 만든 행성/성운(최신 가입순). 그림은
|
||||
// GALAXY 「내 행성」과 같은 기준(팬덤 stage)이고, 모자라면 빈 칸이다.
|
||||
for (var i = 0; i < 3; i++) ...[
|
||||
if (i > 0) const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: AspectRatio(
|
||||
@@ -227,12 +243,23 @@ class _MyScreenState extends State<MyScreen> {
|
||||
// 칸 109 안에 행성 88 — 안쪽 10.5.
|
||||
padding: const EdgeInsets.all(10.5),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF2C2C2C),
|
||||
color: i < _planets.length
|
||||
? const Color(0xFF2C2C2C)
|
||||
: const Color(0x802C2C2C),
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppRadius.md,
|
||||
),
|
||||
),
|
||||
child: Image.asset(img, fit: BoxFit.contain),
|
||||
child: i < _planets.length
|
||||
? Image.asset(
|
||||
GalaxyHomeScreen.cardImageOf(
|
||||
_planets[i],
|
||||
i,
|
||||
),
|
||||
fit: BoxFit.contain,
|
||||
semanticLabel: _planets[i].name,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -259,6 +286,7 @@ class _MyScreenState extends State<MyScreen> {
|
||||
MyListsScreen(
|
||||
kind: MyListKind.inside,
|
||||
insides: widget.insides,
|
||||
translation: widget.translation,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -337,7 +365,9 @@ class _MyScreenState extends State<MyScreen> {
|
||||
),
|
||||
);
|
||||
} catch (_) {
|
||||
messenger.showSnackBar(SnackBar(content: Text(l10n.commonRequestFailed)));
|
||||
messenger.showSnackBar(
|
||||
SnackBar(content: Text(l10n.commonRequestFailed)),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
@@ -464,7 +494,11 @@ class _MyHeader extends StatelessWidget {
|
||||
/// `518:88748` 은 B-04 가 대체한 과거 안). 반영 화면이 `MY` 로 정해져 있어 통계 카드 아래에 둔다.
|
||||
/// 구독 중일 때만 보인다.
|
||||
class _FocusCard extends StatelessWidget {
|
||||
const _FocusCard({required this.focus, required this.busy, required this.onClaim});
|
||||
const _FocusCard({
|
||||
required this.focus,
|
||||
required this.busy,
|
||||
required this.onClaim,
|
||||
});
|
||||
|
||||
final FocusStatus focus;
|
||||
final bool busy;
|
||||
|
||||
Reference in New Issue
Block a user