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.
99 lines
3.2 KiB
99 lines
3.2 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_colors.dart';
|
|
import 'package:hadi_hoda_flutter/core/utils/check_platform.dart';
|
|
import 'package:hadi_hoda_flutter/core/utils/my_image.dart';
|
|
import 'package:hadi_hoda_flutter/core/utils/my_localization.dart';
|
|
import 'package:hadi_hoda_flutter/core/utils/screen_size.dart';
|
|
import 'package:hadi_hoda_flutter/core/widgets/button/enum/button_type.dart';
|
|
import 'package:hadi_hoda_flutter/core/widgets/button/my_button.dart';
|
|
import 'package:hadi_hoda_flutter/features/home/presentation/bloc/home_bloc.dart';
|
|
|
|
class HomePage extends StatelessWidget {
|
|
const HomePage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(backgroundColor: MyColors.transparent),
|
|
extendBodyBehindAppBar: true,
|
|
body: DecoratedBox(
|
|
decoration: BoxDecoration(
|
|
image: DecorationImage(
|
|
image: AssetImage(MyAssets.backgroundHome),
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
child: SizedBox(
|
|
width: context.widthScreen,
|
|
height: context.heightScreen,
|
|
child: Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
_music(context),
|
|
_name(context),
|
|
_bottomBtns(context),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Positioned _music(BuildContext context) {
|
|
return Positioned(
|
|
top: checkSize(context: context, mobile: 36, tablet: 60),
|
|
right: checkSize(context: context, mobile: 16, tablet: 30),
|
|
child: MyImage(
|
|
image: MyAssets.musicOn,
|
|
size: checkSize(context: context, tablet: 120),
|
|
),
|
|
);
|
|
}
|
|
|
|
|
|
Positioned _name(BuildContext context) {
|
|
return Positioned(
|
|
top: 146,
|
|
child: MyImage(
|
|
image: MyAssets.hadiHoda,
|
|
size: checkSize(context: context, mobile: 232, tablet: 400),
|
|
fit: BoxFit.cover,
|
|
),
|
|
);
|
|
}
|
|
|
|
Positioned _bottomBtns(BuildContext context) {
|
|
return Positioned(
|
|
bottom: checkSize(context: context, mobile: 40, tablet: 60),
|
|
left: checkSize(context: context, mobile: 16, tablet: 30),
|
|
right: checkSize(context: context, mobile: 16, tablet: 30),
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
InkWell(
|
|
onTap: () => context.read<HomeBloc>().goToLanguagePage(context),
|
|
child: MyImage(
|
|
image: MyAssets.language,
|
|
size: checkSize(context: context, tablet: 120),
|
|
),
|
|
),
|
|
MyButton(
|
|
onTap: () => context.read<HomeBloc>().goToLevelPage(context),
|
|
type: ButtonType.type2,
|
|
title: context.translate.start,
|
|
),
|
|
InkWell(
|
|
onTap: () => context.read<HomeBloc>().showAboutUs(context),
|
|
child: MyImage(
|
|
image: MyAssets.theme,
|
|
size: checkSize(context: context, tablet: 120),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|