I am getting this error: type 'List>' is not a subtype of type 'List'
Here is the code that's triggering the error.
@override
Widget build(BuildContext context) {
if (widget.productId != null) {
return StreamBuilder(
stream:
Document<Product>(path: 'app-data-inventory/${widget.productId}')
.streamData(),
builder: (BuildContext context, AsyncSnapshot snap) {
if (snap.hasError) {
print(snap.error);
}
if (snap.hasData) {
Product product = snap.data;
return Scaffold(
resizeToAvoidBottomPadding: false,
backgroundColor: AppAppTheme.white,
appBar: appBarComponents,
key: _scaffoldKey,
body: Stack(
children: <Widget>[
Builder(
builder: (context) => SingleChildScrollView(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: [
Container(
color: AppAppTheme.primary,
height: 230,
child: _yourWidget(context, product.productStorage['paths']),
),
SizedBox(
height: 10,
),
CheckboxListTile(
title: const Text('Terms of services'),
value: _product.termsAgreed != null
? _product.termsAgreed
: false,
onChanged: (val) {
setState(
() => _product.termsAgreed = val);
}),
SwitchListTile(
title: const Text('Save as draft'),
value: _product.productStatus == 'draft'
? true
: false,
onChanged: (bool val) => setState(() {
_product.productStatus =
val ? 'draft' : 'unapproved';
})),
]),
),
)
),
],
),
),
),
);
} else {
return UIErrorsMessages.notFoundComponent(
context, 'Product not found!');
}
});
} else {
return UIErrorsMessages.somethingIsNotRightComponent(
context, 'Something went wrong. Try again!');
}
}
}
How can I solve this?