abi_specific_integer_mapping_missing
Classes extending 'AbiSpecificInteger' must have exactly one 'AbiSpecificIntegerMapping' annotation specifying the mapping from ABI to a 'NativeType' integer with a fixed size.
Description
#The analyzer produces this diagnostic when a class that extends AbiSpecificInteger
doesn't have an AbiSpecificIntegerMapping
annotation.
Example
#The following code produces this diagnostic because there's no AbiSpecificIntegerMapping
annotation on the class C
:
dart
import 'dart:ffi';
final class C extends AbiSpecificInteger {
const C();
}
Common fixes
#Add an AbiSpecificIntegerMapping
annotation to the class:
dart
import 'dart:ffi';
@AbiSpecificIntegerMapping({Abi.macosX64 : Int8()})
final class C extends AbiSpecificInteger {
const C();
}
Was this page's content helpful?
Thank you for your feedback!
Provide details Thank you for your feedback! Please let us know what we can do to improve.
Provide details Unless stated otherwise, the documentation on this site reflects Dart 3.8.1. Page last updated on 2025-05-08. View source or report an issue.