'Flutter File Picker package is not working at all

I followed this tutorial online: https://www.youtube.com/watch?v=LlO5jydXws0

For some reason when I press the button to open a file, it does not work or do anything at all?

Here is my code:

ElevatedButton(
                    child: const Text(
                      "+ Select Lights",
                      style: TextStyle(fontSize: 20),
                    ),
                    onPressed: () async {
                      final result = await FilePicker.platform.pickFiles();
                    },
                    style: ButtonStyle(
                        shape:
                            MaterialStateProperty.all<RoundedRectangleBorder>(
                      RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(10)),
                    )),

The usage of file picker in the code is in the first button instance.

I am using an iOS simulator.

Thanks in advance!



Solution 1:[1]

I can verify that this seems to be an issue on iOS versions 15 +. Android doesn't seem to have any issue. but on iOS, on real devices, not simulators, all files are greyed out and not selectable. I've tried setting the filetype as custom and to all, with no change in behavior. I have also tried picking from off the device (Google Drive) to see if that was part of the issue and still, no dice.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bunn1