Spikeysanju / Einsen

🎯 Einsen is a prioritization app that uses Eisenhower matrix technique as workflow to prioritize a list of tasks & built to Demonstrate use of Jetpack Compose with Modern Android Architecture Components & MVVM Architecture.
Apache License 2.0
912 stars 79 forks source link

Always provide a Modifier Parameter #82

Closed Spikeysanju closed 2 years ago

Spikeysanju commented 2 years ago

Is your feature request related to a problem? Please describe. According to latest blog from Chris Banes. It's better to always provide a Modifier to Composable.

Link to blog - https://chris.banes.dev/always-provide-a-modifier/

Describe the solution you'd like Any composable you write which emits layout (even a simple Box), should have a modifier: Modifier parameter, which is then used in the layout.

Sample code from the blog

/**
 * This now has a modifier parameter, allowing callers
 * to customize the layout, behavior and more!
 */
@Composable
private fun HeaderText(
    text: String,
    modifier: Modifier = Modifier,
) {
    Text(
        modifier = modifier,
        // ...
    )
}
Spikeysanju commented 2 years ago

Started working on this issue 👍