addChecked method

Uint32 addChecked(
  1. Uint32 other
)

Adds other dynamically intercepting any numerical layout overflow triggering a Dart StateError.

Implementation

Uint32 addChecked(Uint32 other) {
  final result = value + other.value;
  if (result > 4294967295 || result < 0) {
    throw StateError('Uint32 addition overflow');
  }
  return Uint32.from(result);
}