Skip to content

Instantly share code, notes, and snippets.

@fredgrott
Created June 23, 2024 16:34
Show Gist options
  • Save fredgrott/11d141d2ef1b7afe170ec1be8724027b to your computer and use it in GitHub Desktop.
Save fredgrott/11d141d2ef1b7afe170ec1be8724027b to your computer and use it in GitHub Desktop.
checkbox snippet
@override
Widget build(BuildContext context) {
switch (widget._checkboxType) {
case _CheckboxType.material:
break;
case _CheckboxType.adaptive:
final ThemeData theme = Theme.of(context);
switch (theme.platform) {
case TargetPlatform.android:
case TargetPlatform.fuchsia:
case TargetPlatform.linux:
case TargetPlatform.windows:
break;
case TargetPlatform.iOS:
case TargetPlatform.macOS:
return CupertinoCheckbox(
value: value,
tristate: tristate,
onChanged: onChanged,
activeColor: widget.activeColor,
checkColor: widget.checkColor,
focusColor: widget.focusColor,
focusNode: widget.focusNode,
autofocus: widget.autofocus,
side: widget.side,
shape: widget.shape,
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment