title: Flutter: How can I pass an array in one page on another page?
body: <p>I am using showbottommodal inside a page. I'm throwing the checkboxes I selected in this modal into an array. Then I need to show this array on another page with the help of a button. How can I do that?</p>
  <p>On the second page, I create an array filled as dummy. and I need to send with the help of button.
  In the first page, I indicated the place where the data is written with an arrow.</p>
  <p>My First Page:</p>
  <p><a href="https://i.stack.imgur.com/Bx6Ta.png" rel="nofollow noreferrer">First Page</a></p>
  <pre><code>child: SizedBox(
          height: MediaQuery.of(context).size.height / 13,
          child: TextField(
            
            readOnly: true,
            onTap: () {
              showModalBottomSheet(
                // enableDrag: false,
                // isDismissible: false,
                isScrollControlled: true,
                backgroundColor: it_tool_main_grey_accent,
  
                shape: RoundedRectangleBorder(
                    borderRadius:
                        BorderRadius.vertical(top: Radius.circular(20))),
  
                context: context,
                builder: (context) =&gt; Container(
                  height: MediaQuery.of(context).size.height * 0.88,
                  // ignore: unnecessary_new
                  decoration: new BoxDecoration(
                    color: it_tool_main_grey_accent,
                    borderRadius: new BorderRadius.only(
                      topLeft: const Radius.circular(25.0),
                      topRight: const Radius.circular(25.0),
                    ),
                  ),
                  child: Stack(
                    alignment: Alignment.topRight,
                    children: [
                      // ignore: prefer_const_constructors
                      Padding(
                          padding: const EdgeInsets.only(
                            right: 45.0,
                            top: 5.0,
                          ),
                          // ignore: prefer_const_constructors
                          child: TextButton(
                              child: Text(
                                &quot;Kapat&quot;,
                                // ignore: prefer_const_constructors
                                style: TextStyle(
                                    fontSize: 17.0,
                                    color: it_tool_main_blue,
                                    fontFamily: 'sans-bold.ttf',
                                    fontWeight: FontWeight.bold),
                              ),
                              onPressed: () =&gt; Navigator.of(context).pop(),
                              style: ButtonStyle(
                                  backgroundColor:
                                      MaterialStateProperty.all&lt;Color&gt;(
                                          it_tool_main_grey_accent),
                                  shape: MaterialStateProperty.all&lt;
                                          RoundedRectangleBorder&gt;(
                                      RoundedRectangleBorder(
                                          side: BorderSide.none))))),
  
                      Center(
                        child: buildSheet(),
                      ),
                    ],
                  ),
                ),
              );
            },
            decoration: InputDecoration(
              border: OutlineInputBorder(
                borderSide: BorderSide
                    .none, //borderSide: const BorderSide(width: 2.0),
                borderRadius: BorderRadius.circular(10.0),
              ),
              hintText: 'Kullanıcı seçiniz',&lt;------------ I WANT TO ADD INSIDE OF ARRAY VALUES
              hintStyle: TextStyle(
                  fontSize: 20.0,
                  color: it_tool_main_grey,
                  fontFamily: 'sans-bold.ttf',
                  fontWeight: FontWeight.bold),
              fillColor: Colors.white,
              filled: true,
            ),
          ),
        ),
  </code></pre>
  <p>Second page array send :</p>
  <pre><code>ElevatedButton(onPressed: (){
        List.forEach((key, value) {
          if (List[key] == true) {
            setState(() {
             dummyList.add(key);
             print(dummyList);
            });
          }
        });
      }, child: Text(&quot;bas&quot;)),
  </code></pre>
  <p>Thanks for help guys!</p>