TWriteableId class abstract

A base class for objects that require a string identifier.

This abstract class extends TWriteable and adds a requirement for a string-based unique identifier. It provides a simpler alternative to TWriteableCustomId when you only need string IDs.

Example:

class User extends TWriteableId {
  User({required this.name});

  final String name;

  @override
  String get id => 'user-123';

  @override
  Map<String, dynamic> toJson() => {
    'name': name,
  };
}
Inheritance

Constructors

TWriteableId()

Properties

hashCode int
The hash code for this object.
no setterinherited
id String
The unique string identifier for this object.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts the object to a Firestore-compatible map.
inherited
toString() String
A string representation of this object.
inherited
validate<T>() → TurboResponse<T>?
Validates the object's data before writing to Firestore.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited