dienianindya 1 rok temu
rodzic
commit
7a16f565e7

+ 1
- 1
android/app/build.gradle Wyświetl plik

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

+ 1
- 2
android/app/src/main/AndroidManifest.xml Wyświetl plik

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

BIN
assets/animation/iconapp.gif Wyświetl plik


BIN
assets/animation/iconapp1.gif Wyświetl plik


BIN
assets/animation/iconapp2.gif Wyświetl plik


BIN
ess_keystore.jks Wyświetl plik


BIN
firebase-tools-instant-win.exe Wyświetl plik


+ 12
- 14
lib/Screens/Home/home_screen.dart Wyświetl plik

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

lib/Screens/Login/post_result_model.dart → lib/Screens/Login/login_post.dart Wyświetl plik

@@ -41,7 +41,7 @@ class LoginPostResult {
41 41
   }*/
42 42
 
43 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 45
     String URL = baseURL + "/api/v1/login";
46 46
     print(URL);
47 47
 
@@ -53,7 +53,7 @@ class LoginPostResult {
53 53
           "notif_token": notif_token,
54 54
           "version": version,
55 55
           "device": platform(),
56
-          "imei": imei
56
+          "imei": "imei"
57 57
         }
58 58
       ]
59 59
     }), headers: {

+ 4
- 5
lib/Screens/Login/login_screen.dart Wyświetl plik

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

+ 1
- 1
lib/Screens/Menu/Absensi/absensi_screen.dart Wyświetl plik

@@ -983,4 +983,4 @@ alertDialogEnableLocaionServices(BuildContext context) {
983 983
       return alert;
984 984
     },
985 985
   );
986
-}
986
+}

+ 70
- 9
lib/Screens/Splash/splash_screen.dart Wyświetl plik

@@ -1,6 +1,8 @@
1 1
 import 'dart:async';
2 2
 import 'dart:convert';
3 3
 import 'dart:io';
4
+import 'package:connectivity_plus/connectivity_plus.dart';
5
+import 'package:flutter/cupertino.dart';
4 6
 import 'package:flutter/material.dart';
5 7
 import 'package:flutter/services.dart';
6 8
 import 'package:fluttertoast/fluttertoast.dart';
@@ -8,6 +10,7 @@ import 'package:google_fonts/google_fonts.dart';
8 10
 import 'package:employee_selfservice_mobile/Screens/Login/login_screen.dart';
9 11
 import 'package:employee_selfservice_mobile/Screens/Splash/loginstatus_post.dart';
10 12
 import 'package:employee_selfservice_mobile/constants.dart';
13
+import 'package:internet_connection_checker/internet_connection_checker.dart';
11 14
 import 'package:lottie/lottie.dart';
12 15
 import 'package:shared_preferences/shared_preferences.dart';
13 16
 import '../Home/home_screen.dart';
@@ -23,12 +26,28 @@ class Splash extends StatefulWidget {
23 26
 }
24 27
 
25 28
 class _SplashState extends State<Splash> {
29
+  late StreamSubscription subscription;
30
+  bool isDeviceConnected = false;
31
+  bool isAlertSet = false;
32
+
26 33
   @override
27 34
   void initState() {
28
-    super.initState();
35
+    //getConnectivity();
29 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 51
   @override
33 52
   Widget build(BuildContext context) {
34 53
     return Scaffold(
@@ -40,6 +59,43 @@ class _SplashState extends State<Splash> {
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 101
 class SplashScreen extends StatelessWidget {
@@ -47,6 +103,8 @@ class SplashScreen extends StatelessWidget {
47 103
 
48 104
   @override
49 105
   Widget build(BuildContext context) {
106
+    var size = MediaQuery.of(context).size;
107
+
50 108
     return Scaffold(
51 109
         body: Container(
52 110
       width: double.infinity,
@@ -73,10 +131,11 @@ class SplashScreen extends StatelessWidget {
73 131
                 color: Colors.white
74 132
               ),*/
75 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 141
             Text(appName,
@@ -184,8 +243,8 @@ Future<void> loginStatus(BuildContext context) async {
184 243
               child: Text(action),
185 244
               onPressed: () async {
186 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 248
                   Uri url = Uri.parse(Uri.encodeFull("https://play.google.com/store/apps"));
190 249
                   //final Uri uri = Uri(scheme: "https",  host: "play.google.com");
191 250
                   if(!await launchUrl(url, mode: LaunchMode.externalApplication)) {
@@ -217,13 +276,13 @@ Future<void> loginStatus(BuildContext context) async {
217 276
       }
218 277
     } else {
219 278
       alertDialogFailedResponse(context);
220
-      /*Fluttertoast.showToast(
279
+      Fluttertoast.showToast(
221 280
           msg: "Server Response Error",
222 281
           toastLength: Toast.LENGTH_SHORT,
223 282
           gravity: ToastGravity.CENTER,
224 283
           timeInSecForIosWeb: 1,
225 284
           textColor: Colors.white,
226
-          fontSize: 16.0);*/
285
+          fontSize: 16.0);
227 286
     }
228 287
   });
229 288
 }
@@ -274,3 +333,5 @@ alertDialogFailedResponse(BuildContext context){
274 333
     },
275 334
   );
276 335
 }
336
+
337
+

+ 4
- 6
lib/main.dart Wyświetl plik

@@ -1,5 +1,4 @@
1 1
 import 'dart:ui';
2
-
3 2
 import 'package:firebase_core/firebase_core.dart';
4 3
 import 'package:firebase_messaging/firebase_messaging.dart';
5 4
 import 'package:flutter/material.dart';
@@ -13,11 +12,6 @@ import 'package:firebase_crashlytics/firebase_crashlytics.dart';
13 12
 
14 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 15
 const AndroidNotificationChannel channel = AndroidNotificationChannel(
22 16
     'high_importance_channel', // id
23 17
     'High Importance Notifications', // title
@@ -179,6 +173,10 @@ class _MyAppState extends State<MyApp> {
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 180
 /*void sendLogMessage(String message) {
183 181
   FirebaseCrashlytics.instance.log(message);
184 182
 }*/

+ 8
- 0
pubspec.lock Wyświetl plik

@@ -350,6 +350,14 @@ packages:
350 350
       url: "https://pub.dev"
351 351
     source: hosted
352 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 361
   flutter_image:
354 362
     dependency: "direct main"
355 363
     description:

+ 4
- 1
pubspec.yaml Wyświetl plik

@@ -17,7 +17,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
17 17
 # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 18
 # In Windows, build-name is used as the major, minor, and patch parts
19 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 24
 environment:
23 25
   sdk: '>=2.18.4 <3.0.0'
@@ -91,6 +93,7 @@ dependencies:
91 93
   animations: ^2.0.8
92 94
   firebase_crashlytics: ^3.3.5
93 95
   app_settings: ^5.0.0
96
+  flutter_gif: ^0.0.4
94 97
 
95 98
 dev_dependencies:
96 99
   flutter_test:

BIN
ttwenty.jks Wyświetl plik


Ładowanie…
Anuluj
Zapisz