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

Incompatible with Shortcuts, it seems. #24

Open
markg85 opened this issue Jul 30, 2023 · 2 comments
Open

Incompatible with Shortcuts, it seems. #24

markg85 opened this issue Jul 30, 2023 · 2 comments

Comments

@markg85
Copy link

markg85 commented Jul 30, 2023

Describe the bug
I'm using Shartcuts to handle non-touch input (like enter).
Like so:

    return Shortcuts(
      shortcuts: <LogicalKeySet, Intent>{
        LogicalKeySet(LogicalKeyboardKey.select): ActivateIntent(),
      },

That ActivateIntent you see comes from the flutter SDK and is required. If i do import 'package:flutter/material.dart' hide Intent; then ActivateIntent doesn't compile anymore.

To Reproduce
Steps to reproduce the behavior:
^^ Above

Expected behavior
Should not break shortcuts.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Emulator

Smartphone (please complete the following information):
Emulator

Additional context
N/A

@gnprice
Copy link

gnprice commented Mar 20, 2024

This appears to be a duplicate of #1.

There's no incompatibility here. When two Dart libraries you want to use each define something with the same name, you can always resolve the name conflict by importing with a library prefix. See the Dart documentation:
https://dart.dev/language/libraries#specifying-a-library-prefix

For example:

import 'package:receive_intent/receive_intent.dart' as receive_intent;

@markg85
Copy link
Author

markg85 commented Mar 21, 2024

I'd recommend changing the docs to avoid name collisions (aka, using the .. as receive_intent; as you suggested. That's probably enough already.

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

No branches or pull requests

2 participants