using System.Collections.Generic; using Unity.UIWidgets.foundation; using Unity.UIWidgets.ui; namespace Unity.UIWidgets.widgets { public class Form : StatefulWidget { public Form( Key key = null, Widget child = null, bool autovalidate = false, WillPopCallback onWillPop = null, VoidCallback onChanged = null ) : base(key: key) { D.assert(child != null); this.child = child; this.autovalidate = autovalidate; this.onWillPop = onWillPop; this.onChanged = onChanged; } public static FormState of(BuildContext context) { _FormScope scope = (_FormScope) context.inheritFromWidgetOfExactType(typeof(_FormScope)); return scope?._formState; } public readonly Widget child; public readonly bool autovalidate; public readonly WillPopCallback onWillPop; public readonly VoidCallback onChanged; public override State createState() { return new FormState(); } } public class FormState : State