RpcList<T extends IRpcSerializable> class
Specialized list for objects implementing IRpcSerializable.
Provides serialization/deserialization while keeping type safety and RPC compatibility.
- Implemented types
Constructors
- RpcList()
- Creates an empty list.
- RpcList.empty({int capacity = 0})
- Creates an empty growable list with optional capacity hint.
- RpcList.filled(int length, T fill)
-
Creates a fixed-length list filled with
fill. -
RpcList.from(List<
T> items) - Creates a list from an existing collection.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
True when the list is empty.
no setter
- isNotEmpty → bool
-
True when the list is not empty.
no setter
-
iterator
→ Iterator<
T> -
Returns an iterator.
no setter
- length → int
-
Length of the list.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
T value) → void - Adds an element to the end.
-
addAll(
Iterable< T> items) → void - Adds all elements from another iterable.
-
clear(
) → void - Clears the list.
-
forEach(
void f(T value)) → void - Applies a function to each element.
-
map<
R> (R f(T)) → Iterable< R> - Maps items for convenient collection methods.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
T value) → bool - Removes an element.
-
removeAt(
int index) → T - Removes by index.
-
sort(
[int compare(T a, T b)?]) → void - Sorts items with an optional comparator.
-
toJson(
) → Map< String, dynamic> -
Serializes an object to a map representation.
override
-
toList(
) → List< T> - Returns an unmodifiable copy.
-
toMutableList(
) → List< T> - Returns a mutable copy.
-
toString(
) → String -
A string representation of this object.
inherited
-
where(
bool test(T value)) → RpcList< T> - Filters elements.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
int index) → T - Indexer access.
-
operator []=(
int index, T value) → void - Sets a value by index.
Static Methods
-
fromJson<
T extends IRpcSerializable> (T fromJson(Map< String, dynamic> )) → RpcList<T> Function(Map<String, dynamic> ) - Returns a decoder function that builds an RpcList from JSON.
-
fromJsonRaw<
T extends IRpcSerializable> (List json, T fromJson(Map< String, dynamic> )) → RpcList<T> - Creates a list from a JSON representation.