I am working on a combination of Icon + Text button using Material 3 as my theme. I have done my homework and researched as much as I could possibly do, as a last desperate attempt, I am posting this question. I am beginner with Flutter.
ANd this is what happens upon clicking:
Here is the relevant code of the widget:
class TransactionButton extends StatelessWidget {
const TransactionButton({Key? key, required this.icon, required this.text, required this.onTap})
: super(key: key);
final void Function() onTap;
final IconData icon;
final String text;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
child: Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.primaryContainer,
borderRadius: BorderRadius.circular(8),
),
child: Row(
children: [
Icon(icon, color: Theme.of(context).colorScheme.onPrimaryContainer,),
const SizedBox(width: 8,),
Text(
text,
style: Theme.of(context).textTheme.titleMedium?.copyWith(
color: Theme.of(context).colorScheme.onPrimaryContainer),
)
],
),
),
);
}
}
Remember, Material 3 is enabled. If you carefuly examine the attached gif you will find that at the corners I can see the ripple effect.