Ahh yes.
You’re spot on with the examples here. The ToastData
and SnackData
could absolutely be modeled as a single class
We’ve used it for another case internally where each class type doesn’t have the same data types, in which case the simplified approach you described wouldn’t work. I didn’t include it though because it would have just been a lot more code/text to show.
For the Toast
and Snackbar
example we are probably better off using a single class, and possibly some default argument values.