adder static method
Implementation
static Adder adder({
required CheckCategory parent,
required onCancel(),
required onDone(CheckPoint checkpoint),
CheckPoint? currentCheckpoint,
}) {
return Adder(
'checkpoint',
onSet: (json) {
Map<String, dynamic> checkpoint = json['checkpoint'];
if (currentCheckpoint != null) {
checkpoint = currentCheckpoint.toJson()..addAll(checkpoint);
} else {
checkpoint['PjNr'] = parent.pjNr;
checkpoint['E1'] = parent.index;
checkpoint['E2'] = -1;
}
onDone(CheckPoint.fromJson(checkpoint)!);
},
onCancel: onCancel,
textfieldList: [
InputData(
"KurzText",
hint: S.current!.kurzTextHint,
value: currentCheckpoint?.kurzText,
),
InputData(
"LangText",
hint: S.current!.langTextHint,
verify: InputData.alwaysCorrect,
value: currentCheckpoint?.langText,
),
],
);
}