Browse Source

Update 2909

dienianindya 1 year ago
parent
commit
7a16f565e7

+ 1
- 1
android/app/build.gradle View File

53
 
53
 
54
     signingConfigs {
54
     signingConfigs {
55
         release {
55
         release {
56
-            storeFile file('D:/employee_self_service/ess_keystore.jks')
56
+            storeFile file('D:/Android Studio Projects/ess/ess_keystore.jks')
57
             storePassword '123123'
57
             storePassword '123123'
58
             keyAlias 'ess_keystore'
58
             keyAlias 'ess_keystore'
59
             keyPassword '123123'
59
             keyPassword '123123'

+ 1
- 2
android/app/src/main/AndroidManifest.xml View File

2
     xmlns:tools="http://schemas.android.com/tools"
2
     xmlns:tools="http://schemas.android.com/tools"
3
     package="com.example.hris_selfservice_mobile">
3
     package="com.example.hris_selfservice_mobile">
4
 
4
 
5
-
6
     <uses-permission android:name="android.permission.INTERNET" />
5
     <uses-permission android:name="android.permission.INTERNET" />
7
     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
6
     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
8
     <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
7
     <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
9
-    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
8
+   <!-- <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />-->
10
     <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
9
     <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
11
 
10
 
12
     <application
11
     <application

BIN
assets/animation/iconapp.gif View File


BIN
assets/animation/iconapp1.gif View File


BIN
assets/animation/iconapp2.gif View File


BIN
ess_keystore.jks View File


BIN
firebase-tools-instant-win.exe View File


+ 12
- 14
lib/Screens/Home/home_screen.dart View File

25
 import '../Settings/RequestHttp/getProfileImage_post.dart';
25
 import '../Settings/RequestHttp/getProfileImage_post.dart';
26
 import 'package:internet_connection_checker/internet_connection_checker.dart';
26
 import 'package:internet_connection_checker/internet_connection_checker.dart';
27
 
27
 
28
-var _imageToShow;
29
 late String nameShared;
28
 late String nameShared;
30
 String name = "",
29
 String name = "",
31
     statusDetail = "",
30
     statusDetail = "",
34
     email = "",
33
     email = "",
35
     address = "",
34
     address = "",
36
     position = "";
35
     position = "";
36
+var _imageToShow;
37
 
37
 
38
 
38
 
39
 class HomeView extends StatefulWidget {
39
 class HomeView extends StatefulWidget {
46
   bool isDeviceConnected = false;
46
   bool isDeviceConnected = false;
47
   bool isAlertSet = false;
47
   bool isAlertSet = false;
48
 
48
 
49
+  //var _imageToShow;
50
+
49
   @override
51
   @override
50
   initState() {
52
   initState() {
51
     getConnectivity();
53
     getConnectivity();
52
     getDetail();
54
     getDetail();
53
     _imageToShow = AssetImage('assets/images/ic_administrator.png');
55
     _imageToShow = AssetImage('assets/images/ic_administrator.png');
54
-    WidgetsBinding.instance.addPostFrameCallback((_) async {
56
+    WidgetsBinding.instance.addPostFrameCallback((_) {
55
       getProfileImage();
57
       getProfileImage();
56
     });
58
     });
57
     super.initState();
59
     super.initState();
62
             (ConnectivityResult result) async {
64
             (ConnectivityResult result) async {
63
           isDeviceConnected = await InternetConnectionChecker().hasConnection;
65
           isDeviceConnected = await InternetConnectionChecker().hasConnection;
64
           if (!isDeviceConnected && isAlertSet == false) {
66
           if (!isDeviceConnected && isAlertSet == false) {
65
-            showDialogBox();
67
+            showConnectivityDialogBox();
66
             setState(() => isAlertSet = true);
68
             setState(() => isAlertSet = true);
67
           }
69
           }
68
         },
70
         },
117
           } else if (photo != "false") {
119
           } else if (photo != "false") {
118
             Uint8List decodedBytes = Base64Decoder().convert(photo);
120
             Uint8List decodedBytes = Base64Decoder().convert(photo);
119
             setState(() {
121
             setState(() {
120
-              _imageToShow = Image
121
-                  .memory(decodedBytes, gaplessPlayback: true)
122
-                  .image;
122
+              _imageToShow = Image.memory(decodedBytes, gaplessPlayback: true).image;
123
             });
123
             });
124
           }
124
           }
125
         } else if (status == "failed") {
125
         } else if (status == "failed") {
227
     );
227
     );
228
   }
228
   }
229
 
229
 
230
-  showDialogBox() =>
230
+  showConnectivityDialogBox() =>
231
       showCupertinoDialog<String>(
231
       showCupertinoDialog<String>(
232
         context: context,
232
         context: context,
233
         builder: (BuildContext context) =>
233
         builder: (BuildContext context) =>
254
                     isDeviceConnected =
254
                     isDeviceConnected =
255
                     await InternetConnectionChecker().hasConnection;
255
                     await InternetConnectionChecker().hasConnection;
256
                     if (!isDeviceConnected && isAlertSet == false) {
256
                     if (!isDeviceConnected && isAlertSet == false) {
257
-                      showDialogBox();
257
+                      showConnectivityDialogBox();
258
                       setState(() => isAlertSet = true);
258
                       setState(() => isAlertSet = true);
259
                     }
259
                     }
260
                   },
260
                   },
333
           String photo = object['result']['photo'].toString();
333
           String photo = object['result']['photo'].toString();
334
           if (photo == "false") {
334
           if (photo == "false") {
335
             setState(() {
335
             setState(() {
336
-              _imageToShow = AssetImage('assets/images/ic_administrator.png');
336
+              _imageToShow = AssetImage('assets/icons/ic_pp_2.png');
337
             });
337
             });
338
           } else if (photo != "false") {
338
           } else if (photo != "false") {
339
             Uint8List decodedBytes = Base64Decoder().convert(photo);
339
             Uint8List decodedBytes = Base64Decoder().convert(photo);
340
             //logDev.log(decodedBytes.toString(), name: "DECODED BYTES photo");
340
             //logDev.log(decodedBytes.toString(), name: "DECODED BYTES photo");
341
             setState(() {
341
             setState(() {
342
-              _imageToShow = Image
343
-                  .memory(decodedBytes, gaplessPlayback: true)
344
-                  .image;
342
+              _imageToShow = Image.memory(decodedBytes, gaplessPlayback: true).image;
345
             });
343
             });
346
           }
344
           }
347
         } else if (status == "failed") {
345
         } else if (status == "failed") {
608
                                             AjukanCutiScreen()));
