How to make different font size in one textfield with different colors

Hello all.. , we can use Richtext to display a group characters in different fonts and colors , today we will discuss about RichText

RichText(
  text: TextSpan(
      text: 'Redbull Energy Drink\n',
      style: TextStyle(color: ColorConstant.black900,fontWeight:FontWeight.normal,fontSize:12
      ), /*defining default style is optional */
      children: <TextSpan>[
        TextSpan(
            text: '6 x 250ml', style: TextStyle(color:Colors.grey,fontWeight: FontWeight.normal,fontSize:10)),
      ]
  ),
),


Sign In or Register to comment.