mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
1a21f12d44
commit
554e637a35
@ -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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user