import 'package:flutter/material.dart';
import 'package:lba/res/colors.dart';

Widget buildWrappedInfo(String label, String value) {
    List<String> lines = value.split('\n');
    return Padding(
      padding: const EdgeInsets.only(bottom: 10.0),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          RichText(
            text: TextSpan(
              style: TextStyle(color: LightAppColors.productDetailDivider),
              children: [
                TextSpan(
                  text: '$label ',
                  style: TextStyle(color: LightAppColors.confirmButton),
                ),
                TextSpan(
                  text: lines.first,
                ),
              ],
            ),
          ),
          if (lines.length > 1)
            Padding(
              padding: const EdgeInsets.only(top: 4.0),
              child: Text(
                lines.skip(1).join('\n'),
                style: TextStyle(color: LightAppColors.productDetailDivider),
              ),
            ),
        ],
      ),
    );
  }

