LunchPick(오늘 뭐 먹Z?) Flutter 앱의 초기 구현입니다. 주요 기능: - 네이버 지도 연동 맛집 추가 - 랜덤 메뉴 추천 시스템 - 날씨 기반 거리 조정 - 방문 기록 관리 - Bluetooth 맛집 공유 - 다크모드 지원 기술 스택: - Flutter 3.8.1+ - Riverpod 상태 관리 - Hive 로컬 DB - Clean Architecture 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
88 lines
2.2 KiB
Dart
88 lines
2.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../constants/app_colors.dart';
|
|
|
|
/// 로딩 인디케이터 위젯
|
|
///
|
|
/// 앱 전체에서 일관된 로딩 표시를 위한 공통 위젯
|
|
class LoadingIndicator extends StatelessWidget {
|
|
/// 로딩 메시지 (선택사항)
|
|
final String? message;
|
|
|
|
/// 인디케이터 크기
|
|
final double size;
|
|
|
|
/// 스트로크 너비
|
|
final double strokeWidth;
|
|
|
|
const LoadingIndicator({
|
|
super.key,
|
|
this.message,
|
|
this.size = 40.0,
|
|
this.strokeWidth = 4.0,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
|
|
|
return Center(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
SizedBox(
|
|
width: size,
|
|
height: size,
|
|
child: CircularProgressIndicator(
|
|
strokeWidth: strokeWidth,
|
|
valueColor: AlwaysStoppedAnimation<Color>(
|
|
isDark ? AppColors.darkPrimary : AppColors.lightPrimary,
|
|
),
|
|
),
|
|
),
|
|
if (message != null) ...[
|
|
const SizedBox(height: 16),
|
|
Text(
|
|
message!,
|
|
style: TextStyle(
|
|
fontSize: 14,
|
|
color: isDark
|
|
? AppColors.darkTextSecondary
|
|
: AppColors.lightTextSecondary,
|
|
),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
],
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// 전체 화면 로딩 인디케이터
|
|
///
|
|
/// 화면 전체를 덮는 로딩 표시를 위한 위젯
|
|
class FullScreenLoadingIndicator extends StatelessWidget {
|
|
/// 로딩 메시지 (선택사항)
|
|
final String? message;
|
|
|
|
/// 배경 투명도
|
|
final double backgroundOpacity;
|
|
|
|
const FullScreenLoadingIndicator({
|
|
super.key,
|
|
this.message,
|
|
this.backgroundOpacity = 0.5,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
|
|
|
return Container(
|
|
color: (isDark ? Colors.black : Colors.white)
|
|
.withValues(alpha: backgroundOpacity),
|
|
child: LoadingIndicator(message: message),
|
|
);
|
|
}
|
|
} |