Future<Feature> next() async { if (await hasNext()) { Feature result = nextFeature!; nextFeature = null; return result; } else { throw StateError("hasNext() returned false"); } }