Browse Source

neon: make GlobalPopups mockable

pull/422/head
Nikolas Rimikis 2 years ago
parent
commit
528ae8ef7a
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 10
      packages/neon/neon/lib/src/utils/global_popups.dart

10
packages/neon/neon/lib/src/utils/global_popups.dart

@ -1,10 +1,16 @@
part of '../../neon.dart';
class GlobalPopups {
factory GlobalPopups() => _instance ??= GlobalPopups._();
factory GlobalPopups() => instance ??= GlobalPopups._();
@visibleForTesting
factory GlobalPopups.mocked(final GlobalPopups mock) => instance ??= mock;
GlobalPopups._();
static GlobalPopups? _instance;
@visibleForTesting
static GlobalPopups? instance;
bool _registered = false;
void register(final BuildContext context) {

Loading…
Cancel
Save