ContextMenuItem constructor

ContextMenuItem({
  1. dynamic id,
  2. @Deprecated("Use id instead") int? androidId,
  3. @Deprecated("Use id instead") String? iosId,
  4. required String title,
  5. dynamic action()?,
})

Implementation

ContextMenuItem(
    {this.id,
    @Deprecated("Use id instead") this.androidId,
    @Deprecated("Use id instead") this.iosId,
    required this.title,
    this.action}) {
  if (Util.isAndroid) {
    this.id = this.id ?? this.androidId;
    assert(this.id is int);
  } else if (Util.isIOS) {
    this.id = this.id ?? this.iosId;
  }
  assert(this.id != null && (this.id is int || this.id is String));
}