title: Error: Not a constant expression in Flutter
body: <p>I using the demo from this <a href="https://pub.dev/packages/photo_view" rel="noreferrer">library</a> and it works perfectly.
  But when I implement in my project, I get error on this line</p>
  
  <blockquote>
    <p>Error: Not a constant expression. const
    AssetImage(snapshot.data[index]),</p>
  </blockquote>
  
  <p>My <code>Container</code> is wrapping in <code>InkWell</code>.</p>
  
  <pre><code>  InkWell(
        child: Container(
                   padding:
                        EdgeInsets.zero,
                       height: 150,
                        width: 150,
                        decoration:
                              BoxDecoration(
                                        image: DecorationImage(
                                         image: AssetImage(snapshot.data[index]),
                                              fit: BoxFit .fill),
                                    ),
                             ),
        onTap: () {
                 print('The value is ' + snapshot .data[index]);
                      Navigator.push(
                        context,
                        MaterialPageRoute(
                          builder:
                           (context) =&gt;
                              const FullScreenWrapper(imageProvider:const AssetImage(snapshot.data[index]),  // here the error
                                      )));
                 },
         ),
  </code></pre>
  
  <p>Here the printed value</p>
  
  <blockquote>
    <p>The value is
    /storage/emulated/0/Android/data/xxx/files/Pictures/scaled_1572364487252xxx.jpg</p>
  </blockquote>
  
  <p>If I remove the <strong>const</strong>, I get others error</p>
  
  <blockquote>
    <p>Arguments of a constant creation must be constant expressions. Try
    making the argument a valid constant, or use 'new' to call the
    constructor.</p>
  </blockquote>
  
  <p>I even tried using <code>new</code> but to no avail.</p>