-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
General: Creating Multiple Duplicate Fields #66
Labels
bug
Something isn't working
Comments
Hi! |
import 'package:flutter/material.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final _formKey = GlobalKey<FormBuilderState>();
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
children: [
FormBuilderFilePicker(
name: "doc",
maxFiles: 2,
previewImages: true,
onChanged: (val) => print(val),
decoration: const InputDecoration(
border: InputBorder.none,
),
typeSelectors: const [
TypeSelector(
type: FileType.media,
selector: Row(
children: <Widget>[
Icon(
Icons.add_circle,
color: Colors.white,
),
Padding(
padding: EdgeInsets.only(left: 8.0),
child: Text(
"Add Passport Copy",
style: TextStyle(
color: Colors.white,
),
),
),
],
),
),
],
validator: FormBuilderValidators.compose([
FormBuilderValidators.required(),
]),
onFileLoading: (val) {
print(val);
},
),
],
),
),
);
}
} |
@deandreamatias Please check I've updated |
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
4.0.0
Platforms
Flutter doctor
Flutter doctor
Minimal code example
Code sample
Current Behavior
Automatically creating multiple duplicate fields
Expected Behavior
Not create duplicate fields
Steps To Reproduce
Just add file picker field in a formbuilder
Aditional information
No response
The text was updated successfully, but these errors were encountered: