import 'package:flutter/material.dart';

class Constant {
  static double designHeight = 982;
  static double designWidth = 1512;
  static String versi = "Versi 16";

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

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

  static TextStyle layananTitle({required BuildContext context}) {
    return TextStyle(
      fontSize: Constant.getActualX(context: context, x: 18),
      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;
  }
}
