How to add icon to RaisedButton at the right side
Padding(
padding: const EdgeInsets.only(top: 15.0),
child: new SizedBox(
width: double.infinity,
child: new RaisedButton(
textColor: Colors.white,
color: coloraccent,
onPressed: () {},
child: const Text('UPADATE'),
)),
),
You can use Icon() widget to add icons to your Flutter App. You have to pass the icon data as an icon to this widget. You can use default available Material icons with Icons class.
Displaying Icon on the Right SideStep 1: Add the Row widget inside the ElevatedButton. Step 2: Add the Text('Download') width inside the Row. Step 3: Then add the SizedBox(width: 5,) followed by the actual icon widget i.e. Icon(Icons. download,size: 24.0,).
You can simply add ElevatedButton. icon() widget, you will get the icon property where you can pass Icon data to add Icon on Elevated Button.
You can just wrap your RaisedButton.icon
to the Directionality
widget:
Directionality(
textDirection: TextDirection.rtl,
child: RaisedButton.icon(
onPressed: () {},
color: Colors.deepPurple,
icon: Icon(
Icons.arrow_drop_down,
color: Colors.white,
),
label: Text(
"Category",
style: TextStyle(color: Colors.white),
),
),
)
You can try this out, it works fine for me.
child: RaisedButton(
onPressed: () => navigateToLogin(context),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("Continue",style: TextStyle(fontSize: 20)),
Icon(Icons.navigate_next)
],
),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With