3
I need to put the note @required in a builder:
class Pacote {
final int id;
final int nCodigos;
final String tabela;
Pacote({@required this.id, @required this.nCodigos, @required this.tabela});
// ...
}
Only that there was no import in this specific file. Thus, gave error that the @required was not a known element:
Undefined name 'required' used as an Annotation.
Try Defining the name or importing it from Another library.
Vscode suggested me to import from one of the following places:
package:flutter/cupetinopackage:flutter/widgetspackage:flutter/materialpackage:flutter/foundation
cupertino and material are interface styles as I recall, while widgets is related to visual elements. And this particular piece of code is just a business class, without any knowledge or use on screen.
So where should be the most appropriate place to care and have access to this note, @required? It is one of listed or another separate package?
