Browse Source

feat(neon): skip platform initialization if already initialized

Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
pull/866/head
Nikolas Rimikis 1 year ago
parent
commit
df75a05f8c
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 4
      packages/neon/neon/lib/src/platform/platform.dart

4
packages/neon/neon/lib/src/platform/platform.dart

@ -17,6 +17,10 @@ abstract interface class NeonPlatform {
/// ///
/// Required to be called before accessing [NeonPlatform.instance]. /// Required to be called before accessing [NeonPlatform.instance].
static Future<void> setup() async { static Future<void> setup() async {
if (_platform != null) {
return;
}
if (Platform.isAndroid) { if (Platform.isAndroid) {
_platform = const AndroidNeonPlatform(); _platform = const AndroidNeonPlatform();
} else if (Platform.isLinux) { } else if (Platform.isLinux) {

Loading…
Cancel
Save