INSIDE · STATION · 참여형 번역 · 알림 · MY 화면

This commit is contained in:
Sn-Kinos
2026-09-29 17:06:48 +09:00
parent 18afc9cb98
commit 3aca678072
31 changed files with 10046 additions and 25 deletions
@@ -0,0 +1,110 @@
import 'package:flutter/material.dart';
import '../../core/theme/tokens.dart';
import 'station_data.dart';
import '../../core/i18n/app_locale.dart';
/// 판매처 제안 — S-S-SUGGEST.
///
/// 제안은 `stationSuggestions` 에 `status: 'pending'` 으로 들어가고 운영이 심사한다.
/// 보안 규칙이 생성 시 status 를 pending 으로 못박고 있으므로(§7), 화면이 다른 값을
/// 보내면 거부당한다. 등록 경로는 6주차에 잇는다.
class StationSuggestScreen extends StatefulWidget {
const StationSuggestScreen({super.key});
@override
State<StationSuggestScreen> createState() => _StationSuggestScreenState();
}
class _StationSuggestScreenState extends State<StationSuggestScreen> {
final _form = GlobalKey<FormState>();
final _title = TextEditingController();
final _url = TextEditingController();
final _reason = TextEditingController();
StationCategory _category = StationCategory.shop;
@override
void dispose() {
_title.dispose();
_url.dispose();
_reason.dispose();
super.dispose();
}
void _submit() {
if (!(_form.currentState?.validate() ?? false)) return;
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(context.l10n.stationSuggestLater)),
);
}
@override
Widget build(BuildContext context) {
final t = Theme.of(context).textTheme;
return Scaffold(
appBar: AppBar(
title: Text(context.l10n.stationSuggest),
actions: [TextButton(onPressed: _submit, child: Text(context.l10n.commonSubmit))],
),
body: Form(
key: _form,
child: ListView(
padding: const EdgeInsets.all(AppSpace.s4),
children: [
TextFormField(
controller: _title,
decoration: InputDecoration(labelText: context.l10n.commonName),
maxLength: 40,
validator: (v) =>
(v ?? '').trim().isEmpty ? context.l10n.commonNameRequired : null,
),
const SizedBox(height: AppSpace.s3),
TextFormField(
controller: _url,
decoration: InputDecoration(
labelText: context.l10n.commonUrl,
hintText: 'https://',
),
keyboardType: TextInputType.url,
validator: (v) {
final raw = (v ?? '').trim();
if (raw.isEmpty) return context.l10n.commonUrlRequired;
final uri = Uri.tryParse(raw);
// http 도 막는다. 검증한 판매처를 평문으로 안내할 이유가 없다.
if (uri == null || uri.scheme != 'https' || uri.host.isEmpty) {
return context.l10n.commonUrlHttps;
}
return null;
},
),
const SizedBox(height: AppSpace.s3),
DropdownButtonFormField<StationCategory>(
initialValue: _category,
decoration: InputDecoration(labelText: context.l10n.commonCategory),
items: [
for (final c in StationCategory.values)
DropdownMenuItem(value: c, child: Text(c.label)),
],
onChanged: (v) => setState(() => _category = v ?? _category),
),
const SizedBox(height: AppSpace.s3),
TextFormField(
controller: _reason,
decoration: InputDecoration(
labelText: context.l10n.stationReason,
alignLabelWithHint: true,
),
maxLines: 5,
maxLength: 500,
),
const SizedBox(height: AppSpace.s5),
Text(
context.l10n.stationSuggestNote,
style: t.bodySmall,
),
],
),
),
);
}
}