suppress property
A widget to allow users to suppress alerts of this type.
The logic for this should be user-implemented. Here is a sample of a widget that can be passed in for this parameter:
class DoNotNotifyRow extends StatefulWidget {
const DoNotNotifyRow({Key? key}) : super(key: key);
@override
_DoNotNotifyRowState createState() => _DoNotNotifyRowState();
}
class _DoNotNotifyRowState extends State<DoNotNotifyRow> {
bool suppress = false;
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
MacosCheckbox(
value: suppress,
onChanged: (value) {
setState(() => suppress = value);
},
),
const SizedBox(width: 8),
Text('Don\'t ask again'),
],
);
}
}
Notable, the above widget is a StatefulWidget
. Your widget must be
stateful or your checkbox will not update as you expect.
Implementation
final Widget? suppress;