title: How can I make the switches, which have their own StatelessWidget Class toggle when clicked?
body: <p>I am trying to make two switches toggle between on and off when they are clicked. I created a StatelessWidget class for the design of the switches. However, when I use this, and call the class in my User interface class, the switches do not change state. How can I update my code to allow for there to be a change?</p>
  <pre><code>import 'package:flutter/material.dart';
  
  class NotificationItem extends StatelessWidget {
    NotificationItem(
        {@required this.title,
        @required this.pushStatus,
        @required this.emailStatus});
  
    String title;
    bool pushStatus;
    bool emailStatus;
  
    @override
    Widget build(BuildContext context) {
      return Row(
        children: &lt;Widget&gt;[
          Expanded(
            child: Padding(
              padding: EdgeInsets.all(20),
              child: Text(
                title,
                style: TextStyle(
                    fontFamily: kFontFamilyNormal,
                    fontSize: 17,
                    color: AppColor.text,
                    fontWeight: FontWeight.w500),
              ),
            ),
          ),
          Expanded(
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: &lt;Widget&gt;[
                Switch(
                  value: emailStatus,
                  onChanged: (value) {
                    emailStatus = value;
                    print(emailStatus);
                  },
                  activeTrackColor: AppColor.primaryColorDark,
                  activeColor: AppColor.white,
                ),
                Switch(
                  value: pushStatus,
                  onChanged: (value) {
                    pushStatus = value;
                    print(pushStatus);
                  },
                  activeTrackColor: AppColor.primaryColorDark,
                  activeColor: AppColor.white,
                ),
              ],
            ),
          ),
        ],
      );
    }
  }
  </code></pre>
  <p>and the following code is how I am calling it:</p>
  <pre><code>NotificationItem(
                  title: 'New messages',
                  emailStatus: emailStatus,
                  pushStatus: pushStatus,
                )
  </code></pre>