section-engineering-education / engineering-education

“Section's Engineering Education (EngEd) Program is dedicated to offering a unique quality community experience for computer science university students."
Apache License 2.0
364 stars 889 forks source link

Advanced form operations In Jetpack compose #4762

Closed LinusMuema closed 2 years ago

LinusMuema commented 2 years ago

[Android] Advanced form operations In Jetpack compose

Forms are an important part of applications. They help us manage user's data easily.

In Jetpack compose, Material doesn't provide a Form composable which means we handle the TextField's operations manually. This includes the state management, validation of the value and getting the TextField's value. As the application and the scope grows, this becomes a menace as you have two write more code for all the fields ergo prone to more errors.

This article aims to guide the user through a DRY approach to handling form fields and how to easily manage state in the TextFields.

Key takeaways

  1. Textfield's state management
  2. Form validation in Jetpack compose
  3. A dry approach to handling form fields
  4. Encapsulation in Jetpack compose

Article quality

This article goes beyond what is provided in the documentation and adds encapsulation to our composables. The same content isn't provided on other blog sites as compose is still a new framework.

References

N/A

LinusMuema commented 2 years ago

Sorry @louisefindlay23 I saw this message late. Let me get to the article