Skip to content
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

Cannot clear ReactiveFilePicker files #132

Closed
leoshusar opened this issue Oct 25, 2023 · 4 comments
Closed

Cannot clear ReactiveFilePicker files #132

leoshusar opened this issue Oct 25, 2023 · 4 comments

Comments

@leoshusar
Copy link

I'm trying to pick a single file and I can't seem to find a way to clear MultiFile.

I'm trying to hack it somehow and even something like this doesn't work:

ReactiveFilePicker<String>(
  formControlName: '$i.filePath',
  filePickerBuilder: (pick, files, onChange) {
    return Column(
      children: [
        Text(files.platformFiles.firstOrNull?.name ?? ''),
        ElevatedButton(
          onPressed: () async {
            final c = formModel.form.control('pairs.$i.filePath');
            c.value = const MultiFile<String>();
            await pick();
          },
          child: const Text('Pick file'),
        ),
      ],
    );
  },
),

When I break in the pickFile() method, I can see the field.value is the empty MultiFile<String> I created, but the final value still contains previously picked files:
image

and it then appends my newly picked file.

Am I missing something or is it a bug?

@vasilich6107
Copy link
Contributor

Hi
Check example
It has delete button
image

@vasilich6107
Copy link
Contributor

Hi @leoshusar do you still have issues?

@vasilich6107
Copy link
Contributor

Closing the issue due to the lack of response

Copy link

github-actions bot commented Aug 8, 2024

Hi @leoshusar!
Your issue has been closed. If we were helpful don't forget to star the repo.

Please check our reactive_forms_generator package

We would appreciate sponsorship subscription or one time donation
https://github.com/sponsors/artflutter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants