import 'package:flutter/material.dart';

enum DisplaySize {
  extraSmall, //mobile
  small, //tablet
  medium, //laptop
  large, //desktop
}

extension DisplaySizeDetector on Size {
  DisplaySize get displaySize {
    if (width < 600) {
      return DisplaySize.extraSmall;
    } else if (width < 1024) {
      return DisplaySize.small;
    } else if (width < 1440) {
      return DisplaySize.medium;
    } else {
      return DisplaySize.large;
    }
  }

  String get displaySizeName {
    switch (displaySize) {
      case DisplaySize.extraSmall:
        return 'Mobile';
      case DisplaySize.small:
        return 'Tablet';
      case DisplaySize.medium:
        return 'Laptop';
      case DisplaySize.large:
        return 'Desktop';
    }
  }
}
