title: flutter - type file is not a subtype of type 'imageprovider dynamic '
body: <p>When i select image from image picker i am getting this error
  type file is not a subtype of type 'imageprovider dynamic '</p>
  
  I tried using stack even though the same error
  
  
  <pre><code>  class _ProfileState extends State&lt;Profile&gt; {
           @override
            Widget build(BuildContext context) {
              return Scaffold(
                appBar: AppBar(
                  automaticallyImplyLeading: true,
                  title: Text('Profile'),
                  centerTitle: true,
                  elevation: 10.0,
                ),
                body: Container(
                  decoration: BoxDecoration(
                      image: DecorationImage(
                          image: _imageFile == null
                              ? AssetImage('assets/tom.jpg')
                              : _imageFile,
                          fit: BoxFit.cover)),
                  child: ListView(
                    children: &lt;Widget&gt;[
                      Container(
                        height: MediaQuery.of(context).size.height / 1.4,
                      ),
                      Card(
                        color: Colors.grey.withOpacity(0.1),
                        shape: RoundedRectangleBorder(
                            borderRadius: BorderRadius.circular(10.0)),
                        child: cameraAndEdit(context),
                      ),
                      Container(
                        width: MediaQuery.of(context).size.width,
                        color: Colors.white70,
                        child: Padding(
                          padding: const EdgeInsets.all(8.0),
                          child: Column(
                            children: &lt;Widget&gt;[
                              box(),
                              line(color: Colors.deepPurple, lineHeight: 5.0),
                              // nameDesignation(),
                              infoRow(
                                  infoIcon: Icon(Icons.person),
                                  infoText: 'Name',
                                  detail: 'Tom Cruise',
                                  textColor: Colors.black),
                              Divider(),
                              infoRow(
                                  infoIcon: Icon(Icons.location_on),
                                  infoText: 'Address',
                                  detail: '#9/1 1st main Circle street Bangalore 560-096',
                                  textColor: Colors.black),
                              Divider(),
                              infoRow(
                                  infoIcon: Icon(Icons.gesture),
                                  infoText: 'Age',
                                  detail: '25',
                                  textColor: Colors.black),
                              Divider(),
                              infoRow(
                                  infoIcon: Icon(Icons.phone),
                                  infoText: 'Phone',
                                  detail: '+91 9148046273',
                                  textColor: Colors.black),
                              line(color: Colors.deepPurple, lineHeight: 5.0),
                              box(),
                            ],
                          ),
                        ),
                      ),
                    ],
                  ),
                ),
              );
            }
  </code></pre>