mirror of https://github.com/AMT-Cheif/drift.git
Merge pull request #1896 from cnmade/patch-1
Using read<int> instead readInt
This commit is contained in:
commit
3331d625b0
|
@ -83,7 +83,7 @@ Stream<List<CategoryWithCount>> categoriesWithCount() {
|
||||||
// CategoryWithCount. As we defined the Category table earlier, drift knows how to parse
|
// CategoryWithCount. As we defined the Category table earlier, drift knows how to parse
|
||||||
// a category. The only thing left to do manually is extracting the amount
|
// a category. The only thing left to do manually is extracting the amount
|
||||||
return rows
|
return rows
|
||||||
.map((row) => CategoryWithCount(Category.fromData(row.data, this), row.readInt('amount')))
|
.map((row) => CategoryWithCount(Category.fromData(row.data, this), row.read<int>('amount')))
|
||||||
.toList();
|
.toList();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ Stream<int> amountOfTodosInCategory(int id) {
|
||||||
'SELECT COUNT(*) AS c FROM todos WHERE category = ?',
|
'SELECT COUNT(*) AS c FROM todos WHERE category = ?',
|
||||||
variables: [Variable.withInt(id)],
|
variables: [Variable.withInt(id)],
|
||||||
readsFrom: {todos},
|
readsFrom: {todos},
|
||||||
).map((row) => row.readInt('c')).watch();
|
).map((row) => row.read<int>('c')).watch();
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue