CommonDataClass<T extends CommonDataClass<T> > class
abstract
A base class for data model classes, must implement String id, fromMap
and toMap methods
import 'package:get_storage_pro/src/common_data_class.dart';
@gsp
class YourModel extends CommonDataClass<YourModel> {
final String id;
final String name;
YourModel({required this.id, required this.name});
factory YourModel.fromMap(Map<String, dynamic> map) {
return YourModel(
id: map['id'] as String,
name: map['name'] as String,
);
}
@override
Map<String, dynamic> toMap() {
return {'id': id, 'name': name};
}
}
Constructors
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> - A map representation of the data object.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited