Securrency-OSS/mirai

feat: Add support to submit a form

Closed this issue · 0 comments

Description

In the LSD library, I've implemented a method to store input values using an InheritedWidget, maintaining all form values in a Map<String, String>. I believe we can incorporate a similar approach in Mirai. Additionally, we can introduce a signal to instruct the UI to disable all input modifications and other related buttons while the form is being submitted. Once the server responds, an Action will be dispatched to inform the UI of any further steps required.

I'm curious if there might be a better approach to achieve this.

Based on your experiences, @divyanshub024 and @i-asimkhan, what do you think is the best way to implement this feature?

Requirements

  • Submit a form
  • Disable fields when form is submitting
  • Disable buttons when the form is submitting
  • Execute a action in the end of the submission request, sented by the server

Additional Context

This issue is complement of: #107, #51

LSD Form Provider:
https://github.com/RodolfoSilva/lsd/blob/main/packages/lsd_form/lib/src/lsd_form_provider.dart

LSD Field Builder:
https://github.com/RodolfoSilva/lsd/blob/main/packages/lsd_form/lib/src/lsd_form_field.dart

LSD Form state
https://github.com/RodolfoSilva/lsd/blob/main/packages/lsd_form/lib/src/lsd_form_data_state.dart

LSD Form widget
https://github.com/RodolfoSilva/lsd/blob/main/packages/lsd_form/lib/src/lsd_form_widget.dart

LSD From Action:
https://github.com/RodolfoSilva/lsd/blob/main/packages/lsd_form/lib/src/lsd_submit_form.dart