Answers for "disable button if checkbox unchecked flutter"

0

disable button if checkbox unchecked flutter

Column(
        children: [
          Container(
            margin: EdgeInsets.all(17),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Flexible(
                    child: Text(
                  "You agree by checking this box",
                  style: TextStyle(
                      color: Colors.black, fontWeight: FontWeight.bold),
                )),
              ],
            ),
          ),
          SizedBox(
            height: 7,
          ),
          Padding(
            padding: EdgeInsets.only(left: 20),
            child: Container(
              child: Row(
                children: [
                  Container(
                    width: 20,
                    height: 20,
                    child: Transform.scale(
                      scale: 2.0,
                      child: Checkbox(
                        value: isCheck,
                        checkColor: Colors.green,
                        activeColor: Colors.grey,
                        onChanged: (bool value) {
                          setState(() {
                            isCheck = value;
                          });
                        },
                      ),
                    ),
                  ),
                ],
              ),
            ),
          ),
          Container(
            width: MediaQuery.of(context).size.width * .45,
            height: MediaQuery.of(context).size.height * .09,
            child: RaisedButton(
              textColor: Colors.white,
              color: Colors.green,
              shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(10)),
              child: Text(
                "Verify Quarterly Report",
                style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14),
              ),
              onPressed: isCheck ? () => submitReport() : null,
            ),
          ),
        ],
      ),
Posted by: Guest on May-04-2022

Code answers related to "disable button if checkbox unchecked flutter"

Browse Popular Code Answers by Language