i8n누락 사항 추가 적용
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
// Material 3 기반 다이얼로그
|
||||
import '../common/buttons/primary_button.dart';
|
||||
import '../common/buttons/secondary_button.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
|
||||
/// 삭제 확인 다이얼로그
|
||||
/// 글래스모피즘 스타일의 삭제 확인 다이얼로그입니다.
|
||||
@@ -15,8 +16,20 @@ class DeleteConfirmationDialog extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final loc = AppLocalizations.of(context);
|
||||
final textThemeColor = Theme.of(context).colorScheme;
|
||||
final baseMessageStyle = TextStyle(
|
||||
fontSize: 16,
|
||||
color: textThemeColor.onSurfaceVariant,
|
||||
height: 1.5,
|
||||
);
|
||||
final highlightStyle = baseMessageStyle.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: textThemeColor.onSurface,
|
||||
);
|
||||
|
||||
return Dialog(
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
backgroundColor: textThemeColor.surface,
|
||||
elevation: 6,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)),
|
||||
child: Container(
|
||||
@@ -44,11 +57,11 @@ class DeleteConfirmationDialog extends StatelessWidget {
|
||||
|
||||
// 타이틀
|
||||
Text(
|
||||
'구독 삭제',
|
||||
loc.deleteSubscriptionTitle,
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
color: textThemeColor.onSurface,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
@@ -57,22 +70,12 @@ class DeleteConfirmationDialog extends StatelessWidget {
|
||||
RichText(
|
||||
textAlign: TextAlign.center,
|
||||
text: TextSpan(
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
height: 1.5,
|
||||
style: baseMessageStyle,
|
||||
children: _buildLocalizedMessageSpans(
|
||||
loc.deleteSubscriptionMessageTemplate,
|
||||
serviceName,
|
||||
highlightStyle,
|
||||
),
|
||||
children: [
|
||||
const TextSpan(text: '정말로 '),
|
||||
TextSpan(
|
||||
text: serviceName,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
const TextSpan(text: ' 구독을\n삭제하시겠습니까?'),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -84,14 +87,10 @@ class DeleteConfirmationDialog extends StatelessWidget {
|
||||
vertical: 12,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
Theme.of(context).colorScheme.error.withValues(alpha: 0.05),
|
||||
color: textThemeColor.error.withValues(alpha: 0.05),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.error
|
||||
.withValues(alpha: 0.2),
|
||||
color: textThemeColor.error.withValues(alpha: 0.2),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
@@ -100,18 +99,15 @@ class DeleteConfirmationDialog extends StatelessWidget {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.warning_amber_rounded,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.error
|
||||
.withValues(alpha: 0.8),
|
||||
color: textThemeColor.error.withValues(alpha: 0.8),
|
||||
size: 20,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'이 작업은 되돌릴 수 없습니다',
|
||||
loc.deleteIrreversibleWarning,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
color: textThemeColor.error,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
@@ -125,7 +121,7 @@ class DeleteConfirmationDialog extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: SecondaryButton(
|
||||
text: '취소',
|
||||
text: loc.cancel,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop(false);
|
||||
},
|
||||
@@ -134,12 +130,12 @@ class DeleteConfirmationDialog extends StatelessWidget {
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: PrimaryButton(
|
||||
text: '삭제',
|
||||
text: loc.delete,
|
||||
icon: Icons.delete_rounded,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop(true);
|
||||
},
|
||||
backgroundColor: Theme.of(context).colorScheme.error,
|
||||
backgroundColor: textThemeColor.error,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -166,4 +162,27 @@ class DeleteConfirmationDialog extends StatelessWidget {
|
||||
|
||||
return result ?? false;
|
||||
}
|
||||
|
||||
List<TextSpan> _buildLocalizedMessageSpans(
|
||||
String template,
|
||||
String serviceName,
|
||||
TextStyle highlightStyle,
|
||||
) {
|
||||
final parts = template.split('@');
|
||||
if (parts.length == 1) {
|
||||
return [TextSpan(text: template)];
|
||||
}
|
||||
|
||||
final spans = <TextSpan>[];
|
||||
for (int i = 0; i < parts.length; i++) {
|
||||
final segment = parts[i];
|
||||
if (segment.isNotEmpty) {
|
||||
spans.add(TextSpan(text: segment));
|
||||
}
|
||||
if (i < parts.length - 1) {
|
||||
spans.add(TextSpan(text: serviceName, style: highlightStyle));
|
||||
}
|
||||
}
|
||||
return spans;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user