Created
June 23, 2024 16:34
-
-
Save fredgrott/11d141d2ef1b7afe170ec1be8724027b to your computer and use it in GitHub Desktop.
checkbox snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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