diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts
index b26c00a..f55f8e7 100644
--- a/android/app/build.gradle.kts
+++ b/android/app/build.gradle.kts
@@ -8,7 +8,7 @@ plugins {
android {
namespace = "com.example.kdr_kurir_app_v2"
compileSdk = flutter.compileSdkVersion
- ndkVersion = flutter.ndkVersion
+ ndkVersion = "27.0.12077973"
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
diff --git a/android/app/src/main/res/xml/network_security_config.xml b/android/app/src/main/res/xml/network_security_config.xml
new file mode 100644
index 0000000..4806a1e
--- /dev/null
+++ b/android/app/src/main/res/xml/network_security_config.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/app/constant.dart b/lib/app/constant.dart
new file mode 100644
index 0000000..298dedf
--- /dev/null
+++ b/lib/app/constant.dart
@@ -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,
+ );
+ }
+}
diff --git a/lib/app/route.dart b/lib/app/route.dart
new file mode 100644
index 0000000..c9eef2c
--- /dev/null
+++ b/lib/app/route.dart
@@ -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 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;
+ 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;
+ 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;
+ 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;
+ 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;
+ 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;
+ 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());
+ });
+ }
+}
diff --git a/lib/images/bg_login.png b/lib/images/bg_login.png
new file mode 100644
index 0000000..31fd0e2
Binary files /dev/null and b/lib/images/bg_login.png differ
diff --git a/lib/images/bg_problem_login.png b/lib/images/bg_problem_login.png
new file mode 100644
index 0000000..47759da
Binary files /dev/null and b/lib/images/bg_problem_login.png differ
diff --git a/lib/images/icon_eye_password_active.png b/lib/images/icon_eye_password_active.png
new file mode 100644
index 0000000..6b58d86
Binary files /dev/null and b/lib/images/icon_eye_password_active.png differ
diff --git a/lib/images/icon_eye_password_not_active.png b/lib/images/icon_eye_password_not_active.png
new file mode 100644
index 0000000..8b5183b
Binary files /dev/null and b/lib/images/icon_eye_password_not_active.png differ
diff --git a/lib/images/icon_home.png b/lib/images/icon_home.png
new file mode 100644
index 0000000..3d98a01
Binary files /dev/null and b/lib/images/icon_home.png differ
diff --git a/lib/images/icon_home_bell.png b/lib/images/icon_home_bell.png
new file mode 100644
index 0000000..6728517
Binary files /dev/null and b/lib/images/icon_home_bell.png differ
diff --git a/lib/images/icon_home_diterima.png b/lib/images/icon_home_diterima.png
new file mode 100644
index 0000000..f7a0a17
Binary files /dev/null and b/lib/images/icon_home_diterima.png differ
diff --git a/lib/images/icon_home_hasil.png b/lib/images/icon_home_hasil.png
new file mode 100644
index 0000000..a534e5c
Binary files /dev/null and b/lib/images/icon_home_hasil.png differ
diff --git a/lib/images/icon_home_lainnya.png b/lib/images/icon_home_lainnya.png
new file mode 100644
index 0000000..0fb920b
Binary files /dev/null and b/lib/images/icon_home_lainnya.png differ
diff --git a/lib/images/icon_home_sample.png b/lib/images/icon_home_sample.png
new file mode 100644
index 0000000..a57c652
Binary files /dev/null and b/lib/images/icon_home_sample.png differ
diff --git a/lib/images/icon_home_selesai.png b/lib/images/icon_home_selesai.png
new file mode 100644
index 0000000..10b1328
Binary files /dev/null and b/lib/images/icon_home_selesai.png differ
diff --git a/lib/images/icon_home_total.png b/lib/images/icon_home_total.png
new file mode 100644
index 0000000..4e2b963
Binary files /dev/null and b/lib/images/icon_home_total.png differ
diff --git a/lib/images/logo_kdr.png b/lib/images/logo_kdr.png
new file mode 100644
index 0000000..fb21859
Binary files /dev/null and b/lib/images/logo_kdr.png differ
diff --git a/lib/images/logo_kurir_konfirmasi.png b/lib/images/logo_kurir_konfirmasi.png
new file mode 100644
index 0000000..8ed8fe0
Binary files /dev/null and b/lib/images/logo_kurir_konfirmasi.png differ
diff --git a/lib/main.dart b/lib/main.dart
index 7b7f5b6..90bdb59 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -1,7 +1,18 @@
import 'package:flutter/material.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:flutter/services.dart';
+import 'package:intl/date_symbol_data_file.dart';
+
+import 'app/constant.dart';
+import 'app/route.dart';
void main() {
- runApp(const MyApp());
+ WidgetsFlutterBinding.ensureInitialized();
+ SystemChrome.setPreferredOrientations([
+ DeviceOrientation.portraitUp,
+ DeviceOrientation.portraitUp,
+ ]).then((value) => runApp(const ProviderScope(child: MyApp())));
+ // runApp(const ProviderScope(child: MyApp()));
}
class MyApp extends StatelessWidget {
@@ -11,112 +22,34 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
- title: 'Flutter Demo',
+ title: 'Aplikasi Kurir Kedungdoro',
theme: ThemeData(
- // This is the theme of your application.
- //
- // TRY THIS: Try running your application with "flutter run". You'll see
- // the application has a purple toolbar. Then, without quitting the app,
- // try changing the seedColor in the colorScheme below to Colors.green
- // and then invoke "hot reload" (save your changes or press the "hot
- // reload" button in a Flutter-supported IDE, or press "r" if you used
- // the command line to start the app).
- //
- // Notice that the counter didn't reset back to zero; the application
- // state is not lost during the reload. To reset the state, use hot
- // restart instead.
- //
- // This works for code too, not just values: Most code changes can be
- // tested with just a hot reload.
- colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
- ),
- home: const MyHomePage(title: 'Flutter Demo Home Page'),
+ primarySwatch: createMaterialColor(const Color(0xFF005AA9)),
+ fontFamily: 'OpenSans'),
+ debugShowCheckedModeBanner: false,
+ // initialRoute: loginRoute,
+ initialRoute: splashRoute,
+ onGenerateRoute: AppRoute.generateRoute,
);
}
}
-class MyHomePage extends StatefulWidget {
- const MyHomePage({super.key, required this.title});
+MaterialColor createMaterialColor(Color color) {
+ List strengths = [.05];
+ Map swatch = {};
+ final int r = color.red, g = color.green, b = color.blue;
- // This widget is the home page of your application. It is stateful, meaning
- // that it has a State object (defined below) that contains fields that affect
- // how it looks.
-
- // This class is the configuration for the state. It holds the values (in this
- // case the title) provided by the parent (in this case the App widget) and
- // used by the build method of the State. Fields in a Widget subclass are
- // always marked "final".
-
- final String title;
-
- @override
- State createState() => _MyHomePageState();
-}
-
-class _MyHomePageState extends State {
- int _counter = 0;
-
- void _incrementCounter() {
- setState(() {
- // This call to setState tells the Flutter framework that something has
- // changed in this State, which causes it to rerun the build method below
- // so that the display can reflect the updated values. If we changed
- // _counter without calling setState(), then the build method would not be
- // called again, and so nothing would appear to happen.
- _counter++;
- });
+ for (int i = 1; i < 10; i++) {
+ strengths.add(0.1 * i);
}
-
- @override
- Widget build(BuildContext context) {
- // This method is rerun every time setState is called, for instance as done
- // by the _incrementCounter method above.
- //
- // The Flutter framework has been optimized to make rerunning build methods
- // fast, so that you can just rebuild anything that needs updating rather
- // than having to individually change instances of widgets.
- return Scaffold(
- appBar: AppBar(
- // TRY THIS: Try changing the color here to a specific color (to
- // Colors.amber, perhaps?) and trigger a hot reload to see the AppBar
- // change color while the other colors stay the same.
- backgroundColor: Theme.of(context).colorScheme.inversePrimary,
- // Here we take the value from the MyHomePage object that was created by
- // the App.build method, and use it to set our appbar title.
- title: Text(widget.title),
- ),
- body: Center(
- // Center is a layout widget. It takes a single child and positions it
- // in the middle of the parent.
- child: Column(
- // Column is also a layout widget. It takes a list of children and
- // arranges them vertically. By default, it sizes itself to fit its
- // children horizontally, and tries to be as tall as its parent.
- //
- // Column has various properties to control how it sizes itself and
- // how it positions its children. Here we use mainAxisAlignment to
- // center the children vertically; the main axis here is the vertical
- // axis because Columns are vertical (the cross axis would be
- // horizontal).
- //
- // TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint"
- // action in the IDE, or press "p" in the console), to see the
- // wireframe for each widget.
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- const Text('You have pushed the button this many times:'),
- Text(
- '$_counter',
- style: Theme.of(context).textTheme.headlineMedium,
- ),
- ],
- ),
- ),
- floatingActionButton: FloatingActionButton(
- onPressed: _incrementCounter,
- tooltip: 'Increment',
- child: const Icon(Icons.add),
- ), // This trailing comma makes auto-formatting nicer for build methods.
+ for (var strength in strengths) {
+ final double ds = 0.5 - strength;
+ swatch[(strength * 1000).round()] = Color.fromRGBO(
+ r + ((ds < 0 ? r : (255 - r)) * ds).round(),
+ g + ((ds < 0 ? g : (255 - g)) * ds).round(),
+ b + ((ds < 0 ? b : (255 - b)) * ds).round(),
+ 1,
);
}
+ return MaterialColor(color.value, swatch);
}
diff --git a/lib/models/auth_model.dart b/lib/models/auth_model.dart
new file mode 100644
index 0000000..4afdb30
--- /dev/null
+++ b/lib/models/auth_model.dart
@@ -0,0 +1,71 @@
+class AuthModel {
+ final String token;
+ final AuthKurirModel model;
+
+ AuthModel({
+ required this.token,
+ required this.model,
+ });
+}
+
+class AuthKurirModel {
+ User? user;
+ String? token;
+
+ AuthKurirModel({this.user, this.token});
+
+ AuthKurirModel.fromJson(Map json) {
+ user = json['user'] != null ? User.fromJson(json['user']) : null;
+ token = json['token'];
+ }
+
+ Map toJson() {
+ final Map data = {};
+ if (user != null) {
+ data['user'] = user!.toJson();
+ }
+ data['token'] = token;
+ return data;
+ }
+}
+
+class User {
+ String? mUserID;
+ String? mUserUsername;
+ String? mStaffName;
+ String? ip;
+ String? agent;
+ String? mUserPassword = "";
+ String? mCourierID;
+
+ User(
+ {this.mUserID,
+ this.mUserUsername,
+ this.mStaffName,
+ this.ip,
+ this.agent,
+ this.mUserPassword,
+ this.mCourierID});
+
+ User.fromJson(Map json) {
+ mUserID = json['M_UserID'];
+ mUserUsername = json['M_UserUsername'];
+ mStaffName = json['Nat_StaffName'];
+ ip = json['ip'];
+ agent = json['agent'];
+ mCourierID = json['M_CourierID'];
+ mUserPassword = "";
+ }
+
+ Map toJson() {
+ final Map data = {};
+ data['M_UserID'] = mUserID;
+ data['M_UserUsername'] = mUserUsername;
+ data['Nat_StaffName'] = mStaffName;
+ data['ip'] = ip;
+ data['agent'] = agent;
+ data['M_CourierID'] = mCourierID;
+ data['M_UserPassword'] = mUserPassword;
+ return data;
+ }
+}
diff --git a/lib/models/company_model.dart b/lib/models/company_model.dart
new file mode 100644
index 0000000..c77fce7
--- /dev/null
+++ b/lib/models/company_model.dart
@@ -0,0 +1,32 @@
+class CompanyModel {
+ String? mCompanyID;
+ String? mCompanyName;
+ String? mCompanyNumber;
+ String? detail;
+ String? mCompanyAddress;
+
+ CompanyModel(
+ {this.mCompanyID,
+ this.mCompanyName,
+ this.mCompanyNumber,
+ this.detail,
+ this.mCompanyAddress});
+
+ CompanyModel.fromJson(Map json) {
+ mCompanyID = json['M_CompanyID'];
+ mCompanyName = json['M_CompanyName'];
+ mCompanyNumber = json['M_CompanyNumber'];
+ detail = json['detail'];
+ mCompanyAddress = json['M_CompanyAddress'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['M_CompanyID'] = this.mCompanyID;
+ data['M_CompanyName'] = this.mCompanyName;
+ data['M_CompanyNumber'] = this.mCompanyNumber;
+ data['detail'] = this.detail;
+ data['M_CompanyAddress'] = this.mCompanyAddress;
+ return data;
+ }
+}
diff --git a/lib/models/detail_history_model.dart b/lib/models/detail_history_model.dart
new file mode 100644
index 0000000..d9d8538
--- /dev/null
+++ b/lib/models/detail_history_model.dart
@@ -0,0 +1,149 @@
+import 'dart:convert';
+
+import '../models/patient_model.dart';
+
+// "note_penyerahan": "lengkap",
+// "alamat_pengantaran": "Jl Sampangan no 231 ABA Barusari, Semarang Selatan, Semarang",
+// "penerima": "Nicolas Saputra",
+// "note_penerima": "oke lengkap",
+class DetailHistoryModel {
+ String? id;
+ String? tipeid;
+ String? tipe;
+ String? noSuratJalan;
+ String? nama;
+ String? distance;
+ String? cdate;
+ String? alamatPengambilan;
+ String? petugasPenyerahan;
+ String? alamatPengantaran;
+ String? penerima;
+ String? lokasiPengambilanAwal;
+ String? latPengambilanAwal;
+ String? lngPengambilanAwal;
+ String? lokasiPengambilanAkhir;
+ String? latPengambilanAkhir;
+ String? lngPengambilanAkhir;
+ String? lokasiPengantaranAwal;
+ String? latPengantaranAwal;
+ String? lngPengantaranAwal;
+ String? lokasiPengantaranAkhir;
+ String? latPengantaranAkhir;
+ String? lngPengantaranAkhir;
+ String? notePenyerahan;
+ String? notePenerimaan;
+ List? patients;
+ String? foNote;
+ String? adminNote;
+
+ DetailHistoryModel(
+ {this.id,
+ this.tipeid,
+ this.tipe,
+ this.noSuratJalan,
+ this.nama,
+ this.distance,
+ this.cdate,
+ this.alamatPengambilan,
+ this.petugasPenyerahan,
+ this.alamatPengantaran,
+ this.penerima,
+ this.lokasiPengambilanAwal,
+ this.latPengambilanAwal,
+ this.lngPengambilanAwal,
+ this.lokasiPengambilanAkhir,
+ this.latPengambilanAkhir,
+ this.lngPengambilanAkhir,
+ this.lokasiPengantaranAwal,
+ this.latPengantaranAwal,
+ this.lngPengantaranAwal,
+ this.lokasiPengantaranAkhir,
+ this.latPengantaranAkhir,
+ this.lngPengantaranAkhir,
+ this.notePenerimaan,
+ this.notePenyerahan,
+ this.foNote,
+ this.adminNote,
+ this.patients});
+
+ DetailHistoryModel.fromJson(Map json) {
+ id = json['id'];
+ tipeid = json['tipeid'];
+ tipe = json['tipe'];
+ noSuratJalan = json['no_surat_jalan'];
+ nama = json['nama'];
+ distance = json['distance'];
+ cdate = json['cdate'];
+ alamatPengambilan = json['alamat_pengambilan'];
+ petugasPenyerahan = json['petugas_penyerahan'];
+ alamatPengantaran = json['alamat_pengantaran'];
+ penerima = json['penerima'];
+ lokasiPengambilanAwal = json['lokasi_pengambilan_awal'];
+ latPengambilanAwal = json['lat_pengambilan_awal'];
+ lngPengambilanAwal = json['lng_pengambilan_awal'];
+ lokasiPengambilanAkhir = json['lokasi_pengambilan_akhir'];
+ latPengambilanAkhir = json['lat_pengambilan_akhir'];
+ lngPengambilanAkhir = json['lng_pengambilan_akhir'];
+ lokasiPengantaranAwal = json['lokasi_pengantaran_awal'];
+ latPengantaranAwal = json['lat_pengantaran_awal'];
+ lngPengantaranAwal = json['lng_pengantaran_awal'];
+ lokasiPengantaranAkhir = json['lokasi_pengantaran_akhir'];
+ latPengantaranAkhir = json['lat_pengantaran_akhir'];
+ lngPengantaranAkhir = json['lng_pengantaran_akhir'];
+ notePenerimaan = json['note_penerima'];
+ notePenyerahan = json['note_penyerahan'];
+ foNote = json['fo_note'];
+ adminNote = json['admin_note'];
+ // patients = json['patients'];
+ if (json['patients'].toString().isNotEmpty) {
+ var data = [];
+ // print("hasil json decode");
+ // print(jsonDecode(json['patients']));
+ // print("end");
+ try {
+ jsonDecode(json['patients']).forEach((v) {
+ data.add(PatientModel.fromJson(v));
+ });
+ } catch (e) {
+ print(e);
+ }
+ patients = data;
+ }
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['id'] = this.id;
+ data['tipeid'] = this.tipeid;
+ data['tipe'] = this.tipe;
+ data['no_surat_jalan'] = this.noSuratJalan;
+ data['nama'] = this.nama;
+ data['distance'] = this.distance;
+ data['cdate'] = this.cdate;
+ data['alamat_pengambilan'] = this.alamatPengambilan;
+ data['petugas_penyerahan'] = this.petugasPenyerahan;
+ data['alamat_pengantaran'] = this.alamatPengantaran;
+ data['penerima'] = this.penerima;
+ data['lokasi_pengambilan_awal'] = this.lokasiPengambilanAwal;
+ data['lat_pengambilan_awal'] = this.latPengambilanAwal;
+ data['lng_pengambilan_awal'] = this.lngPengambilanAwal;
+ data['lokasi_pengambilan_akhir'] = this.lokasiPengambilanAkhir;
+ data['lat_pengambilan_akhir'] = this.latPengambilanAkhir;
+ data['lng_pengambilan_akhir'] = this.lngPengambilanAkhir;
+ data['lokasi_pengantaran_awal'] = this.lokasiPengantaranAwal;
+ data['lat_pengantaran_awal'] = this.latPengantaranAwal;
+ data['lng_pengantaran_awal'] = this.lngPengantaranAwal;
+ data['lokasi_pengantaran_akhir'] = this.lokasiPengantaranAkhir;
+ data['lat_pengantaran_akhir'] = this.latPengantaranAkhir;
+ data['lng_pengantaran_akhir'] = this.lngPengantaranAkhir;
+ data['note_penyerahan'] = this.notePenyerahan;
+ data['note_penerima'] = this.notePenerimaan;
+ data['fo_note'] = this.foNote;
+ data['admin_note'] = this.adminNote;
+ // data['patients'] = this.patients;
+ if (this.patients != null || this.patients != "") {
+ data['patients'] = this.patients!.map((v) => v.toJson()).toList();
+ }
+ return data;
+ }
+}
diff --git a/lib/models/detail_work_model.dart b/lib/models/detail_work_model.dart
new file mode 100644
index 0000000..808fe53
--- /dev/null
+++ b/lib/models/detail_work_model.dart
@@ -0,0 +1,195 @@
+import 'dart:convert';
+
+import '../models/patient_model.dart';
+
+class DetailWorkModel {
+ String? id;
+ String? tipeid;
+ String? tipe;
+ String? noSuratJalan;
+ String? nama;
+ String? distance;
+ String? cdate;
+ String? alamatPengambilan;
+ String? petugasPenyerahan;
+ String? alamatPengantaran;
+ String? penerima;
+ String? lokasiPengambilanAwal;
+ String? latPengambilanAwal;
+ String? lngPengambilanAwal;
+ String? lokasiPengambilanAkhir;
+ String? latPengambilanAkhir;
+ String? lngPengambilanAkhir;
+ String? lokasiPengantaranAwal;
+ String? latPengantaranAwal;
+ String? lngPengantaranAwal;
+ String? lokasiPengantaranAkhir;
+ String? latPengantaranAkhir;
+ String? lngPengantaranAkhir;
+ String? notePenyerahan;
+ String? notePenerimaan;
+ List? patients;
+ // TAMBAHAN INPUTAN INFO
+ String? suhuBox;
+ String? suhuSample;
+ String? totalPasien;
+ String? totalEdta;
+ String? totalCitras;
+ String? totalSerum;
+ String? totalUrine;
+ String? totalPleura;
+ String? otherSample;
+ String? totalOther;
+ String? foNote;
+ String? adminNote;
+ String? branchID;
+
+ DetailWorkModel(
+ {this.id,
+ this.tipeid,
+ this.tipe,
+ this.noSuratJalan,
+ this.nama,
+ this.distance,
+ this.cdate,
+ this.alamatPengambilan,
+ this.petugasPenyerahan,
+ this.alamatPengantaran,
+ this.penerima,
+ this.lokasiPengambilanAwal,
+ this.latPengambilanAwal,
+ this.lngPengambilanAwal,
+ this.lokasiPengambilanAkhir,
+ this.latPengambilanAkhir,
+ this.lngPengambilanAkhir,
+ this.lokasiPengantaranAwal,
+ this.latPengantaranAwal,
+ this.lngPengantaranAwal,
+ this.lokasiPengantaranAkhir,
+ this.latPengantaranAkhir,
+ this.lngPengantaranAkhir,
+ this.notePenerimaan,
+ this.notePenyerahan,
+ this.patients,
+ // TAMBAHAN INPUTAN INFO
+ this.suhuBox,
+ this.suhuSample,
+ this.totalPasien,
+ this.totalEdta,
+ this.totalCitras,
+ this.totalSerum,
+ this.totalUrine,
+ this.totalPleura,
+ this.otherSample,
+ this.totalOther,
+ this.foNote,
+ this.adminNote,
+ this.branchID});
+
+ DetailWorkModel.fromJson(Map json) {
+ id = json['id'];
+ tipeid = json['tipeid'];
+ tipe = json['tipe'];
+ noSuratJalan = json['no_surat_jalan'];
+ nama = json['nama'];
+ distance = json['distance'];
+ cdate = json['cdate'];
+ alamatPengambilan = json['alamat_pengambilan'];
+ petugasPenyerahan = json['petugas_penyerahan'];
+ alamatPengantaran = json['alamat_pengantaran'];
+ penerima = json['penerima'];
+ lokasiPengambilanAwal = json['lokasi_pengambilan_awal'];
+ latPengambilanAwal = json['lat_pengambilan_awal'];
+ lngPengambilanAwal = json['lng_pengambilan_awal'];
+ lokasiPengambilanAkhir = json['lokasi_pengambilan_akhir'];
+ latPengambilanAkhir = json['lat_pengambilan_akhir'];
+ lngPengambilanAkhir = json['lng_pengambilan_akhir'];
+ lokasiPengantaranAwal = json['lokasi_pengantaran_awal'];
+ latPengantaranAwal = json['lat_pengantaran_awal'];
+ lngPengantaranAwal = json['lng_pengantaran_awal'];
+ lokasiPengantaranAkhir = json['lokasi_pengantaran_akhir'];
+ latPengantaranAkhir = json['lat_pengantaran_akhir'];
+ lngPengantaranAkhir = json['lng_pengantaran_akhir'];
+ notePenerimaan = json['note_penerima'];
+ notePenyerahan = json['note_penyerahan'];
+ // patients = json['patients'];
+ if (json['patients'].toString().isNotEmpty) {
+ var data = [];
+ // print("hasil json decode");
+ // print(jsonDecode(json['patients']));
+ // print("end");
+ try {
+ jsonDecode(json['patients']).forEach((v) {
+ data.add(PatientModel.fromJson(v));
+ });
+ } catch (e) {
+ print(e);
+ }
+ patients = data;
+ }
+
+ // TAMBAHAN INPUTAN INFO
+ suhuBox = json['suhu_box'];
+ suhuSample = json['suhu_sample'];
+ totalPasien = json['total_pasien'];
+ totalEdta = json['total_edta'];
+ totalCitras = json['total_citras'];
+ totalSerum = json['total_serum'];
+ totalUrine = json['total_urine'];
+ totalPleura = json['total_pleura'];
+ otherSample = json['other_sample'];
+ totalOther = json['total_other'];
+ foNote = json['fo_note'];
+ adminNote = json['admin_note'];
+ branchID = json['branchid'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['id'] = this.id;
+ data['tipeid'] = this.tipeid;
+ data['tipe'] = this.tipe;
+ data['no_surat_jalan'] = this.noSuratJalan;
+ data['nama'] = this.nama;
+ data['distance'] = this.distance;
+ data['cdate'] = this.cdate;
+ data['alamat_pengambilan'] = this.alamatPengambilan;
+ data['petugas_penyerahan'] = this.petugasPenyerahan;
+ data['alamat_pengantaran'] = this.alamatPengantaran;
+ data['penerima'] = this.penerima;
+ data['lokasi_pengambilan_awal'] = this.lokasiPengambilanAwal;
+ data['lat_pengambilan_awal'] = this.latPengambilanAwal;
+ data['lng_pengambilan_awal'] = this.lngPengambilanAwal;
+ data['lokasi_pengambilan_akhir'] = this.lokasiPengambilanAkhir;
+ data['lat_pengambilan_akhir'] = this.latPengambilanAkhir;
+ data['lng_pengambilan_akhir'] = this.lngPengambilanAkhir;
+ data['lokasi_pengantaran_awal'] = this.lokasiPengantaranAwal;
+ data['lat_pengantaran_awal'] = this.latPengantaranAwal;
+ data['lng_pengantaran_awal'] = this.lngPengantaranAwal;
+ data['lokasi_pengantaran_akhir'] = this.lokasiPengantaranAkhir;
+ data['lat_pengantaran_akhir'] = this.latPengantaranAkhir;
+ data['lng_pengantaran_akhir'] = this.lngPengantaranAkhir;
+ data['note_penyerahan'] = this.notePenyerahan;
+ data['note_penerima'] = this.notePenerimaan;
+ // data['patients'] = this.patients;
+ if (this.patients != null || this.patients != "") {
+ data['patients'] = this.patients!.map((v) => v.toJson()).toList();
+ }
+
+ // TAMBAHAN INPUTAN INFO
+ data['suhu_box'] = this.suhuBox;
+ data['suhu_sample'] = this.suhuSample;
+ data['total_pasien'] = this.totalPasien;
+ data['total_edta'] = this.totalEdta;
+ data['total_citras'] = this.totalCitras;
+ data['total_serum'] = this.totalSerum;
+ data['total_urine'] = this.totalUrine;
+ data['total_pleura'] = this.totalPleura;
+ data['other_sample'] = this.otherSample;
+ data['total_other'] = this.totalOther;
+ data['fo_note'] = this.foNote;
+ data['admin_note'] = this.adminNote;
+ data['branchid'] = this.branchID;
+ return data;
+ }
+}
diff --git a/lib/models/history_model.dart b/lib/models/history_model.dart
new file mode 100644
index 0000000..e8b9509
--- /dev/null
+++ b/lib/models/history_model.dart
@@ -0,0 +1,44 @@
+class HistoryModel {
+ String? id;
+ int? tipeid;
+ String? tipe;
+ String? noSuratJalan;
+ String? nama;
+ String? distance;
+ String? cdate;
+ String? ispending;
+
+ HistoryModel(
+ {this.id,
+ this.tipeid,
+ this.tipe,
+ this.noSuratJalan,
+ this.nama,
+ this.distance,
+ this.cdate,
+ this.ispending});
+
+ HistoryModel.fromJson(Map json) {
+ id = json['id'];
+ tipeid = int.parse(json['tipeid']);
+ tipe = json['tipe'];
+ noSuratJalan = json['no_surat_jalan'];
+ nama = json['nama'];
+ distance = json['distance'];
+ cdate = json['cdate'];
+ ispending = json['ispending'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['id'] = this.id;
+ data['tipeid'] = this.tipeid;
+ data['tipe'] = this.tipe;
+ data['no_surat_jalan'] = this.noSuratJalan;
+ data['nama'] = this.nama;
+ data['distance'] = this.distance;
+ data['cdate'] = this.cdate;
+ data['ispending'] = this.ispending;
+ return data;
+ }
+}
diff --git a/lib/models/history_type_model.dart b/lib/models/history_type_model.dart
new file mode 100644
index 0000000..e9e3c50
--- /dev/null
+++ b/lib/models/history_type_model.dart
@@ -0,0 +1,23 @@
+import 'package:equatable/equatable.dart';
+
+class HistoryTypeModel extends Equatable {
+ String? tipeid;
+ String? tipename;
+
+ HistoryTypeModel({this.tipeid, this.tipename});
+
+ HistoryTypeModel.fromJson(Map json) {
+ tipeid = json['tipeid'];
+ tipename = json['tipename'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['tipeid'] = this.tipeid;
+ data['tipename'] = this.tipename;
+ return data;
+ }
+
+ @override
+ List