add method
Implementation
dynamic add(BuildContext context, dynamic currentValue, int loop) {
if (currentValue is! num) {
context.logsCubit.onNewLog(
EditorLogEntity(
id: id,
content: 'The value is not a number',
createdAt: DateTime.now(),
),
);
}
final res = value.get(context: context, loop: loop);
if (res is! num) {
context.logsCubit.onNewLog(
EditorLogEntity(
id: id,
content: 'The value to add is not a number',
createdAt: DateTime.now(),
),
);
return currentValue;
}
return currentValue + res;
}