first commit
This commit is contained in:
125
lib/app/constant.dart
Normal file
125
lib/app/constant.dart
Normal file
@@ -0,0 +1,125 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
38
lib/app/route.dart
Normal file
38
lib/app/route.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:queuedisplay/screen/customer_service_dedicatedv2.dart';
|
||||
|
||||
import 'package:queuedisplay/screen/settings/setting_screen_counter_dedicated.dart';
|
||||
|
||||
const customerServiceDedicatedRoute = '/customerServiceDedicatedRoute';
|
||||
const layananDokterRoute = '/layananDokterScreenRoute';
|
||||
const pengambilanDarahRoute = '/pengambilanDarahScreenRoute';
|
||||
const rontgenUsgRoute = '/rontgenUsgScreenRoute';
|
||||
const settingRoute = '/settingRoute';
|
||||
|
||||
class AppRoute {
|
||||
static Route<dynamic>? generateRoute(RouteSettings settings) {
|
||||
if (settings.name == settingRoute) {
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0,
|
||||
padding: const EdgeInsets.all(0),
|
||||
),
|
||||
child: const SettingScreenCounterDedicated());
|
||||
});
|
||||
}
|
||||
if (settings.name == customerServiceDedicatedRoute) {
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0,
|
||||
padding: const EdgeInsets.all(0),
|
||||
),
|
||||
child: CustomerServiceDedicatedV2());
|
||||
});
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user