code property

  1. @override
String get code
override

Stable machine-readable code for this error.

By default this is derived from the class name, for example EmailInvalidFormat becomes email_invalid_format. The derivation reads runtimeType, which is not stable under code obfuscation (for example a Flutter release build with --obfuscate). If you persist these codes or expose them over an API and ship obfuscated builds, override code with an explicit literal in each error subclass.

Implementation

@override
String get code => 'number_not_in_range';