i need some help because im going crazy. I just want to format date to my locale (should be it-IT).
In flutter app i putted in pubspec.yaml the intl package with the new nullsafety feature:
flutter:
sdk: flutter
intl: ^0.17.0-nullsafety.2
looking into the documentation it says:
<< Note that before doing any DateTime formatting for a particular locale, you must load the appropriate data by calling: >>
import 'package:intl/date_symbol_data_local.dart';
...
initializeDateFormatting('de_DE', null).then(formatDates);
(https://pub.dev/packages/intl/versions/0.17.0-nullsafety.2)
so, just to try, i did:
initializeDateFormatting('it-IT', null).then((value) => {print('intl ok')});
but the dart nullsafety doesnt want a null parameter, and it says "The argument type 'Null' can't be assigned to the parameter type 'String'."
Any suggestion?
Thread: flutter intl 0.17.0 package initializeDateFormatting.
Same problem here, did you solve the issue?
I tried upgrading intl to ^0.18.0, but in my pubspec.yaml I am using
flutter_localizations: # Add this line
sdk: flutter
so, my project is coupled with intl 0.17.0. I realize this when I tried the [flutter pub get] command and got this message:
Running "flutter pub get" in expenses...
**Because expenses depends on flutter_localizations from sdk which depends on intl 0.17.0, intl 0.17.0 is required.**
So, because expenses depends on intl ^0.18.0, version solving failed.
pub get failed (1; So, because expenses depends on intl ^0.18.0, version solving failed.)
I also made a lab with only dart and not flutter, and intl works as expected:
https://gist.github.com/ejyanezp/994c49f15bb2ce3fd4c3d84ed37ca198
So is a compatibility issue between flutter_localizations and intl.
Conclusion: i will go for a workaround and wait the final solution from the authors of both libraries.
Related
after upgrade flutter 3 I am facing this version solving issue.
HTML version not sported SVG
if I am choosing SVG different version so RANDOM_AVTAR is not sported.
both plugin sported or dependent on different version an I need all this how can I control this versions.
ERRORS:
Because every version of random_avatar depends on flutter_svg ^1.0.3 and demo depends on flutter_svg 0.23.0, random_avatar is forbidden.
So, because demo depends on random_avatar ^0.0.2, version solving failed.
pub get failed (1; So, because demo depends on random_avatar ^0.0.2, version solving failed.)
Running "flutter pub get" in fluter...
Because demo depends on flutter_html ^2.1.5 which depends on flutter_svg >=0.22.0 <1.0.0, flutter_svg >=0.22.0 <1.0.0 is required.
So, because demo depends on flutter_svg ^1.0.3, version solving failed.
pub get failed (1; So, because demo depends on flutter_svg ^1.0.3, version solving failed.)
Just for work around you can use
flutter_svg: ^1.1.6
flutter_html: 3.0.0-alpha.5
random_avatar: ^0.0.7
As I understand it, the Package integration_test package is not null type safe. Can the package be used for the current Flutter version (version> 2.0)? If not, are there any alternatives?
as montionned in Readme file, the package is **DEPRECATED
This package has been moved to the Flutter SDK. Starting with Flutter 2.0.
it should be included as:
dev_dependencies:
integration_test:
sdk: flutter
I have an error when i try to add a new plugin in my pubspec.yaml
i add the plugin : easy_localization: ^3.0.0
And i have this error message :
Because flutter_launcher_icons >=0.7.0 <0.9.0 depends on args ^1.5.0 and easy_localization >=3.0.0-nullsafety depends on args ^2.0.0, flutter_launcher_icons >=0.7.0 <0.9.0 is incompatible with easy_localization >=3.0.0-nullsafety.
So, because gameapp depends on both easy_localization ^3.0.0 and flutter_launcher_icons ^0.8.0, version solving failed.
pub get failed (1; So, because gameapp depends on both easy_localization ^3.0.0 and flutter_launcher_icons ^0.8.0, version solving failed.)
Could you try adding,
flutter_launcher_icons: ^0.9.0
args: ^2.0.0
easy_localization: ^3.0.0-nullsafety
to your pubspec.yaml and try saving it again to reload the packages?
The problem is: The library version you want to use is newer than Flutter, and there are two solutions
1: Go to the library website and click on the version and install an old library, for example (easy_localization: ^ 2.3.3)
2: Install the latest version of Flutter. Flutter2
I'm getting this error after I upgrade flutter.
Because no versions of datetime_picker_formfield match >0.4.3 <0.5.0 and datetime_picker_formfield 0.4.3 depends on intl ^0.15.8, datetime_picker_formfield ^0.4.3 requires intl ^0.15.8.
And because every version of flutter_localizations from sdk depends on intl 0.16.0, datetime_picker_formfield ^0.4.3 is incompatible with flutter_localizations from sdk.
So, because APP_NAME depends on both flutter_localizations any from sdk and datetime_picker_formfield ^0.4.3, version solving failed.
Please help.
Thanks.
Try adding these to your pubspec.yaml file:
dependency_overrides:
intl: ^0.16.0
I am trying to use the Jiffy package and the flutter localization package. Problem is now, that both are using the intl package, but with different versions. When I try "Packages get" I get the following error:
Because every version of flutter_localizations from sdk depends on intl 0.15.8 and every version of jiffy depends on intl ^0.16.0, flutter_localizations from sdk is incompatible with jiffy.
Is there a way to solve it? To use both version of intl for example?
Thanks
You just need to add this to your pubspec.yaml file:
dependency_overrides:
intl: ^0.16.0
go to your pubspec.yamal and
under of global_configuration:
set intl version like this :
dependency_overrides:
intl: ^0.15.8
and change it to :
dependency_overrides:
intl: ^0.16.0