From df75a05f8cb8dfa48e118330dbd0136dee8b22b9 Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Wed, 27 Sep 2023 10:04:00 +0200 Subject: [PATCH] feat(neon): skip platform initialization if already initialized Signed-off-by: Nikolas Rimikis --- packages/neon/neon/lib/src/platform/platform.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/neon/neon/lib/src/platform/platform.dart b/packages/neon/neon/lib/src/platform/platform.dart index 8c541890..d4e53fd6 100644 --- a/packages/neon/neon/lib/src/platform/platform.dart +++ b/packages/neon/neon/lib/src/platform/platform.dart @@ -17,6 +17,10 @@ abstract interface class NeonPlatform { /// /// Required to be called before accessing [NeonPlatform.instance]. static Future setup() async { + if (_platform != null) { + return; + } + if (Platform.isAndroid) { _platform = const AndroidNeonPlatform(); } else if (Platform.isLinux) {