Skip to content

Instantly share code, notes, and snippets.

View prasanthperumal92's full-sized avatar

Prasanth Perumal prasanthperumal92

View GitHub Profile
@prasanthperumal92
prasanthperumal92 / infix_sample.kt
Created April 30, 2024 10:46
A goofy sample on why infix keyword is a game changer
open class Animal{
infix fun has(value:Int):Animal{
return this
}
infix fun legs(value:Animal):Animal{
return this
}
infix fun a(value:Any):Animal{
return this
}
@prasanthperumal92
prasanthperumal92 / AppNavigation.kt
Created January 1, 2024 16:58
A single file abstraction for compose navigation with the help of reflection .
package com.prasanth.sampleapp.navigation
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.NamedNavArgument
import androidx.navigation.NavController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.prasanth.sampleapp.view.DetailScreen
[versions]
kotlin = "1.6.21"
coroutines = "1.6.1"
kaHelpers = "3.4.0"
gradlePlugins-agp = "7.2.0"
gradlePlugins-versionCatalog = "0.3.1"
[libraries]
coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }