1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Add support for server conversation message

This commit is contained in:
2021-03-10 19:08:18 +01:00
parent 08c77340a0
commit 2989e98c50
7 changed files with 131 additions and 28 deletions

View File

@ -3,10 +3,10 @@
/// @author Pierre HUBERT
/// Transform a list of dynamic thins into something a list of ints
List<int> listToIntList(List<dynamic> srcList){
List<int> listToIntList(List<dynamic> srcList) {
List<int> list = List();
srcList.forEach((e){
srcList.forEach((e) {
list.add(int.parse(e));
});
@ -14,14 +14,23 @@ List<int> listToIntList(List<dynamic> srcList){
}
/// Find the list of missing elements of a [testList] from a [srcList]
List<T> findMissingFromList<T>(List<T> srcList, List<T>testList) {
List<T> findMissingFromList<T>(List<T> srcList, List<T> testList) {
List<T> dest = List();
testList.forEach((f){
if(!srcList.contains(f) && !dest.contains(f))
dest.add(f);
testList.forEach((f) {
if (!srcList.contains(f) && !dest.contains(f)) dest.add(f);
});
return dest;
}
}
/// Find the list of missing elements of a [testList] from a [srcList]
Set<T> findMissingFromSet<T>(Set<T> srcList, Set<T> testList) {
Set<T> dest = Set();
testList.forEach((f) {
if (!srcList.contains(f)) dest.add(f);
});
return dest;
}