title: FLutter || Pick file using file picker and showing them in a listview.builder
body: <p>Created a function to pick file on onPressed() of Elevated Button, and pass the files to a new function openfiles() and then in open files function, I call a widget show() and pass the parameters to it. How to return in listView.
  The default constructor takes an explicit List of children. This constructor is appropriate for list views with a small number of children because constructing the List requires doing work for every child that could possibly be displayed in the list view instead of just those children that are actually visible.</p>
  <p><strong>pickFile class</strong></p>
  <pre class="lang-dart prettyprint-override"><code>  return Scaffold(
      body: Column(
        children: [
          Container(
            child: ElevatedButton(
              onPressed: () async {
                final result =
                    await FilePicker.platform.pickFiles(allowMultiple:true);
                if (result == null) return;
                openFiles(result.files);
              },
              child: const Text(&quot;pick file&quot;),
            ),
          ),
          Text(&quot;data&quot;),
        ],
      ),
    );
    }
       void openFiles(List&lt;PlatformFile&gt; files) {
       show(files: files);
        }
      }
  </code></pre>
  <p><strong>ListView in UI</strong></p>
  <pre class="lang-dart prettyprint-override"><code>
      import 'package:file_picker/src/platform_file.dart';
      import 'package:flutter/material.dart';
      Widget show({
      List&lt;PlatformFile&gt;? files,
      }) {
      return Scaffold(
      body: ListView.builder(
          itemCount: files!.length,
          itemBuilder: (context, index) {
            final file = files[index];
            return buildFile(file);
            }),
       );}
      Widget buildFile(PlatformFile file) {
      final kb = file.size / 1024;
      final mb = kb / 1024;
      final size =
        (mb &gt;= 1) ? '${mb.toStringAsFixed(2)} MB' : '${kb.toStringAsFixed(2)} KB';
      return Container(
      width: 100,
      height: 100,
      child: InkWell(
        onTap: () =&gt; null,
        child: Container(
          width: 200,
          height: 200,
          child: ListTile(
            leading: (file.extension == 'jpg' || file.extension == 'png')
                ? Image.file(
                    File(file.path.toString()),
                    width: 80,
                    height: 80,
                  )
                : Container(
                    width: 80,
                    height: 80,
                  ),
            title: Text('${file.name}'),
            subtitle: Text('${file.extension}'),
            trailing: Text(
              '$size',
              style: TextStyle(fontWeight: FontWeight.w700),
            ),
          ),
        ),
       ),
      );
      }
  </code></pre>