We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can not reset a form with custom builder. Here is a quick test.
`import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart'; import 'package:flutterapp/my_text.dart';
final GlobalKey _fbKey = GlobalKey();
void main() => runApp(MyApp());
class MyApp extends StatelessWidget { // This widget is the root of your application. @OverRide Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: MyHomePage(), ); } }
var textKey = GlobalKey();
class MyHomePage extends StatelessWidget { @OverRide Widget build(BuildContext context) { return Scaffold( body: SafeArea( child: Column( children: [ FormBuilder( key: _fbKey, autovalidate: true, child: Column( children: [ MyFormBuilderTextField( attribute: 'text', ), FormBuilderCustomField( attribute: 'text2', formField: FormField( builder: (FormFieldState field) { return TextField(); }, ), ), ], ), ), Row( children: [ MaterialButton( child: Text("Submit"), onPressed: () { if (_fbKey.currentState.saveAndValidate()) { print(_fbKey.currentState.value); } }, ), MaterialButton( child: Text("Reset"), onPressed: () { _fbKey.currentState.reset(); }, ), ], ) ], ), ), ); } }`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
can not reset a form with custom builder. Here is a quick test.
`import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:flutterapp/my_text.dart';
final GlobalKey _fbKey = GlobalKey();
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@OverRide
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
var textKey = GlobalKey();
class MyHomePage extends StatelessWidget {
@OverRide
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Column(
children: [
FormBuilder(
key: _fbKey,
autovalidate: true,
child: Column(
children: [
MyFormBuilderTextField(
attribute: 'text',
),
FormBuilderCustomField(
attribute: 'text2',
formField: FormField(
builder: (FormFieldState field) {
return TextField();
},
),
),
],
),
),
Row(
children: [
MaterialButton(
child: Text("Submit"),
onPressed: () {
if (_fbKey.currentState.saveAndValidate()) {
print(_fbKey.currentState.value);
}
},
),
MaterialButton(
child: Text("Reset"),
onPressed: () {
_fbKey.currentState.reset();
},
),
],
)
],
),
),
);
}
}`
The text was updated successfully, but these errors were encountered: