“Composing” the Flutter counter app with Jetpack Compose: Part 1

Step 1:

Step 2:

3.1 Composable functions can execute in any order - Don't let one of your composable depend on another.

3.2 Composable functions can run in parallel - Optimization and one side-effect you should keep in mind.
3.3 Recomposition skips as much as possible - Optimization and oh yeah, they mention the side-effect again. Must be really important to remember that. 3.4 Recomposition is optimistic - Compose expects to finish recomposition before the parameters change again.3.5 Composable functions might run quite frequently - Pass the data to Compose using mutableStateOf or LiveData. What's that? We'll get to it.

Step 3:

MutableStateOf:

Remember composable:

var name by remember { mutableStateOf("") }
var name by rememberSaveable { mutableStateOf("") }

Stateless composable:

composable does not hold its own state and thus it is not tightly coupled to how its state is stored. This way, composable is easy to reuse and test.
val Blue200 = Color(0xFF90CAF9)
val Blue500 = Color(0xFF2196F3)
val Blue700 = Color(0xFF1976D2)
primary = Blue200,
primaryVariant = Blue700,

How many claps does this article deserve?

Mobile Application Developer 📱 Android 💚 | Flutter 💙 Design | Create | Build stuff ⚒️ https://play.google.com/store/apps/dev?id=4716299969505523086

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store