Add Notification convenience methods
The Notification.show method is very limited and I always have to add a custom Notification class with methods like success, error, warning etc.
And there I do
Notification notification = new Notification("The requested employee was not found", 3000, Notification.Position.TOP_END);
notification.addThemeVariants(NotificationVariant.LUMO_ERROR);
notification.open();
It would be great if the Notification class could already have those methods.
Notification are a good example for a builder pattern IMHO. I've created my own NotificationBuilder for our applications where I can specificy globally (based on type (success / error and so on)) timeout, styles and "closeability" so that only the type and content has to be specified.
Indeed, but the builder would not solve my problem.
It should support both, a builder and default static methods for info, success, warning, and error.
Likewise, I had created a Builder for notifications, but in the end, I created another simple one for the ConfirmDialog with pattern builder as well...
I have created something not so perfect, but it works for the moment...
I also agree, show info, warning etc...
- https://github.com/rucko24/EspFlow/blob/main/src/main/java/com/esp/espflow/util/ConfirmDialogBuilder.java#L44