import 'package:flutter/material.dart';

class AppStyle {
  AppStyle._();

  static const double borderRadius = 10;

  static const BoxShadow boxShadow = BoxShadow(color: Colors.black26, blurRadius: 3, offset: Offset(0, 2));

  static double getBorderRadius(BuildContext context) {
    return borderRadius * getScaleFactor(context);
  }

  static double getScaleFactor(BuildContext context) {
    return MediaQuery.of(context).orientation == Orientation.portrait
        ? MediaQuery.of(context).size.width / (360) > 1.5
            ? 1.5
            : MediaQuery.of(context).size.width / (360)
        : MediaQuery.of(context).size.height / (360) > 1.5
            ? 1.5
            : MediaQuery.of(context).size.height / (360);
  }

  static BorderRadius getCardBorder(BuildContext context) {
    return BorderRadius.only(
      topRight: Radius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
      topLeft: Radius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
      bottomRight: Radius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
    );
  }
}
