Enviado em 01/08/2020 - 20:45h
onPressed: () {
d.apagar(_lista[index].id).then((value) {
setState(() {
Navigator.pop(context);
_getElementos();
});
});
} Acredito que o problema está nesse trecho de código, mas não sei como resolver. O erro é o seguinte:
The following RangeError was thrown building BottomSheet(dirty, dependencies: [_InheritedTheme, _LocalizationsScope-[GlobalKey#8c7ec]], state: _BottomSheetState#b9659):
RangeError (index): Invalid value: Not in range 0..1, inclusive: 2