This commit is contained in:
2025-11-26 18:10:10 +09:00
parent 283f08786e
commit bf40c42c2c
43 changed files with 4454 additions and 971 deletions
+79 -3
View File
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:playwith_core/playwith_core.dart'; // AvatarWidget 포함됨
import 'package:url_launcher/url_launcher.dart'; // [추가] 링크 이동용
class SettingsScreen extends StatefulWidget {
const SettingsScreen({super.key});
@@ -24,6 +25,24 @@ class _SettingsScreenState extends State<SettingsScreen> {
super.dispose();
}
// [추가] 홈페이지 열기 함수
Future<void> _launchHomepage() async {
// 이동할 홈페이지 주소를 입력하세요
final Uri url = Uri.parse('https://lunaticbum.kr"');
try {
if (!await launchUrl(url, mode: LaunchMode.externalApplication)) {
throw Exception('Could not launch $url');
}
} catch (e) {
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text("페이지를 열 수 없습니다.")),
);
}
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -41,7 +60,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
// 아바타 변경 영역
GestureDetector(
onTap: () => _settings.pickProfileImage(),
child: Stack(
@@ -70,7 +88,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
const SizedBox(height: 20),
// 닉네임 입력
TextField(
controller: _nickController,
decoration: const InputDecoration(
@@ -83,7 +100,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
const SizedBox(height: 10),
// 기본 아바타 색상 선택 (이미지 없을 때 사용)
const Align(alignment: Alignment.centerLeft, child: Text("기본 배경색")),
const SizedBox(height: 5),
SingleChildScrollView(
@@ -171,6 +187,66 @@ class _SettingsScreenState extends State<SettingsScreen> {
),
),
),
const SizedBox(height: 20),
// 3. 개발자 옵션 (디버그 로그)
_buildSectionTitle("개발자 옵션"),
Card(
child: SwitchListTile(
title: const Text("디버그 로그 표시"),
subtitle: const Text("로비 화면 하단에 네트워크 로그를 표시합니다."),
value: _settings.isShowDebugLog,
onChanged: (val) => _settings.toggleDebugLog(val),
),
),
const SizedBox(height: 20),
// [추가] 4. 정보 섹션 (라이선스)
_buildSectionTitle("정보"),
Card(
child: ListTile(
leading: const Icon(Icons.description_outlined),
title: const Text("오픈소스 라이선스"),
subtitle: const Text("앱에 사용된 라이브러리 정보"),
trailing: const Icon(Icons.arrow_forward_ios, size: 16, color: Colors.grey),
onTap: () {
// 플러터 내장 라이선스 페이지 호출
showLicensePage(
context: context,
applicationName: "PlayWith",
applicationVersion: "1.0.0",
// applicationIcon: Image.asset('assets/icon.png', width: 50), // 아이콘이 있다면 주석 해제
);
},
),
),
const SizedBox(height: 40),
// [추가] 하단 카피라이트 & 링크
GestureDetector(
onTap: _launchHomepage,
child: Column(
children: const [
Text(
"© 2025 lunaticbum. All rights reserved.",
style: TextStyle(color: Colors.grey, fontSize: 12),
),
SizedBox(height: 4),
Text(
"https://lunaticbum.kr", // 보여줄 텍스트
style: TextStyle(
color: Colors.blueAccent,
fontSize: 12,
decoration: TextDecoration.underline
),
),
],
),
),
const SizedBox(height: 30),
],
);
},