Browse Source

fix: battle league background color and widgets

pull/7/head
AmirrezaChegini 4 weeks ago
parent
commit
f7a0d852f0
  1. 1
      lib/common_ui/resources/my_colors.dart
  2. 4
      lib/common_ui/theme/my_theme.dart
  3. 38
      lib/features/battle_league/presentation/ui/battle_league_page.dart

1
lib/common_ui/resources/my_colors.dart

@ -9,4 +9,5 @@ class MyColors {
static const Color black = Colors.black; static const Color black = Colors.black;
static const Color transparent = Colors.transparent; static const Color transparent = Colors.transparent;
static const Color backgroundColor = Color(0xFF160C30); static const Color backgroundColor = Color(0xFF160C30);
static const Color battleLeagueBackgroundColor = Color(0XFF390C82);
} }

4
lib/common_ui/theme/my_theme.dart

@ -6,6 +6,7 @@ enum ColorsName {
primaryColor, primaryColor,
noColor, noColor,
backgroundColor, backgroundColor,
battleLeagueBackgroundColor,
} }
class MyTheme { class MyTheme {
@ -21,12 +22,14 @@ class MyTheme {
ColorsName.primaryColor: MyColors.white, ColorsName.primaryColor: MyColors.white,
ColorsName.noColor: MyColors.transparent, ColorsName.noColor: MyColors.transparent,
ColorsName.backgroundColor: MyColors.backgroundColor, ColorsName.backgroundColor: MyColors.backgroundColor,
ColorsName.battleLeagueBackgroundColor: MyColors.battleLeagueBackgroundColor,
}; };
static Map<ColorsName, Color> get darkColors => { static Map<ColorsName, Color> get darkColors => {
ColorsName.primaryColor: MyColors.white, ColorsName.primaryColor: MyColors.white,
ColorsName.noColor: MyColors.transparent, ColorsName.noColor: MyColors.transparent,
ColorsName.backgroundColor: MyColors.backgroundColor, ColorsName.backgroundColor: MyColors.backgroundColor,
ColorsName.battleLeagueBackgroundColor: MyColors.battleLeagueBackgroundColor,
}; };
} }
@ -37,4 +40,5 @@ extension ThemeExtension on BuildContext {
Color get primaryColor => customColors[ColorsName.primaryColor]!; Color get primaryColor => customColors[ColorsName.primaryColor]!;
Color get noColor => customColors[ColorsName.noColor]!; Color get noColor => customColors[ColorsName.noColor]!;
Color get backgroundColor => customColors[ColorsName.backgroundColor]!; Color get backgroundColor => customColors[ColorsName.backgroundColor]!;
Color get battleLeagueBackgroundColor => customColors[ColorsName.battleLeagueBackgroundColor]!;
} }

38
lib/features/battle_league/presentation/ui/battle_league_page.dart

@ -18,7 +18,7 @@ class BattleLeaguePage extends GetView<BattleLeagueController> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: const Color(0XFF390C82),
backgroundColor: context.battleLeagueBackgroundColor,
appBar: MyAppBar( appBar: MyAppBar(
type: AppBarType.battleLeague, type: AppBarType.battleLeague,
backgroundColor: context.noColor, backgroundColor: context.noColor,
@ -30,7 +30,20 @@ class BattleLeaguePage extends GetView<BattleLeagueController> {
child: Column( child: Column(
children: [ children: [
MySpaces.s30.gapHeight, MySpaces.s30.gapHeight,
Padding(
_tabBars(context),
MySpaces.s12.gapHeight,
_tabViews(),
56.0.gapHeight,
_startButton(context),
MySpaces.s16.gapHeight,
],
),
),
);
}
Padding _tabBars(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: MySpaces.s30), padding: const EdgeInsets.symmetric(horizontal: MySpaces.s30),
child: BattleLeagueTabBar( child: BattleLeagueTabBar(
controller: controller.tabController, controller: controller.tabController,
@ -39,9 +52,11 @@ class BattleLeaguePage extends GetView<BattleLeagueController> {
context.translate.regional_ranking, context.translate.regional_ranking,
], ],
), ),
),
MySpaces.s12.gapHeight,
Expanded(
);
}
Expanded _tabViews() {
return Expanded(
child: TabBarView( child: TabBarView(
controller: controller.tabController, controller: controller.tabController,
children: const [ children: const [
@ -55,19 +70,16 @@ class BattleLeaguePage extends GetView<BattleLeagueController> {
), ),
], ],
), ),
),
56.0.gapHeight,
Padding(
);
}
Padding _startButton(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: MySpaces.s30), padding: const EdgeInsets.symmetric(horizontal: MySpaces.s30),
child: BattleLeagueStartButton( child: BattleLeagueStartButton(
title: context.translate.play_now, title: context.translate.play_now,
onTap: () {}, onTap: () {},
), ),
),
MySpaces.s16.gapHeight,
],
),
),
); );
} }
} }
Loading…
Cancel
Save