String getAsCode(Object? value) { final result = tryGetAsCode(value); if (result != null) { return result; } throw StateError('Unsupported type: ${value.runtimeType}'); }