'Flutter does not recognize my package (Unused impor error)

[1]https://i.stack.imgur.com/6ecpX.png [1]: https://i.stack.imgur.com/0CWri.png

Hey there I was making a todo app on flutter and my app is working correctly. Then, suddenly I write some other codes after that flutter did not recognize my homepage package and saying that 'unused import' but I'm using it.How can I fix this



Solution 1:[1]

Somehow you removed the loading of the HomePage from main.dart. Inside MaterialApp there should be something like:

home: const HomePage()

Solution 2:[2]

It seems you are not setting the HomePage.dart to home attribute in main.dart. Just add

home: const Homepage()

attribute inside the Material app. You will be good to go. Cheers!!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ivo Beckers
Solution 2