skip to Main Content

Wanted to add a image icon next to Click View Text

 child: Row(
        mainAxisSize: MainAxisSize.min,
        children: [
          Column( // Wrap the text and detail sentence in a Column
            children: [
              Text(
                "Click View",
                style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: Color.fromRGBO(255, 201, 102, 100)),
              ),
              Padding(padding: const EdgeInsets.only(top: 30)),
              Text(
                "Additional detail sentence", // Add your detail sentence here
                style: TextStyle(fontSize: 14, color: Colors.grey), // Customize the style as needed
              ),
            ],
          ),
         
        ],
      ),

enter image description here

Add image icon next to Text

3

Answers


  1. Try to wrap your first Text("Click View") widget within a Row() then add an Icon widget as the second children of the Row.

    Row(
     children [
       Text( 
         "Click View",
          style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, 
             color: Color.fromRGBO(255, 201, 102, 100)),
              ),
       Icon()// add your icon widget here
      ]
    )
    

    Then customize it as you preferred.

    Login or Signup to reply.
  2. Try this one

    Row( mainAxisSize: MainAxisSize.min, children: [ Icon( Icons.view_module, // Replace with the desired icon color: Color.fromRGBO(255, 201, 102, 100), // Customize the icon color size: 20, // Customize the icon size ), SizedBox(width: 8), // Add some space between the icon and text Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "Click View", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: Color.fromRGBO(255, 201, 102, 100)), ), Padding(padding: const EdgeInsets.only(top: 8)), // Adjust the padding as needed Text( "Additional detail sentence", style: TextStyle(fontSize: 14, color: Colors.grey), ), ], ), ], )
    
    Login or Signup to reply.
  3. Try This one
    this may work

     Column(
                      // Wrap the text and detail sentence in a Column
                      children: [
                        Row(
                          children: [
                            Text(
                              "Click View",
                              style: TextStyle(
                                  fontWeight: FontWeight.bold,
                                  fontSize: 20,
                                  color: Color.fromRGBO(255, 201, 102, 100)),
                            ),
                            SizedBox(
                              width: 5,
                            ),
                            Icon(Icons.view_carousel_outlined)
                          ],
                        ),
                        Padding(padding: const EdgeInsets.only(top: 30)),
                        Text(
                          "Additional detail sentence", // Add your detail sentence here
                          style: TextStyle(
                              fontSize: 14,
                              color: Colors.grey), // Customize the style as needed
                        ),
                      ],
                    ),
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search