- billing_cycle_selector, category_selector, currency_selector 컴포넌트 분리 - 구독 카드 클릭 이슈 해결을 위한 리팩토링 - SMS 스캔 화면 UI/UX 개선 및 기능 강화 - 상세 화면 컨트롤러 로직 개선 - 알림 서비스 및 구독 URL 매칭 기능 추가 - CLAUDE.md 프로젝트 가이드라인 대폭 확장 - 전반적인 코드 구조 개선 및 타입 안정성 강화 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
117 lines
2.7 KiB
Dart
117 lines
2.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../../theme/app_colors.dart';
|
|
|
|
/// 통화 선택 위젯
|
|
/// KRW(원화)와 USD(달러) 중 선택할 수 있습니다.
|
|
class CurrencySelector extends StatelessWidget {
|
|
final String currency;
|
|
final ValueChanged<String> onChanged;
|
|
final bool isGlassmorphism;
|
|
|
|
const CurrencySelector({
|
|
super.key,
|
|
required this.currency,
|
|
required this.onChanged,
|
|
this.isGlassmorphism = false,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Row(
|
|
children: [
|
|
_CurrencyOption(
|
|
label: '₩',
|
|
value: 'KRW',
|
|
isSelected: currency == 'KRW',
|
|
onTap: () => onChanged('KRW'),
|
|
isGlassmorphism: isGlassmorphism,
|
|
),
|
|
const SizedBox(width: 8),
|
|
_CurrencyOption(
|
|
label: '\$',
|
|
value: 'USD',
|
|
isSelected: currency == 'USD',
|
|
onTap: () => onChanged('USD'),
|
|
isGlassmorphism: isGlassmorphism,
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|
|
|
|
/// 통화 옵션 버튼
|
|
class _CurrencyOption extends StatelessWidget {
|
|
final String label;
|
|
final String value;
|
|
final bool isSelected;
|
|
final VoidCallback onTap;
|
|
final bool isGlassmorphism;
|
|
|
|
const _CurrencyOption({
|
|
required this.label,
|
|
required this.value,
|
|
required this.isSelected,
|
|
required this.onTap,
|
|
required this.isGlassmorphism,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = Theme.of(context);
|
|
|
|
return Expanded(
|
|
child: InkWell(
|
|
onTap: onTap,
|
|
borderRadius: BorderRadius.circular(12),
|
|
child: Container(
|
|
padding: const EdgeInsets.symmetric(vertical: 12),
|
|
decoration: BoxDecoration(
|
|
color: _getBackgroundColor(theme),
|
|
borderRadius: BorderRadius.circular(12),
|
|
border: _getBorder(),
|
|
),
|
|
child: Center(
|
|
child: Text(
|
|
label,
|
|
style: TextStyle(
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.w600,
|
|
color: _getTextColor(),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Color _getBackgroundColor(ThemeData theme) {
|
|
if (isSelected) {
|
|
return isGlassmorphism
|
|
? theme.primaryColor
|
|
: const Color(0xFF3B82F6);
|
|
}
|
|
return isGlassmorphism
|
|
? AppColors.surfaceColorAlt
|
|
: Colors.grey.withValues(alpha: 0.1);
|
|
}
|
|
|
|
Border? _getBorder() {
|
|
if (isSelected || !isGlassmorphism) {
|
|
return null;
|
|
}
|
|
return Border.all(
|
|
color: AppColors.borderColor,
|
|
width: 1.5,
|
|
);
|
|
}
|
|
|
|
Color _getTextColor() {
|
|
if (isSelected) {
|
|
return Colors.white;
|
|
}
|
|
return isGlassmorphism
|
|
? AppColors.navyGray
|
|
: Colors.grey[600]!;
|
|
}
|
|
} |