read method

  1. @override
AppLocalSettingModel read(
  1. BinaryReader reader
)
override

Is called when a value has to be decoded.

Implementation

@override
AppLocalSettingModel read(BinaryReader reader) {
  final numOfFields = reader.readByte();
  final fields = <int, dynamic>{
    for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
  };
  return AppLocalSettingModel(
    themeIndex: fields[0] == null ? 0 : fields[0] as int,
    themeModel: fields[1] == null ? 0 : fields[1] as int,
  );
}