Check out example codes for "dart extension". It will help you in understanding the concepts better.

Code Example 1

extension NumberParsing on String {
  int parseInt() {
    return int.parse(this);
  }
  // ···
}

Code Example 2

extension FancyNum on num {
  num plus(num other) => this + other;

  num times(num other) => this * other;
}

Learn ReactJs, React Native from akashmittal.com