I'm trying in this manner
`Stream getFilteringValues() {
final itemType = items.itemType;
final query = selectOnly(items)..addColumns([itemType]);
return query.map((row) => row.readTable(items)).watch();
}`
You can use selectOnly(items, distinct: true), is that what you need?
i want to use SELECT itemType, itemCategory from items WHICH IS DISTINCT
I'm getting null while calling

I'm not sure I fully understand the question. If you want to run SELECT itemType, itemCategory from items, you can use selectOnly(items)..addColumns([items.itemType, items.itemCategory]).
The reason row.readTable(items) returns null is that moor can't know whether you're selecting all columns from the items table. For instance, let's say the items table had a non-nullable column foo, which you're not selecting. If we made row.readTable(items).foo return null because it's not in the query, we'd have to make it a nullable field after Dart gets non-nullable types. That would be annoying for users writing regular queries where we know foo isn't null.
For now you could probably do
Stream getFilteringValues() {
final itemType = items.itemType;
final query = selectOnly(items)..addColumns([itemType]);
return query.map((row) => Item(itemType: row.read(itemType)).watch();
}
But bear in mind that this is likely to break with NNBD.
I'm still getting issues while using this
can you give me a simple solution to select few columns from a table where i can get their distinct values.
Suppose In
Items Table i have itemType Column where values would be like ["EAR","BRC","PEN","EAR","BRC"]
so from this i want only ["EAR","BRC","PEN"]
And in Second Column itemCategory i would have ["Gold","Plain","Gold"]
i want only ["Gold","Plain"]

I would write two queries for this:
Items Table i have itemType Column where values would be like ["EAR","BRC","PEN","EAR","BRC"] so from this i want only ["EAR","BRC","PEN"]
Stream<List<String>> filterItemTypes() {
final itemType = items.itemType;
final query = selectOnly(items, distinct: true)..addColumns([itemType]);
return query.map((row) => row.read(itemType));
}
And in Second Column itemCategory i would have ["Gold","Plain","Gold"] i want only ["Gold","Plain"]
Stream<List<String>> filterCategories() {
final itemCategory = items.itemCategory;
final query = selectOnly(items, distinct: true)..addColumns([itemCategory]);
return query.map((row) => row.read(itemCategory));
}