Constructor syntax

Constructor syntax

Class with super, parameter setting and constructor method

1class MyClass extends StatelessWidget {
2  late final int c;
3
4  MyClass(int cParam, {Key? key}) : c = cParam, super(key: key) {
5      // Do stuff for constructor here
6      print(c);
7  }
8
9  
10  Widget build(BuildContext context) {
11    return Container();
12  }
13}
14