dienianindya 1 gadu atpakaļ
vecāks
revīzija
c8e2a885ff

+ 0
- 5
.firebaserc Parādīt failu

@@ -1,5 +0,0 @@
1
-{
2
-  "projects": {
3
-    "default": "gsi-hris-self-service"
4
-  }
5
-}

+ 0
- 1
android/app/build.gradle Parādīt failu

@@ -21,7 +21,6 @@ if (flutterVersionName == null) {
21 21
     flutterVersionName = '1.0'
22 22
 }
23 23
 
24
-//apply plugin: 'com.google.gms.google-services'
25 24
 apply plugin: 'com.android.application'
26 25
 apply plugin: 'kotlin-android'
27 26
 apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

+ 0
- 1
android/build.gradle Parādīt failu

@@ -8,7 +8,6 @@ buildscript {
8 8
     dependencies {
9 9
         classpath 'com.android.tools.build:gradle:7.1.3'
10 10
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11
-        classpath 'com.google.gms:google-services:4.3.14'
12 11
     }
13 12
 }
14 13
 

Binārs
firebase.exe Parādīt failu


+ 0
- 20
firebase.json Parādīt failu

@@ -1,20 +0,0 @@
1
-{
2
-  "functions": [
3
-    {
4
-      "source": "functions",
5
-      "codebase": "default",
6
-      "ignore": [
7
-        "node_modules",
8
-        ".git",
9
-        "firebase-debug.log",
10
-        "firebase-debug.*.log"
11
-      ],
12
-      "predeploy": [
13
-        "npm --prefix \"$RESOURCE_DIR\" run lint"
14
-      ]
15
-    }
16
-  ],
17
-  "remoteconfig": {
18
-    "template": "remoteconfig.template.json"
19
-  }
20
-}

+ 0
- 14
functions/.eslintrc.js Parādīt failu

@@ -1,14 +0,0 @@
1
-module.exports = {
2
-  root: true,
3
-  env: {
4
-    es6: true,
5
-    node: true,
6
-  },
7
-  extends: [
8
-    "eslint:recommended",
9
-    "google",
10
-  ],
11
-  rules: {
12
-    quotes: ["error", "double"],
13
-  },
14
-};

+ 0
- 1
functions/.gitignore Parādīt failu

@@ -1 +0,0 @@
1
-node_modules/

+ 0
- 9
functions/index.js Parādīt failu

@@ -1,9 +0,0 @@
1
-const functions = require("firebase-functions");
2
-
3
-// // Create and deploy your first functions
4
-// // https://firebase.google.com/docs/functions/get-started
5
-//
6
-// exports.helloWorld = functions.https.onRequest((request, response) => {
7
-//   functions.logger.info("Hello logs!", {structuredData: true});
8
-//   response.send("Hello from Firebase!");
9
-// });

+ 0
- 2551
functions/package-lock.json
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 0
- 26
functions/package.json Parādīt failu

@@ -1,26 +0,0 @@
1
-{
2
-  "name": "functions",
3
-  "description": "Cloud Functions for Firebase",
4
-  "scripts": {
5
-    "lint": "eslint .",
6
-    "serve": "firebase emulators:start --only functions",
7
-    "shell": "firebase functions:shell",
8
-    "start": "npm run shell",
9
-    "deploy": "firebase deploy --only functions",
10
-    "logs": "firebase functions:log"
11
-  },
12
-  "engines": {
13
-    "node": "16"
14
-  },
15
-  "main": "index.js",
16
-  "dependencies": {
17
-    "firebase-admin": "^10.0.2",
18
-    "firebase-functions": "^3.18.0"
19
-  },
20
-  "devDependencies": {
21
-    "eslint": "^8.9.0",
22
-    "eslint-config-google": "^0.14.0",
23
-    "firebase-functions-test": "^0.2.0"
24
-  },
25
-  "private": true
26
-}

+ 418
- 327
lib/Screens/Home/home_screen.dart Parādīt failu

@@ -4,6 +4,7 @@ import 'dart:typed_data';
4 4
 import 'package:double_back_to_close/double_back_to_close.dart';
5 5
 import 'package:flutter/material.dart';
6 6
 import 'package:fluttertoast/fluttertoast.dart';
7
+import 'package:focus_detector/focus_detector.dart';
7 8
 import 'package:google_fonts/google_fonts.dart';
8 9
 import 'package:hris_selfservice_mobile/Screens/Menu/About/about_screen.dart';
9 10
 import 'package:hris_selfservice_mobile/Screens/Menu/Absensi/absensi_screen.dart';
@@ -17,7 +18,6 @@ import 'package:shared_preferences/shared_preferences.dart';
17 18
 import 'dart:developer' as logDev;
18 19
 import '../Settings/RequestHttp/getDetail_post.dart';
19 20
 import '../Settings/RequestHttp/getProfileImage_post.dart';
20
-import 'package:location/location.dart';
21 21
 
22 22
 
23 23
 var _imageToShow;
@@ -35,15 +35,7 @@ class HomeView extends StatefulWidget {
35 35
   @override
36 36
   _HomeView createState() => _HomeView();
37 37
 }
