TF-913 Fix button text line break in advanced search view

This commit is contained in:
dab246
2022-09-21 11:52:42 +07:00
committed by Dat H. Pham
parent 7fe899daf5
commit d0ff07edfb
7 changed files with 182 additions and 139 deletions
@@ -0,0 +1,60 @@
import 'package:flutter/material.dart';
class LabeledCheckbox extends StatelessWidget {
const LabeledCheckbox({
required this.label,
this.contentPadding,
this.value,
this.onChanged,
this.activeColor,
this.fontSize = 16,
this.gap = 4.0,
this.bold = false,
this.focusNode,
});
final String label;
final EdgeInsets? contentPadding;
final bool? value;
final Function(bool?)? onChanged;
final Color? activeColor;
final double fontSize;
final double gap;
final bool bold;
final FocusNode? focusNode;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () => onChanged?.call(!(value ?? false)),
child: Padding(
padding: contentPadding ?? const EdgeInsets.all(0),
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Checkbox(
value: value,
activeColor: activeColor,
visualDensity: VisualDensity.compact,
focusNode: focusNode,
onChanged: onChanged,
),
SizedBox(
width: gap,
),
Flexible(
child: Text(
label,
style: TextStyle(
fontSize: fontSize,
fontWeight: bold ? FontWeight.bold : FontWeight.normal,
color: Colors.black
),
),
),
],
),
),
);
}
}