Skip to content

Instantly share code, notes, and snippets.

@BKinya
Created September 5, 2020 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BKinya/0f2795806e9712a196253023f5df9f97 to your computer and use it in GitHub Desktop.
Save BKinya/0f2795806e9712a196253023f5df9f97 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
class LabelledCheckBox extends StatelessWidget {
final bool value;
final String label;
final Function onChanged;
LabelledCheckBox(
{@required this.value, @required this.label, @required this.onChanged});
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
onChanged(!value);
},
child: Row(
children: [
Checkbox(
value: value,
onChanged: (bool newValue) {
onChanged(newValue);
},
),
Text(label)
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment