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/models/character_class.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'server/lib/core/models/character_class.dart') diff --git a/server/lib/core/models/character_class.dart b/server/lib/core/models/character_class.dart index 12f4285..def0354 100644 --- a/server/lib/core/models/character_class.dart +++ b/server/lib/core/models/character_class.dart @@ -39,9 +39,9 @@ class CharacterClass { } //TODO: color array + gradiantType support final healthByLevel = (data['health'] as List).cast(); - int radix = 16; + final int radix = 16; final colorValue = data['color']; - Color color = (colorValue is List) + final Color color = (colorValue is List) ? Color(int.parse(colorValue.first as String, radix: radix)) : Color(int.parse(colorValue as String, radix: radix)); @@ -54,7 +54,7 @@ class CharacterClass { : Color(int.parse(data['colorSecondary'], radix: radix)); } - List summonList = []; + final List summonList = []; if (data.containsKey('summons')) { final summons = data['summons'] as Map; for (String key in summons.keys) { @@ -62,7 +62,7 @@ class CharacterClass { } } - List perkList = []; + final List perkList = []; if (data.containsKey('perks')) { final perks = (data['perks'] as List) .cast>(); @@ -71,7 +71,7 @@ class CharacterClass { } } - List perkFHList = []; + final List perkFHList = []; if (data.containsKey('perks_fh')) { final perks = (data['perks_fh'] as List) .cast>(); @@ -107,7 +107,7 @@ class PerkModel { text = data['text']; } - List addList = []; + final List addList = []; if (data.containsKey('adds')) { final adds = (data['adds'] as List).cast(); for (String item in adds) { @@ -115,7 +115,7 @@ class PerkModel { } } - List removeList = []; + final List removeList = []; if (data.containsKey('removes')) { final removes = (data['removes'] as List).cast(); for (String item in removes) { -- cgit v1.3.1