Skip to content

Make form data preservable #237

Answered by agordn52
B3K4682 asked this question in Ideas
Discussion options

You must be logged in to vote

Hi @B3K4682,

It would be a nice feature. If I get time I'll explore this more.
I think for now though, you could just use a singleton Controller for your page and then create the Form instance in there.

Your Controller
class ReportController extends Controller {

  ReportAnIssueForm form = ReportAnIssueForm();

  @override
  bool get singleton => true;
} 
NyPage
class ReportAnIssuePage extends NyStatefulWidget<ReportController> {
  static RouteView path = ("/report-an-issue", (_) => ReportAnIssuePage());
  
  ReportAnIssuePage({super.key}) : super(child: () => _ReportAnIssuePageState());
}

class _ReportAnIssuePageState extends NyPage<ReportAnIssuePage> {
  
  @override
  Widget view(Buil…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by B3K4682
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants