import 'package:fis_measure/interfaces/enums/display_mode.dart';

class LayoutViewPort {
  double left = 0;
  double right = 0;
  double top = 0;
  double bottom = 0;
  DisplayModeEnum displayFormat = DisplayModeEnum.normal;

  LayoutViewPort();

  factory LayoutViewPort.fromJson(Map<String, dynamic> map) {
    final instance = LayoutViewPort();
    instance.bottom = map['b'] ?? double.nan;
    instance.top = map['t'] ?? 0;
    instance.left = map['l'] ?? 0;
    instance.right = map['r'] ?? 0;
    instance.displayFormat = DisplayModeEnum.values[map['format'] ?? 0];

    return instance;
  }
}
