Browse Source

fix: home page

pull/10/head
AmirrezaChegini 1 week ago
parent
commit
786ff6bd9e
  1. 12
      lib/features/home/presentation/pages/home_page.dart
  2. 26
      lib/features/home/presentation/pages/widgets/home_battle_cast.dart
  3. 11
      lib/features/home/presentation/pages/widgets/home_battle_league.dart
  4. 11
      lib/features/home/presentation/pages/widgets/home_custom_widget.dart
  5. 13
      lib/features/home/presentation/pages/widgets/home_membership.dart

12
lib/features/home/presentation/pages/home_page.dart

@ -1,9 +1,9 @@
import 'package:flutter/material.dart' ;
import 'package:get/get.dart';
import 'package:shia_game_flutter/common_ui/resources/my_assets.dart';
import 'package:shia_game_flutter/common_ui/resources/my_spaces.dart';
import 'package:shia_game_flutter/core/utils/gap.dart';
import 'package:shia_game_flutter/core/utils/my_localization.dart';
import 'package:shia_game_flutter/core/utils/screen_size.dart';
import 'package:shia_game_flutter/core/widgets/background/my_background.dart';
import 'package:shia_game_flutter/core/widgets/image/my_image.dart';
import 'package:shia_game_flutter/features/home/presentation/controller/home_controller.dart';
@ -21,16 +21,16 @@ class HomePage extends GetView<HomeController> {
return MyBackground(
child: Column(
children: [
MySpaces.s28.gapHeight,
20.h.gapHeight,
const MyImage(asset: MyAssets.shiaMindGroup),
MySpaces.s40.gapHeight,
40.h.gapHeight,
const HomeMembership(),
HomeBattleLeague(
onTap: controller.goToBattleLeaguePage,
),
MySpaces.s20.gapHeight,
20.h.gapHeight,
_customWidgets(context),
MySpaces.s20.gapHeight,
20.h.gapHeight,
const HomeBattleCast(),
],
),
@ -39,7 +39,7 @@ class HomePage extends GetView<HomeController> {
Widget _customWidgets(BuildContext context) {
return Row(
spacing: MySpaces.s22,
spacing: 20,
children: [
Expanded(
child: HomeCustomWidget(

26
lib/features/home/presentation/pages/widgets/home_battle_cast.dart

@ -1,10 +1,10 @@
import 'package:flutter/material.dart' hide BoxDecoration, BoxShadow;
import 'package:flutter_inset_box_shadow_update/flutter_inset_box_shadow_update.dart';
import 'package:shia_game_flutter/common_ui/resources/my_assets.dart';
import 'package:shia_game_flutter/common_ui/resources/my_spaces.dart';
import 'package:shia_game_flutter/common_ui/resources/my_text_style.dart';
import 'package:shia_game_flutter/core/utils/gap.dart';
import 'package:shia_game_flutter/core/utils/my_localization.dart';
import 'package:shia_game_flutter/core/utils/screen_size.dart';
import 'package:shia_game_flutter/core/widgets/container/my_container.dart';
import 'package:shia_game_flutter/core/widgets/image/my_image.dart';
import 'package:shia_game_flutter/core/widgets/text/gradient_text.dart';
@ -21,8 +21,8 @@ class HomeBattleCast extends StatelessWidget {
clipBehavior: Clip.none,
children: [
MyContainer(
height: 120,
borderRadius: const BorderRadius.all(Radius.circular(MySpaces.s20)),
height: 120.h,
borderRadius: const BorderRadius.all(Radius.circular(20)),
borderGradient: const LinearGradient(
begin: AlignmentDirectional.topCenter,
end: AlignmentDirectional.bottomCenter,
@ -33,7 +33,7 @@ class HomeBattleCast extends StatelessWidget {
center: const Alignment(-0.5, -1),
colors: [const Color(0XFF104CBA).withValues(alpha: 0.2), const Color(0XFF104CBA)],
),
padding: const EdgeInsets.all(MySpaces.s10),
padding: const EdgeInsets.all(10),
image: DecorationImage(
image: const AssetImage(MyAssets.addBackground),
repeat: ImageRepeat.repeat,
@ -52,9 +52,9 @@ class HomeBattleCast extends StatelessWidget {
offset: const Offset(0, 1.04),
blurRadius: 0.52,
shadowColor: const Color(0xFF3C38C4),
fontSize: 22,
fontSize: 22.sp,
),
MySpaces.s10.gapHeight,
10.h.gapHeight,
Container(
padding: const EdgeInsets.all(5),
decoration: BoxDecoration(
@ -73,7 +73,7 @@ class HomeBattleCast extends StatelessWidget {
'Sheikh.Sadra VS Ali Masoudi (online) - Sheikh.Sadra number tow VS Ali Masoudi tabar (tomorrow)',
maxLines: 1,
style: Lexend.semiBold.copyWith(
fontSize: 8,
fontSize: 8.sp,
color: const Color(0XFFB6B3FF),
),
),
@ -83,12 +83,12 @@ class HomeBattleCast extends StatelessWidget {
),
PositionedDirectional(
start: -1,
top: -MySpaces.s4,
top: -4,
child: MyContainer(
color: const Color(0XFFCC9B22),
padding: const EdgeInsets.symmetric(
vertical: MySpaces.s2,
horizontal: MySpaces.s8,
vertical: 2,
horizontal: 8,
),
borderRadius: const BorderRadiusDirectional.only(
topStart: Radius.circular(6),
@ -99,14 +99,14 @@ class HomeBattleCast extends StatelessWidget {
child: Text(
'2 New',
style: Lexend.extraBold.copyWith(
fontSize: 11,
fontSize: 11.sp,
),
),
),
),
const PositionedDirectional(
end: MySpaces.s20,
top: -MySpaces.s10,
end: 20,
top: -10,
child: Row(
children: [
MyImage(

11
lib/features/home/presentation/pages/widgets/home_battle_league.dart

@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:shia_game_flutter/common_ui/resources/my_assets.dart';
import 'package:shia_game_flutter/common_ui/resources/my_spaces.dart';
import 'package:shia_game_flutter/common_ui/resources/my_text_style.dart';
import 'package:shia_game_flutter/core/utils/gap.dart';
import 'package:shia_game_flutter/core/utils/my_localization.dart';
@ -22,10 +21,10 @@ class HomeBattleLeague extends StatelessWidget {
MyContainer(
onTap: onTap,
width: context.widthScreen,
height: 120,
height: 120.h,
padding: const EdgeInsets.symmetric(
horizontal: MySpaces.s12,
vertical: MySpaces.s16,
horizontal: 12,
vertical: 16,
),
borderGradient: const LinearGradient(
begin: AlignmentDirectional.centerStart,
@ -49,12 +48,12 @@ class HomeBattleLeague extends StatelessWidget {
shadowColor: const Color(0xFF3E1381),
blurRadius: 0.84,
offset: const Offset(0, 1.69),
fontSize: 22,
fontSize: 22.sp,
),
Text(
context.translate.answer_win,
style: Lexend.medium.copyWith(
fontSize: 10,
fontSize: 10.sp,
color: const Color(0XFFA183D2),
),
),

11
lib/features/home/presentation/pages/widgets/home_custom_widget.dart

@ -1,7 +1,6 @@
import 'package:flutter/material.dart' hide BoxDecoration, BoxShadow;
import 'package:flutter_inset_box_shadow_update/flutter_inset_box_shadow_update.dart';
import 'package:shia_game_flutter/common_ui/resources/my_assets.dart';
import 'package:shia_game_flutter/common_ui/resources/my_spaces.dart';
import 'package:shia_game_flutter/common_ui/resources/my_text_style.dart';
import 'package:shia_game_flutter/core/utils/gap.dart';
import 'package:shia_game_flutter/core/utils/screen_size.dart';
@ -24,7 +23,7 @@ class HomeCustomWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MyContainer(
height: 130,
height: 130.h,
borderRadius: const BorderRadius.all(Radius.circular(20)),
borderGradient: CustomWidgetType.borderGradient[type],
gradient: CustomWidgetType.gradient[type],
@ -36,7 +35,7 @@ class HomeCustomWidget extends StatelessWidget {
BlendMode.srcIn,
),
),
padding: const EdgeInsets.all(MySpaces.s10),
padding: const EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -46,7 +45,7 @@ class HomeCustomWidget extends StatelessWidget {
),
const Spacer(),
CustomWidgetType.title[type] ?? const SizedBox.shrink(),
MySpaces.s10.gapHeight,
10.h.gapHeight,
Container(
padding: const EdgeInsets.all(5),
width: context.widthScreen,
@ -70,14 +69,14 @@ class HomeCustomWidget extends StatelessWidget {
TextSpan(
text: firstText,
style: Lexend.semiBold.copyWith(
fontSize: 8,
fontSize: 8.sp,
color: CustomWidgetType.firstTextColor[type],
),
),
TextSpan(
text: ' $secondText',
style: Lexend.semiBold.copyWith(
fontSize: 8,
fontSize: 8.sp,
color: CustomWidgetType.secondTextColor[type],
),
),

13
lib/features/home/presentation/pages/widgets/home_membership.dart

@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:shia_game_flutter/common_ui/resources/my_assets.dart';
import 'package:shia_game_flutter/common_ui/resources/my_colors.dart';
import 'package:shia_game_flutter/common_ui/resources/my_spaces.dart';
import 'package:shia_game_flutter/common_ui/resources/my_text_style.dart';
import 'package:shia_game_flutter/common_ui/theme/my_theme.dart';
import 'package:shia_game_flutter/core/utils/gap.dart';
@ -26,7 +25,7 @@ class HomeMembership extends StatelessWidget {
const Color(0XFFDE8B4D).withValues(alpha: 0.05),
],
),
borderRadius: const BorderRadius.all(Radius.circular(MySpaces.s20)),
borderRadius: const BorderRadius.all(Radius.circular(20)),
boxShadow: [
const BoxShadow(
color: MyColors.black,
@ -35,22 +34,22 @@ class HomeMembership extends StatelessWidget {
spreadRadius: 20,
),
],
padding: const EdgeInsets.symmetric(horizontal: MySpaces.s16, vertical: 13),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 13),
child: Row(
children: [
const MyImage(asset: MyAssets.iconCrown),
MySpaces.s8.gapWidth,
8.w.gapWidth,
Text(
context.translate.pro_membership,
style: Lexend.semiBold.copyWith(
fontSize: 12,
fontSize: 12.sp,
color: const Color(0XFFFCC230),
),
),
const Spacer(),
const MyImage(asset: MyAssets.iconClock),
MySpaces.s6.gapWidth,
Text('125d 4h', style: Lexend.semiBold.copyWith(fontSize: 12)),
6.w.gapWidth,
Text('125d 4h', style: Lexend.semiBold.copyWith(fontSize: 12.sp)),
],
),
);

Loading…
Cancel
Save