forked from firka/flutter
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:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user