playWith/apps/app/lib/intro/intro_screen.dart

44 lines
1.4 KiB
Dart
Raw Normal View History

2025-11-25 16:34:13 +09:00
import 'package:flutter/material.dart';
import 'package:playwith_core/playwith_core.dart'; // SettingsNotifier
import 'intro_view.dart';
class IntroScreen extends StatelessWidget {
final WidgetBuilder nextScreenBuilder;
const IntroScreen({
super.key,
required this.nextScreenBuilder,
});
void _navigateToNextScreen(BuildContext context) {
// 인트로 종료 후 다음 화면(Lobby)으로 이동 (뒤로가기 불가)
Navigator.of(context).pushReplacement(
PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) => nextScreenBuilder(context),
transitionsBuilder: (context, animation, secondaryAnimation, child) {
return FadeTransition(opacity: animation, child: child);
},
transitionDuration: const Duration(milliseconds: 800), // 부드러운 전환
),
);
}
@override
Widget build(BuildContext context) {
// SettingsNotifier 싱글톤에서 현재 색상 가져오기
final Color currentColor = SettingsNotifier().currentColor;
return Scaffold(
// 배경색은 테마 배경색 사용
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: Center(
child: IntroViewFlutter(
mainColor: currentColor,
onAnimationFinished: () {
_navigateToNextScreen(context);
},
),
),
);
}
}