Skip to content

Commit

Permalink
fix(web): fixing some uncorrect type casting for Web (#12696)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyokone authored Apr 24, 2024
1 parent 46fd5af commit 471b507
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -986,14 +986,14 @@ class AggregateQuerySnapshot
: _data = Map.from(dartify(jsObject.data())),
super.fromJsObject(jsObject);

int? get count => _data['count'] as int?;
int? get count => (_data['count'] as num?)?.toInt();

double? getDataValue(platform_interface.AggregateQuery query) {
final value = _data[AggregateQuery.name(query)];
if (value == null) {
return null;
} else {
return value as double;
return (value as num).toDouble();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ DocumentChangePlatform convertWebDocumentChange(
) {
return DocumentChangePlatform(
convertWebDocumentChangeType(webDocumentChange.type),
webDocumentChange.oldIndex as int,
webDocumentChange.newIndex as int,
webDocumentChange.oldIndex.toInt(),
webDocumentChange.newIndex.toInt(),
convertWebDocumentSnapshot(
firestore,
webDocumentChange.doc!,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class RecaptchaVerifierFactoryWeb extends RecaptchaVerifierFactoryPlatform {
@override
Future<int> render() async {
try {
return await _delegate.render() as int;
return (await _delegate.render()).toInt();
} catch (e) {
throw getFirebaseAuthException(e);
}
Expand Down

0 comments on commit 471b507

Please sign in to comment.