read method

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

Is called when a value has to be decoded.

Implementation

@override
MephistoPersistentTheme read(BinaryReader reader) {
  final numOfFields = reader.readByte();
  final fields = <int, dynamic>{
    for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
  };
  return MephistoPersistentTheme(
    primaryColor: fields[0] as String?,
    primaryColorString: fields[1] as String?,
    fontFamily: fields[2] as String?,
    borderRadius: fields[3] as double?,
    borderWidth: fields[4] as double?,
    isDarkTheme: fields[5] as bool?,
    showBottomNavbarLabels: fields[6] as bool?,
    enableBottomNavbarFeedbacks: fields[7] as bool?,
    isFilledBgWidgets: fields[8] as bool?,
    darkFillColor: fields[9] as String?,
    lightFillColor: fields[10] as String?,
    darkLineColor: fields[11] as String?,
    lightLineColor: fields[12] as String?,
    captionTextAndIconColor: fields[13] as String?,
  );
}