69 lines
1.8 KiB
Dart
69 lines
1.8 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'promotion_model.dart';
|
|
|
|
// **************************************************************************
|
|
// TypeAdapterGenerator
|
|
// **************************************************************************
|
|
|
|
class PromotionModelAdapter extends TypeAdapter<PromotionModel> {
|
|
@override
|
|
final typeId = 11;
|
|
|
|
@override
|
|
PromotionModel read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return PromotionModel(
|
|
id: fields[0] as String,
|
|
title: fields[1] as String,
|
|
description: fields[2] as String,
|
|
imageUrl: fields[3] as String,
|
|
startDate: fields[4] as String,
|
|
endDate: fields[5] as String,
|
|
discountPercentage: (fields[6] as num?)?.toInt(),
|
|
discountAmount: (fields[7] as num?)?.toDouble(),
|
|
terms: fields[8] as String?,
|
|
detailsUrl: fields[9] as String?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, PromotionModel obj) {
|
|
writer
|
|
..writeByte(10)
|
|
..writeByte(0)
|
|
..write(obj.id)
|
|
..writeByte(1)
|
|
..write(obj.title)
|
|
..writeByte(2)
|
|
..write(obj.description)
|
|
..writeByte(3)
|
|
..write(obj.imageUrl)
|
|
..writeByte(4)
|
|
..write(obj.startDate)
|
|
..writeByte(5)
|
|
..write(obj.endDate)
|
|
..writeByte(6)
|
|
..write(obj.discountPercentage)
|
|
..writeByte(7)
|
|
..write(obj.discountAmount)
|
|
..writeByte(8)
|
|
..write(obj.terms)
|
|
..writeByte(9)
|
|
..write(obj.detailsUrl);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is PromotionModelAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|