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?
I was facing the same issue.
Changed import statement to
import 'package:intl/date_symbol_data_local.dart';
from
import 'package:intl/date_symbol_data_file.dart';
Also dependency I am using is intl: ^0.18.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With