void main() {
List<Map<String, dynamic>> products = [
{'id': 24, 'time': '2019-11-24 00:00:00.000'},
{'id': 36, 'time': '2019-11-23 00:00:00.000'},
{'id': 48, 'time': '2019-11-24 00:00:00.000'},
];
In the code above I want to replace 'time' entry '2019-11-24 00:00:00.000' to '2019-10-26 00:00:00.000' for the 'id' 48.
You can try something like this:
products.whereFirst((x) => x["id"] == 48)["time"] = "2019-10-26 00:00:00.000";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With