flutter_slidable
flutter_slidable copied to clipboard
How can i use icon from image asset ?
How can i use icon from image asset?
SlidableAction( onPressed: null, backgroundColor: Color(0xFFEEB4B0), foregroundColor: Colors.white, icon: Image.asset('assets/icon/trash.png'), label: 'Delete', ),
This issue is same with https://github.com/letsar/flutter_slidable/issues/383
If the icon can be made an SVG you can add it to a font. After doing this you'll be able to add the custom icon, CustomIcons.trash
, to the IconData
icon field. Something like https://www.fluttericon.com comes in very handy here. For more info search 'flutter custom icons'.
Sidenote: the icon SVG container must be a square.