606
                                             AjukanCutiScreen()));
609
                               },
607
                               },
610
                             ),
608
                             ),
611
-                            InkWell(
609
+                            /*InkWell(
612
                               child: Container(
610
                               child: Container(
613
                                 width: size.width,
611
                                 width: size.width,
614
                                 height: size.height,
612
                                 height: size.height,
643
                                         builder: (context) =>
641
                                         builder: (context) =>
644
                                             SuratTugas_Screen()));
642
                                             SuratTugas_Screen()));
645
                               },
643
                               },
646
-                            ),
644
+                            ),*/
647
                             InkWell(
645
                             InkWell(
648
                               child: Container(
646
                               child: Container(
649
                                 width: size.width,
647
                                 width: size.width,

lib/Screens/Login/post_result_model.dart → lib/Screens/Login/login_post.dart View File

41
   }*/
41
   }*/
42
 
42
 
43
   static Future<String> connectToAPI(String email, String password, String notif_token,
43
   static Future<String> connectToAPI(String email, String password, String notif_token,
44
-      String version, String device, String imei) async {
44
+      String version, String device) async {
45
     String URL = baseURL + "/api/v1/login";
45
     String URL = baseURL + "/api/v1/login";
46
     print(URL);
46
     print(URL);
47
 
47
 
53
           "notif_token": notif_token,
53
           "notif_token": notif_token,
54
           "version": version,
54
           "version": version,
55
           "device": platform(),
55
           "device": platform(),
56
-          "imei": imei
56
+          "imei": "imei"
57
         }
57
         }
58
       ]
58
       ]
59
     }), headers: {
59
     }), headers: {

+ 4
- 5
lib/Screens/Login/login_screen.dart View File

8
 import 'package:google_fonts/google_fonts.dart';
8
 import 'package:google_fonts/google_fonts.dart';
9
 import 'package:employee_selfservice_mobile/Screens/ForgotPassword/forgotPassword_screen.dart';
9
 import 'package:employee_selfservice_mobile/Screens/ForgotPassword/forgotPassword_screen.dart';
10
 import 'package:employee_selfservice_mobile/Screens/Login/background.dart';
10
 import 'package:employee_selfservice_mobile/Screens/Login/background.dart';
11
-import 'package:employee_selfservice_mobile/Screens/Login/post_result_model.dart';
11
+import 'package:employee_selfservice_mobile/Screens/Login/login_post.dart';
12
 import 'package:employee_selfservice_mobile/Screens/Splash/splash_screen.dart';
12
 import 'package:employee_selfservice_mobile/Screens/Splash/splash_screen.dart';
13
 import 'package:progress_dialog_null_safe/progress_dialog_null_safe.dart';
13
 import 'package:progress_dialog_null_safe/progress_dialog_null_safe.dart';
14
 import 'package:shared_preferences/shared_preferences.dart';
14
 import 'package:shared_preferences/shared_preferences.dart';
159
                                 ),
