The code below no longer works in Dart M3, and I couldn't find what the new syntax is.
Could someone please advise?
#import('dart:uri');
String encodeMap(Map data) {
return Strings.join(data.getKeys().map((k) {
return "${encodeUriComponent(k)}=${encodeUriComponent(data[k])}";
}), "&");
}
Simply use .join(separator)
on Iterable
.
In your case :
import 'dart:uri';
String encodeMap(Map data) {
return data.keys.map((k) {
return "${encodeUriComponent(k)}=${encodeUriComponent(data[k])}";
}).join("&");
}
From Breaking Change: Strings class is going away :
The Strings class (note the trailing "s") in core is going away.
If you used Strings.join(stringIterable, separator) replace it with stringIterable.join(separator).
If you used Strings.concatAll(stringIterable) replace it with stringIterable.join().
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