Open g123k opened 9 months ago
We should both be in bed ATM :-)
We should both be in bed ATM :-)
@g123k Currently in Smoothie we do copy Product
data, in UpToDateProductProvider
:
// TODO(monsieurtanuki): move code to off-dart Product?
Product copy(final Product source) => Product.fromJson(
jsonDecode(jsonEncode(source.toJson())) as Map<String, dynamic>,
);
Moving this copy
code from Smoothie to off-dart would be much less painful than implementing copyWith
, and would provide the same feature as all fields are not final
and nullable.
I didn't know about this in the app 👍
The only here would be to create a "real" copyWith
, not something based on a json, that requires calls to jsonDecode/jsonEncode
Hi everyone,
The
Product
object has non-final fields, but when we want to use theProduct
class as immutable, each client must code it. It would be nice to integrate it directly into the SDK.