-
-
Notifications
You must be signed in to change notification settings - Fork 544
New issue
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
State dos not contain all fields #1360
Labels
bug
Something isn't working
Comments
I had same Problem with FormBuilder and ListView. I switched to SingleChildScrollView
|
I think that this is related with this comment #1426 (comment) I will close this issue. If want to reopen, please add a minimal code example to can execute:
Example: import 'package:flutter/material.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:form_builder_validators/form_builder_validators.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter FormBuilder Example',
debugShowCheckedModeBanner: false,
localizationsDelegates: const [
FormBuilderLocalizations.delegate,
...GlobalMaterialLocalizations.delegates,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: FormBuilderLocalizations.supportedLocales,
home: const _ExamplePage(),
);
}
}
class _ExamplePage extends StatefulWidget {
const _ExamplePage();
@override
State<_ExamplePage> createState() => _ExamplePageState();
}
class _ExamplePageState extends State<_ExamplePage> {
final _formKey = GlobalKey<FormBuilderState>();
@override
Widget build(BuildContext context) {
return Scaffold(
body: FormBuilder(
key: _formKey,
child: Column(
children: [
FormBuilderTextField(
name: 'full_name',
decoration: const InputDecoration(labelText: 'Full Name'),
validator: FormBuilderValidators.compose([
FormBuilderValidators.required(),
]),
),
const SizedBox(height: 10),
ElevatedButton(
onPressed: () {
_formKey.currentState?.saveAndValidate();
debugPrint(_formKey.currentState?.value.toString());
},
child: const Text('Print'),
)
],
),
),
);
}
} Thanks a lot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
Package/Plugin version
9.2.0
Platforms
Flutter doctor
Flutter doctor
Minimal code example
Code sample
Current Behavior
I build a form using Formbuilder the form is generated by a JSON schema-like structure. all expected fields show up in the GUI but the stat fields are missing after saving. Fields are only 7 but values are 11. this is a problem because I use fields to save the values on the server. I check each value if it's dirty
Expected Behavior
expect that all fields i add are also in the fields collection.
Steps To Reproduce
I don't have a quick way to reproduce it for now.
Aditional information
No response
The text was updated successfully, but these errors were encountered: