Answers for "dart how to extend List"

C#
1

dart extending list

import 'dart:collection';

class MyCustomList<E> extends ListBase<E> {
  final List<E> l = [];
  
  set length(int newLength) {
    l.length = newLength;
  }

  int get length => l.length;

  E operator [](int index) => l[index];

  void operator []=(int index, E value) {
    l[index] = value;
  }
}
Posted by: Guest on May-26-2021

C# Answers by Framework

Browse Popular Code Answers by Language