Sealed classes common use-cases in Android
They are used to represent the restricted class hierarchies. Here are some common use-cases:
• UI State Management: UiState -> Loading, Success, Error
• Network Response Handling: NetworkResult -> Loading, Success, Failure
• Navigation Events: NavigationEvent -> GoToHome, GoToLogin, GoBack
• Form Validation: ValidationResult -> Valid, Invalid
• ViewHolder Types in RecyclerView: ListItem -> Header, Content, Footer
• User Actions / Intents (MVI Pattern): UserIntent -> LoadData, ItemClicked, Refresh