This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed class AppError( | |
override val message: String? = null | |
) : Exception(){ | |
data object SocketTimeOutError : AppError("Failed to connect, please check your internet connection and retry.") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Suppress("UNCHECKED_CAST") | |
class MainViewModelFactory(val application: Application) : ViewModelProvider.Factory { | |
override fun <T : androidx.lifecycle.ViewModel> create(modelClass: Class<T>): T { | |
return MainViewModel(application) as T | |
} | |
} | |
//example of usage in a composable | |
LocalViewModelStoreOwner.current?.let { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface JwtService { | |
final String SECRET_KEY = ""; | |
String generateToken( | |
Map<String, Object> extraClaims, | |
UserDetails userDetails | |
); |