Here's a example app that does what I think you're after.
import 'package:flutter/material.dart';
class CheckboxDemo extends StatefulWidget {
@override
_CheckboxDemoState createState() => new _CheckboxDemoState();
}
class _CheckboxDemoState extends State<CheckboxDemo> {
bool visible = true;
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(title: new Text ('Checkbox Demo')),
body: new Center(
child: new Padding(
padding: const EdgeInsets.all(16.0),
child: new Row(
children: <Widget>[
new Checkbox(
value: visible,
onChanged: (bool value) {
setState(() {
visible = value;
});
},
),
new Container(
padding: const EdgeInsets.all(16.0),
width: 100.0,
height: 100.0,
decoration: new BoxDecoration(
backgroundColor: visible ? Colors.blue[400] : null,
),
),
],
),
),
),
);
}
}
void main() {
runApp(new MaterialApp(home: new CheckboxDemo()));
}