Skip to content

Commit

Permalink
feat(linux): platform switch
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Nov 6, 2022
1 parent 7956dfa commit ae71afa
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions lib/src/platform_checkbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,33 @@ class PlatformCheckbox extends StatelessWidget with PlatformMixin<Widget> {

@override
Widget linux(BuildContext context) {
return android(context);
return MouseRegion(
cursor: mouseCursor ?? SystemMouseCursors.click,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Checkbox(
value: value,
tristate: true,
onChanged: onChanged,
mouseCursor: mouseCursor,
focusNode: focusNode,
autofocus: autofocus,
overlayColor: const MaterialStatePropertyAll(Colors.transparent),
side: BorderSide(
color: Theme.of(context).dividerColor,
),
),
if (label != null)
GestureDetector(
onTap: () {
onChanged?.call(value == null ? null : !value!);
},
child: label!,
),
],
),
);
}

@override
Expand All @@ -70,7 +96,7 @@ class PlatformCheckbox extends StatelessWidget with PlatformMixin<Widget> {
focusNode: focusNode,
child: MouseRegion(
cursor: mouseCursor ?? SystemMouseCursors.click,
child: FluentUI.Row(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
Expand Down

0 comments on commit ae71afa

Please sign in to comment.