Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import 'package:cloud_firestore_platform_interface/cloud_firestore_platform_interface.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart'
show FirebasePluginPlatform;
show FirebasePlugin;
import 'package:flutter/foundation.dart';
import 'package:meta/meta.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ part of '../cloud_firestore.dart';
///
/// FirebaseFirestore firestore = FirebaseFirestore.instanceFor(app: secondaryApp);
/// ```
class FirebaseFirestore extends FirebasePluginPlatform {
class FirebaseFirestore extends FirebasePlugin {
FirebaseFirestore._({
required this.app,
required this.databaseId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'dart:typed_data';
import 'package:cloud_functions_platform_interface/cloud_functions_platform_interface.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart'
show FirebasePluginPlatform;
show FirebasePlugin;
import 'package:flutter/foundation.dart';

export 'package:cloud_functions_platform_interface/cloud_functions_platform_interface.dart'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ part of '../cloud_functions.dart';
/// The entry point for accessing FirebaseFunctions.
///
/// You can get an instance by calling [FirebaseFunctions.instance].
class FirebaseFunctions extends FirebasePluginPlatform {
class FirebaseFunctions extends FirebasePlugin {
FirebaseFunctions._({required this.app, String? region})
: _region = region ??= 'us-central1',
super(app.name, 'plugins.flutter.io/firebase_functions');
Expand Down
4 changes: 2 additions & 2 deletions packages/firebase_ai/firebase_ai/lib/src/firebase_ai.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import 'package:firebase_app_check/firebase_app_check.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart'
show FirebasePluginPlatform;
show FirebasePlugin;
import 'package:http/http.dart' as http;
import 'package:meta/meta.dart';

Expand All @@ -26,7 +26,7 @@ import 'base_model.dart';
const _defaultLocation = 'us-central1';

/// The entrypoint for generative models.
class FirebaseAI extends FirebasePluginPlatform {
class FirebaseAI extends FirebasePlugin {
FirebaseAI._({
required this.app,
required this.location,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import 'package:firebase_analytics_platform_interface/firebase_analytics_platform_interface.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart'
show FirebasePluginPlatform;
show FirebasePlugin;
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
part of '../firebase_analytics.dart';

/// Firebase Analytics API.
class FirebaseAnalytics extends FirebasePluginPlatform {
class FirebaseAnalytics extends FirebasePlugin {
FirebaseAnalytics._({
required this.app,
this.webOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

part of '../firebase_app_check.dart';

class FirebaseAppCheck extends FirebasePluginPlatform
implements FirebaseService {
class FirebaseAppCheck extends FirebasePlugin implements FirebaseService {
static Map<String, FirebaseAppCheck> _firebaseAppCheckInstances = {};

FirebaseAppCheck._({required this.app})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
import 'package:firebase_app_installations_platform_interface/firebase_app_installations_platform_interface.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart'
show FirebasePluginPlatform;
show FirebasePlugin;

part 'src/firebase_app_installations.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

part of '../firebase_app_installations.dart';

class FirebaseInstallations extends FirebasePluginPlatform {
class FirebaseInstallations extends FirebasePlugin {
FirebaseInstallations._({required this.app})
: super(app.name, 'plugins.flutter.io/firebase_app_installations');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
part of '../firebase_auth.dart';

/// The entry point of the Firebase Authentication SDK.
class FirebaseAuth extends FirebasePluginPlatform implements FirebaseService {
class FirebaseAuth extends FirebasePlugin implements FirebaseService {
// Cached instances of [FirebaseAuth].
static Map<String, FirebaseAuth> _firebaseAuthInstances = {};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MethodChannelFirebase extends FirebasePlatform {
}

/// Creates and attaches a new [MethodChannelFirebaseApp] to the [MethodChannelFirebase]
/// and adds any constants to the [FirebasePluginPlatform] class.
/// and adds any constants to the [FirebasePlugin] class.
void _initializeFirebaseAppFromMap(CoreInitializeResponse response) {
MethodChannelFirebaseApp methodChannelFirebaseApp =
MethodChannelFirebaseApp(
Expand All @@ -45,8 +45,7 @@ class MethodChannelFirebase extends FirebasePlatform {

appInstances[methodChannelFirebaseApp.name] = methodChannelFirebaseApp;

FirebasePluginPlatform
._constantsForPluginApps[methodChannelFirebaseApp.name] =
FirebasePlugin._constantsForPluginApps[methodChannelFirebaseApp.name] =
response.pluginConstants;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class MethodChannelFirebaseApp extends FirebaseAppPlatform {
await _api.delete(name);

MethodChannelFirebase.appInstances.remove(name);
FirebasePluginPlatform._constantsForPluginApps.remove(name);
FirebasePlugin._constantsForPluginApps.remove(name);
_isDeleted = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@

part of '../../firebase_core_platform_interface.dart';

/// The interface that other FlutterFire plugins must extend.
/// The base class that other FlutterFire plugins must extend.
///
/// This class provides access to common plugin properties and constants which
/// are available once the user has initialized FlutterFire.
abstract class FirebasePluginPlatform extends PlatformInterface {
abstract class FirebasePlugin {
// ignore: public_member_api_docs
FirebasePluginPlatform(this._appName, this._methodChannelName)
: super(token: _token);
FirebasePlugin(this._appName, this._methodChannelName);

/// The global data store for all constants, for each plugin and [FirebaseAppPlatform] instance.
///
Expand All @@ -26,13 +25,6 @@ abstract class FirebasePluginPlatform extends PlatformInterface {

final String _methodChannelName;

static final Object _token = Object();

// ignore: public_member_api_docs
static void verify(FirebasePluginPlatform instance) {
PlatformInterface.verify(instance, _token);
}

/// Returns any plugin constants this plugin app instance has initialized.
Map<dynamic, dynamic> get pluginConstants {
final appConstants =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ void main() {
FirebasePlatform.instance = mock;
});
});

group('$FirebasePlugin', () {
test('is not a platform interface', () {
expect(TestFirebasePlugin(), isNot(isA<PlatformInterface>()));
});
});
}

class ImplementsFirebasePlatform implements FirebasePlatform {
Expand Down Expand Up @@ -70,3 +76,7 @@ class FirebaseCoreMockPlatform extends Mock
MockPlatformInterfaceMixin
implements
FirebasePlatform {}

class TestFirebasePlugin extends FirebasePlugin {
TestFirebasePlugin() : super(defaultFirebaseAppName, 'test_plugin');
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart'
show FirebasePluginPlatform;
show FirebasePlugin;
import 'package:firebase_crashlytics_platform_interface/firebase_crashlytics_platform_interface.dart';
import 'package:flutter/foundation.dart'
show DiagnosticLevel, FlutterError, FlutterErrorDetails, kDebugMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ part of '../firebase_crashlytics.dart';
/// The entry point for accessing a [FirebaseCrashlytics].
///
/// You can get an instance by calling [FirebaseCrashlytics.instance].
class FirebaseCrashlytics extends FirebasePluginPlatform {
class FirebaseCrashlytics extends FirebasePlugin {
FirebaseCrashlytics._({required this.app})
: super(app.name, 'plugins.flutter.io/firebase_crashlytics');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import 'cache/cache_data_types.dart';
import 'cache/cache.dart';

/// DataConnect class
class FirebaseDataConnect extends FirebasePluginPlatform {
class FirebaseDataConnect extends FirebasePlugin {
/// Constructor for initializing Data Connect
@visibleForTesting
FirebaseDataConnect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'dart:async';

import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart'
show FirebasePluginPlatform;
show FirebasePlugin;
import 'package:firebase_database_platform_interface/firebase_database_platform_interface.dart';
import 'package:flutter/foundation.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ part of '../firebase_database.dart';

/// The entry point for accessing a Firebase Database. You can get an instance
/// by calling `FirebaseDatabase.instance` or `FirebaseDatabase.instanceFor()`.
class FirebaseDatabase extends FirebasePluginPlatform {
class FirebaseDatabase extends FirebasePlugin {
FirebaseDatabase._({required this.app, this.databaseURL})
: super(app.name, 'plugins.flutter.io/firebase_database') {
if (databaseURL != null && databaseURL!.endsWith('/')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart'
show FirebasePluginPlatform;
show FirebasePlugin;
import 'package:firebase_in_app_messaging_platform_interface/firebase_in_app_messaging_platform_interface.dart';

class FirebaseInAppMessaging extends FirebasePluginPlatform {
class FirebaseInAppMessaging extends FirebasePlugin {
FirebaseInAppMessaging._({required this.app})
: super(app.name, 'plugins.flutter.io/firebase_in_app_messaging');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'dart:async';

import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart'
show FirebasePluginPlatform;
show FirebasePlugin;
import 'package:firebase_messaging_platform_interface/firebase_messaging_platform_interface.dart';

export 'package:firebase_messaging_platform_interface/firebase_messaging_platform_interface.dart'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ part of '../firebase_messaging.dart';
/// The [FirebaseMessaging] entry point.
///
/// To get a new instance, call [FirebaseMessaging.instance].
class FirebaseMessaging extends FirebasePluginPlatform {
class FirebaseMessaging extends FirebasePlugin {
// Cached and lazily loaded instance of [FirebaseMessagingPlatform] to avoid
// creating a [MethodChannelFirebaseMessaging] when not needed or creating an
// instance with the default app before a user specifies an app.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'dart:async';

import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart'
show FirebasePluginPlatform;
show FirebasePlugin;
import 'package:firebase_ml_model_downloader_platform_interface/firebase_ml_model_downloader_platform_interface.dart';
import 'package:flutter/foundation.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

part of '../firebase_ml_model_downloader.dart';

class FirebaseModelDownloader extends FirebasePluginPlatform {
class FirebaseModelDownloader extends FirebasePlugin {
FirebaseModelDownloader._({required this.app})
: super(app.name, 'plugins.flutter.io/firebase_ml_model_downloader');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ part of '../firebase_performance.dart';
/// The Firebase Performance API.
///
/// You can get an instance by calling [FirebasePerformance.instance].
class FirebasePerformance extends FirebasePluginPlatform {
class FirebasePerformance extends FirebasePlugin {
FirebasePerformance._({required this.app})
: super(app.name, 'plugins.flutter.io/firebase_performance');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'dart:async';

import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart'
show FirebasePluginPlatform;
show FirebasePlugin;
import 'package:firebase_remote_config_platform_interface/firebase_remote_config_platform_interface.dart';

export 'package:firebase_remote_config_platform_interface/firebase_remote_config_platform_interface.dart'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ part of '../firebase_remote_config.dart';
/// You can get an instance by calling [FirebaseRemoteConfig.instance]. Note
/// [FirebaseRemoteConfig.instance] is async.
// ignore: prefer_mixin
class FirebaseRemoteConfig extends FirebasePluginPlatform {
class FirebaseRemoteConfig extends FirebasePlugin {
FirebaseRemoteConfig._({required this.app})
: super(app.name, 'plugins.flutter.io/firebase_remote_config');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'dart:io' show File;
// import 'package:flutter/foundation.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart'
show FirebasePluginPlatform;
show FirebasePlugin;
import 'package:firebase_storage_platform_interface/firebase_storage_platform_interface.dart';
import 'package:flutter/foundation.dart';
import 'package:mime/mime.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
part of firebase_storage;

/// The entrypoint for [FirebaseStorage].
class FirebaseStorage extends FirebasePluginPlatform {
class FirebaseStorage extends FirebasePlugin {
FirebaseStorage._({required this.app, required this.bucket})
: super(app.name, 'plugins.flutter.io/firebase_storage');

Expand Down
Loading