title: Class final parameter is updating when I change local variable
body: <p>I have a parameter for a stateful widget called 'Item' that has a list property called 'images'.</p>
  <pre><code>class ItemPage extends StatefulWidget {
    final PageMode mode;
    final Item? item;
  
    const ItemPage({
      Key? key,
      required this.mode,
      this.item,
    }) : super(key: key);
  
    @override
    _ItemPageState createState() =&gt; _ItemPageState();
  }
  </code></pre>
  <p>In my initstate function, i set the value of a local variable called 'images' to the value retrieved from the Item parameter as shown below.</p>
  <pre><code>  void initState() {
      // TODO: implement initState
      super.initState();
  
      switch (widget.mode) {
        case PageMode.create:
          purchaseDate = DateTime(
              DateTime.now().year, DateTime.now().month, DateTime.now().day);
          warrantyValid = DateTime(
              purchaseDate.year + 1, purchaseDate.month, purchaseDate.day);
          break;
        case PageMode.update:
          contName.text = widget.item!.productName;
          contCost.text = widget.item!.cost.toString();
          purchaseDate = widget.item!.purchaseDate;
          contPurchase.text = formattedDate(purchaseDate);
          warrantyValid = widget.item!.warrantyValid;
          contValid.text = formattedDate(warrantyValid);
          contSerial.text = widget.item!.serialNumber;
          contNotes.text = widget.item!.notes;
          contLink.text = widget.item!.link;
          images = widget.item!.images;
  
          break;
      }
    }
  </code></pre>
  <p>When i add an item to this local list- the original list also gets modified.</p>
  <pre><code>   setState(() {
        images.add({'path': file.path, 'type': 'local'});
  
      });
  </code></pre>
  <p>Below is a screenshot of the local variable right after an item has been added to the list.</p>
  <p><a href="https://i.stack.imgur.com/SVxuk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SVxuk.png" alt="enter image description here" /></a></p>
  <p>Next is a screenshot of the original property from the final Item parameter in my class.</p>
  <p><a href="https://i.stack.imgur.com/dVIUD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dVIUD.png" alt="enter image description here" /></a></p>
  <p>As you can see- both the lists have 2 items whereas the original final one should only have 1 item and the local one should have 2 items since I added one.</p>
  <p>I can't seem to understand why the original keeps getting modified.</p>