Links: Flutter
Stateless widgets are inmutable and don’t store any mutable data. They can be used for UI components that don’t require dynamic updates during runtime.
Example
class MyButton extends StatelessWidget {
final String label;
const MyButton({required this.label});
@override
Widget build(BuildContext context) {
return ElevatedButton(
onPressed: () {},
child: Text(label),
);
}
}
You would call the widget this way:
MyButton(label: "Click Me")