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 01c5841 commit 90552fe
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 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
Expand Up @@ -66,7 +66,7 @@ abstract class RecaptchaVerifierFactoryPlatform extends PlatformInterface {
}

/// Ensures that a delegate class extends [RecaptchaVerifierFactoryPlatform].
static void verify(RecaptchaVerifierFactoryPlatform instance) {
static void verifyExtends(RecaptchaVerifierFactoryPlatform instance) {
PlatformInterface.verify(instance, _token);
}

Expand Down
Expand Up @@ -46,7 +46,7 @@ void main() {
group('verify()', () {
test('calls successfully', () {
try {
RecaptchaVerifierFactoryPlatform.verify(
RecaptchaVerifierFactoryPlatform.verifyExtends(
recaptchaVerifierFactoryPlatform);
return;
} catch (_) {
Expand Down

0 comments on commit 90552fe

Please sign in to comment.