title: How to get return value with pop on Flutter?
body: <p>I would like to know how to get two values with pop on Flutter.
  I tried to write the code. but I got the exception &quot;A non-null String must be provided to a Text widget.&quot;</p>
  <p>Here is the codes.<br></p>
  <p>First Screen</p>
  <pre><code>                      ElevatedButton(
                          child: const Text('move to second screen'),
                          style: ElevatedButton.styleFrom(
                              primary: Colors.orange, onPrimary: Colors.white),
                          onPressed: () async {
                            final List&lt;String&gt; _response =
                                await Navigator.pushNamed(
                                    context, '/adminCategoryPicker');
                            emoji = _response[0];
                            emojiName = _response[1];
                          },
                        ),
  </code></pre>
  <p>Second Screen</p>
  <pre><code>return Card(
                    child: ListTile(
                      leading: Text(targetElectricsEmojiLists[index]),
                      title: Text(targetElectricsNameLists[index]),
                      onTap: () {
                        setState(() {
                          _selectedName = targetElectricsNameLists[index];
                          _selectedEmoji = targetElectricsEmojiLists[index];
                        });
                        Navigator.pop(
                          context,
                          {_selectedName, _selectedEmoji},
                        );
                      },
                    ),
                  );
  </code></pre>
  <p>I think this issue is below section. Do you know other way to write the codes?</p>
  <p>First Screen</p>
  <pre><code>onPressed: () async {
       final List&lt;String&gt; _response =
       await Navigator.pushNamed(
            context, '/goToSecondScreen');
             emoji = _response[0];
             emojiName = _response[1];
  },
  </code></pre>
  <p>Second Screen</p>
  <pre><code>Navigator.pop(
         context,
         {_selectedName, _selectedEmoji},
  );
  </code></pre>
  <hr />
  
  I changed the codes. Moreover, I got the errors.
  <p>[ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: type 'MaterialPageRoute' is not a subtype of type 'Route&lt;List&gt;?' in type cast</p>
  <p>First Screen</p>
  <pre><code>ElevatedButton(
                          child: const Text('move to second screen'),
                          style: ElevatedButton.styleFrom(
                              primary: Colors.orange, onPrimary: Colors.white),
                          onPressed: () async {
                            final List&lt;String&gt; _response =
                                await Navigator.pushNamed(
                                    context, '/adminCategoryPicker');
                            emojiName = _response[0];
                            emoji = _response[1];
                          },
                        ),
  </code></pre>
  <p>Second Screen</p>
  <pre><code>return Card(
                    child: ListTile(
                      leading: Text(targetElectricsEmojiLists[index] ?? 'null'),
                      title: Text(targetElectricsNameLists[index] ?? 'null'),
                      onTap: () {
                        setState(() {
                          _selectedName = targetElectricsNameLists[index];
                          _selectedEmoji = targetElectricsEmojiLists[index];
                        });
                        Navigator.pop(
                          context,
                          [_selectedName, _selectedEmoji],
                        );
                      },
                    ),
                  );
  </code></pre>