Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Relative Paths instead of fully qualified. #24

Open
rodydavis opened this issue Nov 19, 2018 · 3 comments
Open

Use Relative Paths instead of fully qualified. #24

rodydavis opened this issue Nov 19, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@rodydavis
Copy link

https://stackoverflow.com/questions/22764330/syntax-for-specifying-file-path-relative-and-absolute

This makes it a lot easier for reusable code in other projects.

Here is a plugin in vs code that does this already: https://marketplace.visualstudio.com/items?itemName=luanpotter.dart-import

@rodydavis
Copy link
Author

rodydavis commented Nov 19, 2018

instead of:

// STARTER: import - do not remove comment
import 'package:my-project/ui/contacts/contacts_screen.dart';
import 'package:my-project/ui/contacts/edit/contacts_edit_vm.dart';
import 'package:my-project/ui/contacts/view/contacts_view_vm.dart';
import 'package:my-project/redux/contacts/contacts_actions.dart';
import 'package:my-project/redux/contacts/contacts_middleware.dart';

use:

// STARTER: import - do not remove comment
import 'ui/contacts/contacts_screen.dart';
import 'ui/contacts/edit/contacts_edit_vm.dart';
import 'ui/contacts/view/contacts_view_vm.dart';
import 'redux/contacts/contacts_actions.dart';
import 'redux/contacts/contacts_middleware.dart';

and in a file you can go up folders:
import '../../redux/contacts/contacts_actions.dart';

@hillelcoren
Copy link
Owner

Maybe, not sure..

When we started with Flutter (around 6 months ago) I ran into problems using relative paths (ie, dart-lang/sdk#32916) and found always using the full path easier to work with. Additionally, this change would cause problems for people who used the older version of this project.

I'll keep it in mind if we release a v2 of the project.

@hillelcoren hillelcoren added the enhancement New feature or request label Nov 19, 2018
@rodydavis
Copy link
Author

Sounds good. As a final result, it is really helpful to copy files between projects. But performance may need to be more important here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants