-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UPDATE column value Uint8List cause Unhandled Exception #696
Comments
first click insertTask button second click updateTask button then will occur Unhandled Exception E/flutter (17057): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'String' is not a subtype of type 'Uint8List' in type cast source code : https://github.com/HXiaoMing/floor_new_issue.git |
@HXiaoMing Thank you for reporting the issue. I'll check it today. |
Good catch @HXiaoMing, as I see, the value for |
@entity(tableName: Task.tableName)
class Task {
static const tableName = 'Task';
@PrimaryKey
final int id;
final Uint8List data;
Task(this.id, this.data);
@OverRide$id, len: $ {data.length}';
String toString() {
return 'Task{id:
}
}
@dao
abstract class TaskDao {
@query('SELECT * FROM ${Task.tableName} WHERE id = :id')
Future<Task?> findTaskById(int id);
@insert(onConflict: OnConflictStrategy.replace)
Future insertTask(Task task);
@query('UPDATE ${Task.tableName} SET data = :data WHERE id = :id')
Future updateData(Uint8List data, int id);
}
i want to update table Task column data, data type is Uint8List,database type is blob,after execute TaskDao method updateData,data value change to String!!!
after execute method updateData ,and then execute TaskDao method findTaskById occur Unhandled Exception
E/flutter (17057): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'String' is not a subtype of type 'Uint8List' in type cast
E/flutter (17057): #0 _$TaskDao.findTaskById. (package:floor_issue/issue/database.g.dart:117:48)
E/flutter (17057): #1 QueryAdapter.query (package:floor/src/adapter/query_adapter.dart:30:18)
E/flutter (17057):
E/flutter (17057):
source code : https://github.com/HXiaoMing/floor_new_issue.git
The text was updated successfully, but these errors were encountered: