Adude
Adude

Reputation: 68

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!

Upvotes: 2

Views: 3318

Answers (0)

Related Questions