Skip to content

Commit

Permalink
fix: fix verify
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyokone committed Oct 12, 2022
1 parent c489191 commit 3857c1a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Expand Up @@ -17,9 +17,7 @@ part of cloud_firestore;
/// ```
class FirebaseFirestore extends FirebasePluginPlatform {
FirebaseFirestore._({required this.app})
: super(app.name, 'plugins.flutter.io/firebase_firestore') {
FirebasePluginPlatform.verify(instance);
}
: super(app.name, 'plugins.flutter.io/firebase_firestore');

static final Map<String, FirebaseFirestore> _cachedInstances = {};

Expand All @@ -37,6 +35,8 @@ class FirebaseFirestore extends FirebasePluginPlatform {
}

FirebaseFirestore newInstance = FirebaseFirestore._(app: app);
FirebasePluginPlatform.verify(newInstance);

_cachedInstances[app.name] = newInstance;

return newInstance;
Expand Down
Expand Up @@ -11,9 +11,7 @@ part of cloud_functions;
class FirebaseFunctions extends FirebasePluginPlatform {
FirebaseFunctions._({required this.app, String? region})
: _region = region ??= 'us-central1',
super(app.name, 'plugins.flutter.io/firebase_functions') {
FirebasePluginPlatform.verify(instance);
}
super(app.name, 'plugins.flutter.io/firebase_functions');

// Cached and lazily loaded instance of [FirebaseFunctionsPlatform] to avoid
// creating a [MethodChannelFirebaseFunctions] when not needed or creating an
Expand Down Expand Up @@ -52,6 +50,7 @@ class FirebaseFunctions extends FirebasePluginPlatform {

FirebaseFunctions newInstance =
FirebaseFunctions._(app: app, region: region);
FirebasePluginPlatform.verify(newInstance);
_cachedInstances[cachedKey] = newInstance;

return newInstance;
Expand Down
Expand Up @@ -7,9 +7,7 @@ part of firebase_analytics;
/// Firebase Analytics API.
class FirebaseAnalytics extends FirebasePluginPlatform {
FirebaseAnalytics._({required this.app})
: super(app.name, 'plugins.flutter.io/firebase_analytics') {
FirebasePluginPlatform.verify(instance);
}
: super(app.name, 'plugins.flutter.io/firebase_analytics');

/// Namespace for analytics API available on Android only. This is deprecated in favor of
/// `FirebaseAnalytics.instance.setSessionTimeoutDuration()`.
Expand Down Expand Up @@ -48,7 +46,10 @@ class FirebaseAnalytics extends FirebasePluginPlatform {
factory FirebaseAnalytics.instanceFor({required FirebaseApp app}) {
if (kIsWeb || app.name == defaultFirebaseAppName) {
return _firebaseAnalyticsInstances.putIfAbsent(app.name, () {
return FirebaseAnalytics._(app: app);
final instance = FirebaseAnalytics._(app: app);
FirebasePluginPlatform.verify(instance);

return instance;
});
}

Expand Down

0 comments on commit 3857c1a

Please sign in to comment.