title: Instagram like post screen flutter
body: <p>I am trying to build a picture and camera screen in a page like the Instagram post screen I  tried using storage path which currently only works on android and also returns an error, I want it to work on android and ios so I can easily pick multiple images no cropping or editing needed for the pictures.</p>
  <p><img src="https://i.stack.imgur.com/IInQq.png" alt="image here" /></p>
  <pre><code>class FileModel {
    List&lt;String&gt; files;
    String folder;
  
    FileModel({this.files, this.folder});
  
    FileModel.fromJson(Map&lt;String, dynamic&gt; json) {
      files = json['files'].cast&lt;String&gt;();
      folder = json['folderName'];
    }
  }
  
  
  
      import 'dart:convert';
  import 'dart:io';
  import 'package:flutter/material.dart';
  import 'package:storage_path/storage_path.dart';
  import 'package:rojar1/models/file_model.dart';
  
  class PostScreen extends StatefulWidget {
    static String routeName = &quot;/postscreen&quot;;
    PostScreen({Key key, this.title}) : super(key: key);
    final String title;
    @override
    _PostScreenState createState() =&gt; _PostScreenState();
  }
  
  class _PostScreenState extends State&lt;PostScreen&gt; {
    List&lt;FileModel&gt; files;
    FileModel selectedModel;
    String image;
    @override
    void initState() {
      super.initState();
      getImagesPath();
    }
  
    getImagesPath() async {
      var imagePath = await StoragePath.imagesPath;
      var images = jsonDecode(imagePath) as List;
      files = images.map&lt;FileModel&gt;((e) =&gt; FileModel.fromJson(e)).toList();
      if (files != null &amp;&amp; files.length &gt; 0)
        setState(() {
          selectedModel = files[0];
          image = files[0].files[0];
        });
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: SafeArea(
          child: Column(
            children: &lt;Widget&gt;[
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: &lt;Widget&gt;[
                  Row(
                    children: &lt;Widget&gt;[
                      Icon(Icons.clear),
                      SizedBox(width: 10),
                      DropdownButtonHideUnderline(
                          child: DropdownButton&lt;FileModel&gt;(
                        items: getItems(),
                        onChanged: (FileModel d) {
                          assert(d.files.length &gt; 0);
                          image = d.files[0];
                          setState(() {
                            selectedModel = d;
                          });
                        },
                        value: selectedModel,
                      ))
                    ],
                  ),
                  Padding(
                    padding: const EdgeInsets.all(8.0),
                    child: Text(
                      'Next',
                      style: TextStyle(color: Colors.blue),
                    ),
                  )
                ],
              ),
              Divider(),
              Container(
                  height: MediaQuery.of(context).size.height * 0.45,
                  child: image != null
                      ? Image.file(File(image),
                          height: MediaQuery.of(context).size.height * 0.45,
                          width: MediaQuery.of(context).size.width)
                      : Container()),
              Divider(),
              selectedModel == null &amp;&amp; selectedModel.files.length &lt; 1
                  ? Container()
                  : Container(
                      height: MediaQuery.of(context).size.height * 0.38,
                      child: GridView.builder(
                          gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
                              crossAxisCount: 4,
                              crossAxisSpacing: 4,
                              mainAxisSpacing: 4),
                          itemBuilder: (_, i) {
                            var file = selectedModel.files[i];
                            return GestureDetector(
                              child: Image.file(
                                File(file),
                                fit: BoxFit.cover,
                              ),
                              onTap: () {
                                setState(() {
                                  image = file;
                                });
                              },
                            );
                          },
                          itemCount: selectedModel.files.length),
                    )
            ],
          ),
        ),
      );
    }
  
    List&lt;DropdownMenuItem&gt; getItems() {
      return files
              .map((e) =&gt; DropdownMenuItem(
                    child: Text(
                      e.folder,
                      style: TextStyle(color: Colors.black),
                    ),
                    value: e,
                  ))
              .toList() ??
          [];
    }
  }
  </code></pre>