fromJson method

  1. @override
MouseCursor? fromJson(
  1. Map<String, dynamic>? json
)
override

Implementation

@override
MouseCursor? fromJson(Map<String, dynamic>? json) {
  if (json == null) return null;

  switch (json['type']) {
    case 'defer':
      return MouseCursor.defer;

    case 'material':
      switch (json['cursor']) {
        case 'clickable':
          return MaterialStateMouseCursor.clickable;

        case 'textable':
          return MaterialStateMouseCursor.textable;
      }
      break;
    case 'system':
      switch (json['cursor']) {
        case 'alias':
          return SystemMouseCursors.alias;

        case 'allScroll':
          return SystemMouseCursors.allScroll;

        case 'basic':
          return SystemMouseCursors.basic;

        case 'cell':
          return SystemMouseCursors.cell;

        case 'click':
          return SystemMouseCursors.click;

        case 'contextMenu':
          return SystemMouseCursors.contextMenu;

        case 'copy':
          return SystemMouseCursors.copy;

        case 'disappearing':
          return SystemMouseCursors.disappearing;

        case 'forbidden':
          return SystemMouseCursors.forbidden;

        case 'grab':
          return SystemMouseCursors.grab;

        case 'grabbing':
          return SystemMouseCursors.grabbing;

        case 'help':
          return SystemMouseCursors.help;

        case 'move':
          return SystemMouseCursors.move;

        case 'none':
          return SystemMouseCursors.none;

        case 'precise':
          return SystemMouseCursors.precise;

        case 'progress':
          return SystemMouseCursors.progress;

        case 'resizeColumn':
          return SystemMouseCursors.resizeColumn;

        case 'resizeDown':
          return SystemMouseCursors.resizeDown;

        case 'resizeDownLeft':
          return SystemMouseCursors.resizeDownLeft;

        case 'resizeDownRight':
          return SystemMouseCursors.resizeDownRight;

        case 'resizeLeft':
          return SystemMouseCursors.resizeLeft;

        case 'resizeRight':
          return SystemMouseCursors.resizeRight;

        case 'resizeRow':
          return SystemMouseCursors.resizeRow;

        case 'resizeUp':
          return SystemMouseCursors.resizeUp;

        case 'resizeUpDown':
          return SystemMouseCursors.resizeUpDown;

        case 'resizeUpLeft':
          return SystemMouseCursors.resizeUpLeft;

        case 'resizeUpLeftDownRight':
          return SystemMouseCursors.resizeUpLeftDownRight;

        case 'resizeUpRight':
          return SystemMouseCursors.resizeUpRight;

        case 'resizeUpRightDownLeft':
          return SystemMouseCursors.resizeUpRightDownLeft;

        case 'text':
          return SystemMouseCursors.text;

        case 'verticalText':
          return SystemMouseCursors.verticalText;

        case 'wait':
          return SystemMouseCursors.wait;

        case 'zoomIn':
          return SystemMouseCursors.zoomIn;

        case 'zoomOut':
          return SystemMouseCursors.zoomOut;
      }
      break;
    case 'uncontrolled':
      return MouseCursor.uncontrolled;
  }

  throw 'Unsuported_Json_Value';
}