added items count check

This commit is contained in:
Vadim 2022-10-29 21:04:06 +03:00
parent b6e377959f
commit 050c0f3ea3

View file

@ -78,6 +78,9 @@ class MeteringBloc extends Bloc<MeteringEvent, MeteringState> {
int itemsCount = min(_apertureValues.length + shutterSpeedOffset, _shutterSpeedValues.length + apertureOffset) - int itemsCount = min(_apertureValues.length + shutterSpeedOffset, _shutterSpeedValues.length + apertureOffset) -
max(apertureOffset, shutterSpeedOffset); max(apertureOffset, shutterSpeedOffset);
if (itemsCount < 0) {
return List.empty(growable: false);
}
return List.generate( return List.generate(
itemsCount, itemsCount,
(index) => ExposurePair( (index) => ExposurePair(