Prisma Client Dart is an auto-generated type-safe ORM. It uses Prisma Engine as the data access layer and is as consistent as possible with the Prisma Client JS/TS APIs.
Prisma schema of
Image Bytes? @db.Image
generates:
image: (json['Image'] as List<dynamic>?)?.map((e) => e as int).toList()
When it executes I get:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'String' is not a subtype of type 'List<dynamic>?' in type cast
Changing the generated code to:
image: json['Image'] != null? base64Decode((json['Image'] as String)) : null
works for me. Is there an actual solution?
I'm on Dart 3.1.5 on linux_x64.
How would I achieve this? Just using schema of string would work, but I get:
Error converting field "Image" of expected non-nullable type "String", found incompatible value of
Prisma schema of
Image Bytes? @db.Image
generates:image: (json['Image'] as List<dynamic>?)?.map((e) => e as int).toList()
When it executes I get:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'String' is not a subtype of type 'List<dynamic>?' in type cast
Changing the generated code to:
image: json['Image'] != null? base64Decode((json['Image'] as String)) : null
works for me. Is there an actual solution?I'm on Dart 3.1.5 on linux_x64.
How would I achieve this? Just using schema of string would work, but I get:
Error converting field "Image" of expected non-nullable type "String", found incompatible value of