- 설정 화면에 SMS 권한 카드 추가: 상태 표시(허용/미허용/영구 거부), 권한 요청/설정 이동 지원\n- 기존 알림 권한 카드 스타일과 일관성 유지 feat(permissions): 최초 실행 시 SMS 권한 온보딩 화면 추가 및 Splash에서 라우팅 (Android) - 권한 필요 이유/수집 범위 현지화 문구 추가\n- 거부/영구거부 케이스 처리 및 설정 이동 chore(codex): AGENTS.md/체크 스크립트/CI/프롬프트 템플릿 추가 - AGENTS.md, scripts/check.sh, scripts/fix.sh, .github/workflows/flutter_ci.yml, .claude/agents/codex.md, 문서 템플릿 추가 refactor(logging): 경로별 print 제거 후 경량 로거(Log) 도입 - SMS 스캐너/컨트롤러, URL 매처, 데이터 리포지토리, 내비게이션, 메모리/성능 유틸 등 핵심 경로 치환 feat(exchange): 환율 API URL을 --dart-define로 오버라이드 가능 + 폴백 로깅 강화 test: URL 매처/환율 스모크 테스트 추가 chore(android): RECEIVE_SMS 권한 제거 (READ_SMS만 유지) fix(lints): dart fix + 수동 정리로 경고 대폭 감소, 비동기 context(mounted) 보강 fix(deprecations):\n- flutter_local_notifications의 androidAllowWhileIdle → androidScheduleMode 전환\n- WillPopScope → PopScope 교체 i18n: SMS 권한 온보딩/설정 문구 현지화 키 추가
231 lines
6.2 KiB
Dart
231 lines
6.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../utils/logger.dart';
|
|
import 'dart:ui';
|
|
import '../theme/app_colors.dart';
|
|
import 'themed_text.dart';
|
|
|
|
class GlassmorphismCard extends StatelessWidget {
|
|
final Widget child;
|
|
final EdgeInsetsGeometry? padding;
|
|
final EdgeInsetsGeometry? margin;
|
|
final double? width;
|
|
final double? height;
|
|
final double borderRadius;
|
|
final double blur;
|
|
final double opacity;
|
|
final Color? backgroundColor;
|
|
final Gradient? gradient;
|
|
final Border? border;
|
|
final List<BoxShadow>? boxShadow;
|
|
final VoidCallback? onTap;
|
|
|
|
const GlassmorphismCard({
|
|
super.key,
|
|
required this.child,
|
|
this.padding,
|
|
this.margin,
|
|
this.width,
|
|
this.height,
|
|
this.borderRadius = 16.0,
|
|
this.blur = 10.0,
|
|
this.opacity = 0.1,
|
|
this.backgroundColor,
|
|
this.gradient,
|
|
this.border,
|
|
this.boxShadow,
|
|
this.onTap,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
|
|
|
|
return Container(
|
|
width: width,
|
|
height: height,
|
|
margin: margin,
|
|
child: Material(
|
|
color: Colors.transparent,
|
|
child: InkWell(
|
|
onTap: onTap,
|
|
borderRadius: BorderRadius.circular(borderRadius),
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.circular(borderRadius),
|
|
child: BackdropFilter(
|
|
filter: ImageFilter.blur(sigmaX: blur, sigmaY: blur),
|
|
child: Container(
|
|
padding: padding,
|
|
decoration: BoxDecoration(
|
|
color: backgroundColor ?? AppColors.glassCard,
|
|
gradient: gradient ??
|
|
LinearGradient(
|
|
begin: Alignment.topLeft,
|
|
end: Alignment.bottomRight,
|
|
colors: isDarkMode
|
|
? AppColors.glassGradientDark
|
|
: AppColors.glassGradient,
|
|
),
|
|
borderRadius: BorderRadius.circular(borderRadius),
|
|
border: border ??
|
|
Border.all(
|
|
color: isDarkMode
|
|
? AppColors.primaryColor.withValues(alpha: 0.3)
|
|
: AppColors.glassBorder,
|
|
width: 1,
|
|
),
|
|
boxShadow: boxShadow ??
|
|
[
|
|
const BoxShadow(
|
|
color: AppColors
|
|
.shadowBlack, // color.md 가이드: rgba(0,0,0,0.08)
|
|
blurRadius: 20,
|
|
spreadRadius: -5,
|
|
offset: Offset(0, 10),
|
|
),
|
|
],
|
|
),
|
|
child: GlassmorphicIndicator(
|
|
child: child,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
// 애니메이션이 적용된 글래스모피즘 카드
|
|
class AnimatedGlassmorphismCard extends StatefulWidget {
|
|
final Widget child;
|
|
final EdgeInsetsGeometry? padding;
|
|
final EdgeInsetsGeometry? margin;
|
|
final double? width;
|
|
final double? height;
|
|
final double borderRadius;
|
|
final double blur;
|
|
final double opacity;
|
|
final Duration animationDuration;
|
|
final VoidCallback? onTap;
|
|
|
|
const AnimatedGlassmorphismCard({
|
|
super.key,
|
|
required this.child,
|
|
this.padding,
|
|
this.margin,
|
|
this.width,
|
|
this.height,
|
|
this.borderRadius = 16.0,
|
|
this.blur = 10.0,
|
|
this.opacity = 0.1,
|
|
this.animationDuration = const Duration(milliseconds: 200),
|
|
this.onTap,
|
|
});
|
|
|
|
@override
|
|
State<AnimatedGlassmorphismCard> createState() =>
|
|
_AnimatedGlassmorphismCardState();
|
|
}
|
|
|
|
class _AnimatedGlassmorphismCardState extends State<AnimatedGlassmorphismCard>
|
|
with SingleTickerProviderStateMixin {
|
|
late AnimationController _controller;
|
|
late Animation<double> _scaleAnimation;
|
|
late Animation<double> _blurAnimation;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_controller = AnimationController(
|
|
duration: widget.animationDuration,
|
|
vsync: this,
|
|
);
|
|
|
|
_scaleAnimation = Tween<double>(
|
|
begin: 1.0,
|
|
end: 0.98,
|
|
).animate(CurvedAnimation(
|
|
parent: _controller,
|
|
curve: Curves.easeInOut,
|
|
));
|
|
|
|
_blurAnimation = Tween<double>(
|
|
begin: widget.blur,
|
|
end: widget.blur * 1.5,
|
|
).animate(CurvedAnimation(
|
|
parent: _controller,
|
|
curve: Curves.easeInOut,
|
|
));
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
_controller.dispose();
|
|
super.dispose();
|
|
}
|
|
|
|
void _handleTapDown(TapDownDetails details) {
|
|
_controller.forward();
|
|
}
|
|
|
|
void _handleTapUp(TapUpDetails details) {
|
|
_controller.reverse();
|
|
}
|
|
|
|
void _handleTapCancel() {
|
|
_controller.reverse();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
// onTap이 없으면 제스처 처리를 하지 않음
|
|
if (widget.onTap == null) {
|
|
return GlassmorphismCard(
|
|
padding: widget.padding,
|
|
margin: widget.margin,
|
|
width: widget.width,
|
|
height: widget.height,
|
|
borderRadius: widget.borderRadius,
|
|
blur: widget.blur,
|
|
opacity: widget.opacity,
|
|
onTap: null,
|
|
child: widget.child,
|
|
);
|
|
}
|
|
|
|
return GestureDetector(
|
|
behavior: HitTestBehavior.opaque,
|
|
onTapDown: _handleTapDown,
|
|
onTapUp: (details) {
|
|
_handleTapUp(details);
|
|
// onTap 콜백 실행
|
|
if (widget.onTap != null) {
|
|
Log.d('[AnimatedGlassmorphismCard] onTap 콜백 실행');
|
|
widget.onTap!();
|
|
}
|
|
},
|
|
onTapCancel: _handleTapCancel,
|
|
child: AnimatedBuilder(
|
|
animation: _controller,
|
|
builder: (context, child) {
|
|
return Transform.scale(
|
|
scale: _scaleAnimation.value,
|
|
child: GlassmorphismCard(
|
|
padding: widget.padding,
|
|
margin: widget.margin,
|
|
width: widget.width,
|
|
height: widget.height,
|
|
borderRadius: widget.borderRadius,
|
|
blur: _blurAnimation.value,
|
|
opacity: widget.opacity,
|
|
onTap: null, // GlassmorphismCard의 onTap은 사용하지 않음
|
|
child: widget.child,
|
|
),
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|