You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.1 KiB
67 lines
2.1 KiB
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:hadi_hoda_flutter/common_ui/resources/my_assets.dart';
|
|
import 'package:hadi_hoda_flutter/common_ui/resources/my_spaces.dart';
|
|
import 'package:hadi_hoda_flutter/core/utils/my_image.dart';
|
|
import 'package:hadi_hoda_flutter/core/utils/screen_size.dart';
|
|
import 'package:hadi_hoda_flutter/features/intro/presentation/bloc/intro_bloc.dart';
|
|
import 'package:hadi_hoda_flutter/features/intro/presentation/bloc/intro_event.dart';
|
|
import 'package:hadi_hoda_flutter/features/intro/presentation/ui/widgets/intro_loading_widget.dart';
|
|
|
|
class IntroPage extends StatefulWidget {
|
|
const IntroPage({super.key});
|
|
|
|
@override
|
|
State<IntroPage> createState() => _IntroPageState();
|
|
}
|
|
|
|
class _IntroPageState extends State<IntroPage> {
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
context.read<IntroBloc>().add(SaveLevelsEvent());
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: Container(
|
|
height: context.heightScreen,
|
|
width: context.widthScreen,
|
|
decoration: BoxDecoration(
|
|
gradient: LinearGradient(
|
|
begin: Alignment.topCenter,
|
|
end: Alignment.bottomCenter,
|
|
colors: [Color(0XFF00154C), Color(0XFF150532)],
|
|
),
|
|
image: DecorationImage(
|
|
image: AssetImage(MyAssets.pattern),
|
|
scale: 3,
|
|
repeat: ImageRepeat.repeat,
|
|
colorFilter: ColorFilter.mode(
|
|
Colors.white.withValues(alpha: 0.2),
|
|
BlendMode.srcIn,
|
|
),
|
|
),
|
|
),
|
|
child: Stack(
|
|
alignment: Alignment.center,
|
|
children: [_image(), _loading(context)],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
MyImage _image() => MyImage(image: MyAssets.hadiHoda, size: 200);
|
|
|
|
Positioned _loading(BuildContext context) {
|
|
return Positioned(
|
|
bottom: MediaQuery.viewPaddingOf(context).bottom + MySpaces.s10,
|
|
child: IntroLoadingWidget(
|
|
percent: 80,
|
|
loadingStream: context.read<IntroBloc>().loadingStream,
|
|
),
|
|
);
|
|
}
|
|
}
|