-
-
Notifications
You must be signed in to change notification settings - Fork 463
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
Fluent UI is incompatible with Flutter Material #150
Comments
Did you try using library prefix? https://dart.dev/guides/language/language-tour#using-libraries import 'package:lib2/lib2.dart' as lib2; |
@jolleekin Thanks for your response. No, I didn't. It may work but the linter doesn't fully support it (regarding suggestions). Or is there a option to enable this. |
Hello! You can use the import 'package:fluent_ui/fluent_ui.dart' as fluent_ui;
import 'package:flutter/material.dart'; And use it using the prefix if(Platform.isWindows) return fluent_ui.Checkbox(); //Fluent UI
if(Platform.isAndroid) return Checkbox(); //Material |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This package is great but it doesn't work in a single codebase with material.
As an example I want to build a custom class called
AdaptiveCheckbox
. This class decides which Checkbox should be used:Errors occurre at
ThemeData
,TextButton
,Tab
,Divider
,Scrollbar
,Tooltip
,showDialog
TextStyle
orColors
.The error message is:
The name 'ThemeData' is defined in the libraries 'package:fluent_ui/src/styles/theme.dart (via package:fluent_ui/fluent_ui.dart)' and 'package:flutter/src/material/theme_data.dart (via package:flutter/material.dart)'. (ambiguous_import at [demo] lib/src/constants/theme.dart:113)
or
'TextButton' isn't a function. (invocation_of_non_function at [demo] lib/src/widgets/buttons/blank_button.dart:136)
Solution
Could you please rename overlapping class names to something like
FluentName
orFlName
.That would be so helpful.
The text was updated successfully, but these errors were encountered: