в предложении where вы должны заменить time
именем столбца в таблице
Future<int> sumItems() async {
DateTime now = new DateTime.now();
DateTime today = new DateTime(now.year, now.month, now.day);
DateTime endtoday = today.add(new Duration(days:1));
await openDb();
final sum = await _database.rawQuery("SELECT sum(amount) as sum FROM Water WHERE time >= '" + today.millisecondsSinceEpoch.toString() + "' AND time < '" + endtoday.millisecondsSinceEpoch.toString() + "'");
return sum[0]["sum"];
}