Major UI/UX and architecture improvements
- Implemented new navigation system with NavigationProvider and route management - Added adaptive theme system with ThemeProvider for better theme handling - Introduced glassmorphism design elements (app bars, scaffolds, cards) - Added advanced animations (spring animations, page transitions, staggered lists) - Implemented performance optimizations (memory manager, lazy loading) - Refactored Analysis screen into modular components - Added floating navigation bar with haptic feedback - Improved subscription cards with swipe actions - Enhanced skeleton loading with better animations - Added cached network image support - Improved overall app architecture and code organization 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
74
lib/utils/haptic_feedback_helper.dart
Normal file
74
lib/utils/haptic_feedback_helper.dart
Normal file
@@ -0,0 +1,74 @@
|
||||
import 'package:flutter/services.dart';
|
||||
import 'dart:io' show Platform;
|
||||
|
||||
/// 햅틱 피드백을 관리하는 헬퍼 클래스
|
||||
class HapticFeedbackHelper {
|
||||
static bool _isEnabled = true;
|
||||
|
||||
/// 햅틱 피드백 활성화 여부 설정
|
||||
static void setEnabled(bool enabled) {
|
||||
_isEnabled = enabled;
|
||||
}
|
||||
|
||||
/// 가벼운 햅틱 피드백
|
||||
static Future<void> lightImpact() async {
|
||||
if (!_isEnabled || !_isPlatformSupported()) return;
|
||||
await HapticFeedback.lightImpact();
|
||||
}
|
||||
|
||||
/// 중간 강도 햅틱 피드백
|
||||
static Future<void> mediumImpact() async {
|
||||
if (!_isEnabled || !_isPlatformSupported()) return;
|
||||
await HapticFeedback.mediumImpact();
|
||||
}
|
||||
|
||||
/// 강한 햅틱 피드백
|
||||
static Future<void> heavyImpact() async {
|
||||
if (!_isEnabled || !_isPlatformSupported()) return;
|
||||
await HapticFeedback.heavyImpact();
|
||||
}
|
||||
|
||||
/// 선택 햅틱 피드백 (iOS의 경우 Taptic Engine)
|
||||
static Future<void> selectionClick() async {
|
||||
if (!_isEnabled || !_isPlatformSupported()) return;
|
||||
await HapticFeedback.selectionClick();
|
||||
}
|
||||
|
||||
/// 진동 패턴 (Android)
|
||||
static Future<void> vibrate({int duration = 50}) async {
|
||||
if (!_isEnabled || !_isPlatformSupported()) return;
|
||||
await HapticFeedback.vibrate();
|
||||
}
|
||||
|
||||
/// 성공 피드백 패턴
|
||||
static Future<void> success() async {
|
||||
if (!_isEnabled || !_isPlatformSupported()) return;
|
||||
await HapticFeedback.mediumImpact();
|
||||
await Future.delayed(const Duration(milliseconds: 100));
|
||||
await HapticFeedback.lightImpact();
|
||||
}
|
||||
|
||||
/// 에러 피드백 패턴
|
||||
static Future<void> error() async {
|
||||
if (!_isEnabled || !_isPlatformSupported()) return;
|
||||
await HapticFeedback.heavyImpact();
|
||||
await Future.delayed(const Duration(milliseconds: 100));
|
||||
await HapticFeedback.heavyImpact();
|
||||
}
|
||||
|
||||
/// 경고 피드백 패턴
|
||||
static Future<void> warning() async {
|
||||
if (!_isEnabled || !_isPlatformSupported()) return;
|
||||
await HapticFeedback.mediumImpact();
|
||||
}
|
||||
|
||||
/// 플랫폼이 햅틱 피드백을 지원하는지 확인
|
||||
static bool _isPlatformSupported() {
|
||||
try {
|
||||
return Platform.isIOS || Platform.isAndroid;
|
||||
} catch (e) {
|
||||
// 웹이나 데스크톱에서는 Platform을 사용할 수 없음
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user