step 3 : hapus ai_barcode_scanner, ai barcode, update permission_handler, flutter_map,latlong2
This commit is contained in:
122
lib/app/constant.dart
Normal file
122
lib/app/constant.dart
Normal file
@@ -0,0 +1,122 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class Constant {
|
||||
static String tokenName = "kdr-kurir";
|
||||
// static String baseUrl = "http://devkedungdororaya.aplikasi.web.id/one-api/";
|
||||
|
||||
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;
|
||||
|
||||
static String version = "1.01";
|
||||
|
||||
//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;
|
||||
}
|
||||
|
||||
//color identity
|
||||
static Color backgroundWhite = const Color(0xffFFFFFF);
|
||||
static Color textBlack = const Color(0xFF070708);
|
||||
static Color textGrey = const Color(0xFF919EAB);
|
||||
static Color primaryBlue = const Color(0xFF005AA9);
|
||||
static Color backgroundBlue = const Color(0xFF1890FF).withOpacity(0.25);
|
||||
static Color iconBlue = const Color(0xFF3366FF);
|
||||
static Color primaryGreen = const Color(0xFF229A16);
|
||||
static Color backgroundGreen = const Color(0xFF54D62C).withOpacity(0.25);
|
||||
static Color primaryOrange = const Color(0xFFB78103);
|
||||
static Color backgroundOrange = const Color(0xFFFFC107).withOpacity(0.25);
|
||||
static Color primaryRed = const Color(0xFFB72136);
|
||||
static Color primaryYellow = const Color(0xFFFFC107);
|
||||
static Color primaryPurple = const Color(0xFFBF07FF);
|
||||
static Color backgroundPurple = const Color(0xFFBF07FF).withOpacity(0.25);
|
||||
static Color textSecondary = const Color(0xFF637381);
|
||||
|
||||
// sindhu
|
||||
static Color textPrimary = const Color(0xff212B36);
|
||||
static Color primaryMain = const Color(0xff3366FF);
|
||||
static Color errorDark = const Color(0xffB72136);
|
||||
// static Color dropdownTextColor = const Color(0xff005AA9);
|
||||
static Color blueButton = const Color(0xff005AA9);
|
||||
static Color primaryDark = const Color(0xff005AA9);
|
||||
static Color buttonIsNotActive = const Color(0xffDFE3E8);
|
||||
static Color historyCardColor = const Color(0xff54D62C).withOpacity(0.08);
|
||||
static Color historyCardColorPending =
|
||||
const Color(0xffFF0D05).withOpacity(0.08);
|
||||
|
||||
// typography
|
||||
static TextStyle heading2({required BuildContext context}) {
|
||||
return TextStyle(
|
||||
fontSize: Constant.getActualY(context: context, y: 28),
|
||||
height: 1.5,
|
||||
);
|
||||
}
|
||||
|
||||
static TextStyle body1({required BuildContext context}) {
|
||||
return TextStyle(
|
||||
fontSize: Constant.getActualY(context: context, y: 16),
|
||||
height: 1.5,
|
||||
);
|
||||
}
|
||||
|
||||
static TextStyle caption1({required BuildContext context}) {
|
||||
return TextStyle(
|
||||
fontSize: Constant.getActualY(context: context, y: 12),
|
||||
height: 1.5,
|
||||
);
|
||||
}
|
||||
|
||||
static TextStyle buttonLarge({required BuildContext context}) {
|
||||
return TextStyle(
|
||||
fontSize: Constant.getActualY(context: context, y: 15),
|
||||
height: 1.5,
|
||||
);
|
||||
}
|
||||
|
||||
static TextStyle heading4({required BuildContext context}) {
|
||||
return TextStyle(
|
||||
fontSize: Constant.getActualY(context: context, y: 18),
|
||||
height: 1.5,
|
||||
);
|
||||
}
|
||||
|
||||
static TextStyle body3({required BuildContext context}) {
|
||||
return TextStyle(
|
||||
fontSize: Constant.getActualY(context: context, y: 14),
|
||||
height: 1.5,
|
||||
);
|
||||
}
|
||||
|
||||
static TextStyle caption2({required BuildContext context}) {
|
||||
return TextStyle(
|
||||
fontSize: Constant.getActualY(context: context, y: 10),
|
||||
height: 1.5,
|
||||
);
|
||||
}
|
||||
|
||||
static TextStyle heading3({required BuildContext context}) {
|
||||
return TextStyle(
|
||||
fontSize: Constant.getActualY(context: context, y: 20),
|
||||
height: 1.5,
|
||||
);
|
||||
}
|
||||
|
||||
static TextStyle body2({required BuildContext context}) {
|
||||
return TextStyle(
|
||||
fontSize: Constant.getActualY(context: context, y: 14),
|
||||
height: 1.5,
|
||||
);
|
||||
}
|
||||
}
|
||||
285
lib/app/route.dart
Normal file
285
lib/app/route.dart
Normal file
@@ -0,0 +1,285 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../screen/change_password_screen/change_password_screen.dart';
|
||||
import '../screen/input_pekerjaan/input_pekerjaan_lain_lain.dart';
|
||||
import '../screen/input_pekerjaan/input_pekerjaan_pengambilan_bahan.dart';
|
||||
import '../screen/personal_information_screen/personal_information_screen.dart';
|
||||
import '../screen/test/test_home_screen.dart';
|
||||
import '../screen/work_process_screen/work_process_screen.dart';
|
||||
|
||||
import '../screen/input_pekerjaan/input_lain_lain_screen.dart';
|
||||
import '../screen/input_pekerjaan/input_pekerjaan_pengantaran_hasil.dart';
|
||||
import '../screen/input_pekerjaan/input_pekerjaan_screen.dart';
|
||||
import '../screen/input_pekerjaan/input_pengambilan_bahan_screen.dart';
|
||||
import '../screen/input_pekerjaan/input_pengantaran_hasil_dokter_screen.dart';
|
||||
import '../screen/input_pekerjaan/input_pengantaran_hasil_instansi_screen.dart';
|
||||
import '../screen/input_pekerjaan/input_pengantaran_hasil_pasien_screen.dart';
|
||||
import '../screen/input_pekerjaan/input_scan_screen.dart';
|
||||
import '../screen/konfirmasi/konfirmasi_screen.dart';
|
||||
import '../screen/login/login_screen.dart';
|
||||
import '../screen/problemlogin/problem_login_screen.dart';
|
||||
import '../screen/splash_screen/splash_screen.dart';
|
||||
import '../screen/menu_screen/menu_screen.dart';
|
||||
// import '../screen/splash_screen.dart';
|
||||
|
||||
const splashRoute = "/splashRoute";
|
||||
const loginRoute = "/loginRoute";
|
||||
const problemLoginRoute = "/problemLoginRoute";
|
||||
const testHomeRoute = "/testHomeRoute";
|
||||
const inputPekerjaan = "/inputPekerjaan";
|
||||
const inputScanRoute = "/inputScanRoute";
|
||||
const konfirmasiRoute = "/konfirmasiRoute";
|
||||
const inputPengantaranHasilPasien = "/inputPengantaranHasilPasien";
|
||||
const inputPengantaranHasilInstansi = "/inputPengantaranHasilInstansi";
|
||||
const inputPengantaranHasilDokter = "/inputPengantaranHasilDokter";
|
||||
const inputPengambilanBahan = "/inputPengambilanBahan";
|
||||
const inputLainLain = "/inputLainLain";
|
||||
const personalInformationRoute = "/personalInformation";
|
||||
const changePasswordRoute = "/changPassword";
|
||||
const workProcessRoute = "/workProcessRoute";
|
||||
|
||||
const menuRoute = "/menuRoute";
|
||||
const inputPekerjaanPengantaranHasil = "/inputPekerjaanPengantaranHasil";
|
||||
const inputPekerjaanPengambilanBahan = "/inputPekerjaanPengambilanBahan";
|
||||
const inputPekerjaanLainLain = "/inputPekerjaanLainLain";
|
||||
|
||||
class inputPekerjaanProp {
|
||||
final int input;
|
||||
final int tipe;
|
||||
|
||||
inputPekerjaanProp(this.input, this.tipe);
|
||||
}
|
||||
|
||||
class InputScanPekerjaanProp {
|
||||
final int input;
|
||||
final int tipe;
|
||||
|
||||
InputScanPekerjaanProp(this.input, this.tipe);
|
||||
}
|
||||
|
||||
class AppRoute {
|
||||
static Route<dynamic> generateRoute(RouteSettings settings) {
|
||||
// splash screen
|
||||
if (settings.name == splashRoute) {
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: const SplashScreen());
|
||||
});
|
||||
}
|
||||
|
||||
// login
|
||||
if (settings.name == loginRoute) {
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: const LoginScreen());
|
||||
});
|
||||
}
|
||||
|
||||
// problem login
|
||||
if (settings.name == problemLoginRoute) {
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: const ProblemLoginScreen());
|
||||
});
|
||||
}
|
||||
|
||||
// test home screen
|
||||
if (settings.name == testHomeRoute) {
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: const TestHomeScreen());
|
||||
});
|
||||
}
|
||||
// test Menu screen
|
||||
if (settings.name == menuRoute) {
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: const MenuScreen());
|
||||
});
|
||||
}
|
||||
|
||||
// input pekerjaan
|
||||
if (settings.name == inputPekerjaan) {
|
||||
final inputPekerjaanProp args = settings.arguments as inputPekerjaanProp;
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: InputPekerjaan(
|
||||
input: args.input,
|
||||
tipe: args.tipe,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
// input pekerjaan pengantaran hasil
|
||||
if (settings.name == inputPekerjaanPengantaranHasil) {
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: const InputPekerjaanPengantaranHasil());
|
||||
});
|
||||
}
|
||||
|
||||
// input pekerjaan pengambilan bahan
|
||||
if (settings.name == inputPekerjaanPengambilanBahan) {
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: const InputPekerjaanPengambilanBahan());
|
||||
});
|
||||
}
|
||||
|
||||
// input pekerjaan lain lain
|
||||
if (settings.name == inputPekerjaanLainLain) {
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: const InputPekerjaanPekerjaanLainLain());
|
||||
});
|
||||
}
|
||||
|
||||
// input pengantaran hasil pasien
|
||||
if (settings.name == inputPengantaranHasilPasien) {
|
||||
final args = settings.arguments as Map<String, dynamic>;
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: InputPengantaranHasilPasienScreen(
|
||||
data: args,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
// input pengantaran hasil instansi
|
||||
if (settings.name == inputPengantaranHasilInstansi) {
|
||||
final args = settings.arguments as Map<String, dynamic>;
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context)
|
||||
.copyWith(textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: InputPengantaranHasilInstansiScreen(
|
||||
data: args,
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// input pengantaran hasil dokter
|
||||
if (settings.name == inputPengantaranHasilDokter) {
|
||||
final args = settings.arguments as Map<String, dynamic>;
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context)
|
||||
.copyWith(textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: InputPengantaranHasilDokterScreen(
|
||||
data: args,
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// input pengambilan bahan
|
||||
if (settings.name == inputPengambilanBahan) {
|
||||
final args = settings.arguments as Map<String, dynamic>;
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context)
|
||||
.copyWith(textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: InputPengambilanBahanScreen(
|
||||
data: args,
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// input lain lain
|
||||
if (settings.name == inputLainLain) {
|
||||
final args = settings.arguments as Map<String, dynamic>;
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context)
|
||||
.copyWith(textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: InputLainLain(
|
||||
data: args,
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// input scan
|
||||
if (settings.name == inputScanRoute) {
|
||||
// final args = settings.arguments as Map<String, dynamic>;
|
||||
final InputScanPekerjaanProp args =
|
||||
settings.arguments as InputScanPekerjaanProp;
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context)
|
||||
.copyWith(textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: InputScanScreen(
|
||||
data: args,
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// konfirmasi
|
||||
if (settings.name == konfirmasiRoute) {
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: const KonfirmasiScreen());
|
||||
});
|
||||
}
|
||||
// Informasi Pribadi
|
||||
if (settings.name == personalInformationRoute) {
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: const PersonalInformationScreen());
|
||||
});
|
||||
}
|
||||
if (settings.name == changePasswordRoute) {
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: const ChangePasswordScreen());
|
||||
});
|
||||
}
|
||||
if (settings.name == workProcessRoute) {
|
||||
final args = settings.arguments as DetailWorkProp;
|
||||
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: WorkProcessScreen(
|
||||
data: args,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context)
|
||||
.copyWith(textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
child: const SplashScreen());
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user