How to list and display all document files using path_provider and file_manager

1.return all local storage documents in a list

  • I want to preview a list a all pdf files and display them on a custom widget screen that a already create
         class MainPage extends StatefulWidget {
           const MainPage({Key? key}) : super(key: key);

         _MainPageState createState() => _MainPageState();

         class _MainPageState extends State<MainPage> {
          bool isLoading = false;

          Future getFile() async {
           FilePickerResult? result = await FilePicker.platform.pickFiles(
           type: FileType.custom,
          allowedExtensions: ['pdf'],
              List<File> files = result! => File(path!)).toList();

             void initState() {

           Widget build(BuildContext context) => SafeArea(
               child: Scaffold(
               body: Center(
              // child: isLoading
              //           ? const CircularProgressIndicator()
              //           : files.isEmpty
              //               ? const Center(child: Text('No notes...')):,

              ), ```

please help me achieve it  !!!  :pray: