0xf1f1
02/09/2024, 4:24 PMEric Vergnaud
02/09/2024, 5:46 PMGarret Yoder
02/09/2024, 6:10 PM0xf1f1
02/09/2024, 6:18 PMVlad
02/09/2024, 6:30 PMApp
Vlad
02/09/2024, 6:31 PMVlad
02/09/2024, 6:33 PMCasey Brooks
02/09/2024, 6:33 PM*Component
, *Widget
, etc. The fact that the function is capitalized already lets the user know that the function is @Composable
and generates UI elements.
Likewise, shared components shouldn’t be making changes internally, but instead should expose callbacks to their parent with the requested action. For example, a shared component should have an onClick
lambda rather than accessing a VM by DI internally to submit a change when clicked.
So for naming your components, just choose a name that appropriately describes the UI they generate. But in general, the Compose comunity tends to use the term “Component” for a Composable Function, instead of “Widget” like you’d see in Flutter or more traditional UI systems.Casey Brooks
02/09/2024, 6:35 PMApp*
described above) can be useful to help maintain your components vs the ones provided by the Material libraries, or to separate similar components by their domain in your application0xf1f1
02/09/2024, 7:39 PM