import 'package:flutter/material.dart';

class Constant {
  static double designHeight = 1080;
  static double designWidth = 1920;

  // url
  // static String baseUrl = "http://devone.aplikasi.web.id/one-api/";
  static String baseUrl = 'a';
  static String baseSocket = 'a';

  static Color textBlack = const Color(0xff212B36);
  static Color red1 = const Color(0xff0C00AC);
  static Color red2 = const Color(0xff004AAC);
  static Color textRed = const Color(0xff0C00AC);

  // checkbox color
  static Color checkboxActive = const Color(0xff0C00AC);
  static Color checkboxCheck = Colors.white;
  static Color checkboxSelected = Colors.red.shade100;

  static TextStyle h1({required BuildContext context}) {
    return TextStyle(
      fontSize: Constant.getActualX(context: context, x: 68),
      fontWeight: FontWeight.w700,
    );
  }

  static TextStyle S75({required BuildContext context}) {
    return TextStyle(
      fontSize: Constant.getActualX(context: context, x: 80),
      fontWeight: FontWeight.w700,
    );
  }

  static TextStyle h2({required BuildContext context}) {
    return TextStyle(
      fontSize: Constant.getActualX(context: context, x: 30),
      fontWeight: FontWeight.w700,
    );
  }

  static TextStyle h2LayananDokter({required BuildContext context}) {
    return TextStyle(
      fontSize: Constant.getActualX(context: context, x: 40),
      fontWeight: FontWeight.w700,
    );
  }

  static TextStyle S50({required BuildContext context}) {
    return TextStyle(
      fontSize: Constant.getActualX(context: context, x: 50),
      fontWeight: FontWeight.w700,
    );
  }

  static TextStyle body_1({required BuildContext context}) {
    return TextStyle(
      fontSize: Constant.getActualX(context: context, x: 44),
      fontWeight: FontWeight.w700,
    );
  }

  static TextStyle body_big({required BuildContext context}) {
    return TextStyle(
      fontSize: Constant.getActualX(context: context, x: 70),
      fontWeight: FontWeight.w700,
    );
  }

  static TextStyle body_2({required BuildContext context}) {
    return TextStyle(
      fontSize: Constant.getActualX(context: context, x: 40),
      fontWeight: FontWeight.w700,
    );
  }

  static TextStyle body_3({required BuildContext context}) {
    return TextStyle(
      fontSize: Constant.getActualX(context: context, x: 32),
      fontWeight: FontWeight.w700,
    );
  }

  static TextStyle subTitle({required BuildContext context}) {
    return TextStyle(
      fontSize: Constant.getActualX(context: context, x: 22),
      fontWeight: FontWeight.w600,
    );
  }

  static TextStyle label({required BuildContext context}) {
    return TextStyle(
        fontSize: Constant.getActualX(context: context, x: 16),
        fontStyle: FontStyle.italic);
  }

  static TextStyle normal({required BuildContext context}) {
    return TextStyle(
      fontSize: Constant.getActualX(context: context, x: 16),
    );
  }

  //size convertion
  static double getActualX({
    required BuildContext context,
    required double x,
  }) {
    return x / designWidth * MediaQuery.of(context).size.width;
  }

  static double getActualY({
    required BuildContext context,
    required double y,
  }) {
    return y / designHeight * MediaQuery.of(context).size.height;
  }

  static setBaseUrl(String text) {
    // baseUrl = "http://devone.aplikasi.web.id/one-api/";
    text = "devcpone.aplikasi.web.id";
    baseUrl = "https://$text/one-api/";
    baseSocket = text;
  }
}