159
                                 ),
160
                               ),
160
                               ),
161
                               onTap: () async {
161
                               onTap: () async {
162
-                                String imei;
162
+                                /*String imei;
163
                                 try {
163
                                 try {
164
                                   imei = await FlutterUdid.udid;
164
                                   imei = await FlutterUdid.udid;
165
                                 } on PlatformException {
165
                                 } on PlatformException {
166
                                   imei = 'Failed to get UDID.';
166
                                   imei = 'Failed to get UDID.';
167
                                 }
167
                                 }
168
-                                logDev.log(imei, name: "IMEI");
168
+                                logDev.log(imei, name: "IMEI");*/
169
                                 if (!validateForm(context)) {
169
                                 if (!validateForm(context)) {
170
                                   return;
170
                                   return;
171
                                 } else {
171
                                 } else {
179
                                           passwordController.text.toString(),
179
                                           passwordController.text.toString(),
180
                                           notif_token!,
180
                                           notif_token!,
181
                                           version,
181
                                           version,
182
-                                          platform(),
183
-                                          imei)
182
+                                          platform(),)
184
                                       .then((valueResult) async {
183
                                       .then((valueResult) async {
185
                                     Map<String, dynamic> object = json.decode(valueResult);
184
                                     Map<String, dynamic> object = json.decode(valueResult);
186
                                     if (object.containsKey("result").toString() == "true") {
185
                                     if (object.containsKey("result").toString() == "true") {

+ 1
- 1
lib/Screens/Menu/Absensi/absensi_screen.dart View File

983
       return alert;
983
       return alert;
984
     },
984
     },
985
   );
985
   );
986
-}
986
+}

+ 70
- 9
lib/Screens/Splash/splash_screen.dart View File

1
 import 'dart:async';
1
 import 'dart:async';
2
 import 'dart:convert';
2
 import 'dart:convert';
3
 import 'dart:io';
3
 import 'dart:io';
4
+import 'package:connectivity_plus/connectivity_plus.dart';
5
+import 'package:flutter/cupertino.dart';
4
 import 'package:flutter/material.dart';
6
 import 'package:flutter/material.dart';
5
 import 'package:flutter/services.dart';
7
 import 'package:flutter/services.dart';
6
 import 'package:fluttertoast/fluttertoast.dart';
8
 import 'package:fluttertoast/fluttertoast.dart';
8
 import 'package:employee_selfservice_mobile/Screens/Login/login_screen.dart';
10
 import 'package:employee_selfservice_mobile/Screens/Login/login_screen.dart';
9
 import 'package:employee_selfservice_mobile/Screens/Splash/loginstatus_post.dart';
11
 import 'package:employee_selfservice_mobile/Screens/Splash/loginstatus_post.dart';
10
 import 'package:employee_selfservice_mobile/constants.dart';
12
 import 'package:employee_selfservice_mobile/constants.dart';
13
+import 'package:internet_connection_checker/internet_connection_checker.dart';
11
 import 'package:lottie/lottie.dart';
14
 import 'package:lottie/lottie.dart';
12
 import 'package:shared_preferences/shared_preferences.dart';
15
 import 'package:shared_preferences/shared_preferences.dart';
13
 import '../Home/home_screen.dart';
16
 import '../Home/home_screen.dart';
23
 }
26
 }
24
 
27
 
