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

🐛 The name 'Colors' is defined in the libraries 'package:fluent_ui/src/styles/color.dart (via package:fluent_ui/fluent_ui.dart)' and 'package:flutter/src/material/colors.dart (via package:flutter/material.dart)'. #51

Closed
Patrick386 opened this issue Jun 27, 2021 · 7 comments

Comments

@Patrick386
Copy link

Patrick386 commented Jun 27, 2021

Flutter Web:

I want to use this package, but I can't use it because of the following problem. How can I solve this?

스크린샷 2021-06-27 오후 4 23 12

@bdlukaa
Copy link
Owner

bdlukaa commented Jun 27, 2021

you're trying to import both fluent and material libraries. Please import only one.

If you need to import both, use:

import 'package:flutter/material.dart' as material;
import 'package: fluent_ui/fluent_ui.dart';

@bdlukaa
Copy link
Owner

bdlukaa commented Jul 1, 2021

Do you still see this issue?

@Patrick386
Copy link
Author

Unfortunately, that doesn't solve the problem.

2021-07-02_135741

2021-07-02_135805

2021-07-02_135818

@JohnOyekanmi
Copy link

Unfortunately, that doesn't solve the problem.

2021-07-02_135741

2021-07-02_135805

2021-07-02_135818

To use scaffold you'll have to do: material.Scaffold(...)

To use any api, widget or Classes defined in the material Libraries you'll have to add a material. (or the name used in importing the material Library) prefix before the concerned item.

You can try hiding the Colors class api from being exposed by importing the material library this way:

import 'package:flutter/material.dart' hide Colors; import 'package: fluent_ui/fluent_ui.dart';

This will hide the Colors api from being exposed in the import. You can also use this same method to hide it from the fluent_ui package as well.

@bdlukaa
Copy link
Owner

bdlukaa commented Jul 20, 2021

Yes! I don't see why to use both libraries together, anyways.

Can this issue be closed?

@Patrick386
Copy link
Author

Yes, you can close it.
It's a great package. Thank you.

@bdlukaa
Copy link
Owner

bdlukaa commented Jul 21, 2021

thanks :)

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

3 participants