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.
88 lines
3.1 KiB
88 lines
3.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/core/utils/my_image.dart';
|
|
import 'package:hadi_hoda_flutter/core/utils/screen_size.dart';
|
|
import 'package:hadi_hoda_flutter/features/home/presentation/bloc/home_bloc.dart';
|
|
import 'package:hadi_hoda_flutter/features/home/presentation/ui/widgets/bottom_path.dart';
|
|
import 'package:hadi_hoda_flutter/features/home/presentation/ui/widgets/mission_widget.dart';
|
|
import 'package:hadi_hoda_flutter/features/home/presentation/ui/widgets/top_path.dart';
|
|
|
|
class HomePage extends StatelessWidget {
|
|
const HomePage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: SingleChildScrollView(
|
|
child: Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
_background(),
|
|
_topPath(context),
|
|
_bottomPath(context),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
MyImage _background() {
|
|
return MyImage(image: MyAssets.mapBackground, fit: BoxFit.cover);
|
|
}
|
|
|
|
Positioned _topPath(BuildContext context) {
|
|
return Positioned(
|
|
top: context.heightScreen * 0.16,
|
|
left: context.widthScreen * 0.15,
|
|
child: Stack(
|
|
children: [
|
|
TopPath(
|
|
height: 950,
|
|
width: context.widthScreen * 0.6,
|
|
),
|
|
...List.generate(
|
|
context.read<HomeBloc>().topLocationList.length,
|
|
(index) => Positioned(
|
|
top: context.read<HomeBloc>().topLocationList[index].top,
|
|
bottom: context.read<HomeBloc>().topLocationList[index].bottom,
|
|
right: context.read<HomeBloc>().topLocationList[index].right,
|
|
left: context.read<HomeBloc>().topLocationList[index].left,
|
|
child: MissionWidget(
|
|
index: context.read<HomeBloc>().topLocationList[index].index ?? 0,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
Positioned _bottomPath(BuildContext context) {
|
|
return Positioned(
|
|
bottom: context.heightScreen * 0.12,
|
|
left: context.widthScreen * 0.2,
|
|
child: Stack(
|
|
clipBehavior: Clip.none,
|
|
children: [
|
|
BottomPath(
|
|
width: context.widthScreen * 0.75,
|
|
height: context.heightScreen * 0.65,
|
|
),
|
|
...List.generate(
|
|
context.read<HomeBloc>().bottomLocationList.length,
|
|
(index) => Positioned(
|
|
top: context.read<HomeBloc>().bottomLocationList[index].top,
|
|
bottom: context.read<HomeBloc>().bottomLocationList[index].bottom,
|
|
right: context.read<HomeBloc>().bottomLocationList[index].right,
|
|
left: context.read<HomeBloc>().bottomLocationList[index].left,
|
|
child: MissionWidget(
|
|
index: context.read<HomeBloc>().bottomLocationList[index].index ?? 0,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|