From dart announcements of new releases, breaking changes and other important news.
The dart: uri library is removed and the Uri class is added to the kernel.
The dart: uri library has been deleted.
What changed?
The dart: uri library has been deleted.
The Uri class is now in the core library . The top-level encodeUriComponent , enocdeUri , decodeUriComponent , decodeUri from dart:uri were transferred to the static methods Uri.encodeComponent , Uri.enocdeFull , Uri.decodeComponent , Uri.decodeFull .
The Uri.fromComponents constructor was renamed only to Uri , and the previous Uri constructor containing the URI string is no longer available, but should be replaced by calling the static Uri.parse method.
Finally, space handling in plus and plus for space encoding / decoding has been removed from Uri.encodeComponent and Uri.decodeComponent . To get this encoding / decoding, use the added static methods Uri.encodeQueryComponent and Uri.decodeQueryComponent .
In addition, the Uri class has additional features. See Changes and dartdoc for more information.
The dartdoc for the Uri class will be improved in the next couple of days.
Who was hurt?
Dart users: uri.
How to update the code?
Change the use of new Uri(...) to Uri.parse(...)
Change the use of the new Uri.fromComponents(...) to new Uri(...)
Change the calls to encodeUriComponent , enocdeUri , decodeUriComponent , decodeUri to calls Uri.encodeComponent , Uri.enocdeFull , Uri.decodeComponent , Uri.decodeFull .
Finally, you use the fact that encodeUriComponent and decodeUriComponent changed the space to plus and plus to space. If for this use Uri.encodeQueryComponent and Uri.decodeQueryComponent instead of Uri.encodeComponent and Uri.decodeComponent