로그인을 Figma 2단계(로그인 → 간편 로그인)로 · 회원가입 · 약관 동의 · 가입 완료 화면

This commit is contained in:
Sn-Kinos
2026-09-27 21:22:02 +09:00
parent 388ea4227c
commit 735bdb76b3
14 changed files with 729 additions and 218 deletions
+283
View File
@@ -0,0 +1,283 @@
import 'package:flutter/material.dart';
import '../../core/theme/tokens.dart';
/// 회원가입 약관 — Figma `179:24230`(미동의) · `179:24324`(전체 동의).
///
/// 필수 3항(서비스 · 위치기반 · 만 14세)을 모두 체크해야 「완료」가 켜진다. 완료하면 `true` 를
/// 돌려주고, 부른 쪽([SimpleLoginScreen] 가입 모드)이 제공자 인증으로 넘어간다.
///
/// 약관 본문은 시안의 자리 표시 문구다. 확정 약관이 오면 [_body] 만 바꾼다.
class TermsScreen extends StatefulWidget {
const TermsScreen({super.key});
@override
State<TermsScreen> createState() => _TermsScreenState();
}
enum _Term {
service('서비스 이용약관 (필수)', required: true, body: true),
location('위치기반 서비스 이용약관 (필수)', required: true, body: true),
age('만 14세 이상입니다. (필수)', required: true, body: false),
marketing('마케팅 정보 및 이벤트 알림 수신 동의 (선택)', required: false, body: true);
const _Term(this.label, {required this.required, required this.body});
final String label;
final bool required;
final bool body;
}
const _body =
'FANUZU 서비스 이용약관\n\n제1조 (적용범위)\n서비스 이용약관에 대한 더미 텍스트 입니다.\n'
'추후 작성해주시기 바랍니다. 서비스 이용약관에 대한 더미 텍스트 입니다.';
const _stroke = Color(0xFF545454);
class _TermsScreenState extends State<TermsScreen> {
final _agreed = <_Term>{};
bool get _all => _agreed.length == _Term.values.length;
bool get _ready =>
_Term.values.where((t) => t.required).every(_agreed.contains);
void _toggle(_Term t) =>
setState(() => _agreed.contains(t) ? _agreed.remove(t) : _agreed.add(t));
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('이용 약관')),
body: ListView(
padding: const EdgeInsets.all(AppSpace.s4),
children: [
_Box(
child: _CheckRow(
label: '전체 동의',
checked: _all,
size: 16,
onTap: () => setState(
() => _all ? _agreed.clear() : _agreed.addAll(_Term.values),
),
),
),
for (final t in _Term.values) ...[
const SizedBox(height: AppSpace.s3),
_Box(
child: t.body
? Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Container(
// 시안 획은 안쪽이다 — decoration 이면 획 두께만큼 높이가 는다.
foregroundDecoration: const BoxDecoration(
border: Border(bottom: BorderSide(color: _stroke)),
),
child: _CheckRow(
label: t.label,
checked: _agreed.contains(t),
onTap: () => _toggle(t),
),
),
const Padding(
padding: EdgeInsets.symmetric(vertical: AppSpace.s4),
child: SizedBox(
height: 80,
child: ClipRect(
child: Text(
_body,
overflow: TextOverflow.clip,
style: TextStyle(
fontFamily: AppFonts.display,
fontFamilyFallback: [AppFonts.body],
fontSize: 12,
height: 1.36,
letterSpacing: -0.3,
color: AppColors.onCosmic,
),
),
),
),
),
],
)
: _CheckRow(
label: t.label,
checked: _agreed.contains(t),
onTap: () => _toggle(t),
),
),
],
const SizedBox(height: AppSpace.s6),
Row(
children: [
Expanded(
child: FilledButton(
onPressed: () => Navigator.of(context).pop(false),
style: FilledButton.styleFrom(
backgroundColor: Colors.black,
foregroundColor: AppColors.onCosmic,
),
child: const Text('이전'),
),
),
const SizedBox(width: 10),
Expanded(
child: FilledButton(
onPressed: _ready
? () => Navigator.of(context).pop(true)
: null,
style: FilledButton.styleFrom(
backgroundColor: AppColors.cosmicAccent,
foregroundColor: AppColors.onCosmicAccent,
disabledBackgroundColor: const Color(0xFF333333),
disabledForegroundColor: const Color(0xFF777777),
),
child: const Text('완료'),
),
),
],
),
],
),
);
}
}
/// 약관 칸 — #545454 획 · 모서리 8 · 좌우 16.
class _Box extends StatelessWidget {
const _Box({required this.child});
final Widget child;
@override
Widget build(BuildContext context) => Container(
padding: const EdgeInsets.symmetric(horizontal: AppSpace.s4),
foregroundDecoration: BoxDecoration(
border: Border.all(color: _stroke),
borderRadius: BorderRadius.circular(AppRadius.sm),
),
child: child,
);
}
/// 체크 행 — circle-check 20 · 간격 16 · ABeeZee. 미동의는 #767676, 동의는 핑크.
class _CheckRow extends StatelessWidget {
const _CheckRow({
required this.label,
required this.checked,
required this.onTap,
this.size = 14,
});
final String label;
final bool checked;
final VoidCallback onTap;
final double size;
@override
Widget build(BuildContext context) => InkWell(
onTap: onTap,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: AppSpace.s4),
child: Row(
children: [
ImageIcon(
const AssetImage('assets/icons/circle_check.png'),
size: 20,
color: checked ? AppColors.cosmicAccent : AppColors.onCosmicMuted,
),
const SizedBox(width: AppSpace.s4),
Expanded(
child: Text(
label,
style: TextStyle(
fontFamily: AppFonts.display,
fontFamilyFallback: const [AppFonts.body],
fontSize: size,
height: size == 16 ? 24 / 16 : 20 / 14,
color: AppColors.onCosmic,
),
),
),
],
),
),
);
}
/// 회원가입 완료 — Figma `182:29344`. 「시작」은 이 화면을 닫는다.
///
/// 아직 가입 동선에 걸려 있지 않다. 제공자 인증이 성공하면 라우터 redirect 가 곧장 셸로
/// 보내므로, 이 화면을 끼우려면 redirect 가 「가입 직후」를 알아야 한다(app_router 공유 변경).
class SignupCompleteScreen extends StatelessWidget {
const SignupCompleteScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Padding(
padding: EdgeInsets.all(20),
child: SizedBox.square(
dimension: 120,
child: DecoratedBox(
decoration: BoxDecoration(
color: AppColors.cosmicAccent,
shape: BoxShape.circle,
),
),
),
),
const SizedBox(height: AppSpace.s6),
const Text(
'회원가입이 완료되었습니다',
style: TextStyle(
fontFamily: AppFonts.body,
fontSize: 24,
fontWeight: FontWeight.w600,
height: 1,
color: AppColors.onCosmic,
),
),
const SizedBox(height: AppSpace.s3),
Text(
'팬덤 활동을 시작할 수 있습니다.\n다양한 활동을 통해 내 팬덤 행성을 키워보세요.',
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: AppFonts.display,
fontFamilyFallback: const [AppFonts.body],
fontSize: 14,
height: 24 / 14,
color: const Color(0xFFCDCDCD),
),
),
],
),
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: AppSpace.s4),
child: FilledButton(
onPressed: () => Navigator.of(context).maybePop(),
style: FilledButton.styleFrom(
backgroundColor: AppColors.cosmicAccent,
foregroundColor: AppColors.onCosmicAccent,
),
child: const Text('시작'),
),
),
],
),
),
);
}
}