25
 class _SplashState extends State<Splash> {
28
 class _SplashState extends State<Splash> {
29
+  late StreamSubscription subscription;
30
+  bool isDeviceConnected = false;
31
+  bool isAlertSet = false;
32
+
26
   @override
33
   @override
27
   void initState() {
34
   void initState() {
28
-    super.initState();
35
+    //getConnectivity();
29
     Timer(Duration(seconds: 10), () => loginStatus(context));
36
     Timer(Duration(seconds: 10), () => loginStatus(context));
37
+    super.initState();
30
   }
38
   }
31
 
39
 
40
+  /*getConnectivity() =>
41
+      subscription = Connectivity().onConnectivityChanged.listen(
42
+            (ConnectivityResult result) async {
43
+          isDeviceConnected = await InternetConnectionChecker().hasConnection;
44
+          if (!isDeviceConnected && isAlertSet == false) {
45
+            showConnectivityDialogBox();
46
+            setState(() => isAlertSet = true);
47
+          }
48
+        },
49
+      );*/
50
+
32
   @override
51
   @override
33
   Widget build(BuildContext context) {
52
   Widget build(BuildContext context) {
34
     return Scaffold(
53
     return Scaffold(
40
           ],
59
           ],
41
         ));
60
         ));
42
   }
61
   }
62
+
63
+  /*showConnectivityDialogBox() =>
64
+      showCupertinoDialog<String>(
65
+        context: context,
66
+        builder: (BuildContext context) =>
67
+            CupertinoAlertDialog(
68
+              title: const Text('No Connection'),
69
+              content: const Text('Please check your internet connectivity'),
70
+              actions: <Widget>[
71
+                Column(
72
+                  children: [
73
+                    SizedBox(
74
+                      width: 250,
75
+                      height: 250,
76
+                      child: LottieBuilder.asset(
77
+                        //'assets/animation/animation_no_internet.json',
78
+                          'assets/animation/animation_no_internet_3.json',
79
+                          repeat: true),
80
+                    ),
81
+                  ],
82
+                ),
83
+                TextButton(
84
+                  onPressed: () async {
85
+                    Navigator.pop(context, 'Cancel');
86
+                    setState(() => isAlertSet = false);
87
+                    isDeviceConnected =
88
+                    await InternetConnectionChecker().hasConnection;
89
+                    if (!isDeviceConnected && isAlertSet == false) {
90
+                      showConnectivityDialogBox();
91
+                      setState(() => isAlertSet = true);
92
+                    }
93
+                  },
94
+                  child: const Text('Retry'),
95
+                ),
96
+              ],
97
+            ),
98
+      );*/
43
 }
99
 }
44
 
100
 
45
 class SplashScreen extends StatelessWidget {
101
 class SplashScreen extends StatelessWidget {
47
 
103
 
48
   @override
104
   @override
49
   Widget build(BuildContext context) {
105
   Widget build(BuildContext context) {
106
+    var size = MediaQuery.of(context).size;
107
+
50
     return Scaffold(
108
     return Scaffold(
51
         body: Container(
109
         body: Container(
52
       width: double.infinity,
110
       width: double.infinity,
73
                 color: Colors.white
131
                 color: Colors.white
74
               ),*/
132
               ),*/
75
               child: SizedBox(
133
               child: SizedBox(
76
-                width: 250,
77
-                height: 250,
78
-                child: LottieBuilder.asset('assets/animation/animation_4.json',
79
-                    repeat: true),
134
+                width: size.width * 0.55,
135
+                //height: 250,
136
+                child: /*Image.asset('assets/animation/iconapp2.gif')*/
137
+                LottieBuilder.asset('assets/animation/animation_4.json',
138
+                    repeat: true, ),
80
               ),
139
               ),
81
             ),
140
             ),
82
             Text(appName,
141
             Text(appName,
184
               child: Text(action),
243
               child: Text(action),
185
               onPressed: () async {
244
               onPressed: () async {
186
                 if (action == "update") {
245
                 if (action == "update") {
187
-                 /* _launchURL(Uri.parse("https://play.google.com/store/apps"));
188
-                  SystemChannels.platform.invokeMethod('SystemNavigator.pop');*/
246
+                  _launchURL(Uri.parse("https://play.google.com/store/apps"));
247
+                  SystemChannels.platform.invokeMethod('SystemNavigator.pop');
189
                   Uri url = Uri.parse(Uri.encodeFull("https://play.google.com/store/apps"));
248
                   Uri url = Uri.parse(Uri.encodeFull("https://play.google.com/store/apps"));
190
                   //final Uri uri = Uri(scheme: "https",  host: "play.google.com");
249
                   //final Uri uri = Uri(scheme: "https",  host: "play.google.com");
191
                   if(!await launchUrl(url, mode: LaunchMode.externalApplication)) {
250
                   if(!await launchUrl(url, mode: LaunchMode.externalApplication)) {
217
       }
276
       }
218
     } else {
277
     } else {
219
       alertDialogFailedResponse(context);
278
       alertDialogFailedResponse(context);
220
-      /*Fluttertoast.showToast(
279
+      Fluttertoast.showToast(
221
           msg: "Server Response Error",
280
           msg: "Server Response Error",
222
           toastLength: Toast.LENGTH_SHORT,
281
           toastLength: Toast.LENGTH_SHORT,
223
           gravity: ToastGravity.CENTER,
282
           gravity: ToastGravity.CENTER,
224
           timeInSecForIosWeb: 1,
283
           timeInSecForIosWeb: 1,
225
           textColor: Colors.white,
284
           textColor: Colors.white,
226
-          fontSize: 16.0);*/
285
+          fontSize: 16.0);
227
     }
286
     }
228
   });
287
   });
229
 }
288
 }
274
     },
