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);

        @override
         _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!.paths.map((path) => File(path!)).toList();
          }

            @override
             void initState() {
            super.initState();
           getFile();
        }

          @override
           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: