buttonMinPriceWidget method

Widget buttonMinPriceWidget(
  1. BuildContext context, {
  2. double? minPrice,
  3. double? currentPrice,
  4. required String addMoreToRequestText,
})

Implementation

Widget buttonMinPriceWidget(BuildContext context,
    {double? minPrice,
    double? currentPrice,
    required String addMoreToRequestText}) {
  return minPrice != null && currentPrice != null && (minPrice > currentPrice)
      ? Column(
          children: [
            Container(
              padding: EdgeInsets.only(
                  left: DUI.spacing.lateralPaddingValue,
                  right: DUI.spacing.lateralPaddingValue,
                  top: DUI.spacing.lateralPaddingValue,
                  bottom: 10),
              decoration: BoxDecoration(
                  color: Theme.of(context).colorScheme.background,
                  borderRadius:
                      BorderRadius.circular(DUI.spacing.borderRadius),
                  border: Border.all(
                      color: Theme.of(context)
                          .textTheme
                          .bodyMedium!
                          .color!
                          .withOpacity(0.2),
                      width: DUI.spacing.borderWidth)),
              child: DUI.text.small(
                  context,
                  addMoreToRequestText.replaceAll(
                      "%@", Utils.parsePrice(minPrice - currentPrice)),
                  textAlign: TextAlign.start,
                  bold: true),
            ),
          ],
        )
      : const SizedBox.shrink();
}