You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@overrideFuture<Task> test(int id) async {
if (database is sqflite.Transaction) {
returnsuper.test(id);
} else {
return (database as sqflite.Database)
.transaction<Task>((transaction) async {
final transactionDatabase =_$FlutterDatabase(changeListener)
..database = transaction;
return transactionDatabase.taskDao.test(id);
});
}
}
This code doesn't compile because the method is declared with a not nullable return type, and also sqflite.Database.transaction<Task>(..) (in the else branch) is invoked with a not nullable parametric type
The text was updated successfully, but these errors were encountered:
Mabsten
changed the title
Re
Transaction: a nullable return type becomes not nullable in the method's implementation
Apr 30, 2021
Step to reproduce the issue:
add this simple method to the TaskDao class in the official example
run
flutter pub run build_runner build
Generated code:
This code doesn't compile because the method is declared with a not nullable return type, and also
sqflite.Database.transaction<Task>(..)
(in the else branch) is invoked with a not nullable parametric typeThe text was updated successfully, but these errors were encountered: