PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, September 11, 2022

[FIXED] How to use expanded in rich text flutter

 September 11, 2022     cross-platform, flutter, flutter-layout     No comments   

Issue

Hi good evening everyone. I am trying to use expanded in my rich text but unable to achieve. My main problem is that widget get overflow on different screen size so I need a way of how to achieve expanded since expanded will help text to fit according to sizer of the screen

code :

  Container(
                width: double.maxFinite,
                height: 100,
                margin: const EdgeInsets.only(left: 150,top: 50),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(
                      "Watch your playlist",
                      style: TextStyle(
                        fontSize: 18,
                        fontWeight: FontWeight.bold,
                        color: color.AppColor.homePageDetails
                      ),
                    ),
                    SizedBox(height: 10,),//56:39
                    RichText(
                      text: TextSpan(
                       text: "stream up\n",
                        style:TextStyle(
                          color: color.AppColor.homePagePlanColor,
                          fontSize: 16
                        ),
                        children: [
                          TextSpan(
                            text:"check out your favourite"
                          )
                        ]
                      ),
                    ),

                  ],
                ),
              )

Solution

                      Expanded(
                              child: SingleChildScrollView(
                                scrollDirection: Axis.horizontal,
                                child: RichText(
                                  text: TextSpan(

worked for me



Answered By - Kartikeya Tiwari
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing