# Flutter Error: Text() vs const Text()



I was watching this video tutorial on flutter to learn
Container() or Container class. 

As per the instructor in  [video tutorial](https://api.flutter.dev/flutter/widgets/Container-class.html)   
the code shown is 

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1639222713474/AK_AfXaVkW.png)


but when I  write the same code I get the error.. 

[{
	"resource": "/C:/flutter_app/lib/main.dart",
	"owner": "_generated_diagnostic_collection_name_#1",
	"code": {
		"value": "prefer_const_constructors",
		"target": {
			"$mid": 1,
			"external": "https://dart-lang.github.io/linter/lints/prefer_const_constructors.html",
			"path": "/linter/lints/prefer_const_constructors.html",
			"scheme": "https",
			"authority": "dart-lang.github.io"
		}
	},
	"severity": 2,
	"message": "Prefer const with constant constructors.",

	"source": "dart",
	"startLineNumber": 7,
	"startColumn": 14,
	"endLineNumber": 7,
	"endColumn": 28
}]

One solution is: 

Add the word Const before the class 
```
child: const Text('Nimish'),
``` 
 and it should resolve the issue.


