SingleData constructor

SingleData(
  1. num down,
  2. num up, {
  3. String? id,
  4. dynamic x,
})

Implementation

SingleData(this.down, this.up, {String? id, this.x}) {
  if (id != null && id.isNotEmpty) {
    this.id = id;
  } else {
    this.id = const Uuid().v4().toString().replaceAll('-', '');
  }

  if (up < down) {
    throw FlutterError('maxData must more than minData');
  }

  if (x != null) {
    if (!(x is num || x is String)) {
      throw FlutterError('x only support num or string');
    }
  }
}