https://kotlinlang.org logo
Title
d

Deklan Webster

04/04/2021, 2:21 PM
Have an extension of the question @v79 asked the other day
Is compose-desktop feasible for desktop-only apps? Or am always going to be constrained by its mobile-centric roots? I'm needing tooltips, file pickers, font pickers, that sort of thing...
If someone is interested in building primarily a desktop app (maybe a mobile app port someday), how do Flutter and Compose-desktop compare for that purpose? (I know there are probably many Flutter vs Compose questions but, sorry, it's very confusing as an outside observer)
👍 1
j

jim

04/05/2021, 10:41 AM
I think the primary difference is one of language: Do you prefer to write Dart or Kotlin? There are other differences. Flutter has been around a bit longer and so it's a bit more mature and supports more platforms. Compose has better native interoperability on all platforms - including the ability to directly embed native widgets, call directly into system functions, etc. Compose is also the official toolkit for Android. There are a variety of technical and non-technical considerations and they will differ based on your own needs, so no one can reasonably make that decision for you. You will need to do your own analysis and choose based on your own requirements. Personally, I'm a believer in the future of Compose 😉
👍 7
:android-eyes: 1
❤️ 24
:jetpack-compose: 1
:kotlin-intensifies: 1
a

Arkadii Ivanov

04/05/2021, 11:43 AM
Btw Flutter will be a default choice for future Ubuntu apps. Why not Compose? 🤓https://twitter.com/ubuntu/status/1367063203600031746?s=19
j

jim

04/05/2021, 12:35 PM
Yeah, we started a conversation with the Ubuntu team after that tweet went out, so conversations are ongoing. We will keep you all in the loop as things continue to evolve.
💯 17
👍 6
v

v79

04/05/2021, 2:40 PM
I fear this is a mental leap too far for me... I find it very difficult to look at a running Compose app and find the associated code; nothing is named (variables, anyone?). There's no Structure support in IntelliJ (and how could there be?). Just as I was getting the hang of DSLs as a mental model, here comes a new model with nested functions which look like constructors, but aren't (and aren't assigned to variables anyway). I look at a line of code like
val model by component.models.asState()
(from the Todo example) and I've no idea what it does - is this applicable to me and the app I'd like to write, or not? Maybe I'm just too old and stuck in a OO, Imperative, enterprise Java world, but by golly Compose is difficult to understand.
👴 1
Oh, and Modifier is FAR too overloaded with functions and behaviours and ordering matters, so it's clearly not a builder pattern...
☝️ 1
m

manueldidonna

04/06/2021, 11:18 AM
@v79 the fact that the ordering must be explicit is a great feature. In the android View class the root of the pain is that every property has to be aware of all of the others to work correctly (you have padding, margins, clipToPadding, scrollbar width to account for the padding, bidirectional padding, etc). In compose the contract between the modifiers is very minimal, there is no risk of getting to a point where you couldn't keep the full set of behaviors in your head anymore.
☝️ 1