38
-
39
-class _HomeView extends State<HomeView> {
40
-  @override
41
-  initState() {
42
-    getDetail();
43
-    _imageToShow = AssetImage('assets/images/ic_administrator.png');
44
-    WidgetsBinding.instance.addPostFrameCallback((_) async {
45
-     /* final location = await getLocation();
46
-      logDev.log("Location: ${location.latitude}, ${location.longitude}");*/
38
+/*WidgetsBinding.instance.addPostFrameCallback((_) async {
47 39
       ProgressDialog loading = ProgressDialog(context);
48 40
       loading = ProgressDialog(context,
49 41
           type: ProgressDialogType.normal,
@@ -67,7 +59,14 @@ class _HomeView extends State<HomeView> {
67 59
               fontWeight: FontWeight.w600));
68 60
       loading.show();
69 61
       _imageToShow = getProfileImage();
70
-    });
62
+    });*/
63
+
64
+class _HomeView extends State<HomeView> {
65
+  @override
66
+  initState() {
67
+    getDetail();
68
+    _imageToShow = AssetImage('assets/images/ic_administrator.png');
69
+    super.initState();
71 70
   }
72 71
 
73 72
   //Get Profile image
@@ -110,7 +109,7 @@ class _HomeView extends State<HomeView> {
110 109
             });
111 110
           } else if (photo != "false") {
112 111
             Uint8List decodedBytes = Base64Decoder().convert(photo);
113
-            logDev.log(decodedBytes.toString(), name: "DECODED BYTES photo");
112
+            //logDev.log(decodedBytes.toString(), name: "DECODED BYTES photo");
114 113
             setState(() {
115 114
               _imageToShow = Image
116 115
                   .memory(decodedBytes, gaplessPlayback: true)
@@ -210,224 +209,315 @@ class _HomeView extends State<HomeView> {
210 209
   }
211 210
 }
212 211
 
213
-class HomeScreen extends StatelessWidget {
212
+class HomeScreen extends StatefulWidget {
213
+  @override
214
+  State<HomeScreen> createState() => _HomeScreenState();
215
+}
216
+
217
+class _HomeScreenState extends State<HomeScreen> {
218
+  //Get Profile image
219
+  getProfileImage() async {
220
+    final SharedPreferences prefs = await SharedPreferences.getInstance();
221
+    final session = prefs.getString('session');
222
+
223
+    ProgressDialog loading = ProgressDialog(context);
224
+    loading = ProgressDialog(context,
225
+        type: ProgressDialogType.normal,
226
+        isDismissible: false,
227
+        showLogs: true);
228
+    loading.style(
229
+        message: 'Please Wait .....',
230
+        borderRadius: 5,
231
+        backgroundColor: Colors.white,
232
+        progressWidget: CircularProgressIndicator(),
233
+        elevation: 10.0,
234
+        padding: EdgeInsets.all(10),
235
+        insetAnimCurve: Curves.easeInOut,
236
+        progress: 0.0,
237
+        maxProgress: 100.0,
238
+        progressTextStyle: TextStyle(
239
+            color: Colors.black, fontSize: 10.0, fontWeight: FontWeight.w400),
240
+        messageTextStyle: TextStyle(
241
+            color: Colors.black,
242
+            fontSize: 15.0,
243
+            fontWeight: FontWeight.w600));
244
+
245
+    loading.show();
246
+    GetProfileImage_Post.connectToAPI(session!).then((valueResult) async {
247
+      Map<String, dynamic> object = json.decode(valueResult);
248
+      if (object.containsKey("result").toString() == "true") {
249
+        String status = object['result']['status'].toString();
250
+        logDev.log(status, name: "STATUS GET PROFILE");
251
+        if (status == "success") {
252
+          String photo = object['result']['photo'].toString();
253
+          if (photo == "false") {
254
+            setState(() {
255
+              _imageToShow = AssetImage('assets/images/ic_administrator.png');
256
+            });
257
+          } else if (photo != "false") {
258
+            Uint8List decodedBytes = Base64Decoder().convert(photo);
259
+            //logDev.log(decodedBytes.toString(), name: "DECODED BYTES photo");
260
+            setState(() {
261
+              _imageToShow = Image
262
+                  .memory(decodedBytes, gaplessPlayback: true)
263
+                  .image;
264
+            });
265
+          }
266
+        } else if (status == "failed") {
267
+          String message = object['result']['message'].toString();
268
+          Fluttertoast.showToast(
269
+              msg: message,
270
+              toastLength: Toast.LENGTH_LONG,
271
+              gravity: ToastGravity.CENTER,
272
+              timeInSecForIosWeb: 1,
273
+              textColor: Colors.white,
274
+              fontSize: 16.0);
275
+        }
276
+        loading.hide();
277
+      } else {
278
+        Fluttertoast.showToast(
279
+            msg: "Server Response Error",
280
+            toastLength: Toast.LENGTH_SHORT,
281
+            gravity: ToastGravity.CENTER,
282
+            timeInSecForIosWeb: 1,
283
+            textColor: Colors.white,
284
+            fontSize: 16.0);
285
+        loading.hide();
286
+      }
287
+    });
288
+    return _imageToShow;
289
+  }
290
+
214 291
   @override
215 292
   Widget build(BuildContext context) {
216 293
     var size = MediaQuery.of(context).size;
217
-    return Scaffold(
218
-        body: SingleChildScrollView(
219
-      child: Stack(
220
-        children: <Widget>[
221
-          Container(
222
-            height: size.height * 0.3,
223
-            decoration: BoxDecoration(
224
-                gradient: LinearGradient(
225
-                    begin: Alignment.topRight,
226
-                    end: Alignment.bottomRight,
227
-                    colors: [
228
-                  Color(0xFFD21404),
229
-                  Color(0xFFFD7267),
230
-                ])),
231
-          ),
232
-          SafeArea(
233
-            child: Padding(
234
-              padding: EdgeInsets.all(20),
235
-              child: Column(
236
-                children: <Widget>[
237
-                  Align(
238
-                    alignment: Alignment.topRight,
239
-                    child: InkWell(
240
-                      child: Container(
241
-                          alignment: Alignment.center,
242
-                          height: 40,
243
-                          width: 40,
244
-                          child: Image.asset('assets/images/ic_settings.png')),
245
-                      onTap: () {
246
-                        Navigator.push(
247
-                            context,
248
-                            MaterialPageRoute(
249
-                                builder: (context) => SettingsScreen()));
250
-                      },
251
-                    ),
252
-                  ),
253
-                  Container(
254
-                    child:  Stack(
255
-                      alignment: Alignment.topLeft,
256
-                      children: [
257
-                        Container(
258
-                          margin: EdgeInsets.only(top: ((size.width - 20) * 0.33) * 0.5),
259
-                          child: Card(
260
-                            elevation: 15,
294
+    return FocusDetector(
295
+      onFocusLost: (){
296
+        getProfileImage();
297
+      },
298
+      onFocusGained: (){
299
+        getProfileImage();
300
+      },
301
+      onForegroundLost: (){
302
+        getProfileImage();
303
+      },
304
+      onForegroundGained: (){
305
+        getProfileImage();
306
+      },
307
+      child: Scaffold(
308
+          body: SingleChildScrollView(
309
+            child: Stack(
310
+              children: <Widget>[
311
+                Container(
312
+                  height: size.height * 0.3,
313
+                  decoration: BoxDecoration(
314
+                      gradient: LinearGradient(
315
+                          begin: Alignment.topRight,
316
+                          end: Alignment.bottomRight,
317
+                          colors: [
318
+                            Color(0xFFD21404),
319
+                            Color(0xFFFD7267),
320
+                          ])),
321
+                ),
322
+                SafeArea(
323
+                  child: Padding(
324
+                    padding: EdgeInsets.all(20),
325
+                    child: Column(
326
+                      children: <Widget>[
327
+                        Align(
328
+                          alignment: Alignment.topRight,
329
+                          child: InkWell(
261 330
                             child: Container(
262
-                                height: size.width * 0.35,
263
-                                width: size.width - 20,
264
-                                padding: EdgeInsets.all(15),
265
-                                decoration: BoxDecoration(
266
-                                    color: Colors.white,
267
-                                    borderRadius:
268
-                                    BorderRadius.all(Radius.circular(10))),
269
-                                child: Column(
270
-                                  mainAxisAlignment: MainAxisAlignment.end,
271
-                                  crossAxisAlignment: CrossAxisAlignment.center,
272
-                                  children: <Widget>[
273
-                                    Text(name,
274
-                                      maxLines: 2,
275
-                                      overflow: TextOverflow.ellipsis,
276
-                                      textAlign: TextAlign.center,
277
-                                      style: GoogleFonts.inter(
278
-                                          fontSize: 18,
279
-                                          color: Colors.black,
280
-                                          fontWeight: FontWeight.bold),
281
-                                    ),
282
-                                    Text(position,
283
-                                      textAlign: TextAlign.center,
284
-                                      style: GoogleFonts.inter(
285
-                                          fontSize: 17, color: Colors.black),
286
-                                    ),
287
-                                  ],
288
-                                )),
331
+                                alignment: Alignment.center,
332
+                                height: 40,
333
+                                width: 40,
334
+                                child: Image.asset('assets/images/ic_settings.png')),
335
+                            onTap: () {
336
+                              Navigator.push(
337
+                                  context,
338
+                                  MaterialPageRoute(
339
+                                      builder: (context) => SettingsScreen()));
340
+                            },
289 341
                           ),
290 342
                         ),
291
-                        Align(
292
-                          alignment: Alignment.topCenter,
293
-                          child: Container(
294
-                            margin: EdgeInsets.only(left: 15),
343
+                        Container(
344
+                          child:  Stack(
295 345
                             alignment: Alignment.topLeft,
296
-                            height: (size.width - 20) * 0.33,
297
-                            width: (size.width - 20) * 0.33,
298
-                            decoration: BoxDecoration(
299
-                              color: Colors.black,
300
-                              image: DecorationImage(
301
-                                image: _imageToShow,
302
-                                fit: BoxFit.fill,
303
-                              ),
304
-                              shape: BoxShape.circle,
305
-                            ),
306
-                          ),
307
-                        ),
308
-                      ],
309
-                    ),
310
-                  ),
311
-                  GridView.count(
312
-                    shrinkWrap: true,
313
-                    physics: NeverScrollableScrollPhysics(),
314
-                    padding: EdgeInsets.only(top: 25, left: 5, right: 5),
315
-                    crossAxisSpacing: 15,
316
-                    mainAxisSpacing: 15,
317
-                    crossAxisCount: 2,
318
-                    children: <Widget>[
319
-                      InkWell(
320
-                          child: Container(
321
-                            decoration: BoxDecoration(
322
-                                color: Color(0xFFD0D0D0),
323
-                                borderRadius: BorderRadius.circular(5)),
324
-                            child: Column(
325
-                              crossAxisAlignment: CrossAxisAlignment.center,
326
-                              mainAxisAlignment: MainAxisAlignment.center,
327
-                              children: <Widget>[
328
-                                Container(
329
-                                  width: 75,
330
-                                  height: 75,
331
-                                  child: Image.asset(
332
-                                    "assets/icons/menu/ic_absensi.png",
333
-                                    fit: BoxFit.fill,
334
-                                    alignment: Alignment.center,
335
-                                  ),
336
-                                ),
337
-                                Container(
338
-                                  margin: EdgeInsets.only(top: 10),
339
-                                  padding: EdgeInsets.all(5),
340
-                                  child: Text(
341
-                                    'Attendance',
342
-                                    textAlign: TextAlign.center,
343
-                                    style: GoogleFonts.acme(
344
-                                        fontSize: 18, color: Colors.black),
345
-                                  ),
346
-                                ),
347
-                              ],
348
-                            ),
349
-                          ),
350
-                          onTap: () {
351
-                            Navigator.push(
352
-                                context,
353
-                                MaterialPageRoute(
354
-                                    builder: (context) => AbsensiScreen()));
355
-                          }),
356
-                      InkWell(
357
-                        child: Container(
358
-                          decoration: BoxDecoration(
359
-                              color: Color(0xFFD0D0D0),
360
-                              borderRadius: BorderRadius.circular(5)),
361
-                          child: Column(
362
-                            crossAxisAlignment: CrossAxisAlignment.center,
363
-                            mainAxisAlignment: MainAxisAlignment.center,
364
-                            children: <Widget>[
346
+                            children: [
365 347
                               Container(
366
-                                width: 75,
367
-                                height: 75,
368
-                                child: Image.asset(
369
-                                    "assets/icons/menu/ic_slipgaji_2.png",
370
-                                    fit: BoxFit.fill,
371
-                                    alignment: Alignment.center),
348
+                                margin: EdgeInsets.only(top: ((size.width - 20) * 0.33) * 0.5),
349
+                                child: Card(
350
+                                  elevation: 15,
351
+                                  child: Container(
352
+                                      height: size.width * 0.35,
353
+                                      width: size.width - 20,
354
+                                      padding: EdgeInsets.all(15),
355
+                                      decoration: BoxDecoration(
356
+                                          color: Colors.white,
357
+                                          borderRadius:
358
+                                          BorderRadius.all(Radius.circular(10))),
359
+                                      child: Column(
360
+                                        mainAxisAlignment: MainAxisAlignment.end,
361
+                                        crossAxisAlignment: CrossAxisAlignment.center,
362
+                                        children: <Widget>[
363
+                                          Text(name,
364
+                                            maxLines: 2,
365
+                                            overflow: TextOverflow.ellipsis,
366
+                                            textAlign: TextAlign.center,
367
+                                            style: GoogleFonts.inter(
368
+                                                fontSize: 18,
369
+                                                color: Colors.black,
370
+                                                fontWeight: FontWeight.bold),
371
+                                          ),
372
+                                          Text(position,
373
+                                            textAlign: TextAlign.center,
374
+                                            style: GoogleFonts.inter(
375
+                                                fontSize: 17, color: Colors.black),
376
+                                          ),
377
+                                        ],
378
+                                      )),
379
+                                ),
372 380
                               ),
373
-                              Container(
374
-                                margin: EdgeInsets.only(top: 10),
375
-                                padding: EdgeInsets.all(5),
376
-                                child: Text(
377
-                                  'Salary Slip',
378
-                                  textAlign: TextAlign.center,
379
-                                  style: GoogleFonts.acme(
380
-                                      fontSize: 18, color: Colors.black),
381
+                              Align(
382
+                                alignment: Alignment.topCenter,
383
+                                child: Container(
384
+                                  margin: EdgeInsets.only(left: 15),
385
+                                  alignment: Alignment.topLeft,
386
+                                  height: (size.width - 20) * 0.33,
387
+                                  width: (size.width - 20) * 0.33,
388
+                                  decoration: BoxDecoration(
389
+                                    color: Colors.black,
390
+                                    image: DecorationImage(
391
+                                      image: _imageToShow,
392
+                                      fit: BoxFit.fill,
393
+                                    ),
394
+                                    shape: BoxShape.circle,
395
+                                  ),
381 396
                                 ),
382 397
                               ),
383 398
                             ],
384 399
                           ),
385 400
                         ),
386
-                        onTap: () {
387
-                          Navigator.push(
388
-                              context,
389
-                              MaterialPageRoute(
390
-                                  builder: (context) => SlipGajiScreen()));
391
-                        },
392
-                      ),
393
-                      InkWell(
394
-                        child: Container(
395
-                          decoration: BoxDecoration(
396
-                              color: Color(0xFFD0D0D0),
397
-                              borderRadius: BorderRadius.circular(5)),
398
-                          child: Column(
399
-                            crossAxisAlignment: CrossAxisAlignment.center,
400
-                            mainAxisAlignment: MainAxisAlignment.center,
401
-                            children: <Widget>[
402
-                              Container(
403
-                                width: 70,
404
-                                height: 70,
405
-                                child: Image.asset(
406
-                                    "assets/icons/menu/ic_cuti_2.png",
407
-                                    fit: BoxFit.fill,
408
-                                    alignment: Alignment.center),
401
+                        GridView.count(
402
+                          shrinkWrap: true,
403
+                          physics: NeverScrollableScrollPhysics(),
404
+                          padding: EdgeInsets.only(top: 25, left: 5, right: 5),
405
+                          crossAxisSpacing: 15,
406
+                          mainAxisSpacing: 15,
407
+                          crossAxisCount: 2,
408
+                          children: <Widget>[
409
+                            InkWell(
410
+                                child: Container(
411
+                                  decoration: BoxDecoration(
412
+                                      color: Color(0xFFD0D0D0),
413
+                                      borderRadius: BorderRadius.circular(5)),
414
+                                  child: Column(
415
+                                    crossAxisAlignment: CrossAxisAlignment.center,
416
+                                    mainAxisAlignment: MainAxisAlignment.center,
417
+                                    children: <Widget>[
418
+                                      Container(
419
+                                        width: 75,
420
+                                        height: 75,
421
+                                        child: Image.asset(
422
+                                          "assets/icons/menu/ic_absensi.png",
423
+                                          fit: BoxFit.fill,
424
+                                          alignment: Alignment.center,
425
+                                        ),
426
+                                      ),
427
+                                      Container(
428
+                                        margin: EdgeInsets.only(top: 10),
429
+                                        padding: EdgeInsets.all(5),
430
+                                        child: Text(
431
+                                          'Attendance',
432
+                                          textAlign: TextAlign.center,
433
+                                          style: GoogleFonts.acme(
434
+                                              fontSize: 18, color: Colors.black),
435
+                                        ),
436
+                                      ),
437
+                                    ],
438
+                                  ),
439
+                                ),
440
+                                onTap: () {
441
+                                  Navigator.push(
442
+                                      context,
443
+                                      MaterialPageRoute(
444
+                                          builder: (context) => AbsensiScreen()));
445
+                                }),
446
+                            InkWell(
447
+                              child: Container(
448
+                                decoration: BoxDecoration(
449
+                                    color: Color(0xFFD0D0D0),
450
+                                    borderRadius: BorderRadius.circular(5)),
451
+                                child: Column(
452
+                                  crossAxisAlignment: CrossAxisAlignment.center,
453
+                                  mainAxisAlignment: MainAxisAlignment.center,
454
+                                  children: <Widget>[
455
+                                    Container(
456
+                                      width: 75,
457
+                                      height: 75,
458
+                                      child: Image.asset(
459
+                                          "assets/icons/menu/ic_slipgaji_2.png",
460
+                                          fit: BoxFit.fill,
461
+                                          alignment: Alignment.center),
462
+                                    ),
463
+                                    Container(
464
+                                      margin: EdgeInsets.only(top: 10),
465
+                                      padding: EdgeInsets.all(5),
466
+                                      child: Text(
467
+                                        'Pay Slip',
468
+                                        textAlign: TextAlign.center,
469
+                                        style: GoogleFonts.acme(
470
+                                            fontSize: 18, color: Colors.black),
471
+                                      ),
472
+                                    ),
473
+                                  ],
474
+                                ),
409 475
                               ),
410
-                              Container(
411
-                                margin: EdgeInsets.only(top: 10),
412
-                                padding: EdgeInsets.all(5),
413
-                                child: Text(
414
-                                  'Time Off Submission',
415
-                                  textAlign: TextAlign.center,
416
-                                  style: GoogleFonts.acme(
417
-                                      fontSize: 18, color: Colors.black),
476
+                              onTap: () {
477
+                                Navigator.push(
478
+                                    context,
479
+                                    MaterialPageRoute(
480
+                                        builder: (context) => SlipGajiScreen()));
481
+                              },
482
+                            ),
483
+                            InkWell(
484
+                              child: Container(
485
+                                decoration: BoxDecoration(
486
+                                    color: Color(0xFFD0D0D0),
487
+                                    borderRadius: BorderRadius.circular(5)),
488
+                                child: Column(
489
+                                  crossAxisAlignment: CrossAxisAlignment.center,
490
+                                  mainAxisAlignment: MainAxisAlignment.center,
491
+                                  children: <Widget>[
492
+                                    Container(
493
+                                      width: 70,
494
+                                      height: 70,
495
+                                      child: Image.asset(
496
+                                          "assets/icons/menu/ic_cuti_2.png",
497
+                                          fit: BoxFit.fill,
498
+                                          alignment: Alignment.center),
499
+                                    ),
500
+                                    Container(
501
+                                      margin: EdgeInsets.only(top: 10),
502
+                                      padding: EdgeInsets.all(5),
503
+                                      child: Text(
504
+                                        'Time Off Submission',
505
+                                        textAlign: TextAlign.center,
506
+                                        style: GoogleFonts.acme(
507
+                                            fontSize: 18, color: Colors.black),
508
+                                      ),
509
+                                    ),
510
+                                  ],
418 511
                                 ),
419 512
                               ),
420
-                            ],
421
-                          ),
422
-                        ),
423
-                        onTap: () {
424
-                          Navigator.push(
425
-                              context,
426
-                              MaterialPageRoute(
427
-                                  builder: (context) => AjukanCutiScreen()));
428
-                        },
429
-                      ),
430
-                      /*InkWell(
513
+                              onTap: () {
514
+                                Navigator.push(
515
+                                    context,
516
+                                    MaterialPageRoute(
517
+                                        builder: (context) => AjukanCutiScreen()));
518
+                              },
519
+                            ),
520
+                            /*InkWell(
431 521
                         child: Container(
432 522
                           decoration: BoxDecoration(
433 523
                               color: Color(0xFFD0D0D0),
@@ -462,126 +552,127 @@ class HomeScreen extends StatelessWidget {
462 552
                                   builder: (context) => BeritaScreen()));
463 553
                         },
464 554
                       ),*/
465
-                      InkWell(
466
-                        child: Container(
467
-                          decoration: BoxDecoration(
468
-                              color: Color(0xFFD0D0D0),
469
-                              borderRadius: BorderRadius.circular(5)),
470
-                          child: Column(
471
-                            crossAxisAlignment: CrossAxisAlignment.center,
472
-                            mainAxisAlignment: MainAxisAlignment.center,
473
-                            children: <Widget>[
474
-                              Container(
475
-                                width: 70,
476
-                                height: 70,
477
-                                child: Image.asset(
478
-                                  "assets/icons/menu/ic_surattugas_2.png",
479
-                                  fit: BoxFit.fill,
480
-                                  alignment: Alignment.center,
481
-                                ),
482
-                              ),
483
-                              Container(
484
-                                margin: EdgeInsets.only(top: 10),
485
-                                padding: EdgeInsets.all(5),
486
-                                child: Text(
487
-                                  'Assignment Letter',
488
-                                  textAlign: TextAlign.center,
489
-                                  style: GoogleFonts.acme(
490
-                                      fontSize: 18, color: Colors.black),
555
+                            InkWell(
556
+                              child: Container(
557
+                                decoration: BoxDecoration(
558
+                                    color: Color(0xFFD0D0D0),
559
+                                    borderRadius: BorderRadius.circular(5)),
560
+                                child: Column(
561
+                                  crossAxisAlignment: CrossAxisAlignment.center,
562
+                                  mainAxisAlignment: MainAxisAlignment.center,
563
+                                  children: <Widget>[
564
+                                    Container(
565
+                                      width: 70,
566
+                                      height: 70,
567
+                                      child: Image.asset(
568
+                                        "assets/icons/menu/ic_surattugas_2.png",
569
+                                        fit: BoxFit.fill,
570
+                                        alignment: Alignment.center,
571
+                                      ),
572
+                                    ),
573
+                                    Container(
574
+                                      margin: EdgeInsets.only(top: 10),
575
+                                      padding: EdgeInsets.all(5),
576
+                                      child: Text(
577
+                                        'Assignment Letter',
578
+                                        textAlign: TextAlign.center,
579
+                                        style: GoogleFonts.acme(
580
+                                            fontSize: 18, color: Colors.black),
581
+                                      ),
582
+                                    ),
583
+                                  ],
491 584
                                 ),
492 585
                               ),
493
-                            ],
494
-                          ),
495
-                        ),
496
-                        onTap: () {
497
-                          Navigator.push(
498
-                              context,
499
-                              MaterialPageRoute(
500
-                                  builder: (context) => SuratTugas_Screen()));
501
-                        },
502
-                      ),
503
-                      InkWell(
504
-                        child: Container(
505
-                          decoration: BoxDecoration(
506
-                              color: Color(0xFFD0D0D0),
507
-                              borderRadius: BorderRadius.circular(5)),
508
-                          child: Column(
509
-                            crossAxisAlignment: CrossAxisAlignment.center,
510
-                            mainAxisAlignment: MainAxisAlignment.center,
511
-                            children: <Widget>[
512
-                              Container(
513
-                                width: 70,
514
-                                height: 70,
515
-                                child: Image.asset(
516
-                                    "assets/icons/menu/ic_reimburse.png",
517
-                                    fit: BoxFit.fill,
518
-                                    alignment: Alignment.center),
519
-                              ),
520
-                              Container(
521
-                                margin: EdgeInsets.only(top: 10),
522
-                                padding: EdgeInsets.all(5),
523
-                                child: Text(
524
-                                  'Reimburse',
525
-                                  textAlign: TextAlign.center,
526
-                                  style: GoogleFonts.acme(
527
-                                      fontSize: 18, color: Colors.black),
586
+                              onTap: () {
587
+                                Navigator.push(
588
+                                    context,
589
+                                    MaterialPageRoute(
590
+                                        builder: (context) => SuratTugas_Screen()));
591
+                              },
592
+                            ),
593
+                            InkWell(
594
+                              child: Container(
595
+                                decoration: BoxDecoration(
596
+                                    color: Color(0xFFD0D0D0),
597
+                                    borderRadius: BorderRadius.circular(5)),
598
+                                child: Column(
599
+                                  crossAxisAlignment: CrossAxisAlignment.center,
600
+                                  mainAxisAlignment: MainAxisAlignment.center,
601
+                                  children: <Widget>[
602
+                                    Container(
603
+                                      width: 70,
604
+                                      height: 70,
605
+                                      child: Image.asset(
606
+                                          "assets/icons/menu/ic_reimburse.png",
607
+                                          fit: BoxFit.fill,
608
+                                          alignment: Alignment.center),
609
+                                    ),
610
+                                    Container(
611
+                                      margin: EdgeInsets.only(top: 10),
612
+                                      padding: EdgeInsets.all(5),
613
+                                      child: Text(
614
+                                        'Reimburse',
615
+                                        textAlign: TextAlign.center,
616
+                                        style: GoogleFonts.acme(
617
+                                            fontSize: 18, color: Colors.black),
618
+                                      ),
619
+                                    ),
620
+                                  ],
528 621
                                 ),
529 622
                               ),
530
-                            ],
531
-                          ),
532
-                        ),
533
-                        onTap: () {
534
-                          Navigator.push(
535
-                              context,
536
-                              MaterialPageRoute(
537
-                                  builder: (context) => ReimburseScreen()));
538
-                        },
539
-                      ),
540
-                      InkWell(
541
-                        child: Container(
542
-                          decoration: BoxDecoration(
543
-                              color: Color(0xFFD0D0D0),
544
-                              borderRadius: BorderRadius.circular(5)),
545
-                          child: Column(
546
-                            crossAxisAlignment: CrossAxisAlignment.center,
547
-                            mainAxisAlignment: MainAxisAlignment.center,
548
-                            children: <Widget>[
549
-                              Container(
550
-                                width: 70,
551
-                                height: 70,
552
-                                child: Image.asset(
553
-                                    "assets/icons/menu/ic_about_2.png",
554
-                                    fit: BoxFit.fill,
555
-                                    alignment: Alignment.center),
556
-                              ),
557
-                              Container(
558
-                                margin: EdgeInsets.only(top: 10),
559
-                                padding: EdgeInsets.all(5),
560
-                                child: Text(
561
-                                  'About',
562
-                                  textAlign: TextAlign.center,
563
-                                  style: GoogleFonts.acme(
564
-                                      fontSize: 18, color: Colors.black),
623
+                              onTap: () {
624
+                                Navigator.push(
625
+                                    context,
626
+                                    MaterialPageRoute(
627
+                                        builder: (context) => ReimburseScreen()));
628
+                              },
629
+                            ),
630
+                            InkWell(
631
+                              child: Container(
632
+                                decoration: BoxDecoration(
633
+                                    color: Color(0xFFD0D0D0),
634
+                                    borderRadius: BorderRadius.circular(5)),
635
+                                child: Column(
636
+                                  crossAxisAlignment: CrossAxisAlignment.center,
637
+                                  mainAxisAlignment: MainAxisAlignment.center,
638
+                                  children: <Widget>[
639
+                                    Container(
640
+                                      width: 70,
641
+                                      height: 70,
642
+                                      child: Image.asset(
643
+                                          "assets/icons/menu/ic_about_2.png",
644
+                                          fit: BoxFit.fill,
645
+                                          alignment: Alignment.center),
646
+                                    ),
647
+                                    Container(
648
+                                      margin: EdgeInsets.only(top: 10),
649
+                                      padding: EdgeInsets.all(5),
650
+                                      child: Text(
651
+                                        'About',
652
+                                        textAlign: TextAlign.center,
653
+                                        style: GoogleFonts.acme(
654
+                                            fontSize: 18, color: Colors.black),
655
+                                      ),
656
+                                    ),
657
+                                  ],
565 658
                                 ),
566 659
                               ),
567
-                            ],
568
-                          ),
569
-                        ),
570
-                        onTap: () {
571
-                          Navigator.push(
572
-                              context,
573
-                              MaterialPageRoute(
574
-                                  builder: (context) => AboutScreen()));
575
-                        },
576
-                      ),
577
-                    ],
578
-                  )
579
-                ],
580
-              ),
660
+                              onTap: () {
661
+                                Navigator.push(
662
+                                    context,
663
+                                    MaterialPageRoute(
664
+                                        builder: (context) => AboutScreen()));
665
+                              },
666
+                            ),
667
+                          ],
668
+                        )
669
+                      ],
670
+                    ),
671
+                  ),
672
+                ),
673
+              ],
581 674
             ),
582
-          ),
583
-        ],
584
-      ),
585
-    ));
675
+          )),
676
+    );
586 677
   }
587 678
 }

+ 40
- 2
lib/Screens/Login/login_screen.dart Parādīt failu

@@ -1,4 +1,6 @@
1
+import 'dart:async';
1 2
 import 'dart:convert';
3
+import 'package:firebase_core/firebase_core.dart';
2 4
 import 'package:flutter/material.dart';
3 5
 import 'package:flutter/services.dart';
4 6
 import 'package:flutter_udid/flutter_udid.dart';
@@ -13,6 +15,8 @@ import 'package:shared_preferences/shared_preferences.dart';
13 15
 import '../Home/home_screen.dart';
14 16
 import 'inputWidget.dart';
15 17
 import 'dart:developer' as logDev;
18
+import 'package:plain_notification_token/plain_notification_token.dart';
19
+import 'dart:io' show Platform;
16 20
 
17 21
 class LoginView extends StatefulWidget {
18 22
   @override
@@ -20,6 +24,7 @@ class LoginView extends StatefulWidget {
20 24
 }
21 25
 
22 26
 class _LoginView extends State<LoginView> {
27
+
23 28
   @override
24 29
   Widget build(BuildContext context) {
25 30
     return Scaffold(
@@ -34,10 +39,43 @@ class _LoginView extends State<LoginView> {
34 39
   }
35 40
 }
36 41
 
37
-class LoginScreen extends StatelessWidget {
42
+class LoginScreen extends StatefulWidget {
43
+  @override
44
+  State<LoginScreen> createState() => _LoginScreenState();
45
+}
46
+
47
+class _LoginScreenState extends State<LoginScreen> {
38 48
   late LoginPostResult loginPostResult;
39 49
   String version = "1.0.0";
40
-  String notif_token = "ginro";
50
+  String notif_token = "";
51
+
52
+  String _pushToken = '0819';
53
+  IosNotificationSettings? _settings;
54
+  late StreamSubscription onTokenRefreshSubscription;
55
+
56
+  @override
57
+  void initState() {
58
+    WidgetsBinding.instance.addPostFrameCallback((_) {
59
+      getNotifToken();
60
+    });
61
+    super.initState();
62
+  }
63
+  
64
+  getNotifToken () async {
65
+    await Firebase.initializeApp();
66
+    final plainNotificationToken = PlainNotificationToken();
67
+    if (Platform.isIOS) {
68
+      plainNotificationToken.requestPermission();
69
+      await plainNotificationToken.onIosSettingsRegistered.first;
70
+    }
71
+    onTokenRefreshSubscription = PlainNotificationToken().onTokenRefresh.listen((token) {
72
+      setState(() {
73
+        _pushToken = token;
74
+      });
75
+    });
76
+    logDev.log(_pushToken, name: "Notif TOKEN");
77
+   /* final notif_token = await plainNotificationToken.onTokenRefresh.listen ((t));*/
78
+  }
41 79
 
42 80
   @override
43 81
   Widget build(BuildContext context) {

+ 0
- 6
lib/Screens/Login/post_result_model.dart Parādīt failu

@@ -1,15 +1,9 @@
1 1
 import 'dart:convert';
2 2
 import 'dart:core';
3 3
 import 'dart:io' show Platform;
4
-import 'package:device_imei/device_imei.dart';
5
-import 'package:device_info_plus/device_info_plus.dart';
6
-import 'package:flutter/services.dart';
7
-import 'package:flutter_udid/flutter_udid.dart';
8 4
 import 'package:http/http.dart' as http;
9 5
 import 'package:hris_selfservice_mobile/constants.dart';
10 6
 import 'dart:developer' as developer;
11
-import 'package:device_imei/device_imei.dart';
12
-import 'package:shared_preferences/shared_preferences.dart';
13 7
 
14 8
 late String platformDevice;
15 9
 platform(){

+ 2
- 2
lib/Screens/Menu/Reimburse/history_reimburse.dart Parādīt failu

@@ -47,7 +47,6 @@ class _HistoryReimburse extends State<HistoryReimburse> {
47 47
     WidgetsBinding.instance.addPostFrameCallback((_) async {
48 48
       getHistoryData();
49 49
     });
50
-    logDev.log(HistoryLength.toString(), name: "Banyak History");
51 50
   }
52 51
 
53 52
   getHistoryData() async {
@@ -181,7 +180,8 @@ class _HistoryReimburse extends State<HistoryReimburse> {
181 180
               ],
182 181
             ),
183 182
             Container(
184
-              margin: EdgeInsets.only(top: (MediaQuery.of(context).size.height / 6) + 40, left: 5, right: 5, bottom: 10),
183
+              margin: EdgeInsets.only(top: (MediaQuery.of(context).size.height / 6) + 40,
184
+                  left: 5, right: 5, bottom: 10),
185 185
               child: ListView.builder(
186 186
                 scrollDirection: Axis.vertical,
187 187
                 shrinkWrap: true,

+ 1
- 1
lib/Screens/Menu/SlipGaji/RequestHttp/detailSlipGaji_post.dart Parādīt failu

@@ -30,7 +30,7 @@ class DetailSlipGaji_Post {
30 30
       "Api-key": apiKey
31 31
     });
32 32
 
33
-    developer.log(sendData.body, name: "Get History Reimburse Result");
33
+    developer.log(sendData.body, name: "Detail Slip Gaji Result");
34 34
     return sendData.body;
35 35
   }
36 36
 }

+ 115
- 68
lib/Screens/Menu/SlipGaji/slipgaji_screen.dart Parādīt failu

@@ -1,14 +1,12 @@
1 1
 import 'dart:convert';
2 2
 
3 3
 import 'package:flutter/cupertino.dart';
4
-import 'package:flutter/gestures.dart';
5 4
 import 'package:flutter/material.dart';
6 5
 import 'package:fluttertoast/fluttertoast.dart';
7 6
 import 'package:google_fonts/google_fonts.dart';
8 7
 import 'package:hris_selfservice_mobile/Screens/Menu/SlipGaji/RequestHttp/detailSlipGaji_post.dart';
9 8
 import 'package:hris_selfservice_mobile/Screens/Menu/SlipGaji/RequestHttp/historySlipGaji_post.dart';
10 9
 import 'package:hris_selfservice_mobile/Screens/Menu/SlipGaji/background.dart';
11
-import 'package:intl/date_symbol_data_local.dart';
12 10
 import 'package:progress_dialog_null_safe/progress_dialog_null_safe.dart';
13 11
 import 'dart:developer' as logDev;
14 12
 
@@ -22,10 +20,12 @@ class SlipGajiScreen extends StatefulWidget {
22 20
 }
23 21
 
24 22
 class _SlipGajiScreenState extends State<SlipGajiScreen> {
23
+  //History Slip Gaji
25 24
   late List <String> dateTo_List;
26 25
   late List <String> batchID_List;
27 26
 
28 27
   //Detail Slip Gaji
28
+  late List <String> number_List;
29 29
   late List <String> period_List;
30 30
   late List <String> namaPegawai_List;
31 31
   late List <String> status_List;
@@ -37,8 +37,8 @@ class _SlipGajiScreenState extends State<SlipGajiScreen> {
37 37
   late List <String> category_List;
38 38
   late List <String> total_List;
39 39
 
40
-  late int HistoryLength;
41
-  late int DetailLength;
40
+  int HistoryLength = 0;
41
+  late int indexBatchID = 0;
42 42
 
43 43
   var selectedDate;
44 44
   bool visible = false;
@@ -49,41 +49,47 @@ class _SlipGajiScreenState extends State<SlipGajiScreen> {
49 49
     dateTo_List = [""];
50 50
     batchID_List = [""];
51 51
 
52
+    number_List = [""];
53
+    period_List = [""];
54
+    namaPegawai_List = [""];
55
+    status_List = [""];
56
+    structure_List = [""];
57
+    position = "";
58
+
52 59
     name_List = [""];
53 60
     category_List = [""];
54 61
     total_List = [""];
55 62
 
56 63
     WidgetsBinding.instance.addPostFrameCallback((_) {
57
-      ProgressDialog loading = ProgressDialog(context);
58
-      loading = ProgressDialog(context,
59
-          type: ProgressDialogType.normal, isDismissible: false, showLogs: true);
60
-      loading.style(
61
-          message: 'Please Wait .....',
62
-          borderRadius: 3,
63
-          backgroundColor: Colors.white,
64
-          progressWidget: CircularProgressIndicator(),
65
-          elevation: 10.0,
66
-          padding: EdgeInsets.all(10),
67
-          insetAnimCurve: Curves.easeInOut,
68
-          progress: 0.0,
69
-          maxProgress: 100.0,
70
-          progressTextStyle: TextStyle(
71
-              color: Colors.black, fontSize: 10.0, fontWeight: FontWeight.w400),
72
-          messageTextStyle: TextStyle(
73
-              color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600));
74
-      loading.show();
75 64
       getHistoryData();
76
-      loading.hide();
77 65
     });
78 66
   }
79 67
 
80 68
   getHistoryData() async {
69
+    ProgressDialog loading = ProgressDialog(context);
70
+    loading = ProgressDialog(context,
71
+        type: ProgressDialogType.normal, isDismissible: false, showLogs: true);
72
+    loading.style(
73
+        message: 'Please Wait .....',
74
+        borderRadius: 3,
75
+        backgroundColor: Colors.white,
76
+        progressWidget: CircularProgressIndicator(),
77
+        elevation: 10.0,
78
+        padding: EdgeInsets.all(10),
79
+        insetAnimCurve: Curves.easeInOut,
80
+        progress: 0.0,
81
+        maxProgress: 100.0,
82
+        progressTextStyle: TextStyle(
83
+            color: Colors.black, fontSize: 10.0, fontWeight: FontWeight.w400),
84
+        messageTextStyle: TextStyle(
85
+            color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600));
86
+    loading.show();
81 87
     HistorySlipGaji_Post.connectToAPI().then((valueResult) async {
82 88
       Map<String, dynamic> object = json.decode(valueResult);
83 89
       if (object.containsKey("result").toString() == "true"){
84 90
         String result = object['result'].toString();
85 91
         if (result.contains("failed")) {
86
-          //loading.hide();
92
+          loading.hide();
87 93
           setState(() {
88 94
             alertDialogFailedRetrievedData(context);
89 95
           });
@@ -94,7 +100,7 @@ class _SlipGajiScreenState extends State<SlipGajiScreen> {
94 100
               String dateTo = historySlipGaji[i]['date_to'].toString();
95 101
               String bulan = dateTo.substring(5,7);
96 102
               String tahun = dateTo.substring(0,4);
97
-              String batchID = historySlipGaji[i][''].toString();
103
+              String batchID = historySlipGaji[i]['batch_id'].toString();
98 104
 
99 105
               String bulanStr = "";
100 106
               if (bulan == "01"){
@@ -126,6 +132,7 @@ class _SlipGajiScreenState extends State<SlipGajiScreen> {
126 132
               String bulanTahun = bulanStr + " " + tahun;
127 133
               dateTo_List.add(bulanTahun);
128 134
               batchID_List.add(batchID);
135
+
129 136
             }
130 137
             dateTo_List.removeAt(0);
131 138
             batchID_List.removeAt(0);
@@ -133,7 +140,7 @@ class _SlipGajiScreenState extends State<SlipGajiScreen> {
133 140
             HistoryLength = historySlipGaji.length;
134 141
 
135 142
           });
136
-          //loading.hide();
143
+          loading.hide();
137 144
         }
138 145
       } else {
139 146
         setState((){
@@ -146,10 +153,10 @@ class _SlipGajiScreenState extends State<SlipGajiScreen> {
146 153
               textColor: Colors.white,
147 154
               fontSize: 16.0);
148 155
         });
149
-        //loading.hide();
156
+        loading.hide();
150 157
       }
151 158
     });
152
-
159
+    return HistoryLength;
153 160
   }
154 161
 
155 162
   getDetailData () async {
@@ -172,60 +179,75 @@ class _SlipGajiScreenState extends State<SlipGajiScreen> {
172 179
             color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600));
173 180
     loading.show();
174 181
 
182
+    //logDev.log(batchID_List.toString(), name: "ALL BATCH ID");
183
+
175 184
     final SharedPreferences prefs = await SharedPreferences.getInstance();
176
-    for (int i = 0; i < HistoryLength; i++){
177
-      DetailSlipGaji_Post.connectToAPI(batchID_List[i]).then((valueResult) async {
185
+      DetailSlipGaji_Post.connectToAPI(batchID_List[indexBatchID]).then((valueResult) async {
178 186
         Map<String, dynamic> object = json.decode(valueResult);
179 187
         if (object.containsKey("result").toString() == "true"){
180 188
           String result = object['result'].toString();
181 189
           if (result.contains("failed")) {
182 190
             loading.hide();
191
+            logDev.log("ERROR", name: "FAILED RESULT");
183 192
             setState(() {
184 193
               alertDialogFailedRetrievedData(context);
185 194
             });
186 195
           } else {
187
-            List <dynamic> detailSlipGaji = object['result'];
196
+            //List <dynamic> detailSlipGaji = object['result'];
188 197
             setState(() {
189 198
               position = prefs.getString('position')!;
190
-              for (int k = 0; k < detailSlipGaji.length; k++){
191
-                String tanggalAwal = detailSlipGaji[k]['date_from'].toString();
192
-                String tanggalAkhir = detailSlipGaji[k]['date_to'].toString();
193
-                String namaPegawai = detailSlipGaji[k]['employee'].toString();
194
-                String status = detailSlipGaji[i]['status'].toString();
195
-                String structure = detailSlipGaji[i]['structure'].toString();
196
-                List <dynamic> component = object['result']['component'];
197
-                for (int j = 0; j < component.length; j++){
198
-                  String name = component[j]['name'].toString();
199
-                  String category = component[j]['category'].toString();
200
-                  String total = component[j]['total'].toString();
201
-
202
-                  name_List.add(name);
203
-                  category_List.add(category);
204
-                  total_List.add(total);
205
-                }
206
-
207
-                period_List.add(tanggalAwal + " - " + tanggalAkhir);
208
-                namaPegawai_List.add(namaPegawai);
209
-                status_List.add(status);
199
+              String nomor = object['result']['number'];
200
+              String tanggalAwal = object['result']['date_from'];
201
+              String tanggalAkhir = object['result']['date_to'];
202
+              String namaPegawai = object['result']['employee'];
203
+              String status = object['result']['status'];
204
+              String structure =object['result']['structure'];
205
+              number_List.add(nomor);
206
+              structure_List.add(structure);
207
+              period_List.add(tanggalAwal + " to " + tanggalAkhir);
208
+              namaPegawai_List.add(namaPegawai);
209
+              status_List.add(status);
210
+
211
+              List <dynamic> component = object['result']['component'];
212
+              logDev.log(component.length.toString(), name: "BANYAK COMPONENT");
213
+              for (int j = 0; j < component.length; j++){
214
+                String name = component[j]['name'].toString();
215
+                String category = component[j]['category'].toString();
216
+                int total = component[j]['total'];
217
+
218
+                name_List.add(name);
219
+                category_List.add(category);
220
+                total_List.add(total.toString());
210 221
               }
222
+
223
+              number_List.remove(0);
224
+              structure_List.removeAt(0);
225
+              period_List.removeAt(0);
226
+              namaPegawai_List.removeAt(0);
227
+              status_List.removeAt(0);
228
+
229
+              name_List.removeAt(0);
230
+              category_List.removeAt(0);
231
+              total_List.removeAt(0);
211 232
             });
212 233
             loading.hide();
213 234
           }
214 235
         } else {
215 236
           setState((){
216 237
             alertDialogFailedResponse(context);
217
-            Fluttertoast.showToast(
238
+            logDev.log("ERROR", name: "RESPONSE FAILED RESULT");
239
+           /* Fluttertoast.showToast(
218 240
                 msg: "Server Response Error",
219 241
                 toastLength: Toast.LENGTH_SHORT,
220 242
                 gravity: ToastGravity.CENTER,
221 243
                 timeInSecForIosWeb: 1,
222 244
                 textColor: Colors.white,
223
-                fontSize: 16.0);
245
+                fontSize: 16.0);*/
224 246
           });
225 247
           loading.hide();
226 248
         }
227 249
       });
228
-    }
250
+
229 251
   }
230 252
 
231 253
   @override
@@ -245,7 +267,7 @@ class _SlipGajiScreenState extends State<SlipGajiScreen> {
245 267
                   crossAxisAlignment: CrossAxisAlignment.end,
246 268
                   children: [
247 269
                     Text(
248
-                      'Salary Slip\t\t',
270
+                      'Pay Slip\t\t',
249 271
                       maxLines: 1,
250 272
                       style: GoogleFonts.luckiestGuy(
251 273
                         fontSize: 28,
@@ -297,6 +319,14 @@ class _SlipGajiScreenState extends State<SlipGajiScreen> {
297 319
                                       selectedDate = value!;
298 320
                                       if (selectedDate == value){
299 321
                                         visible = true;
322
+                                        for (int i = 0; i < dateTo_List.length; i ++){
323
+                                          if (selectedDate == dateTo_List[i]){
324
+                                            indexBatchID = i;
325
+                                            break;
326
+                                          }
327
+                                        }
328
+                                        //logDev.log(indexBatchID.toString(), name: "INDEX BATCH ID");
329
+                                        getDetailData();
300 330
                                       } else {
301 331
                                         visible = false;
302 332
                                       }
@@ -317,7 +347,7 @@ class _SlipGajiScreenState extends State<SlipGajiScreen> {
317 347
                     Visibility(
318 348
                       visible: visible,
319 349
                       child: Text(
320
-                        'Salary Slip ' + selectedDate.toString() + "\nPT. Global Service Indonesia",
350
+                        'Pay Slip ' + selectedDate.toString() + "\nPT. Global Service Indonesia",
321 351
                         textAlign: TextAlign.center,
322 352
                         style: GoogleFonts.viga(
323 353
                           fontSize: 15,
@@ -327,18 +357,34 @@ class _SlipGajiScreenState extends State<SlipGajiScreen> {
327 357
                     ),
328 358
                     Visibility(
329 359
                         visible: visible,
330
-                        child: Container(
331
-                          height: 200,
332
-                          child: Card(
333
-                            elevation: 7,
334
-                            child: Container(
335
-                                decoration: BoxDecoration(
336
-                                    color: Color(0XFFFFFEFC),
337
-                                    borderRadius: BorderRadius.circular(10)
338
-                                )
339
-                            ),
340
-                          ),
341
-                        )),
360
+                        child: ListView.builder(
361
+                          shrinkWrap: true,
362
+                          itemCount: 1,
363
+                          itemBuilder: (context, int indexBatchID){
364
+                            return Container(
365
+                              //height: 200,
366
+                              margin: EdgeInsets.fromLTRB(0, 15, 0, 10),
367
+                              decoration: BoxDecoration(
368
+                                color: Color(0XFFFFFEFC),
369
+                                borderRadius: BorderRadius.circular(10),
370
+                              ),
371
+                              child: Card(
372
+                                elevation: 5,
373
+                                child: Column(
374
+                                    children: [
375
+                                      Text(number_List[indexBatchID], style: GoogleFonts.rubikBubbles(fontSize: 16)),
376
+                                      Text(number_List[indexBatchID], style: GoogleFonts.rubikBubbles(fontSize: 16)),
377
+                                      Text(structure_List[indexBatchID], style: GoogleFonts.nunito(fontSize: 15)),
378
+                                      Text(period_List[indexBatchID], style: GoogleFonts.nunito(fontSize: 15)),
379
+                                      Text(name_List[indexBatchID], style: GoogleFonts.nunito(fontSize: 15)),
380
+                                      Text(position, style: GoogleFonts.nunito(fontSize: 15)),
381
+                                      Text("Payment : " /*+ payment_List[i]*/, style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic))],
382
+                                  ),
383
+                              ),
384
+                            );
385
+                          },
386
+                        ),
387
+                    ),
342 388
                     Visibility(
343 389
                       visible: visible,
344 390
                       child: Container(
@@ -366,6 +412,7 @@ const List<Color> Gradients1 = [
366 412
   Color(0xFF03A0FE),
367 413
 ];
368 414
 
415
+
369 416
 alertDialogFailedRetrievedData(BuildContext context){
370 417
   Widget okButton = TextButton(
371 418
     child: Text("Refresh"),

+ 1
- 1
lib/Screens/Menu/SuratTugas/RequestHttp/historyST_post.dart Parādīt failu

@@ -28,7 +28,7 @@ class HistoryST_Post {
28 28
       "Api-key": apiKey
29 29
     });
30 30
 
31
-    developer.log(sendData.body, name: "Get History Reimburse Result");
31
+    //developer.log(sendData.body, name: "Get History ST Result");
32 32
     return sendData.body;
33 33
   }
34 34
 }

+ 1154
- 0
lib/Screens/Menu/SuratTugas/deklarasi_st.dart
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 91
- 22
lib/Screens/Menu/SuratTugas/history_st.dart Parādīt failu

@@ -67,9 +67,7 @@ class _HistoryST extends State<HistoryST> {
67 67
 
68 68
     WidgetsBinding.instance.addPostFrameCallback((_) async {
69 69
       getHistoryData();
70
-      getDetailData();
71 70
     });
72
-    logDev.log(HistoryLength.toString(), name: "Banyak History");
73 71
   }
74 72
 
75 73
   getHistoryData() async {
@@ -141,6 +139,73 @@ class _HistoryST extends State<HistoryST> {
141 139
             visible.removeAt(0);
142 140
 
143 141
             HistoryLength = historyST.length;
142
+            logDev.log(HistoryLength.toString(), name: "HISTORY LENGTH");
143
+
144
+            for (int i = 0; i < HistoryLength;i++){
145
+              DetailST_Post.connectToAPI(id_List[i]).then((valueResult) async {
146
+                Map<String, dynamic> object = jsonDecode(valueResult);
147
+                if (object.containsKey("result").toString() == "true") {
148
+                  String result = object['result'].toString();
149
+                  if (result.contains("failed")) {
150
+                    loading.hide();
151
+                    alertDialogFailedRetrievedData(context);
152
+                  } else {
153
+                    List <dynamic> detailST = object['result'];
154
+                    loading.hide();
155
+                    setState(() {
156
+                      for (int j = 0; j < HistoryLength; j++){
157
+                        String tglST = detailST[j]['tgl_st'].toString();
158
+                        String uMuka = detailST[j]['umuka'].toString();
159
+                        String tglBerangkat = detailST[j]['tgl_berangkat'].toString();
160
+                        String tglKembali = detailST[j]['tgl_kembali'].toString();
161
+                        String tujuan = detailST[j]['tujuan'].toString();
162
+
163
+                        List<dynamic> ticketID = object['result']['ticket_ids'];
164
+                        String ticketType = ticketID[j]['type'].toString();
165
+                        String ticketFrom = ticketID[j]['from'].toString();
166
+                        String ticketTo = ticketID[j]['to'].toString();
167
+                        String ticketDate = ticketID[j]['tgl'].toString();
168
+                        String ticketPrice = ticketID[j]['harga'].toString();
169
+
170
+                        tglST_List.add(tglST);
171
+                        uMuka_List.add(uMuka);
172
+                        tglBerangkat_List.add(tglBerangkat);
173
+                        tglKembali_List.add(tglKembali);
174
+                        tujuan_List.add(tujuan);
175
+
176
+                        ticketType_List.add(ticketType);
177
+                        ticketFrom_List.add(ticketFrom);
178
+                        ticketTo_List.add(ticketTo);
179
+                        ticketDate_List.add(ticketDate);
180
+                        ticketPrice_List.add(ticketPrice);
181
+
182
+                        logDev.log(tglST_List.toString(), name:"semua list");
183
+                      }
184
+                    });
185
+                  }
186
+                } else {
187
+                  Fluttertoast.showToast(
188
+                      msg: "Server Response Error",
189
+                      toastLength: Toast.LENGTH_SHORT,
190
+                      gravity: ToastGravity.CENTER,
191
+                      timeInSecForIosWeb: 1,
192
+                      textColor: Colors.white,
193
+                      fontSize: 16.0);
194
+                }
195
+              });
196
+            }
197
+            tglST_List.removeAt(0);
198
+            uMuka_List.removeAt(0);
199
+            tglBerangkat_List.removeAt(0);
200
+            tglKembali_List.removeAt(0);
201
+            tujuan_List.removeAt(0);
202
+
203
+            ticketType_List.removeAt(0);
204
+            ticketFrom_List.removeAt(0);
205
+            ticketTo_List.removeAt(0);
206
+            ticketDate_List.removeAt(0);
207
+            ticketPrice_List.removeAt(0);
208
+            loading.hide();
144 209
           });
145 210
         }
146 211
       } else {
@@ -152,9 +217,11 @@ class _HistoryST extends State<HistoryST> {
152 217
             textColor: Colors.white,
153 218
             fontSize: 16.0);
154 219
       }
220
+      loading.hide();
155 221
     });
156 222
   }
157
-  getDetailData() async {
223
+
224
+  /*getDetailData() async {
158 225
     ProgressDialog loading = ProgressDialog(context);
159 226
     loading = ProgressDialog(context,
160 227
         type: ProgressDialogType.normal, isDismissible: false, showLogs: true);
@@ -173,6 +240,7 @@ class _HistoryST extends State<HistoryST> {
173 240
         messageTextStyle: TextStyle(
174 241
             color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600));
175 242
 
243
+    logDev.log(HistoryLength.toString(), name: "Banyak History");
176 244
     for (int i = 0; i < HistoryLength;i++){
177 245
       DetailST_Post.connectToAPI(id_List[i]).then((valueResult) async {
178 246
         Map<String, dynamic> object = jsonDecode(valueResult);
@@ -210,19 +278,9 @@ class _HistoryST extends State<HistoryST> {
210 278
                 ticketTo_List.add(ticketTo);
211 279
                 ticketDate_List.add(ticketDate);
212 280
                 ticketPrice_List.add(ticketPrice);
213
-              }
214 281
 
215
-              tglST_List.removeAt(0);
216
-              uMuka_List.removeAt(0);
217
-              tglBerangkat_List.removeAt(0);
218
-              tglKembali_List.removeAt(0);
219
-              tujuan_List.removeAt(0);
220
-
221
-              ticketType_List.removeAt(0);
222
-              ticketFrom_List.removeAt(0);
223
-              ticketTo_List.removeAt(0);
224
-              ticketDate_List.removeAt(0);
225
-              ticketPrice_List.removeAt(0);
282
+                logDev.log(tglST_List.toString(), name:"semua list");
283
+              }
226 284
             });
227 285
           }
228 286
         } else {
@@ -236,8 +294,19 @@ class _HistoryST extends State<HistoryST> {
236 294
         }
237 295
       });
238 296
     }
297
+    tglST_List.removeAt(0);
298
+    uMuka_List.removeAt(0);
299
+    tglBerangkat_List.removeAt(0);
300
+    tglKembali_List.removeAt(0);
301
+    tujuan_List.removeAt(0);
302
+
303
+    ticketType_List.removeAt(0);
304
+    ticketFrom_List.removeAt(0);
305
+    ticketTo_List.removeAt(0);
306
+    ticketDate_List.removeAt(0);
307
+    ticketPrice_List.removeAt(0);
239 308
     loading.hide();
240
-  }
309
+  }*/
241 310
 
242 311
   @override
243 312
   Widget build(BuildContext context) {
@@ -259,7 +328,7 @@ class _HistoryST extends State<HistoryST> {
259 328
                           crossAxisAlignment: CrossAxisAlignment.end,
260 329
                           children: [
261 330
                             Text(
262
-                              'Assignment Letter\nHistory\t\t',
331
+                              'History\t\t',
263 332
                               maxLines: 1,
264 333
                               style: GoogleFonts.luckiestGuy(
265 334
                                 fontSize: 28,
@@ -319,7 +388,7 @@ class _HistoryST extends State<HistoryST> {
319 388
                                 ),
320 389
                               ],
321 390
                             ),
322
-                            Align(
391
+                            /*Align(
323 392
                               alignment: Alignment.centerLeft,
324 393
                               child: Visibility(
325 394
                                   visible: visible[i],
@@ -329,21 +398,21 @@ class _HistoryST extends State<HistoryST> {
329 398
                                       mainAxisAlignment: MainAxisAlignment.start,
330 399
                                       crossAxisAlignment: CrossAxisAlignment.start,
331 400
                                       children: [
332
-                                        Text("\nAssignment Letter Date\t : " + tglST_List[i], style: GoogleFonts.josefinSans(fontSize: 15, fontWeight: FontWeight.bold)),
401
+                                        *//*Text("\nAssignment Letter Date\t : " + tglST_List[i], style: GoogleFonts.josefinSans(fontSize: 15, fontWeight: FontWeight.bold)),*//*
333 402
                                         Text("Down Payment\t\t : " + uMuka_List[i], style: GoogleFonts.nunito(fontSize: 15)),
334 403
                                         Text("Departure Date\t\t : " + tglBerangkat_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),
335 404
                                         Text("Return Date\t\t : " + tglKembali_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),
336 405
                                         Text("Destination\t\t : " + tujuan_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),
337
-                                        Text("Ticket Type\t\t : " + ticketType_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),
406
+                                        *//*Text("Ticket Type\t\t : " + ticketType_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),
338 407
                                         Text("From\t\t\t : " + ticketFrom_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),
339 408
                                         Text("To\t\t : " + ticketTo_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),
340 409
                                         Text("Ticket Date\t\t : " + ticketDate_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),
341
-                                        Text("Ticket Price\t\t\t : " + ticketPrice_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),
410
+                                        Text("Ticket Price\t\t\t : " + ticketPrice_List[i], style: GoogleFonts.yeonSung(fontSize: 14, fontStyle: FontStyle.italic)),*//*
342 411
                                       ],
343 412
                                     ),
344 413
                                   )
345 414
                               ),
346
-                            )
415
+                            )*/
347 416
                           ],
348 417
                         ),
349 418
                       ),

+ 2
- 1
lib/Screens/Menu/SuratTugas/surattugas_screen.dart Parādīt failu

@@ -5,6 +5,7 @@ import 'package:hris_selfservice_mobile/Screens/Menu/SuratTugas/history_st.dart'
5 5
 import 'package:hris_selfservice_mobile/Screens/Menu/SuratTugas/pengajuan_st.dart';
6 6
 
7 7
 import '../SlipGaji/background.dart';
8
+import 'deklarasi_st.dart';
8 9
 
9 10
 class SuratTugas_Screen extends StatefulWidget {
10 11
   const SuratTugas_Screen({Key? key}) : super(key: key);
@@ -129,7 +130,7 @@ class _SuratTugas_ScreenState extends State<SuratTugas_Screen> {
129 130
                           Navigator.push(
130 131
                               context,
131 132
                               MaterialPageRoute(
132
-                                  builder: (context) => PengajuanST_Screen()));
133
+                                  builder: (context) => DeklarasiST_Screen()));
133 134
                         },
134 135
                       ),
135 136
                       InkWell(

+ 1
- 1
macos/Flutter/GeneratedPluginRegistrant.swift Parādīt failu

@@ -14,7 +14,7 @@ import flutter_udid
14 14
 import geolocator_apple
15 15
 import location
16 16
 import path_provider_macos
17
-import shared_preferences_macos
17
+import shared_preferences_foundation
18 18
 import url_launcher_macos
19 19
 
20 20
 func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {

+ 20
- 13
pubspec.lock Parādīt failu

@@ -35,7 +35,7 @@ packages:
35 35
       name: args
36 36
       url: "https://pub.dartlang.org"
37 37
     source: hosted
38
-    version: "2.3.1"
38
+    version: "2.3.2"
39 39
   async:
40 40
     dependency: "direct main"
41 41
     description:
@@ -352,6 +352,13 @@ packages:
352 352
       url: "https://pub.dartlang.org"
353 353
     source: hosted
354 354
     version: "8.1.2"
355
+  focus_detector:
356
+    dependency: "direct main"
357
+    description:
358
+      name: focus_detector
359
+      url: "https://pub.dartlang.org"
360
+    source: hosted
361
+    version: "2.0.1"
355 362
   geocoding:
356 363
     dependency: "direct main"
357 364
     description:
@@ -526,7 +533,7 @@ packages:
526 533
       name: json_annotation
527 534
       url: "https://pub.dartlang.org"
528 535
     source: hosted
529
-    version: "4.7.0"
536
+    version: "4.8.0"
530 537
   latlong2:
531 538
     dependency: transitive
532 539
     description:
@@ -673,7 +680,7 @@ packages:
673 680
       name: path_provider_macos
674 681
       url: "https://pub.dartlang.org"
675 682
     source: hosted
676
-    version: "2.0.6"
683
+    version: "2.0.7"
677 684
   path_provider_platform_interface:
678 685
     dependency: transitive
679 686
     description:
@@ -778,7 +785,7 @@ packages:
778 785
       name: shared_preferences
779 786
       url: "https://pub.dartlang.org"
780 787
     source: hosted
781
-    version: "2.0.15"
788
+    version: "2.0.16"
782 789
   shared_preferences_android:
783 790
     dependency: transitive
784 791
     description:
@@ -786,10 +793,10 @@ packages:
786 793
       url: "https://pub.dartlang.org"
787 794
     source: hosted
788 795
     version: "2.0.14"
789
-  shared_preferences_ios:
796
+  shared_preferences_foundation:
790 797
     dependency: transitive
791 798
     description:
792
-      name: shared_preferences_ios
799
+      name: shared_preferences_foundation
793 800
       url: "https://pub.dartlang.org"
794 801
     source: hosted
795 802
     version: "2.1.1"
@@ -800,13 +807,6 @@ packages:
800 807
       url: "https://pub.dartlang.org"
801 808
     source: hosted
802 809
     version: "2.1.2"
803
-  shared_preferences_macos:
804
-    dependency: transitive
805
-    description:
806
-      name: shared_preferences_macos
807
-      url: "https://pub.dartlang.org"
808
-    source: hosted
809
-    version: "2.0.5"
810 810
   shared_preferences_platform_interface:
811 811
     dependency: transitive
812 812
     description:
@@ -973,6 +973,13 @@ packages:
973 973
       url: "https://pub.dartlang.org"
974 974
     source: hosted
975 975
     version: "2.1.2"
976
+  visibility_detector:
977
+    dependency: transitive
978
+    description:
979
+      name: visibility_detector
980
+      url: "https://pub.dartlang.org"
981
+    source: hosted
982
+    version: "0.2.2"
976 983
   win32:
977 984
     dependency: transitive
978 985
     description:

+ 2
- 1
pubspec.yaml Parādīt failu

@@ -48,7 +48,6 @@ dependencies:
48 48
   dio: ^4.0.6
49 49
   get_it: ^7.2.0
50 50
   firebase_messaging: ^14.1.3
51
-  firebase_core: ^2.4.0
52 51
   flutter_local_notifications: ^13.0.0
53 52
   shared_preferences: ^2.0.15
54 53
   # device_information: ^0.0.4
@@ -84,6 +83,8 @@ dependencies:
84 83
   connectivity_plus: ^3.0.2
85 84
   internet_connection_checker: ^1.0.0+1
86 85
   plain_notification_token: ^0.0.4
86
+  focus_detector: ^2.0.1
87
+  firebase_core: ^2.4.1
87 88
 
88 89
 dev_dependencies:
89 90
   flutter_test:

+ 0
- 1
remoteconfig.template.json Parādīt failu

@@ -1 +0,0 @@
1
-{}

Notiek ielāde…
Atcelt
Saglabāt