<select id="selectPostIn" parameterType="map">
SELECT *
FROM POST P
WHERE ID in
<foreach collection="list" item="item" index="index"
open="(" separator="," close=")">
#{item}
</foreach>
</select>
//You can use a try-catch block to prevent the exception from breaking the flow:
bool kisweb;
try{
if(Platform.isAndroid||Platform.isIOS) {
kisweb=false;
} else {
kisweb=true;
}
} catch(e){
kisweb=true;
}
ex)
list.add(color1);
list.add(color2);
list.add(color3);
list.add(color4);
// with cascade
List list = [];
list
..add(color1)
..add(color2)
..add(color3)
..add(color4);
//It's the cascade operator of Dart
var l1 = new List<int>()..add(0)..addAll([1, 2, 3]);
//results in l1 being a list [0, 1, 2, 3]
var l1 = new List<int>().add(0).addAll([1, 2, 3]);
results in an error, because.add(0)returnsvoid
..(in the former example) refers tonew List(), while.(in the later) refers to the return value of the previous part of the expression.
..was introduced to avoid the need to returnthisin all kinds of methods likeadd()to be able to use an API in a fluent way.