- refactoring conifg
This commit is contained in:
2025-12-07 14:56:43 +09:00
parent d3fca333cb
commit 8771f2c1af
15 changed files with 295 additions and 156 deletions
@@ -90,9 +90,9 @@ class CharacterStatusCard extends StatelessWidget {
}).toList(),
),
),
Text("ATK: ${character.totalAtk}"),
Text("DEF: ${character.totalDefense}"),
Text("LUCK: ${character.totalLuck}"),
Text("ATK: ${character.totalAtk}", style: const TextStyle(color: ThemeConfig.textColorWhite)),
Text("DEF: ${character.totalDefense}", style: const TextStyle(color: ThemeConfig.textColorWhite)),
Text("LUCK: ${character.totalLuck}", style: const TextStyle(color: ThemeConfig.textColorWhite)),
],
),
),
@@ -135,16 +135,16 @@ class CharacterStatusCard extends StatelessWidget {
child: Container(
padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.black54,
color: ThemeConfig.enemyIntentBg,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.redAccent),
border: Border.all(color: ThemeConfig.enemyIntentBorder),
),
child: Column(
children: [
Text(
"INTENT",
style: TextStyle(
color: Colors.redAccent,
color: ThemeConfig.enemyIntentBorder,
fontSize: 10,
fontWeight: FontWeight.bold,
),
@@ -156,14 +156,14 @@ class CharacterStatusCard extends StatelessWidget {
intent.type == EnemyActionType.attack
? Icons.flash_on
: Icons.shield,
color: Colors.yellow,
color: ThemeConfig.rarityRare, // Yellow
size: 16,
),
const SizedBox(width: 4),
Text(
intent.description,
style: const TextStyle(
color: Colors.white,
color: ThemeConfig.textColorWhite,
fontSize: 12,
),
),
+21 -20
View File
@@ -3,6 +3,7 @@ import '../../providers/battle_provider.dart';
import '../../game/model/item.dart';
import '../../utils/item_utils.dart';
import '../../game/enums.dart';
import '../../game/config/theme_config.dart';
class ShopUI extends StatelessWidget {
final BattleProvider battleProvider;
@@ -15,7 +16,7 @@ class ShopUI extends StatelessWidget {
final shopItems = battleProvider.currentStage.shopItems;
return Container(
color: Colors.black87,
color: ThemeConfig.shopBg,
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
@@ -25,22 +26,22 @@ class ShopUI extends StatelessWidget {
children: [
const Row(
children: [
Icon(Icons.store, size: 32, color: Colors.amber),
Icon(Icons.store, size: 32, color: ThemeConfig.mainIconColor),
SizedBox(width: 8),
Text(
"Merchant",
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold, color: Colors.white),
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold, color: ThemeConfig.textColorWhite),
),
],
),
Row(
children: [
const Icon(Icons.monetization_on, color: Colors.amber),
const Icon(Icons.monetization_on, color: ThemeConfig.statGoldColor),
const SizedBox(width: 4),
Text(
"${player.gold} G",
style: const TextStyle(
color: Colors.amber,
color: ThemeConfig.statGoldColor,
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -49,7 +50,7 @@ class ShopUI extends StatelessWidget {
),
],
),
const Divider(color: Colors.grey),
const Divider(color: ThemeConfig.textColorGrey),
const SizedBox(height: 16),
// Shop Items Grid
@@ -58,7 +59,7 @@ class ShopUI extends StatelessWidget {
? const Center(
child: Text(
"Sold Out",
style: TextStyle(color: Colors.grey, fontSize: 24),
style: TextStyle(color: ThemeConfig.textColorGrey, fontSize: 24),
),
)
: GridView.builder(
@@ -76,7 +77,7 @@ class ShopUI extends StatelessWidget {
return InkWell(
onTap: () => _showBuyConfirmation(context, item),
child: Card(
color: Colors.blueGrey[800],
color: ThemeConfig.shopItemCardBg,
shape: item.rarity != ItemRarity.magic
? RoundedRectangleBorder(
side: BorderSide(
@@ -129,7 +130,7 @@ class ShopUI extends StatelessWidget {
height: 32,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: canBuy ? Colors.amber : Colors.grey,
backgroundColor: canBuy ? ThemeConfig.statGoldColor : ThemeConfig.btnDisabled,
foregroundColor: Colors.black,
padding: EdgeInsets.zero,
),
@@ -159,28 +160,28 @@ class ShopUI extends StatelessWidget {
children: [
ElevatedButton.icon(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blueGrey,
backgroundColor: ThemeConfig.btnRerollBg,
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
),
onPressed: player.gold >= 50
? () => battleProvider.rerollShopItems()
: null,
icon: const Icon(Icons.refresh, color: Colors.white),
icon: const Icon(Icons.refresh, color: ThemeConfig.textColorWhite),
label: const Text(
"Reroll (50 G)",
style: TextStyle(color: Colors.white),
style: TextStyle(color: ThemeConfig.textColorWhite),
),
),
ElevatedButton.icon(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.redAccent,
backgroundColor: ThemeConfig.btnLeaveBg,
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
),
onPressed: () => battleProvider.proceedToNextStage(),
icon: const Icon(Icons.exit_to_app, color: Colors.white),
icon: const Icon(Icons.exit_to_app, color: ThemeConfig.textColorWhite),
label: const Text(
"Leave Shop",
style: TextStyle(color: Colors.white),
style: TextStyle(color: ThemeConfig.textColorWhite),
),
),
],
@@ -204,7 +205,7 @@ class ShopUI extends StatelessWidget {
child: const Text("Cancel"),
),
ElevatedButton(
style: ElevatedButton.styleFrom(backgroundColor: Colors.amber),
style: ElevatedButton.styleFrom(backgroundColor: ThemeConfig.statGoldColor),
onPressed: () {
battleProvider.buyItem(item);
Navigator.pop(ctx);
@@ -237,7 +238,7 @@ class ShopUI extends StatelessWidget {
if (item.effects.isNotEmpty)
Text(
item.effects.first.type.name.toUpperCase(),
style: const TextStyle(fontSize: 9, color: Colors.orangeAccent),
style: const TextStyle(fontSize: 9, color: ThemeConfig.rarityLegendary),
textAlign: TextAlign.center,
),
],
@@ -256,11 +257,11 @@ class RestUI extends StatelessWidget {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(Icons.local_hotel, size: 64, color: Colors.blue),
const Icon(Icons.local_hotel, size: 64, color: ThemeConfig.btnRestBg),
const SizedBox(height: 16),
const Text("Rest Area", style: TextStyle(fontSize: 24)),
const Text("Rest Area", style: TextStyle(fontSize: 24, color: ThemeConfig.textColorWhite)),
const SizedBox(height: 8),
const Text("Take a breath and heal."),
const Text("Take a breath and heal.", style: TextStyle(color: ThemeConfig.textColorWhite)),
const SizedBox(height: 32),
ElevatedButton(
onPressed: () {