Skip to content

Commit

Permalink
refactor(firebase_functions)!: remove deprecated APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
Salakar committed Jan 7, 2021
1 parent 5c7f2ff commit 48a1245
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ import 'package:flutter/foundation.dart';
import 'package:meta/meta.dart';

export 'package:cloud_functions_platform_interface/cloud_functions_platform_interface.dart'
show
// ignore: deprecated_member_use
CloudFunctionsException,
HttpsCallableOptions,
FirebaseFunctionsException;
show HttpsCallableOptions, FirebaseFunctionsException;

part 'src/firebase_functions.dart';
part 'src/https_callable.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ class FirebaseFunctions extends FirebasePluginPlatform {
return newInstance;
}

// ignore: public_member_api_docs
@Deprecated(
"Constructing CloudFunctions is deprecated, use 'FirebaseFunctions.instance' or 'FirebaseFunctions.instanceFor' instead")
factory FirebaseFunctions({FirebaseApp app, String region}) {
return FirebaseFunctions.instanceFor(app: app, region: region);
}

final String _region;

String _origin;
Expand All @@ -73,12 +66,6 @@ class FirebaseFunctions extends FirebasePluginPlatform {
return HttpsCallable._(_delegate.httpsCallable(_origin, name, options));
}

@Deprecated("Deprecated in favor of httpsCallable()")
// ignore: public_member_api_docs
HttpsCallable getHttpsCallable({@required String functionName}) {
return httpsCallable(functionName);
}

/// Changes this instance to point to a Cloud Functions emulator running locally.
///
/// Set the [origin] of the local emulator, such as "http://localhost:5001", or `null`
Expand All @@ -100,21 +87,3 @@ class FirebaseFunctions extends FirebasePluginPlatform {
_origin = origin;
}
}

@Deprecated("Deprecated in favor of FirebaseFunctions")
// ignore: public_member_api_docs
class CloudFunctions extends FirebaseFunctions {
/// Returns an instance using the default [FirebaseApp].
static FirebaseFunctions get instance {
return FirebaseFunctions.instanceFor(
app: Firebase.app(),
);
}

// ignore: public_member_api_docs
@Deprecated(
"Constructing CloudFunctions is deprecated, use 'FirebaseFunctions.instance' or 'FirebaseFunctions.instanceFor' instead")
factory CloudFunctions({FirebaseApp app, String region}) {
return FirebaseFunctions.instanceFor(app: app, region: region);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ class HttpsCallable {
assert(_delegate != null);
return HttpsCallableResult<T>._(await _delegate.call(parameters));
}

@Deprecated(
"Setting the timeout is deprecated in favor of using [HttpsCallableOptions]")
// ignore: public_member_api_docs
set timeout(Duration duration) {
_delegate.timeout = duration;
}
}

/// Asserts whether a given call parameter is a valid type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,4 @@ void main() {
functions.httpsCallable('testName');
verify(kMockFirebaseFunctionsPlatform.httpsCallable(any, 'testName', any));
});

//
test('getHttpsCallable()', () {
// ignore: deprecated_member_use_from_same_package
functions.getHttpsCallable(functionName: 'testName');
verify(kMockFirebaseFunctionsPlatform.httpsCallable(any, 'testName', any));
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,5 @@ void main() {
verify(kMockHttpsCallablePlatform(parameters));
});
});

group('set.timeout (deprecated)', () {
test('sets timeout value', () async {
// ignore: deprecated_member_use_from_same_package
kHttpsCallable.timeout = Duration(minutes: 2);

verify(kMockHttpsCallablePlatform.timeout = Duration(minutes: 2));
});
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ class FirebaseFunctionsException extends FirebaseException
/// Additional data provided with the exception.
final dynamic details;
}

@Deprecated("Deprecated in favor of FirebaseFunctionsException")
// ignore: public_member_api_docs
class CloudFunctionsException extends FirebaseFunctionsException {}

0 comments on commit 48a1245

Please sign in to comment.