333
     },
275
   );
334
   );
276
 }
335
 }
336
+
337
+

+ 4
- 6
lib/main.dart View File

1
 import 'dart:ui';
1
 import 'dart:ui';
2
-
3
 import 'package:firebase_core/firebase_core.dart';
2
 import 'package:firebase_core/firebase_core.dart';
4
 import 'package:firebase_messaging/firebase_messaging.dart';
3
 import 'package:firebase_messaging/firebase_messaging.dart';
5
 import 'package:flutter/material.dart';
4
 import 'package:flutter/material.dart';
13
 
12
 
14
 import 'firebase_options.dart';
13
 import 'firebase_options.dart';
15
 
14
 
16
-Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
17
-  logDev.log(message.data.toString(), name: "BACKGROUND HANDLER - DATANYA APA?");
18
-  logDev.log(message.notification!.title.toString(), name: "BACKGROUND HANDLER - ISI NOTIFNYA APA?");
19
-}
20
-
21
 const AndroidNotificationChannel channel = AndroidNotificationChannel(
15
 const AndroidNotificationChannel channel = AndroidNotificationChannel(
22
     'high_importance_channel', // id
16
     'high_importance_channel', // id
23
     'High Importance Notifications', // title
17
     'High Importance Notifications', // title
179
   }
173
   }
180
 }
174
 }
181
 
175
 
176
+Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
177
+  logDev.log(message.data.toString(), name: "BACKGROUND HANDLER - DATANYA APA?");
178
+  logDev.log(message.notification!.title.toString(), name: "BACKGROUND HANDLER - ISI NOTIFNYA APA?");
179
+}
182
 /*void sendLogMessage(String message) {
180
 /*void sendLogMessage(String message) {
183
   FirebaseCrashlytics.instance.log(message);
181
   FirebaseCrashlytics.instance.log(message);
184
 }*/
182
 }*/

+ 8
- 0
pubspec.lock View File

350
       url: "https://pub.dev"
350
       url: "https://pub.dev"
351
     source: hosted
351
     source: hosted
352
     version: "4.2.0+1"
352
     version: "4.2.0+1"
353
+  flutter_gif:
354
+    dependency: "direct main"
355
+    description:
356
+      name: flutter_gif
357
+      sha256: b13d7e484e40685e9236ffbaddf012c2448a2e2c1ac48bed345184dd7bc87f88
358
+      url: "https://pub.dev"
359
+    source: hosted
360
+    version: "0.0.4"
353
   flutter_image:
361
   flutter_image:
354
     dependency: "direct main"
362
     dependency: "direct main"
355
     description:
363
     description:

+ 4
- 1
pubspec.yaml View File

17
 # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
17
 # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18
 # In Windows, build-name is used as the major, minor, and patch parts
18
 # In Windows, build-name is used as the major, minor, and patch parts
19
 # of the product and file versions while build-number is used as the build suffix.
19
 # of the product and file versions while build-number is used as the build suffix.
20
-version: 1.0.0+1
20
+
21
+version: 1.0.1+1
22
+#NOTES : 1.0.1+1  =>>>> 1 + 1 =>>>> version name + version code
21
 
23
 
22
 environment:
24
 environment:
23
   sdk: '>=2.18.4 <3.0.0'
25
   sdk: '>=2.18.4 <3.0.0'
91
   animations: ^2.0.8
93
   animations: ^2.0.8
92
   firebase_crashlytics: ^3.3.5
94
   firebase_crashlytics: ^3.3.5
93
   app_settings: ^5.0.0
95
   app_settings: ^5.0.0
96
+  flutter_gif: ^0.0.4
94
 
97
 
95
 dev_dependencies:
98
 dev_dependencies:
96
   flutter_test:
99
   flutter_test:

BIN
ttwenty.jks View File


Loading…
Cancel
Save