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:
if(Platform.isWindows) return Checkbox(); //Fluent UI
if(Platform.isAndroid) return Checkbox(); //Material
Errors occurre at ThemeData, TextButton, Tab, Divider, Scrollbar, Tooltip, showDialog TextStyle or Colors.
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 or FlName.
That would be so helpful.
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,showDialogTextStyleorColors.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
FluentNameorFlName.That would be so helpful.