From 505e3c2cd7f75b2440247dbf8e9ac7fde6621755 Mon Sep 17 00:00:00 2001 From: zontreck Date: Mon, 1 Jul 2024 23:15:08 -0700 Subject: [PATCH] Apply dart autofixes --- lib/main.dart | 2 +- lib/pages/GameServerPage.dart | 4 ++-- lib/pages/ModManager.dart | 2 +- lib/pages/home.dart | 3 ++- lib/statemachine.dart | 4 ++-- lib/structs/mod.dart | 2 +- lib/structs/settingsEntry.dart | 3 ++- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 6cf8126..6f93a65 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -64,7 +64,7 @@ class ServerPage extends StatelessWidget { port = int.parse(ipParts[1]); } - print("Attempting to connect to FQDN/IP : ${ip} on port ${port}"); + print("Attempting to connect to FQDN/IP : $ip on port $port"); await settings.client!.startConnect(ip, port); C2SLoginPacket login = C2SLoginPacket(); diff --git a/lib/pages/GameServerPage.dart b/lib/pages/GameServerPage.dart index cf316e4..5083bd3 100644 --- a/lib/pages/GameServerPage.dart +++ b/lib/pages/GameServerPage.dart @@ -87,9 +87,9 @@ class GameServerPageState extends State { var response = await Navigator.pushNamed(context, "/server/discord"); - if (response == null) + if (response == null) { return; - else { + } else { DiscordHookProps editResult = response as DiscordHookProps; Settings settings = Settings(); settings.inst!.discord = editResult; diff --git a/lib/pages/ModManager.dart b/lib/pages/ModManager.dart index 64ed09e..ec8e2a6 100644 --- a/lib/pages/ModManager.dart +++ b/lib/pages/ModManager.dart @@ -75,7 +75,7 @@ class ModManagerState extends State { child: ListTile( title: Text(mod.mod_name), subtitle: Text( - "ID: ${mod.mod_id}\nLoad Order: ${idx}\nEnabled: ${mod.enabled}"), + "ID: ${mod.mod_id}\nLoad Order: $idx\nEnabled: ${mod.enabled}"), onTap: () async { final reply = await Navigator.pushNamed( context, "/server/mods/edit", diff --git a/lib/pages/home.dart b/lib/pages/home.dart index d43d54e..8b149f6 100644 --- a/lib/pages/home.dart +++ b/lib/pages/home.dart @@ -120,8 +120,9 @@ class HomePageState extends State { setState(() {}); - if(requireRestart) + if(requireRestart) { Navigator.pop(context); + } }, ) , SwitchListTile(value: requireRestart, onChanged: (V) { diff --git a/lib/statemachine.dart b/lib/statemachine.dart index 76cc971..0479be0 100644 --- a/lib/statemachine.dart +++ b/lib/statemachine.dart @@ -314,7 +314,7 @@ class StateMachine { } DiscordHookHelper.sendWebHook(settings.inst!.discord, alertColor, - "Server Restart Alert", "${current.warning}"); + "Server Restart Alert", current.warning); } // Check Shutdown Pending @@ -348,7 +348,7 @@ class StateMachine { // Mod is ok } else { // Mod is not ok - updatedMods.add("${scannedMod.mod_name}"); + updatedMods.add(scannedMod.mod_name); } } diff --git a/lib/structs/mod.dart b/lib/structs/mod.dart index bea0266..7a52374 100644 --- a/lib/structs/mod.dart +++ b/lib/structs/mod.dart @@ -41,7 +41,7 @@ class Mod { } static Mod deserialize(CompoundTag tag) { - CompoundTag ct = tag as CompoundTag; + CompoundTag ct = tag; return Mod( mod_name: ct.get("name")!.asString(), diff --git a/lib/structs/settingsEntry.dart b/lib/structs/settingsEntry.dart index 8d50146..523b797 100644 --- a/lib/structs/settingsEntry.dart +++ b/lib/structs/settingsEntry.dart @@ -36,9 +36,10 @@ class SettingsEntry { st.pterodactylMode = NbtUtils.readBoolean(tag, "pterodactyl"); } - if (tag.containsKey(DiscordHookProps.TAG_NAME)) + if (tag.containsKey(DiscordHookProps.TAG_NAME)) { st.discord = DiscordHookProps.deserialize( tag.get(DiscordHookProps.TAG_NAME)!.asCompoundTag()); + } st.mods.clear(); ListTag lMods = tag.get("mods") as ListTag;