flutter - store textformfield data in widget

Viewed 17

My intention is to make several custom TextFormField-s, where i get properties of the widget from server, and need to pass text of each form to server by single json on button click.

// ignore: must_be_immutable
abstract class AuthField extends StatefulWidget {
 final String type;
 final String title;
 String data;

 Map<String, dynamic> commit() {
   return {"type": type, "title": title, "value": data};
 }
}

My implementation works fine, but i get "must_be_immutable" warning. Is there correct way to do it, or should i ignore the warning?

P.S. Map gets encoded later on, don't mind it.

0 Answers
Related