title: How do I pass the data from the checked List Tile to the next page (Basket) in flutter
body: <p>I previously used a Listview to present my data, but I was advised to use a Checkbox List tile now I'm stuck on how to pass data. I want to pass the selected/checked List tile's data to the next page (Basket). How do I do that, please help me.</p>
  <p>I am new to Flutter.</p>
  <p>The Main Method Class</p>
  <pre><code>import 'package:cart_app1/Basket.dart';
  import 'package:flutter/material.dart';
  
  void main() {
    runApp(MyApp());
  }
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        debugShowCheckedModeBanner: false,
        title: 'Flutter Demo',
        theme: ThemeData(),
        initialRoute: '/',
        routes: {
          '/': (context) =&gt; MyHomePage(),
          Basket.routeName: (context) =&gt; Basket(),
        },
      );
    }
  }
  </code></pre>
  <p>The product list class</p>
  <pre><code>class MyHomePage extends StatefulWidget {
    @override
    _MyHomePageState createState() =&gt; _MyHomePageState();
  }
  
  class _MyHomePageState extends State&lt;MyHomePage&gt; {
    Map&lt;String, bool&gt; values = {
      &quot;GIN COCKTAILS \nClover Club \t  R65&quot;: false,
      &quot;Beers &amp; Ciders \nHeineken NRB \t R29&quot;: false,
      &quot;Vodka \nCiroc \t R35&quot;: false,
      &quot;Vodka \nCruz Vodka \t R30&quot;: false,
      &quot;COGNAC \nHennesy \t R40&quot;: false,
      &quot;Tequilla \nEl Jimador \t R30&quot;: false,
      &quot;Non-Alcoholic \nSoft-Drink \t R20&quot;: false,
      &quot;WHISK[E]Y \nJohnie Walker Red \t R25&quot;: false,
    };
  
    var toggle = false;
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          title: Text(&quot;The Wing Republic&quot;),
          actions: &lt;Widget&gt;[
            IconButton(
              icon: Icon(Icons.shopping_basket),
              onPressed: () {
                Navigator.of(context)
                    .pushNamed(Basket.routeName, arguments: values);
              },
            ),
          ],
        ),
        body: ListView(
          children: values.keys.map((String key) {
            return CheckboxListTile(
              title: Text(key),
              subtitle: Text(&quot;&quot;),
              isThreeLine: false,
              value: values[key],
              onChanged: (bool value) {
                setState(() {
                  values[key] = value;
                });
              },
            );
          }).toList(),
        ),
      );
    }
  }
  
  </code></pre>
  <p>The Basket Method</p>
  <pre><code>import 'package:flutter/material.dart';
  
  class Basket extends StatelessWidget {
    static const routeName = '/Basket';
  
    @override
    Widget build(BuildContext context) {
      final data = ModalRoute.of(context).settings.arguments as Map&lt;String, bool&gt;;
      return Scaffold();
    }
  }
  
  </code></pre>