This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyListClass{ | |
String value; | |
List<MyItemClass> items; | |
MyListClass(){} | |
MyListClass.fromRaw(Map value){ | |
value = JSON.decode(value['value']); | |
items = JSON.decode(value['items'],reviver:(k,v){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DateTimeFromDateInput extends Transformer<String,DateTime>{ | |
String forward(DateTime d){ | |
String s = d.toString(); | |
return s.substring(0,s.lastIndexOf(' ')); | |
} | |
DateTime reverse(String s) { | |
try{ | |
return DateTime.parse(s); | |
}on Exception { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static bool validsiret(String siret){ | |
if(siret==null) | |
return false; | |
String s = siret.replaceAll(' ',''); | |
if(s.length==0) | |
return false; | |
List<int> ln = new List<int>(); | |
for (int i = 0; i < s.length ; i++) { | |
int n = int.parse(s[i], onError:(_){return 127;}); | |
ln.add(i.isEven ? (n * 2 > 9 ? n * 2 - 9 : n * 2) : n); |