CustomInkwellWidget.text constructor

CustomInkwellWidget.text({
  1. Key? key,
  2. required dynamic onTap(),
  3. required String title,
  4. TextStyle? textStyle,
  5. Color? textColor,
  6. double? textSize,
})

Implementation

CustomInkwellWidget.text({
  Key? key,
  required Function() onTap,
  required String title,
  TextStyle? textStyle,
  Color? textColor,
  double? textSize,
})  : assert(
        textColor == null || textStyle == null,
        'Cannot provide both a textColor and a textStyle\n'
        'To provide both, use "textStyle: TextStyle(color: color)".',
      ),
      assert(
        textSize == null || textStyle == null,
        'Cannot provide both a textSize and a textStyle\n'
        'To provide both, use "textStyle: TextStyle(size: textSize)".',
      ),
      super(
        key: key,
        color: Colors.transparent,
        child: InkWell(
          onTap: onTap,
          child: Text(
            title,
            style: textStyle ??
                AppTextStyle.regularStyle.copyWith(
                  color: textColor,
                  fontSize: textSize,
                ),
          ).paddingAll(8),
        ),
      );