Here is an example of how to add icon to a button in flutter.
Here is the output for this example.
Here is the code from main.dart file.
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@
override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: ElevatedButton.icon(
onPressed: () {},
icon: const Icon(Icons.settings),
label: const Text('Click here')),
),
),
);
}
}
Thanks,Srikanth