ensureSuffix method

  1. @useResult
String ensureSuffix(
  1. String suffix
)

Returns this string with suffix appended if not already present.

Implementation

@useResult
String ensureSuffix(String suffix) => endsWith(suffix) ? this : this + suffix;