'Dart 2.17 has warning when using code snipplet
Solution 1:[1]
Why are you importing implementation files from Flutter? If you have Flutter setup right you do not need to import anything like this.
Solution 2:[2]
You're importing files from a package's src
directory. That is not normal. You're directly importing a package's internal, private files.
The analysis warning tells you the name of the warning (implementation_imports
), and your IDE should allow you to click on it to get more details:
https://dart.dev/tools/linter-rules#implementation_imports
Instead use:
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
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 | SemBauke |
Solution 2 | jamesdlin |