I use flutter to do RaisedButton with icon and the the icon and text I want change position to left. How to do it? This is my code for button.

I want do it like in the image:

enter image description here

Card(
                  child: SizedBox(
                    width: double.infinity,
                    height: 60,
                    child: RaisedButton.icon(
                      icon: Icon(Icons.home,
                          size: 40, color: Theme.of(context).primaryColor),
                      color: Colors.white,
                      textColor: Theme.of(context).primaryColor,
                      label: const Text('Electrical and Wiring',
                          style: TextStyle(
                              fontWeight: FontWeight.normal, fontSize: 15)),
                      onPressed: () => {},
                    ),
                  ),
                ),


Solution 1: Srilal Sachintha

in the Raised Button Widget you can put a Row() or a Column() as the child, so it can be easily done like this,

RaisedButton(
    child: Row(
      children: <Widget>[
        Icon(Icons.call),
        Text('Your Text'),
      ],
    ),
    onPressed: (){
    //Actions
  }),


Solution 2: srikanth7785

You can achieve that using RaisedButton.icon() widget..

You can get more information from documentation.

Here's a minimal example for you..

RaisedButton.icon(onPressed: null, icon: null, label: null);


Solution 3: Mr Random

Try this

GestureDetector(
        behavior: HitTestBehavior.translucent,
        onTap: () {},
        child: Card(
          child: SizedBox(
              width: double.infinity,
              height: 60,
              child: Row(
                children: [
                  Padding(
                    padding: const EdgeInsets.symmetric(horizontal: 8),
                    child: Icon(Icons.home,
                        size: 40, color: Theme.of(context).primaryColor),
                  ),
                  Text('Electrical and Wiring',
                      style: TextStyle(
                          fontWeight: FontWeight.normal, fontSize: 15)),
                ],
              )),
        ),
      ),


Solution 4: Shahryar Rafique

What you can do you can use Directionality widget in flutter with TextButton.icon(). Here is the Code.

 Directionality(
            textDirection: TextDirection.rtl,
            child: TextButton.icon(
              onPressed: null,
              icon: Icon(
                CupertinoIcons.ellipsis_circle_fill,
                color: Colors.green,
              ),
              label: Text(
                "Business Name",
                style: Theme.of(context).textTheme.subtitle1,
              ),
            ),
          ),

And here is the View.

enter image description here