iconTextHorizontal function

Widget iconTextHorizontal({
  1. required Widget leading,
  2. required Widget trailing,
  3. EdgeInsets margin = EdgeInsets.zero,
  4. VoidCallback? onTap,
  5. double spaceBetween = 6,
  6. MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
  7. CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
  8. MainAxisSize mainAxisSize = MainAxisSize.min,
})

Implementation

Widget iconTextHorizontal({
  required final Widget leading,
  required final Widget trailing,
  final EdgeInsets margin = EdgeInsets.zero,
  final VoidCallback? onTap,
  final double spaceBetween = 6,
  final MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
  final CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
  final MainAxisSize mainAxisSize = MainAxisSize.min,
}) =>
    GestureDetector(
      onTap: onTap,
      child: row(
        mainAxisAlignment: mainAxisAlignment,
        crossAxisAlignment: crossAxisAlignment,
        mainAxisSize: mainAxisSize,
        margin: margin,
        children: <Widget>[leading, SizedBox(width: spaceBetween), trailing],
      ),
    );