From 7ee14396b1f1f96ed0472b5949ce82a7f9313276 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Mon, 23 Nov 2026 15:38:13 +0100 Subject: server: make local variables final (prefer_final_locals) 270 locals across 52 files. Six of them were declared with an unnecessarily nullable type (ModifierDeck? / LootDeckModel?) although the initializer is non-nullable; non-final locals were silently flow-promoted to the initializer's type, but final locals are not, so the nullability is dropped where it was wrong. --- server/lib/core/methods/character_methods.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server/lib/core/methods/character_methods.dart') diff --git a/server/lib/core/methods/character_methods.dart b/server/lib/core/methods/character_methods.dart index 9c2705a..6cd6c10 100644 --- a/server/lib/core/methods/character_methods.dart +++ b/server/lib/core/methods/character_methods.dart @@ -193,7 +193,7 @@ class CharacterMethods { final list = character.characterState.summonList; if (list.isNotEmpty && list.first.name == name) { - int hp = health + character.characterState.level * multiplier; + final int hp = health + character.characterState.level * multiplier; list.first.setMaxHealth(s, hp); list.first.setHealth(s, hp); } @@ -261,7 +261,7 @@ class CharacterMethods { } if (name.isNotEmpty) { - MonsterInstance summon = MonsterInstance.summon( + final MonsterInstance summon = MonsterInstance.summon( _kSpecialSummonStandeeNr, MonsterType.summon, name, @@ -282,7 +282,7 @@ class CharacterMethods { List characters, { GameState? gameState, }) { - List newList = []; + final List newList = []; final gs = gameState ?? getIt(); for (final item in gs.currentList) { if (item is Character) { @@ -314,7 +314,7 @@ class CharacterMethods { GameData? gameData, }) { Character? character; - List characters = []; + final List characters = []; final gd = gameData ?? getIt(); final modelData = gd.modelData; for (String key in modelData.keys) { @@ -371,7 +371,7 @@ class CharacterMethods { } if (name.isNotEmpty) { - MonsterInstance summon = MonsterInstance.summon( + final MonsterInstance summon = MonsterInstance.summon( _kSpecialSummonStandeeNr, MonsterType.summon, name, -- cgit v1.3.1