Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: More analysis cleanup #16676

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 @@ -4,7 +4,6 @@
// BSD-style license that can be found in the LICENSE file.

import 'package:cloud_firestore_platform_interface/cloud_firestore_platform_interface.dart';
import 'package:collection/collection.dart';

import 'method_channel_document_change.dart';

Expand All @@ -27,7 +26,7 @@ class MethodChannelQuerySnapshot extends QuerySnapshotPlatform {
document.metadata,
);
})
.whereNotNull()
.nonNulls
.toList(),
data.documentChanges
.map((documentChange) {
Expand All @@ -39,7 +38,7 @@ class MethodChannelQuerySnapshot extends QuerySnapshotPlatform {
documentChange,
);
})
.whereNotNull()
.nonNulls
.toList(),
SnapshotMetadataPlatform(
data.metadata.hasPendingWrites,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,6 @@ firestore_interop.GetOptions? convertGetOptions(GetOptions? options) {
case Source.server:
source = 'server';
break;
default:
source = 'default';
break;
}

return firestore_interop.GetOptions(source: source.toJS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import 'dart:async';

import 'package:_flutterfire_internals/_flutterfire_internals.dart';
import 'package:collection/collection.dart';
import 'package:firebase_auth_platform_interface/src/method_channel/method_channel_multi_factor.dart';
import 'package:firebase_auth_platform_interface/src/method_channel/utils/convert_auth_provider.dart';
import 'package:firebase_auth_platform_interface/src/pigeon/messages.pigeon.dart';
Expand Down Expand Up @@ -437,7 +436,7 @@ class MethodChannelFirebaseAuth extends FirebaseAuthPlatform {
try {
final data = await _api.fetchSignInMethodsForEmail(pigeonDefault, email);

return data.whereNotNull().toList();
return data.nonNulls.toList();
} catch (e, stack) {
convertPlatformException(e, stack);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:collection/collection.dart';
import 'package:firebase_auth_platform_interface/firebase_auth_platform_interface.dart';
import 'package:firebase_auth_platform_interface/src/method_channel/method_channel_firebase_auth.dart';
import 'package:firebase_auth_platform_interface/src/method_channel/method_channel_multi_factor.dart';
Expand Down Expand Up @@ -179,7 +178,7 @@ FirebaseAuthMultiFactorExceptionPlatform parseMultiFactorError(

final pigeonMultiFactorInfo =
(additionalData['multiFactorHints'] as List<Object?>? ?? [])
.whereNotNull()
.nonNulls
.map(
PigeonMultiFactorInfo.decode,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:collection/collection.dart';
import 'package:firebase_auth_platform_interface/firebase_auth_platform_interface.dart';
import 'package:firebase_auth_platform_interface/src/pigeon/messages.pigeon.dart';

List<MultiFactorInfo> multiFactorInfoPigeonToObject(
List<PigeonMultiFactorInfo?> pigeonMultiFactorInfo,
) {
return pigeonMultiFactorInfo.whereNotNull().map((e) {
return pigeonMultiFactorInfo.nonNulls.map((e) {
if (e.phoneNumber != null) {
return PhoneMultiFactorInfo(
displayName: e.displayName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import 'dart:async';

import 'package:collection/collection.dart';
import 'package:firebase_auth_platform_interface/firebase_auth_platform_interface.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

Expand Down Expand Up @@ -85,7 +84,7 @@ abstract class UserPlatform extends PlatformInterface {

/// Returns a list of user information for each linked provider.
List<UserInfo> get providerData {
final inputData = _user.providerData.whereNotNull();
final inputData = _user.providerData.nonNulls;
final List<UserInfo> providerData = [];
for (final Map<Object?, Object?> info in inputData) {
providerData.add(UserInfo.fromJson(info));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ environment:

dependencies:
_flutterfire_internals: ^1.3.46
collection: ^1.16.0
firebase_core: ^3.8.0
flutter:
sdk: flutter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ String convertRecaptchaVerifierSize(RecaptchaVerifierSize size) {
case RecaptchaVerifierSize.compact:
return 'compact';
case RecaptchaVerifierSize.normal:
default:
return 'normal';
}
}
Expand All @@ -462,7 +461,6 @@ String convertRecaptchaVerifierTheme(RecaptchaVerifierTheme theme) {
case RecaptchaVerifierTheme.dark:
return 'dark';
case RecaptchaVerifierTheme.light:
default:
return 'light';
}
}
Expand Down
90 changes: 0 additions & 90 deletions packages/firebase_data_connect/analysis_options.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

library firebase_data_connect;

export 'src/firebase_data_connect.dart';
export 'src/any_value.dart' show AnyValue, defaultSerializer;
export 'src/common/common_library.dart'
show
ConnectorConfig,
Expand All @@ -26,7 +24,7 @@ export 'src/common/common_library.dart'
export 'src/core/empty_serializer.dart' show emptySerializer;
export 'src/core/ref.dart'
show MutationRef, OperationRef, OperationResult, QueryRef, QueryResult;

export 'src/firebase_data_connect.dart';
export 'src/optional.dart'
show
Optional,
Expand All @@ -36,4 +34,3 @@ export 'src/optional.dart'
listDeserializer,
listSerializer;
export 'src/timestamp.dart' show Timestamp;
export 'src/any_value.dart' show AnyValue, defaultSerializer;
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

library firebase_data_connect_common;

import 'dart:convert';

import 'package:firebase_app_check/firebase_app_check.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

part of firebase_data_connect_common;
part of 'common_library.dart';

/// Types of DataConnect errors that can occur.
enum DataConnectErrorCode { unavailable, unauthorized, other }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

part of firebase_data_connect_common;
part of 'common_library.dart';

/// ConnectorConfig options required for connecting to a Data Connect instance.
class ConnectorConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
// limitations under the License.

// Empty serializer to be used when a null variable is passed.
String emptySerializer(void _) {
String emptySerializer(Object? _) {
return '';
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,8 @@ class QueryRef<Data, Variables> extends OperationRef<Data, Variables> {
e.code == DataConnectErrorCode.unauthorized.toString()) {
return this.execute();
} else {
throw e;
rethrow;
}
} catch (e) {
throw e;
}
}

Expand Down Expand Up @@ -164,7 +162,7 @@ class QueryRef<Data, Variables> extends OperationRef<Data, Variables> {
this.execute();
} catch (_) {
// Call to `execute` should properly pass the error to the Stream.
log("Error thrown by execute. The error will propagate via onError.");
log('Error thrown by execute. The error will propagate via onError.');
}
}
return res;
Expand Down Expand Up @@ -196,10 +194,8 @@ class MutationRef<Data, Variables> extends OperationRef<Data, Variables> {
e.code == DataConnectErrorCode.unauthorized.toString()) {
return this.execute();
} else {
throw e;
rethrow;
}
} catch (e) {
throw e;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import 'package:firebase_core_platform_interface/firebase_core_platform_interfac
import 'package:firebase_data_connect/src/common/common_library.dart';
import 'package:firebase_data_connect/src/core/ref.dart';
import 'package:flutter/foundation.dart';

import './network/transport_library.dart'
if (dart.library.io) './network/grpc_library.dart'
if (dart.library.html) './network/rest_library.dart';
Expand All @@ -41,7 +42,7 @@ class FirebaseDataConnect extends FirebasePluginPlatform {
super(app.name, 'plugins.flutter.io/firebase_data_connect') {
_queryManager = QueryManager(this);
if (sdkType != null) {
this._sdkType = sdkType;
_sdkType = sdkType;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

library firebase_data_connect_grpc;

import 'dart:convert';
import 'dart:developer';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

part of firebase_data_connect_grpc;
part of 'grpc_library.dart';

/// Transport used for Android/iOS. Uses a GRPC transport instead of REST.
class GRPCTransport implements DataConnectTransport {
Expand Down Expand Up @@ -107,7 +107,7 @@ class GRPCTransport implements DataConnectTransport {
options: CallOptions(metadata: await getMetadata(authToken)));
return deserializer(jsonEncode(response.data.toProto3Json()));
} on Exception catch (e) {
if (e.toString().contains("invalid Firebase Auth Credentials")) {
if (e.toString().contains('invalid Firebase Auth Credentials')) {
throw DataConnectError(DataConnectErrorCode.unauthorized,
'Failed to invoke operation: ${e.toString()}');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

library firebase_data_connect_rest;

import 'dart:convert';
import 'dart:developer';

Expand Down
Loading
Loading