feat(app): add manual entry and sharing flows
This commit is contained in:
@@ -11,12 +11,12 @@ class TestSplashScreen extends StatefulWidget {
|
||||
State<TestSplashScreen> createState() => _TestSplashScreenState();
|
||||
}
|
||||
|
||||
class _TestSplashScreenState extends State<TestSplashScreen>
|
||||
class _TestSplashScreenState extends State<TestSplashScreen>
|
||||
with TickerProviderStateMixin {
|
||||
late List<AnimationController> _foodControllers;
|
||||
late AnimationController _questionMarkController;
|
||||
late AnimationController _centerIconController;
|
||||
|
||||
|
||||
final List<IconData> foodIcons = [
|
||||
Icons.rice_bowl,
|
||||
Icons.ramen_dining,
|
||||
@@ -28,14 +28,14 @@ class _TestSplashScreenState extends State<TestSplashScreen>
|
||||
Icons.icecream,
|
||||
Icons.bakery_dining,
|
||||
];
|
||||
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_initializeAnimations();
|
||||
// 네비게이션 제거
|
||||
}
|
||||
|
||||
|
||||
void _initializeAnimations() {
|
||||
_foodControllers = List.generate(
|
||||
foodIcons.length,
|
||||
@@ -44,24 +44,26 @@ class _TestSplashScreenState extends State<TestSplashScreen>
|
||||
vsync: this,
|
||||
)..repeat(reverse: true),
|
||||
);
|
||||
|
||||
|
||||
_questionMarkController = AnimationController(
|
||||
duration: const Duration(milliseconds: 500),
|
||||
vsync: this,
|
||||
)..repeat();
|
||||
|
||||
|
||||
_centerIconController = AnimationController(
|
||||
duration: const Duration(seconds: 1),
|
||||
vsync: this,
|
||||
)..repeat(reverse: true);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: isDark ? AppColors.darkBackground : AppColors.lightBackground,
|
||||
backgroundColor: isDark
|
||||
? AppColors.darkBackground
|
||||
: AppColors.lightBackground,
|
||||
body: Stack(
|
||||
children: [
|
||||
Center(
|
||||
@@ -78,7 +80,9 @@ class _TestSplashScreenState extends State<TestSplashScreen>
|
||||
child: Icon(
|
||||
Icons.restaurant_menu,
|
||||
size: 80,
|
||||
color: isDark ? AppColors.darkPrimary : AppColors.lightPrimary,
|
||||
color: isDark
|
||||
? AppColors.darkPrimary
|
||||
: AppColors.lightPrimary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
@@ -90,19 +94,26 @@ class _TestSplashScreenState extends State<TestSplashScreen>
|
||||
style: TextStyle(
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: isDark ? AppColors.darkTextPrimary : AppColors.lightTextPrimary,
|
||||
color: isDark
|
||||
? AppColors.darkTextPrimary
|
||||
: AppColors.lightTextPrimary,
|
||||
),
|
||||
),
|
||||
AnimatedBuilder(
|
||||
animation: _questionMarkController,
|
||||
builder: (context, child) {
|
||||
final questionMarks = '?' * (((_questionMarkController.value * 3).floor() % 3) + 1);
|
||||
final questionMarks =
|
||||
'?' *
|
||||
(((_questionMarkController.value * 3).floor() % 3) +
|
||||
1);
|
||||
return Text(
|
||||
questionMarks,
|
||||
style: TextStyle(
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: isDark ? AppColors.darkTextPrimary : AppColors.lightTextPrimary,
|
||||
color: isDark
|
||||
? AppColors.darkTextPrimary
|
||||
: AppColors.lightTextPrimary,
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -120,8 +131,11 @@ class _TestSplashScreenState extends State<TestSplashScreen>
|
||||
AppConstants.appCopyright,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: (isDark ? AppColors.darkTextSecondary : AppColors.lightTextSecondary)
|
||||
.withValues(alpha: 0.5),
|
||||
color:
|
||||
(isDark
|
||||
? AppColors.darkTextSecondary
|
||||
: AppColors.lightTextSecondary)
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
@@ -130,7 +144,7 @@ class _TestSplashScreenState extends State<TestSplashScreen>
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
for (final controller in _foodControllers) {
|
||||
@@ -148,37 +162,29 @@ void main() {
|
||||
group('LunchPickApp 위젯 테스트', () {
|
||||
testWidgets('스플래시 화면이 올바르게 표시되는지 확인', (WidgetTester tester) async {
|
||||
// 테스트용 스플래시 화면 사용
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: TestSplashScreen(),
|
||||
),
|
||||
);
|
||||
await tester.pumpWidget(const MaterialApp(home: TestSplashScreen()));
|
||||
|
||||
// 스플래시 화면 요소 확인
|
||||
expect(find.text('오늘 뭐 먹Z'), findsOneWidget);
|
||||
expect(find.byIcon(Icons.restaurant_menu), findsOneWidget);
|
||||
expect(find.text(AppConstants.appCopyright), findsOneWidget);
|
||||
|
||||
|
||||
// 애니메이션이 있으므로 pump를 여러 번 호출
|
||||
await tester.pump(const Duration(seconds: 1));
|
||||
|
||||
|
||||
// 여전히 스플래시 화면에 있는지 확인
|
||||
expect(find.text('오늘 뭐 먹Z'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('스플래시 화면 물음표 애니메이션 확인', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: TestSplashScreen(),
|
||||
),
|
||||
);
|
||||
await tester.pumpWidget(const MaterialApp(home: TestSplashScreen()));
|
||||
|
||||
// 초기 상태에서 물음표가 포함된 텍스트 확인
|
||||
expect(find.textContaining('오늘 뭐 먹Z'), findsOneWidget);
|
||||
|
||||
|
||||
// 애니메이션 진행
|
||||
await tester.pump(const Duration(milliseconds: 500));
|
||||
|
||||
|
||||
// 여전히 제목이 표시되는지 확인
|
||||
expect(find.textContaining('오늘 뭐 먹Z'), findsOneWidget);
|
||||
});
|
||||
@@ -196,9 +202,11 @@ void main() {
|
||||
);
|
||||
|
||||
// BuildContext 가져오기
|
||||
final BuildContext context = tester.element(find.byType(TestSplashScreen));
|
||||
final BuildContext context = tester.element(
|
||||
find.byType(TestSplashScreen),
|
||||
);
|
||||
final theme = Theme.of(context);
|
||||
|
||||
|
||||
// 라이트 테마 확인
|
||||
expect(theme.brightness, Brightness.light);
|
||||
});
|
||||
@@ -216,11 +224,13 @@ void main() {
|
||||
);
|
||||
|
||||
// BuildContext 가져오기
|
||||
final BuildContext context = tester.element(find.byType(TestSplashScreen));
|
||||
final BuildContext context = tester.element(
|
||||
find.byType(TestSplashScreen),
|
||||
);
|
||||
final theme = Theme.of(context);
|
||||
|
||||
|
||||
// 다크 테마 확인
|
||||
expect(theme.brightness, Brightness.dark);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user