To keep a consistent coding style, I suggest we use relative paths when importing files from within our app.
// Before
import 'package:sossoldi/model/example.dart';
// After
import 'model/example.dart';
As long as we use it consistently, any of the two styles will have the same performance. However, it's important not to mix them as that might lead to some issues.
To keep a consistent coding style, I suggest we use relative paths when importing files from within our app.
As long as we use it consistently, any of the two styles will have the same performance. However, it's important not to mix them as that might lead to some issues.
The official guide on dart recommends using relative import paths. See also https://stackoverflow.com/q/59693195/14157994 for pros and cons.
The reason why I prefer relative paths is that they are shorter and help differentiate between our files (within
lib
) and external packages.