generate method

  1. @override
Widget generate(
  1. Context context
)
override

Implementation

@override
Widget generate(Context context) {
  var s = Scoreboard(score);
  var prev = s['build_number.prev'];
  var current = s['build_number'];

  return For.of([
    prev >> current,
    current >> currentVersion,
    if (onUpdate != null)
      If(
        prev < current,
        then: onUpdate!,
      ),
    If(
      prev > current,
      then: [
        if (onDowndate != null) ...onDowndate!,
        current >> prev,
      ],
    ),
    if (then != null) then!(current),
    prev.reset(),
  ]);
}