How to use the 'key' in flutter's method?
That method in picture that makes an error, It's called from other file. About that, Flutter required a parameter 'key', so I made it. but makes an error again like below.
Error: The argument type 'Null' can't be assigned to the parameter type 'Key'.
Conclusively what's after 'key:' instead of null?
'''
SavingAccountCard(
color: Color(0xffF1A8AF), key:null
'''
Key is a unique identifier of the widget.
There are different types of keys:
You may be able to remove the required Key from your class, but if it's required and used there you can just use ValueKey('someUniqueIdByYou').
so the code would be:
SavingAccountCard(
color: Color(0xffF1A8AF),
key: ValueKey('AccountCard'),
),