Ignore lints that will be triggered by ExternalDartReference changes (flutter/engine#53572)

https://dart-review.googlesource.com/c/sdk/+/370663 makes
ExternalDartReference generic. By doing so, it triggers two
cast_nullable_to_non_nullable lints that need to be silenced for it to
land. Once the above SDK changes land, this can be refactored to utilize
the generic and avoid the manual cast altogether.
This commit is contained in:
Srujan Gaddam 2024-06-26 09:32:08 -07:00 committed by GitHub
parent 1a21f12d44
commit 554e637a35
2 changed files with 2 additions and 0 deletions

View File

@ -22,6 +22,7 @@ import 'package:ui/src/engine.dart';
/// 6. We call `delete` on SkPaint.
DomFinalizationRegistry _finalizationRegistry = DomFinalizationRegistry(
(ExternalDartReference boxedUniq) {
// ignore: cast_nullable_to_non_nullable
final UniqueRef<Object> uniq = boxedUniq.toDartObject as UniqueRef<Object>;
uniq.collect();
}.toJS

View File

@ -29,6 +29,7 @@ typedef DisposeFunction<T extends NativeType> = void Function(Pointer<T>);
class SkwasmFinalizationRegistry<T extends NativeType> {
SkwasmFinalizationRegistry(this.dispose)
: registry = DomFinalizationRegistry(((ExternalDartReference address) =>
// ignore: cast_nullable_to_non_nullable
dispose(Pointer<T>.fromAddress(address.toDartObject as int))
).toJS);