93 lines
2.7 KiB
Dart
93 lines
2.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
class Constant {
|
|
static String tokenName = "westone-kurir";
|
|
static String version = "1";
|
|
static String baseUrl = "http://kd-kurir.aplikasi.web.id/one-api/";
|
|
static String baseBirtUrl = "http://kd-kurir.aplikasi.web.id/";
|
|
|
|
static double designHeight = 844;
|
|
static double designWidth = 390;
|
|
|
|
//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 Color primary = const Color(0xff2196F3);
|
|
static Color primaryLighten = const Color(0xffE3F2FD);
|
|
static Color primaryDarken = const Color(0xff0D47A1);
|
|
|
|
static Color secondary = const Color(0xffFFC107);
|
|
static Color secondaryLighten = const Color(0xffFFF8E1);
|
|
static Color secondaryDarken = const Color(0xffFF8F00);
|
|
|
|
static Color error = const Color(0xffF44336);
|
|
static Color errorLighten = const Color(0xffFFEBEE);
|
|
static Color errorDarken = const Color(0xffB71C1C);
|
|
|
|
static Color info = const Color(0xff00BCD4);
|
|
static Color infoLighten = const Color(0xffE0F7FA);
|
|
static Color infoDarken = const Color(0xff006064);
|
|
|
|
static Color success = const Color(0xff4CAF50);
|
|
static Color successLighten = const Color(0xffE8F5E9);
|
|
static Color successDarken = const Color(0xff1B5E20);
|
|
|
|
static Color warning = const Color(0xffFF9800);
|
|
static Color warningLighten = const Color(0xffFFF3E0);
|
|
static Color warningDarken = const Color(0xffEF6C00);
|
|
|
|
// typography
|
|
static TextStyle body1({required BuildContext context}) {
|
|
return GoogleFonts.roboto(
|
|
textStyle: TextStyle(
|
|
fontSize: Constant.getActualY(context: context, y: 14),
|
|
height: 1.5,
|
|
));
|
|
}
|
|
|
|
static TextStyle subtitle1({required BuildContext context}) {
|
|
return GoogleFonts.roboto(
|
|
textStyle: TextStyle(
|
|
fontSize: Constant.getActualY(context: context, y: 18),
|
|
height: 1.5,
|
|
));
|
|
}
|
|
|
|
static TextStyle subtitle2({required BuildContext context}) {
|
|
return GoogleFonts.roboto(
|
|
textStyle: TextStyle(
|
|
fontSize: Constant.getActualY(context: context, y: 16),
|
|
height: 1.5,
|
|
));
|
|
}
|
|
|
|
static TextStyle body2({required BuildContext context}) {
|
|
return GoogleFonts.roboto(
|
|
textStyle: TextStyle(
|
|
fontSize: Constant.getActualY(context: context, y: 12),
|
|
height: 1.5,
|
|
));
|
|
}
|
|
|
|
static TextStyle h2({required BuildContext context}) {
|
|
return GoogleFonts.roboto(
|
|
textStyle: TextStyle(
|
|
fontSize: Constant.getActualY(context: context, y: 28),
|
|
height: 1.5,
|
|
));
|
|
}
|
|
}
|