Home > Net >  Remove space between widgets in row flutter
Remove space between widgets in row flutter

Time:05-12

I need to remove the space between two or more Text widgets in a Row.

This is the code using a Row

      Row(
        mainAxisAlignment: MainAxisAlignment.start,
        //   textBaseline: TextBaseline.alphabetic,
        //   crossAxisAlignment: CrossAxisAlignment.baseline,
        children: [
          Text(
            r'$ '   formatNumber(valueText),
            style: TextStyle(
              color: Color(0xff210049),
              fontSize: smallTextSize,
              fontFamily: 'RedHat',
            ),
          ),
          Text(
            ',00',
            style: TextStyle(
              color: Color(0xff210049),
              fontSize: smallTextSize,
              fontFamily: 'RedHat',
            ),
          ),
        ],
      ),

I also tried using a RichText, but the result is the same:

          RichText(
        text: TextSpan(
          text: r'$ '   formatNumber(valueText),
          style: TextStyle(
            color: Color(0xff210049),
            fontSize: smallTextSize,
            fontFamily: 'RedHat',
          ),
          children: <TextSpan>[
            TextSpan(
              text: ',00',
              style: TextStyle(
                color: Color(0xff210049),
                fontSize: smallTextSize,
                fontFamily: 'RedHat',
              ),
            ),
          ],
        ),
      ),

The last line in the image is an examlpe of what I need to get

enter image description here

CodePudding user response:

I really don't understand. you need to remove the spaces only. then just delete the space after $ sign

   Text(
              r'$'   '333    '.trim(),
              style: TextStyle(
                color: Color(0xff210049),
                //fontSize: smallTextSize,
                fontFamily: 'RedHat',
              ),
            ),
  • Related