로그인 · 회원가입 흐름을 서버 계정·약관 동의와 연결
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../core/i18n/app_locale.dart';
|
||||
import '../../core/theme/tokens.dart';
|
||||
|
||||
/// 회원가입 약관 — Figma `179:24230`(미동의) · `179:24324`(전체 동의).
|
||||
@@ -16,16 +17,22 @@ class TermsScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
enum _Term {
|
||||
service('서비스 이용약관 (필수)', required: true, body: true),
|
||||
location('위치기반 서비스 이용약관 (필수)', required: true, body: true),
|
||||
age('만 14세 이상입니다. (필수)', required: true, body: false),
|
||||
marketing('마케팅 정보 및 이벤트 알림 수신 동의 (선택)', required: false, body: true);
|
||||
service(required: true, body: true),
|
||||
location(required: true, body: true),
|
||||
age(required: true, body: false),
|
||||
marketing(required: false, body: true);
|
||||
|
||||
const _Term(this.label, {required this.required, required this.body});
|
||||
const _Term({required this.required, required this.body});
|
||||
|
||||
final String label;
|
||||
final bool required;
|
||||
final bool body;
|
||||
|
||||
String label(AppLocalizations l10n) => switch (this) {
|
||||
service => l10n.termsService,
|
||||
location => l10n.termsLocation,
|
||||
age => l10n.termsAge,
|
||||
marketing => l10n.termsMarketing,
|
||||
};
|
||||
}
|
||||
|
||||
const _body =
|
||||
@@ -47,13 +54,13 @@ class _TermsScreenState extends State<TermsScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('이용 약관')),
|
||||
appBar: AppBar(title: Text(context.l10n.termsTitle)),
|
||||
body: ListView(
|
||||
padding: const EdgeInsets.all(AppSpace.s4),
|
||||
children: [
|
||||
_Box(
|
||||
child: _CheckRow(
|
||||
label: '전체 동의',
|
||||
label: context.l10n.termsAgreeAll,
|
||||
checked: _all,
|
||||
size: 16,
|
||||
onTap: () => setState(
|
||||
@@ -74,7 +81,7 @@ class _TermsScreenState extends State<TermsScreen> {
|
||||
border: Border(bottom: BorderSide(color: _stroke)),
|
||||
),
|
||||
child: _CheckRow(
|
||||
label: t.label,
|
||||
label: t.label(context.l10n),
|
||||
checked: _agreed.contains(t),
|
||||
onTap: () => _toggle(t),
|
||||
),
|
||||
@@ -102,7 +109,7 @@ class _TermsScreenState extends State<TermsScreen> {
|
||||
],
|
||||
)
|
||||
: _CheckRow(
|
||||
label: t.label,
|
||||
label: t.label(context.l10n),
|
||||
checked: _agreed.contains(t),
|
||||
onTap: () => _toggle(t),
|
||||
),
|
||||
@@ -118,7 +125,7 @@ class _TermsScreenState extends State<TermsScreen> {
|
||||
backgroundColor: Colors.black,
|
||||
foregroundColor: AppColors.onCosmic,
|
||||
),
|
||||
child: const Text('이전'),
|
||||
child: Text(context.l10n.commonPrev),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
@@ -133,7 +140,7 @@ class _TermsScreenState extends State<TermsScreen> {
|
||||
disabledBackgroundColor: const Color(0xFF333333),
|
||||
disabledForegroundColor: const Color(0xFF777777),
|
||||
),
|
||||
child: const Text('완료'),
|
||||
child: Text(context.l10n.commonDone),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -206,12 +213,12 @@ class _CheckRow extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
/// 회원가입 완료 — Figma `182:29344`. 「시작」은 이 화면을 닫는다.
|
||||
///
|
||||
/// 아직 가입 동선에 걸려 있지 않다. 제공자 인증이 성공하면 라우터 redirect 가 곧장 셸로
|
||||
/// 보내므로, 이 화면을 끼우려면 redirect 가 「가입 직후」를 알아야 한다(app_router 공유 변경).
|
||||
/// 회원가입 완료 — Figma `182:29344`. 가입 직후 라우터 redirect 가 한 번 띄우고
|
||||
/// ([AuthRepository.justSignedUp]), 「시작」은 [onStart] 로 셸에 들어간다.
|
||||
class SignupCompleteScreen extends StatelessWidget {
|
||||
const SignupCompleteScreen({super.key});
|
||||
const SignupCompleteScreen({super.key, this.onStart});
|
||||
|
||||
final VoidCallback? onStart;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -238,8 +245,8 @@ class SignupCompleteScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: AppSpace.s6),
|
||||
const Text(
|
||||
'회원가입이 완료되었습니다',
|
||||
Text(
|
||||
context.l10n.signupDoneTitle,
|
||||
style: TextStyle(
|
||||
fontFamily: AppFonts.body,
|
||||
fontSize: 24,
|
||||
@@ -250,7 +257,7 @@ class SignupCompleteScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: AppSpace.s3),
|
||||
Text(
|
||||
'팬덤 활동을 시작할 수 있습니다.\n다양한 활동을 통해 내 팬덤 행성을 키워보세요.',
|
||||
context.l10n.signupDoneBody,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontFamily: AppFonts.display,
|
||||
@@ -267,12 +274,12 @@ class SignupCompleteScreen extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: AppSpace.s4),
|
||||
child: FilledButton(
|
||||
onPressed: () => Navigator.of(context).maybePop(),
|
||||
onPressed: onStart ?? () => Navigator.of(context).maybePop(),
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: AppColors.cosmicAccent,
|
||||
foregroundColor: AppColors.onCosmicAccent,
|
||||
),
|
||||
child: const Text('시작'),
|
||||
child: Text(context.l10n.commonStart),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user