https://kotlinlang.org
Join Slack
Hello. I'm trying to deserialize into a LocalDate object from a JSON ISO string (e.g. "2021-10-01")....
j

Jonathan Hollingsworth

over 4 years ago
Hello. I'm trying to deserialize into a LocalDate object from a JSON ISO string (e.g. "2021-10-01"). I'm using
kotlinx.serializable
On the way out (i.e. serializing) it works fine with this
@Serializable
data class Task(
    var id: Int? = null, val title: String, val detail: String? = null,
    @Contextual
    val dueDate: LocalDate? = null
)
But when I try to
val task = call.receive<Task>()
in route, then I get an
Serializer for class 'LocalDate' is not found.
I've been through the kotlinx.serialization docs, but I can't see find anything to help.
j
b
a
  • 3
  • 8
  • 3094
I have a problem with navigation. It is working perfectly on my Wear OS emulator but crashing on my ...
n

Nat Strangerweather

almost 3 years ago
I have a problem with navigation. It is working perfectly on my Wear OS emulator but crashing on my Pixel watch. I would love it if someone could please help! 😊 Details in thread.
n
y
  • 2
  • 30
  • 3061
did someone try to use Mockk on KMM project?
e

egor

over 2 years ago
did someone try to use Mockk on KMM project?
e
h
+3
  • 5
  • 12
  • 3000
Do IDE previews work in a compose multiplatform setup? I’m not having much luck with previews define...
a

aidanvii

over 2 years ago
Do IDE previews work in a compose multiplatform setup? I’m not having much luck with previews defined in shared/…/androidMain, or even the top level android module itself. The preview pane split icon just doesn’t show. Not sure if it’s a bug or if I’m doing something wrong 🤷
a
d
s
  • 3
  • 10
  • 2999
I’m playing around with Compose Multiplatform, using the template from <here> Sometimes when I buil...
j

jordond

over 2 years ago
I’m playing around with Compose Multiplatform, using the template from here Sometimes when I build I get this error:
Cannot locate tasks that match ':shared:testClasses' as task 'testClasses' not found in project ':shared'.
I can fix it by running a Gradle Sync and then building again, but it’s kind of annoying. Any idea how to fix it?
j
e
  • 2
  • 1
  • 2915
Hey folks, is there a concept of viewModel in compose desktop?
e

Emmanuel

over 3 years ago
Hey folks, is there a concept of viewModel in compose desktop?
e
b
+4
  • 6
  • 8
  • 2898
How do I know if a lateinit local variable is initialized? ```fun foo() { lateinit var x: Int ...
m

Mendess

about 4 years ago
How do I know if a lateinit local variable is initialized?
fun foo() {
    lateinit var x: Int
    if (::x.isInitialized()) {}
}
This doesn't seem to work
m
j
+2
  • 4
  • 14
  • 2889
Hi Everyone, why i`m facing this error @Composable invocations can only happen from the context of a...
a

Asad Mukhtar

over 3 years ago
Hi Everyone, why i`m facing this error @Composable invocations can only happen from the context of a @Composable function at stringResource(R.string.dont_have_an_account) line?
derivedStateOf {
    buildAnnotatedString {
        withStyle(
            style = SpanStyle(
                color = PrimaryTextColor,
                fontSize = TextUnit(12f, TextUnitType.Sp),
                fontFamily = FontFamily(listOf(Font(R.font.poppins_regular)))
            )
        ) {
            append(stringResource(R.string.dont_have_an_account))
        }
        withStyle(
            style = SpanStyle(
                color = BlueColor,
                fontSize = TextUnit(12f, TextUnitType.Sp),
                fontFamily = FontFamily(listOf(Font(R.font.poppins_semibold)))
            )
        ) {
            append("  Create Here")
        }
    }
}
a
f
o
  • 3
  • 7
  • 2882
Does `AnimatedVisibility` have a finished listener? I know it has `MutableTransitionState` where yo...
c

Chris Johnson

over 4 years ago
Does
AnimatedVisibility
have a finished listener? I know it has
MutableTransitionState
where you can check if all the animations are done via
isIdle
but I guess I'm looking for an example of when to use that check. I assume it wouldn't be inside the
AnimatedVisibility
content composable and outside of it would make it get hit on every recomposition if I'm remembering the
MutableTransitionState
c
a
d
  • 3
  • 3
  • 2867
We cannot able to use `try-catch` inside composable function. I am getting the below error `Try catc...
a

amar_1995

about 6 years ago
We cannot able to use
try-catch
inside composable function. I am getting the below error
Try catch is not supported around composable function invocations.
😄 2
a
k
+3
  • 5
  • 14
  • 2775
Previous456Next

kotlinlang

A modern programming language that makes developers happier.

Powered by