Browse Source

Update 2402 13:43

dienianindya 1 year ago
parent
commit
17f88a3408

+ 4
- 0
android/app/src/main/AndroidManifest.xml View File

33
             <meta-data
33
             <meta-data
34
                 android:name="io.flutter.embedding.android.NormalTheme"
34
                 android:name="io.flutter.embedding.android.NormalTheme"
35
                 android:resource="@style/NormalTheme" />
35
                 android:resource="@style/NormalTheme" />
36
+            <intent-filter>
37
+                <action android:name="FLUTTER_NOTIFICATION_CLICK"/>
38
+                <category android:name="android.intent.category.DEFAULT"/>
39
+            </intent-filter>
36
             <intent-filter>
40
             <intent-filter>
37
                 <action android:name="android.intent.action.MAIN" />
41
                 <action android:name="android.intent.action.MAIN" />
38
                 <category android:name="android.intent.category.LAUNCHER" />
42
                 <category android:name="android.intent.category.LAUNCHER" />

+ 1
- 0
assets/animation/animation_no_internet_2.json
File diff suppressed because it is too large
View File


+ 1
- 0
assets/animation/animation_no_internet_3.json
File diff suppressed because it is too large
View File


+ 1
- 0
assets/animation/animation_no_internet_4.json
File diff suppressed because it is too large
View File


+ 1
- 0
assets/animation/animation_no_internet_5.json
File diff suppressed because it is too large
View File


+ 0
- 100
lib/Screens/CheckInternetConnection/CheckInternetConnection.dart View File

1
-import 'dart:async';
2
-import 'dart:developer' as developer;
3
-
4
-import 'package:connectivity_plus/connectivity_plus.dart';
5
-import 'package:flutter/material.dart';
6
-import 'package:flutter/services.dart';
7
-import 'package:google_fonts/google_fonts.dart';
8
-import 'package:lottie/lottie.dart';
9
-
10
-class MyHomePage extends StatefulWidget {
11
-  @override
12
-  State<MyHomePage> createState() => _MyHomePageState();
13
-}
14
-
15
-class _MyHomePageState extends State<MyHomePage> {
16
-  ConnectivityResult _connectionStatus = ConnectivityResult.none;
17
-  final Connectivity _connectivity = Connectivity();
18
-  late StreamSubscription<ConnectivityResult> _connectivitySubscription;
19
-
20
-  @override
21
-  void initState() {
22
-    super.initState();
23
-    initConnectivity();
24
-
25
-    _connectivitySubscription = _connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
26
-  }
27
-
28
-  @override
29
-  void dispose() {
30
-    _connectivitySubscription.cancel();
31
-    super.dispose();
32
-  }
33
-
34
-  // Platform messages are asynchronous, so we initialize in an async method.
35
-  Future<void> initConnectivity() async {
36
-    late ConnectivityResult result;
37
-    // Platform messages may fail, so we use a try/catch PlatformException.
38
-    try {
39
-      result = await _connectivity.checkConnectivity();
40
-    } on PlatformException catch (e) {
41
-      developer.log('Couldn\'t check connectivity status', error: e);
42
-      return;
43
-    }
44
-
45
-    // If the widget was removed from the tree while the asynchronous platform
46
-    // message was in flight, we want to discard the reply rather than calling
47
-    // setState to update our non-existent appearance.
48
-    if (!mounted) {
49
-      return Future.value(null);
50
-    }
51
-
52
-    return _updateConnectionStatus(result);
53
-  }
54
-
55
-  Future<void> _updateConnectionStatus(ConnectivityResult result) async {
56
-    setState(() {
57
-      _connectionStatus = result;
58
-    });
59
-  }
60
-
61
-  @override
62
-  Widget build(BuildContext context) {
63
-    return Container(
64
-      child: Column(
65
-        children: [
66
-          SizedBox(
67
-            width: 250,
68
-            height: 250,
69
-            child: LottieBuilder.asset(
70
-                'assets/animation/animation_no_internet.json',
71
-                repeat: true),
72
-          ),
73
-          Text(
74
-            "No Internet Connection",
75
-            style: GoogleFonts.josefinSans(fontSize: 18),
76
-          ),
77
-          Padding(
78
-            padding: EdgeInsets.all(15),
79
-            child: Text(
80
-              'You Are Not Connected to The Internet. Please check your Wifi or Mobile Data!',
81
-              style: GoogleFonts.zillaSlab(fontSize: 16),
82
-            ),
83
-          ),
84
-          ElevatedButton(
85
-              onPressed: (){
86
-
87
-              },
88
-              child: Text("Retry",
89
-                  textAlign: TextAlign.center,
90
-                  style: TextStyle(
91
-                      color: Colors.white,
92
-                      fontSize: 17,
93
-                      fontWeight: FontWeight.w500)
94
-              )
95
-          )
96
-        ],
97
-      ),
98
-    );
99
-  }
100
-}

+ 0
- 21
lib/Screens/CheckInternetConnection/ConnectivityProvider.dart View File

1
-import 'package:flutter/material.dart';
2
-
3
-class ConnectivityProvider with ChangeNotifier{
4
-  /*Connectivity
5
-  ConnectivityProvider _connectivityProvider = new ConnectivityProvider();
6
-
7
-  late bool _isOnline;
8
-  bool get isOnline => _isOnline;
9
-
10
-  startMonitoring() async {
11
-
12
-  }
13
-
14
-  Future<void> initConnectivity() async {
15
-    try {
16
-      var connectivityResult = await (Connectivity().checkConnectivity());
17
-    } catch {
18
-
19
-    }
20
-  }*/
21
-}

+ 0
- 40
lib/Screens/CheckInternetConnection/NoInternetConnection.dart View File

1
-import 'package:flutter/material.dart';
2
-import 'package:google_fonts/google_fonts.dart';
3
-import 'package:lottie/lottie.dart';
4
-
5
-class NoInternetConnection extends StatefulWidget {
6
-  const NoInternetConnection({Key? key}) : super(key: key);
7
-
8
-  @override
9
-  State<NoInternetConnection> createState() => _NoInternetConnectionState();
10
-}
11
-
12
-class _NoInternetConnectionState extends State<NoInternetConnection> {
13
-  @override
14
-  Widget build(BuildContext context) {
15
-    return Container(
16
-      child: Column(
17
-        children: [
18
-          SizedBox(
19
-            width: 250,
20
-            height: 250,
21
-            child: LottieBuilder.asset(
22
-                'assets/animation/animation_no_internet.json',
23
-                repeat: true),
24
-          ),
25
-          Text(
26
-            "No Internet Connection",
27
-            style: GoogleFonts.josefinSans(fontSize: 18),
28
-          ),
29
-          Padding(
30
-            padding: EdgeInsets.all(15),
31
-            child: Text(
32
-              'You Are Not Connected to The Internet. Please check your Wifi or Mobile Data!',
33
-              style: GoogleFonts.zillaSlab(fontSize: 16),
34
-            ),
35
-          ),
36
-        ],
37
-      ),
38
-    );
39
-  }
40
-}

+ 4
- 1
lib/Screens/ForgotPassword/forgotPassword_screen.dart View File

146
                                       AlertDialog alert = AlertDialog(
146
                                       AlertDialog alert = AlertDialog(
147
                                         title: Text("Employee Self Service"),
147
                                         title: Text("Employee Self Service"),
148
                                         //content: Text(message),
148
                                         //content: Text(message),
149
-                                        content: Text("Link for reset password has been sent to your email address"),
149
+                                        content: Text("Link to reset password has been sent to your email address"),
150
                                         actions: [
150
                                         actions: [
151
                                           okButton,
151
                                           okButton,
152
                                         ],
152
                                         ],
154
                                       // show the dialog
154
                                       // show the dialog
155
                                       showDialog(
155
                                       showDialog(
156
                                         context: context,
156
                                         context: context,
157
+                                        barrierDismissible: false,
157
                                         builder: (BuildContext context) {
158
                                         builder: (BuildContext context) {
158
                                           return alert;
159
                                           return alert;
159
                                         },
160
                                         },
179
                                       // show the dialog
180
                                       // show the dialog
180
                                       showDialog(
181
                                       showDialog(
181
                                         context: context,
182
                                         context: context,
183
+                                        barrierDismissible: false,
182
                                         builder: (BuildContext context) {
184
                                         builder: (BuildContext context) {
183
                                           return alert;
185
                                           return alert;
184
                                         },
186
                                         },
292
   // show the dialog
294
   // show the dialog
293
   showDialog(
295
   showDialog(
294
     context: context,
296
     context: context,
297
+    barrierDismissible: false,
295
     builder: (BuildContext context) {
298
     builder: (BuildContext context) {
296
       return alert;
299
       return alert;
297
     },
300
     },

+ 73
- 88
lib/Screens/Home/home_screen.dart View File

1
+import 'dart:async';
1
 import 'dart:convert';
2
 import 'dart:convert';
2
 import 'dart:typed_data';
3
 import 'dart:typed_data';
3
 
4
 
5
+import 'package:connectivity_plus/connectivity_plus.dart';
4
 import 'package:double_back_to_close/double_back_to_close.dart';
6
 import 'package:double_back_to_close/double_back_to_close.dart';
7
+import 'package:flutter/cupertino.dart';
5
 import 'package:flutter/material.dart';
8
 import 'package:flutter/material.dart';
6
 import 'package:fluttertoast/fluttertoast.dart';
9
 import 'package:fluttertoast/fluttertoast.dart';
7
 import 'package:focus_detector/focus_detector.dart';
10
 import 'package:focus_detector/focus_detector.dart';
13
 import 'package:hris_selfservice_mobile/Screens/Menu/SlipGaji/slipgaji_screen.dart';
16
 import 'package:hris_selfservice_mobile/Screens/Menu/SlipGaji/slipgaji_screen.dart';
14
 import 'package:hris_selfservice_mobile/Screens/Menu/SuratTugas/surattugas_screen.dart';
17
 import 'package:hris_selfservice_mobile/Screens/Menu/SuratTugas/surattugas_screen.dart';
15
 import 'package:hris_selfservice_mobile/Screens/Settings/settings_screen.dart';
18
 import 'package:hris_selfservice_mobile/Screens/Settings/settings_screen.dart';
19
+import 'package:lottie/lottie.dart';
16
 import 'package:progress_dialog_null_safe/progress_dialog_null_safe.dart';
20
 import 'package:progress_dialog_null_safe/progress_dialog_null_safe.dart';
17
 import 'package:shared_preferences/shared_preferences.dart';
21
 import 'package:shared_preferences/shared_preferences.dart';
18
 import 'dart:developer' as logDev;
22
 import 'dart:developer' as logDev;
19
 import '../Settings/RequestHttp/getDetail_post.dart';
23
 import '../Settings/RequestHttp/getDetail_post.dart';
20
 import '../Settings/RequestHttp/getProfileImage_post.dart';
24
 import '../Settings/RequestHttp/getProfileImage_post.dart';
25
+import 'package:internet_connection_checker/internet_connection_checker.dart';
21
 
26
 
22
 var _imageToShow;
27
 var _imageToShow;
23
 late String nameShared;
28
 late String nameShared;
36
 }
41
 }
37
 
42
 
38
 class _HomeView extends State<HomeView> {
43
 class _HomeView extends State<HomeView> {
44
+  late StreamSubscription subscription;
45
+  bool isDeviceConnected = false;
46
+  bool isAlertSet = false;
47
+
39
   @override
48
   @override
40
   initState() {
49
   initState() {
50
+    getConnectivity();
41
     getDetail();
51
     getDetail();
42
     _imageToShow = AssetImage('assets/images/ic_administrator.png');
52
     _imageToShow = AssetImage('assets/images/ic_administrator.png');
43
-    /*WidgetsBinding.instance.addPostFrameCallback((_) async {
44
-      ProgressDialog loading = ProgressDialog(context);
45
-      loading = ProgressDialog(context,
46
-          type: ProgressDialogType.normal,
47
-          isDismissible: false,
48
-          showLogs: true);
49
-      loading.style(
50
-          message: 'Please Wait .....',
51
-          borderRadius: 5,
52
-          backgroundColor: Colors.white,
53
-          progressWidget: CircularProgressIndicator(),
54
-          elevation: 10.0,
55
-          padding: EdgeInsets.all(10),
56
-          insetAnimCurve: Curves.easeInOut,
57
-          progress: 0.0,
58
-          maxProgress: 100.0,
59
-          progressTextStyle: TextStyle(
60
-              color: Colors.black, fontSize: 10.0, fontWeight: FontWeight.w400),
61
-          messageTextStyle: TextStyle(
62
-              color: Colors.black,
63
-              fontSize: 15.0,
64
-              fontWeight: FontWeight.w600));
65
-      loading.show();
66
-      _imageToShow = getProfileImage();
67
-    });*/
53
+    WidgetsBinding.instance.addPostFrameCallback((_) async {
54
+      getProfileImage();
55
+    });
68
     super.initState();
56
     super.initState();
69
   }
57
   }
70
 
58
 
59
+  getConnectivity() =>
60
+      subscription = Connectivity().onConnectivityChanged.listen(
61
+            (ConnectivityResult result) async {
62
+          isDeviceConnected = await InternetConnectionChecker().hasConnection;
63
+          if (!isDeviceConnected && isAlertSet == false) {
64
+            showDialogBox();
65
+            setState(() => isAlertSet = true);
66
+          }
67
+        },
68
+      );
69
+
70
+  @override
71
+  void dispose() {
72
+    subscription.cancel();
73
+    super.dispose();
74
+  }
75
+
71
   //Get Profile image
76
   //Get Profile image
72
   getProfileImage() async {
77
   getProfileImage() async {
73
     final SharedPreferences prefs = await SharedPreferences.getInstance();
78
     final SharedPreferences prefs = await SharedPreferences.getInstance();
74
     final session = prefs.getString('session');
79
     final session = prefs.getString('session');
75
 
80
 
76
-    /*ProgressDialog loading = ProgressDialog(context);
81
+    ProgressDialog loading = ProgressDialog(context);
77
     loading = ProgressDialog(context,
82
     loading = ProgressDialog(context,
78
         type: ProgressDialogType.normal,
83
         type: ProgressDialogType.normal,
79
         isDismissible: false,
84
         isDismissible: false,
93
         messageTextStyle: TextStyle(
98
         messageTextStyle: TextStyle(
94
             color: Colors.black,
99
             color: Colors.black,
95
             fontSize: 15.0,
100
             fontSize: 15.0,
96
-            fontWeight: FontWeight.w600));*/
101
+            fontWeight: FontWeight.w600));
102
+
103
+    loading.show();
97
 
104
 
98
     GetProfileImage_Post.connectToAPI(session!).then((valueResult) async {
105
     GetProfileImage_Post.connectToAPI(session!).then((valueResult) async {
99
       Map<String, dynamic> object = json.decode(valueResult);
106
       Map<String, dynamic> object = json.decode(valueResult);
108
             });
115
             });
109
           } else if (photo != "false") {
116
           } else if (photo != "false") {
110
             Uint8List decodedBytes = Base64Decoder().convert(photo);
117
             Uint8List decodedBytes = Base64Decoder().convert(photo);
111
-            //logDev.log(decodedBytes.toString(), name: "DECODED BYTES photo");
112
             setState(() {
118
             setState(() {
113
               _imageToShow = Image
119
               _imageToShow = Image
114
                   .memory(decodedBytes, gaplessPlayback: true)
120
                   .memory(decodedBytes, gaplessPlayback: true)
115
                   .image;
121
                   .image;
116
             });
122
             });
117
           }
123
           }
118
-          //loading.hide();
124
+          loading.hide();
119
         } else if (status == "failed") {
125
         } else if (status == "failed") {
120
           String message = object['result']['message'].toString();
126
           String message = object['result']['message'].toString();
121
           Fluttertoast.showToast(
127
           Fluttertoast.showToast(
126
               textColor: Colors.white,
132
               textColor: Colors.white,
127
               fontSize: 16.0);
133
               fontSize: 16.0);
128
         }
134
         }
129
-        //loading.hide();
135
+        loading.hide();
130
       } else {
136
       } else {
131
         Fluttertoast.showToast(
137
         Fluttertoast.showToast(
132
             msg: "Server Response Error",
138
             msg: "Server Response Error",
135
             timeInSecForIosWeb: 1,
141
             timeInSecForIosWeb: 1,
136
             textColor: Colors.white,
142
             textColor: Colors.white,
137
             fontSize: 16.0);
143
             fontSize: 16.0);
138
-        //loading.hide();
144
+        loading.hide();
139
       }
145
       }
140
     });
146
     });
141
     return _imageToShow;
147
     return _imageToShow;
143
 
149
 
144
   //GetDetail
150
   //GetDetail
145
   getDetail() async {
151
   getDetail() async {
146
-    final SharedPreferences prefs = await SharedPreferences.getInstance();
147
-    final session = prefs.getString('session');
148
-    GetDetail_Post.connectToAPI(session!).then((valueResult) async {
152
+    GetDetail_Post.connectToAPI().then((valueResult) async {
149
       Map<String, dynamic> object = json.decode(valueResult);
153
       Map<String, dynamic> object = json.decode(valueResult);
150
       if (object.containsKey("result").toString() == "true") {
154
       if (object.containsKey("result").toString() == "true") {
151
         statusDetail = object['result']['status'].toString();
155
         statusDetail = object['result']['status'].toString();
207
       ),
211
       ),
208
     );
212
     );
209
   }
213
   }
214
+
215
+  showDialogBox() => showCupertinoDialog<String>(
216
+    context: context,
217
+    builder: (BuildContext context) => CupertinoAlertDialog(
218
+      title: const Text('No Connection'),
219
+      content: const Text('Please check your internet connectivity'),
220
+      actions: <Widget>[
221
+        Column(
222
+          children: [
223
+            SizedBox(
224
+              width: 250,
225
+              height: 250,
226
+              child: LottieBuilder.asset(
227
+                  //'assets/animation/animation_no_internet.json',
228
+                  'assets/animation/animation_no_internet_3.json',
229
+                  repeat: true),
230
+            ),
231
+          ],
232
+        ),
233
+        TextButton(
234
+          onPressed: () async {
235
+            Navigator.pop(context, 'Cancel');
236
+            setState(() => isAlertSet = false);
237
+            isDeviceConnected = await InternetConnectionChecker().hasConnection;
238
+            if (!isDeviceConnected && isAlertSet == false) {
239
+              showDialogBox();
240
+              setState(() => isAlertSet = true);
241
+            }
242
+          },
243
+          child: const Text('Retry'),
244
+        ),
245
+      ],
246
+    ),
247
+  );
210
 }
248
 }
211
 
249
 
212
 class HomeScreen extends StatefulWidget {
250
 class HomeScreen extends StatefulWidget {
220
     final SharedPreferences prefs = await SharedPreferences.getInstance();
258
     final SharedPreferences prefs = await SharedPreferences.getInstance();
221
     final session = prefs.getString('session');
259
     final session = prefs.getString('session');
222
 
260
 
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 {
261
     GetProfileImage_Post.connectToAPI(session!).then((valueResult) async {
247
       Map<String, dynamic> object = json.decode(valueResult);
262
       Map<String, dynamic> object = json.decode(valueResult);
248
       if (object.containsKey("result").toString() == "true") {
263
       if (object.containsKey("result").toString() == "true") {
258
             Uint8List decodedBytes = Base64Decoder().convert(photo);
273
             Uint8List decodedBytes = Base64Decoder().convert(photo);
259
             //logDev.log(decodedBytes.toString(), name: "DECODED BYTES photo");
274
             //logDev.log(decodedBytes.toString(), name: "DECODED BYTES photo");
260
             setState(() {
275
             setState(() {
261
-              _imageToShow = Image
262
-                  .memory(decodedBytes, gaplessPlayback: true)
263
-                  .image;
276
+              _imageToShow = Image.memory(decodedBytes, gaplessPlayback: true).image;
264
             });
277
             });
265
           }
278
           }
266
         } else if (status == "failed") {
279
         } else if (status == "failed") {
292
   Widget build(BuildContext context) {
305
   Widget build(BuildContext context) {
293
     var size = MediaQuery.of(context).size;
306
     var size = MediaQuery.of(context).size;
294
 
307
 
295
-    /*ProgressDialog loading = ProgressDialog(context);
296
-    loading = ProgressDialog(context,
297
-    type: ProgressDialogType.normal,
298
-    isDismissible: false,
299
-    showLogs: true);
300
-    loading.style(
301
-    message: 'Please Wait .....',
302
-    borderRadius: 5,
303
-    backgroundColor: Colors.white,
304
-    progressWidget: CircularProgressIndicator(),
305
-    elevation: 10.0,
306
-    padding: EdgeInsets.all(10),
307
-    insetAnimCurve: Curves.easeInOut,
308
-    progress: 0.0,
309
-    maxProgress: 100.0,
310
-    progressTextStyle: TextStyle(
311
-    color: Colors.black, fontSize: 10.0, fontWeight: FontWeight.w400),
312
-    messageTextStyle: TextStyle(
313
-    color: Colors.black,
314
-    fontSize: 15.0,
315
-    fontWeight: FontWeight.w600));*/
316
-
317
     return FocusDetector(
308
     return FocusDetector(
318
       /*onVisibilityGained: (){
309
       /*onVisibilityGained: (){
319
         getProfileImage();
310
         getProfileImage();
320
-        loading.hide();
321
       },
311
       },
322
       onVisibilityLost: (){
312
       onVisibilityLost: (){
323
         getProfileImage();
313
         getProfileImage();
324
-        loading.hide();
325
       },
314
       },
326
       onFocusLost: (){
315
       onFocusLost: (){
327
         getProfileImage();
316
         getProfileImage();
328
-        loading.hide();
329
       },*/
317
       },*/
330
       onFocusGained: (){
318
       onFocusGained: (){
331
         getProfileImage();
319
         getProfileImage();
332
-        //loading.hide();
333
       },
320
       },
334
 /*      onForegroundLost: (){
321
 /*      onForegroundLost: (){
335
         getProfileImage();
322
         getProfileImage();
336
-        loading.hide();
337
       },
323
       },
338
       onForegroundGained: (){
324
       onForegroundGained: (){
339
         getProfileImage();
325
         getProfileImage();
340
-        loading.hide();
341
       },*/
326
       },*/
342
       child: Scaffold(
327
       child: Scaffold(
343
           body: SingleChildScrollView(
328
           body: SingleChildScrollView(

+ 3
- 23
lib/Screens/Login/login_screen.dart View File

18
 import 'inputWidget.dart';
18
 import 'inputWidget.dart';
19
 import 'dart:developer' as logDev;
19
 import 'dart:developer' as logDev;
20
 //import 'package:plain_notification_token/plain_notification_token.dart';
20
 //import 'package:plain_notification_token/plain_notification_token.dart';
21
-import 'dart:io' show Platform;
22
 
21
 
23
 class LoginView extends StatefulWidget {
22
 class LoginView extends StatefulWidget {
24
   @override
23
   @override
51
   String version = "1.0.0";
50
   String version = "1.0.0";
52
   String notif_token = "";
51
   String notif_token = "";
53
 
52
 
54
-  String _pushToken = '0819';
55
-  //IosNotificationSettings? _settings;
56
   late StreamSubscription onTokenRefreshSubscription;
53
   late StreamSubscription onTokenRefreshSubscription;
57
 
54
 
58
   @override
55
   @override
59
   void initState() {
56
   void initState() {
60
-    /*WidgetsBinding.instance.addPostFrameCallback((_) {
61
-      getNotifToken();
62
-    });*/
63
     super.initState();
57
     super.initState();
64
   }
58
   }
65
-  
66
-  /*getNotifToken () async {
67
-    await Firebase.initializeApp(
68
-      options: DefaultFirebaseOptions.currentPlatform,
69
-    );
70
-    final notif_token = await FirebaseMessaging.instance.getToken();
71
-    logDev.log(notif_token.toString(), name: "NOTIFICATION TOKEN");
72
-  }*/
73
 
59
 
74
   @override
60
   @override
75
   Widget build(BuildContext context) {
61
   Widget build(BuildContext context) {
201
                                           platform(),
187
                                           platform(),
202
                                           imei)
188
                                           imei)
203
                                       .then((valueResult) async {
189
                                       .then((valueResult) async {
204
-                                    // loginPostResult = valueResult;
205
                                     Map<String, dynamic> object = json.decode(valueResult);
190
                                     Map<String, dynamic> object = json.decode(valueResult);
206
                                     if (object.containsKey("result").toString() == "true") {
191
                                     if (object.containsKey("result").toString() == "true") {
207
                                       String status = object['result']['status'].toString();
192
                                       String status = object['result']['status'].toString();
225
                                         passwordController.clear();
210
                                         passwordController.clear();
226
 
211
 
227
                                         await loading.hide();
212
                                         await loading.hide();
228
-                                        Navigator.pushReplacement(
229
-                                            context,
230
-                                            MaterialPageRoute(
231
-                                                builder: (context) =>
232
-                                                    HomeView()));
213
+                                        Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) => HomeView()));
233
                                       } else if (status == "failed") {
214
                                       } else if (status == "failed") {
234
-                                        String message = object['result']
235
-                                                ['message']
236
-                                            .toString();
215
+                                        String message = object['result']['message'].toString();
237
                                         Fluttertoast.showToast(
216
                                         Fluttertoast.showToast(
238
                                             msg: message,
217
                                             msg: message,
239
                                             toastLength: Toast.LENGTH_SHORT,
218
                                             toastLength: Toast.LENGTH_SHORT,
405
   // show the dialog
384
   // show the dialog
406
   showDialog(
385
   showDialog(
407
     context: context,
386
     context: context,
387
+    barrierDismissible: false,
408
     builder: (BuildContext context) {
388
     builder: (BuildContext context) {
409
       return alert;
389
       return alert;
410
     },
390
     },

+ 99
- 21
lib/Screens/Menu/Absensi/absensi_history_screen.dart View File

1
 import 'dart:convert';
1
 import 'dart:convert';
2
 import 'package:flutter/material.dart';
2
 import 'package:flutter/material.dart';
3
 import 'package:google_fonts/google_fonts.dart';
3
 import 'package:google_fonts/google_fonts.dart';
4
+import 'package:hris_selfservice_mobile/constants.dart';
4
 import 'package:intl/intl.dart';
5
 import 'package:intl/intl.dart';
5
 import 'package:progress_dialog_null_safe/progress_dialog_null_safe.dart';
6
 import 'package:progress_dialog_null_safe/progress_dialog_null_safe.dart';
6
 import 'dart:developer' as logDev;
7
 import 'dart:developer' as logDev;
25
   late List <String> dayDate_List;
26
   late List <String> dayDate_List;
26
   late List <String> date_List;
27
   late List <String> date_List;
27
   late List <String> month_List;
28
   late List <String> month_List;
29
+
28
   //late List <String> workingHours_List;
30
   //late List <String> workingHours_List;
29
   late List <String> showCheckIn_List;
31
   late List <String> showCheckIn_List;
30
   late List <String> showCheckOut_List;
32
   late List <String> showCheckOut_List;
31
 
33
 
32
   int HistoryLength = 0;
34
   int HistoryLength = 0;
33
 
35
 
36
+  //List Visibility Double Date
37
+  late List <bool> visibilityDate2;
38
+
34
   @override
39
   @override
35
   initState() {
40
   initState() {
36
     super.initState();
41
     super.initState();
43
     dayDate_List = [""];
48
     dayDate_List = [""];
44
     date_List = [""];
49
     date_List = [""];
45
     month_List = [""];
50
     month_List = [""];
51
+
46
     //workingHours_List = [""];
52
     //workingHours_List = [""];
47
     showCheckIn_List = [""];
53
     showCheckIn_List = [""];
48
     showCheckOut_List = [""];
54
     showCheckOut_List = [""];
49
 
55
 
56
+    visibilityDate2 = [false];
57
+
50
     WidgetsBinding.instance.addPostFrameCallback((_) async {
58
     WidgetsBinding.instance.addPostFrameCallback((_) async {
51
       getHistoryData();
59
       getHistoryData();
52
     });
60
     });
102
                 String showCheckInTime = checkInTimeLocal.substring(11, 19);
110
                 String showCheckInTime = checkInTimeLocal.substring(11, 19);
103
                 //logDev.log(showCheckInTime.substring(0,5), name: "SHOW CHECK IN TIME");
111
                 //logDev.log(showCheckInTime.substring(0,5), name: "SHOW CHECK IN TIME");
104
 
112
 
105
-                date_List.add(date);
106
-                month_List.add(month);
113
+                date_List.add(date + "|00");
114
+                month_List.add(month + "|000");
107
                 showCheckIn_List.add(showCheckInTime.substring(0,5));
115
                 showCheckIn_List.add(showCheckInTime.substring(0,5));
116
+                //visibilityDate2[i+1] = false;
108
               }
117
               }
109
               if (check_out != "false"){
118
               if (check_out != "false"){
110
                 //Convert UTC to Local Time - Check Out Time
119
                 //Convert UTC to Local Time - Check Out Time
115
                 String showCheckOutTime = checkOutTimeLocal.substring(11, 19);
124
                 String showCheckOutTime = checkOutTimeLocal.substring(11, 19);
116
                 //logDev.log(showCheckOutTime, name: "SHOW CHECK OUT TIME");
125
                 //logDev.log(showCheckOutTime, name: "SHOW CHECK OUT TIME");
117
                 showCheckOut_List.add(showCheckOutTime.substring(0,5));
126
                 showCheckOut_List.add(showCheckOutTime.substring(0,5));
127
+                //visibilityDate2[i+1] = true;
118
 
128
 
119
                 if (check_in.substring(0, 10) == check_out.substring(0,10)){
129
                 if (check_in.substring(0, 10) == check_out.substring(0,10)){
120
                   //Get Day Check In
130
                   //Get Day Check In
121
-                  String dayDate = DateFormat('EEEE').format(DateTime.parse(check_in));
122
-                  dayDate_List.add(dayDate.substring(0,3));
131
+                  String dayDateIn = DateFormat('EEEE').format(DateTime.parse(check_in));
132
+                  String dateIn = DateFormat('dd').format(DateTime.parse(check_in));
133
+                  String monthIn = DateFormat('MMM').format(DateTime.parse(check_in));
134
+
135
+                  //dayDate_List.add(dayDate.substring(0,3));
136
+                  dayDate_List.add(dayDateIn.substring(0,3) + "|000");
137
+                  date_List[i+1] = dateIn + "|00";
138
+                  month_List[i+1] = monthIn + "|000";
139
+                  visibilityDate2[i+1] = false;
140
+
123
                 } else if (check_in.substring(0, 10) != check_out.substring(0,10)){
141
                 } else if (check_in.substring(0, 10) != check_out.substring(0,10)){
124
                   //Get Day Check In & Check Out
142
                   //Get Day Check In & Check Out
125
                   String dayDateIn = DateFormat('EEEE').format(DateTime.parse(check_in));
143
                   String dayDateIn = DateFormat('EEEE').format(DateTime.parse(check_in));
126
-                  String dayDateOut = DateFormat('EEEE').format(DateTime.parse(check_in));
127
-                  dayDate_List.add(dayDateIn.substring(0,3) + "\t" + dayDateOut.substring(0,3));
144
+                  String dayDateOut = DateFormat('EEEE').format(DateTime.parse(check_out));
145
+
146
+                  String dateIn = DateFormat('dd').format(DateTime.parse(check_in));
147
+                  String monthIn = DateFormat('MMM').format(DateTime.parse(check_in));
148
+
149
+                  String dateOut = DateFormat('dd').format(DateTime.parse(check_out));
150
+                  String monthOut = DateFormat('MMM').format(DateTime.parse(check_out));
151
+
152
+                  logDev.log(dateIn + "\n" + monthIn + "\n" + dateOut + "\n" + monthOut, name: "ABSENSI IN OUT TIDAK SAMA");
153
+
154
+                  dayDate_List.add(dayDateIn.substring(0,3) + "|" + dayDateOut.substring(0,3));
155
+                  date_List[i+1] = dateIn + "|" + dateOut;
156
+                  month_List[i+1] = monthIn + "|" + monthOut;
157
+
158
+                  visibilityDate2[i+1] = true;
159
+
160
+                  logDev.log(dayDate_List.toString() + "\n" + date_List.toString() + "\n" + month_List.toString(), name: "LIST ABSENSI IN OUT TIDAK SAMA");
128
                 }
161
                 }
129
               }
162
               }
163
+
130
               if (check_in == "false"){
164
               if (check_in == "false"){
131
                 String show_check_in = "-";
165
                 String show_check_in = "-";
132
                 showCheckIn_List.add(show_check_in);
166
                 showCheckIn_List.add(show_check_in);
138
                 showCheckOut_List.add(show_check_out);
172
                 showCheckOut_List.add(show_check_out);
139
 
173
 
140
                 String dayDate = DateFormat('EEEE').format(DateTime.parse(check_in));
174
                 String dayDate = DateFormat('EEEE').format(DateTime.parse(check_in));
141
-                dayDate_List.add(dayDate.substring(0,3));
175
+                dayDate_List.add(dayDate.substring(0,3) + "|000");
142
               }
176
               }
143
               if (check_in != "false" && check_out != "false"){
177
               if (check_in != "false" && check_out != "false"){
144
                 DateFormat format = DateFormat("HH:mm");
178
                 DateFormat format = DateFormat("HH:mm");
163
             dayDate_List.removeAt(0);
197
             dayDate_List.removeAt(0);
164
             date_List.removeAt(0);
198
             date_List.removeAt(0);
165
             month_List.removeAt(0);
199
             month_List.removeAt(0);
200
+
166
             //workingHours_List.removeAt(0);
201
             //workingHours_List.removeAt(0);
167
             showCheckIn_List.removeAt(0);
202
             showCheckIn_List.removeAt(0);
168
             showCheckOut_List.removeAt(0);
203
             showCheckOut_List.removeAt(0);
169
 
204
 
205
+            visibilityDate2.removeAt(0);
206
+
170
             HistoryLength = historyAbsensi.length;
207
             HistoryLength = historyAbsensi.length;
171
           });
208
           });
172
         }
209
         }
236
                           child: Row(
273
                           child: Row(
237
                             children: [
274
                             children: [
238
                               Expanded(
275
                               Expanded(
239
-                                  flex: 2,
276
+                                  flex: 3,
240
                                   child:
277
                                   child:
241
                                   Container(
278
                                   Container(
279
+                                    alignment: Alignment.center,
242
                                     padding: EdgeInsets.all(5),
280
                                     padding: EdgeInsets.all(5),
243
                                     decoration: BoxDecoration(
281
                                     decoration: BoxDecoration(
244
                                         border: Border.all(color: Colors.black),
282
                                         border: Border.all(color: Colors.black),
245
                                         borderRadius: BorderRadius.all(Radius.circular(3)),
283
                                         borderRadius: BorderRadius.all(Radius.circular(3)),
246
                                     ),
284
                                     ),
247
                                     child: Column(
285
                                     child: Column(
286
+                                      mainAxisAlignment: MainAxisAlignment.center,
248
                                       children: [
287
                                       children: [
249
-                                        Text(dayDate_List[i], style: GoogleFonts.fredokaOne(fontSize: 16, color: Colors.blueGrey)),
250
-                                        Text(date_List[i], style: GoogleFonts.fredokaOne(fontSize: 16, color: Colors.blueGrey)),
251
-                                        Text(month_List[i], style: GoogleFonts.fredokaOne(fontSize: 16, color: Colors.blueGrey)),
288
+                                        Row(
289
+                                          children: [
290
+                                            Text(dayDate_List[i].substring(0,3), style: GoogleFonts.fredokaOne(fontSize: 15, color: Colors.blueGrey)),
291
+                                            Visibility(
292
+                                              visible: visibilityDate2[i],
293
+                                              child: Text("\t|\t", style: GoogleFonts.fredokaOne(fontSize: 15, color: Colors.blueGrey)),
294
+                                            ),
295
+                                            Visibility(
296
+                                              visible: visibilityDate2[i],
297
+                                              child: Text(dayDate_List[i].substring(4,7), style: GoogleFonts.fredokaOne(fontSize: 15, color: Colors.blueGrey)),
298
+                                            )
299
+                                          ],
300
+                                        ),
301
+                                        Row(
302
+                                          children: [
303
+                                            Text(date_List[i].substring(0,2), style: GoogleFonts.fredokaOne(fontSize: 15, color: Colors.blueGrey)),
304
+                                            Visibility(
305
+                                              visible: visibilityDate2[i],
306
+                                              child: Text("\t|\t", style: GoogleFonts.fredokaOne(fontSize: 15, color: Colors.blueGrey)),
307
+                                            ),
308
+                                            Visibility(
309
+                                              visible: visibilityDate2[i],
310
+                                              child: Text(date_List[i].substring(3,5), style: GoogleFonts.fredokaOne(fontSize: 15, color: Colors.blueGrey)),
311
+                                            ),
312
+                                          ],
313
+                                        ),
314
+                                        Row(
315
+                                          children: [
316
+                                            Text(month_List[i].substring(0,3), style: GoogleFonts.fredokaOne(fontSize: 15, color: Colors.blueGrey)),
317
+                                            Visibility(
318
+                                              visible: visibilityDate2[i],
319
+                                              child: Text("\t|\t", style: GoogleFonts.fredokaOne(fontSize: 15, color: Colors.blueGrey)),
320
+                                            ),
321
+                                            Visibility(
322
+                                              visible: visibilityDate2[i],
323
+                                              child: Text(month_List[i].substring(4,7), style: GoogleFonts.fredokaOne(fontSize: 15, color: Colors.blueGrey)),
324
+                                            )
325
+                                          ],
326
+                                        ),
252
                                       ],
327
                                       ],
253
-                                    ),
328
+                                    )
329
+                                    ,
254
                                   )
330
                                   )
255
                               ),
331
                               ),
256
                               Expanded(
332
                               Expanded(
257
                                 flex: 2,
333
                                 flex: 2,
258
                                 child: Column(
334
                                 child: Column(
259
                                   children: [
335
                                   children: [
260
-                                    Text("Check In", style: GoogleFonts.fredokaOne(fontSize: 17),),
261
-                                    Text(showCheckIn_List[i], style: GoogleFonts.barlowSemiCondensed(fontSize: 17),),
336
+                                    Text("Check In", style: GoogleFonts.fredokaOne(fontSize: 16),textAlign: TextAlign.center),
337
+                                    Text(showCheckIn_List[i], style: GoogleFonts.barlowSemiCondensed(fontSize: 16),textAlign: TextAlign.center),
262
                                   ],
338
                                   ],
263
                                 ),
339
                                 ),
264
                               ),
340
                               ),
266
                                 flex: 2,
342
                                 flex: 2,
267
                                 child: Column(
343
                                 child: Column(
268
                                   children: [
344
                                   children: [
269
-                                    Text("Check Out", style: GoogleFonts.fredokaOne(fontSize: 16),),
270
-                                    Text(showCheckOut_List[i], style: GoogleFonts.barlowSemiCondensed(fontSize: 17),),
345
+                                    Text("Check Out", style: GoogleFonts.fredokaOne(fontSize: 16),textAlign: TextAlign.center),
346
+                                    Text(showCheckOut_List[i], style: GoogleFonts.barlowSemiCondensed(fontSize: 16),textAlign: TextAlign.center),
271
                                   ],
347
                                   ],
272
                                 ),
348
                                 ),
273
                               ),
349
                               ),
274
                               Expanded(
350
                               Expanded(
275
-                                flex: 3,
351
+                                flex: 2,
276
                                 child: Column(
352
                                 child: Column(
277
                                   children: [
353
                                   children: [
278
-                                    Text("Working Hours", style: GoogleFonts.fredokaOne(fontSize: 16),),
279
-                                    Text(worked_hours_List[i], style: GoogleFonts.barlowSemiCondensed(fontSize: 17),),
354
+                                    Text("Working\nHours", style: GoogleFonts.fredokaOne(fontSize: 16), textAlign: TextAlign.center),
355
+                                    Text(worked_hours_List[i], style: GoogleFonts.barlowSemiCondensed(fontSize: 16),textAlign: TextAlign.center),
280
                                   ],
356
                                   ],
281
                                 ),
357
                                 ),
282
                               ),
358
                               ),
319
 
395
 
320
   // set up the AlertDialog
396
   // set up the AlertDialog
321
   AlertDialog alert = AlertDialog(
397
   AlertDialog alert = AlertDialog(
322
-    title: Text("Employee Self Service"),
398
+    title: Text(appName),
323
     content: Text("Failed to Retrieve Data"),
399
     content: Text("Failed to Retrieve Data"),
324
     actions: [
400
     actions: [
325
       noButton,
401
       noButton,
330
   // show the dialog
406
   // show the dialog
331
   showDialog(
407
   showDialog(
332
     context: context,
408
     context: context,
409
+    barrierDismissible: false,
333
     builder: (BuildContext context) {
410
     builder: (BuildContext context) {
334
       return alert;
411
       return alert;
335
     },
412
     },
357
 
434
 
358
   // set up the AlertDialog
435
   // set up the AlertDialog
359
   AlertDialog alert = AlertDialog(
436
   AlertDialog alert = AlertDialog(
360
-    title: Text("Employee Self Service"),
437
+    title: Text(appName),
361
     content: Text("Server Response Error"),
438
     content: Text("Server Response Error"),
362
     actions: [
439
     actions: [
363
       noButton,
440
       noButton,
368
   // show the dialog
445
   // show the dialog
369
   showDialog(
446
   showDialog(
370
     context: context,
447
     context: context,
448
+    barrierDismissible: false,
371
     builder: (BuildContext context) {
449
     builder: (BuildContext context) {
372
       return alert;
450
       return alert;
373
     },
451
     },

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

723
   // show the dialog
723
   // show the dialog
724
   showDialog(
724
   showDialog(
725
     context: context,
725
     context: context,
726
+    barrierDismissible: false,
726
     builder: (BuildContext context) {
727
     builder: (BuildContext context) {
727
       return alert;
728
       return alert;
728
     },
729
     },
760
   // show the dialog
761
   // show the dialog
761
   showDialog(
762
   showDialog(
762
     context: context,
763
     context: context,
764
+    barrierDismissible: false,
763
     builder: (BuildContext context) {
765
     builder: (BuildContext context) {
764
       return alert;
766
       return alert;
765
     },
767
     },
788
   // show the dialog
790
   // show the dialog
789
   showDialog(
791
   showDialog(
790
     context: context,
792
     context: context,
793
+    barrierDismissible: false,
791
     builder: (BuildContext context) {
794
     builder: (BuildContext context) {
792
       return alert;
795
       return alert;
793
     },
796
     },
816
   // show the dialog
819
   // show the dialog
817
   showDialog(
820
   showDialog(
818
     context: context,
821
     context: context,
822
+    barrierDismissible: false,
819
     builder: (BuildContext context) {
823
     builder: (BuildContext context) {
820
       return alert;
824
       return alert;
821
     },
825
     },
844
   // show the dialog
848
   // show the dialog
845
   showDialog(
849
   showDialog(
846
     context: context,
850
     context: context,
851
+    barrierDismissible: false,
847
     builder: (BuildContext context) {
852
     builder: (BuildContext context) {
848
       return alert;
853
       return alert;
849
     },
854
     },
872
   // show the dialog
877
   // show the dialog
873
   showDialog(
878
   showDialog(
874
     context: context,
879
     context: context,
880
+    barrierDismissible: false,
875
     builder: (BuildContext context) {
881
     builder: (BuildContext context) {
876
       return alert;
882
       return alert;
877
     },
883
     },
900
   // show the dialog
906
   // show the dialog
901
   showDialog(
907
   showDialog(
902
     context: context,
908
     context: context,
909
+    barrierDismissible: false,
903
     builder: (BuildContext context) {
910
     builder: (BuildContext context) {
904
       return alert;
911
       return alert;
905
     },
912
     },
938
   // show the dialog
945
   // show the dialog
939
   showDialog(
946
   showDialog(
940
     context: context,
947
     context: context,
948
+    barrierDismissible: false,
941
     builder: (BuildContext context) {
949
     builder: (BuildContext context) {
942
       return alert;
950
       return alert;
943
     },
951
     },
964
   // show the dialog
972
   // show the dialog
965
   showDialog(
973
   showDialog(
966
     context: context,
974
     context: context,
975
+    barrierDismissible: false,
967
     builder: (BuildContext context) {
976
     builder: (BuildContext context) {
968
       return alert;
977
       return alert;
969
     },
978
     },

+ 113
- 36
lib/Screens/Menu/SlipGaji/slipgaji_screen.dart View File

2
 
2
 
3
 import 'package:flutter/cupertino.dart';
3
 import 'package:flutter/cupertino.dart';
4
 import 'package:flutter/material.dart';
4
 import 'package:flutter/material.dart';
5
-import 'package:fluttertoast/fluttertoast.dart';
6
 import 'package:google_fonts/google_fonts.dart';
5
 import 'package:google_fonts/google_fonts.dart';
7
 import 'package:hris_selfservice_mobile/Screens/Menu/SlipGaji/RequestHttp/detailSlipGaji_post.dart';
6
 import 'package:hris_selfservice_mobile/Screens/Menu/SlipGaji/RequestHttp/detailSlipGaji_post.dart';
8
 import 'package:hris_selfservice_mobile/Screens/Menu/SlipGaji/RequestHttp/downloadSlipGaji_post.dart';
7
 import 'package:hris_selfservice_mobile/Screens/Menu/SlipGaji/RequestHttp/downloadSlipGaji_post.dart';
9
 import 'package:hris_selfservice_mobile/Screens/Menu/SlipGaji/RequestHttp/historySlipGaji_post.dart';
8
 import 'package:hris_selfservice_mobile/Screens/Menu/SlipGaji/RequestHttp/historySlipGaji_post.dart';
10
 import 'package:hris_selfservice_mobile/Screens/Menu/SlipGaji/background.dart';
9
 import 'package:hris_selfservice_mobile/Screens/Menu/SlipGaji/background.dart';
10
+import 'package:hris_selfservice_mobile/constants.dart';
11
 import 'package:progress_dialog_null_safe/progress_dialog_null_safe.dart';
11
 import 'package:progress_dialog_null_safe/progress_dialog_null_safe.dart';
12
 import 'dart:developer' as logDev;
12
 import 'dart:developer' as logDev;
13
 
13
 
14
 import 'package:shared_preferences/shared_preferences.dart';
14
 import 'package:shared_preferences/shared_preferences.dart';
15
+import 'package:url_launcher/url_launcher.dart';
15
 
16
 
16
 class SlipGajiScreen extends StatefulWidget {
17
 class SlipGajiScreen extends StatefulWidget {
17
   const SlipGajiScreen({Key? key}) : super(key: key);
18
   const SlipGajiScreen({Key? key}) : super(key: key);
145
       } else {
146
       } else {
146
         setState((){
147
         setState((){
147
           alertDialogFailedResponse(context);
148
           alertDialogFailedResponse(context);
148
-         /* Fluttertoast.showToast(
149
-              msg: "Server Response Error",
150
-              toastLength: Toast.LENGTH_SHORT,
151
-              gravity: ToastGravity.CENTER,
152
-              timeInSecForIosWeb: 1,
153
-              textColor: Colors.white,
154
-              fontSize: 16.0);*/
155
         });
149
         });
156
         loading.hide();
150
         loading.hide();
157
       }
151
       }
179
             color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600));
173
             color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600));
180
     loading.show();
174
     loading.show();
181
 
175
 
182
-    //logDev.log(batchID_List.toString(), name: "ALL BATCH ID");
183
-
184
     final SharedPreferences prefs = await SharedPreferences.getInstance();
176
     final SharedPreferences prefs = await SharedPreferences.getInstance();
185
       DetailSlipGaji_Post.connectToAPI(batchID_List[indexBatchID]).then((valueResult) async {
177
       DetailSlipGaji_Post.connectToAPI(batchID_List[indexBatchID]).then((valueResult) async {
186
         Map<String, dynamic> object = json.decode(valueResult);
178
         Map<String, dynamic> object = json.decode(valueResult);
193
               alertDialogFailedRetrievedData(context);
185
               alertDialogFailedRetrievedData(context);
194
             });
186
             });
195
           } else {
187
           } else {
196
-            //List <dynamic> detailSlipGaji = object['result'];
188
+            List <dynamic> detailSlipGaji = object['result'];
197
             setState(() {
189
             setState(() {
198
               position = prefs.getString('position')!;
190
               position = prefs.getString('position')!;
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());
191
+              logDev.log(position, name: "POSITION");
192
+              for (int i = 0; i < detailSlipGaji.length; i++){
193
+                String nomor = detailSlipGaji[i]['number'].toString();
194
+                logDev.log(nomor, name: "NOMOR/NUMBER");
195
+                String tanggalAwal = detailSlipGaji[i]['date_from'];
196
+                String tanggalAkhir = detailSlipGaji[i]['date_to'];
197
+                String namaPegawai = detailSlipGaji[i]['employee'];
198
+                String status = detailSlipGaji[i]['status'];
199
+                String structure =detailSlipGaji[i]['structure'];
200
+                //number_List.add(nomor);
201
+                structure_List.add(structure);
202
+                period_List.add(tanggalAwal + " to " + tanggalAkhir);
203
+                namaPegawai_List.add(namaPegawai);
204
+                status_List.add(status);
205
+
206
+                List <dynamic> component =detailSlipGaji[i]['component'];
207
+                logDev.log(component.length.toString(), name: "BANYAK COMPONENT");
208
+                for (int j = 0; j < component.length; j++){
209
+                  String name = component[j]['name'].toString();
210
+                  String category = component[j]['category'].toString();
211
+                  double total = component[j]['total'];
212
+
213
+                  name_List.add(name);
214
+                  category_List.add(category);
215
+                  total_List.add(total.toString());
216
+                }
221
               }
217
               }
222
 
218
 
219
+
223
               number_List.remove(0);
220
               number_List.remove(0);
224
               structure_List.removeAt(0);
221
               structure_List.removeAt(0);
225
               period_List.removeAt(0);
222
               period_List.removeAt(0);
391
                         alignment: Alignment.centerRight,
388
                         alignment: Alignment.centerRight,
392
                         child: ElevatedButton(
389
                         child: ElevatedButton(
393
                           onPressed: () {
390
                           onPressed: () {
394
-                            DownloadSlipGaji_Post.connectToAPI(batch_id).then((value) => null)
391
+                            ProgressDialog loading = ProgressDialog(context);
392
+                            loading = ProgressDialog(context,
393
+                                type: ProgressDialogType.normal, isDismissible: false, showLogs: true);
394
+                            loading.style(
395
+                                message: 'Please Wait .....',
396
+                                borderRadius: 3,
397
+                                backgroundColor: Colors.white,
398
+                                progressWidget: CircularProgressIndicator(),
399
+                                elevation: 10.0,
400
+                                padding: EdgeInsets.all(10),
401
+                                insetAnimCurve: Curves.easeInOut,
402
+                                progress: 0.0,
403
+                                maxProgress: 100.0,
404
+                                progressTextStyle: TextStyle(
405
+                                    color: Colors.black, fontSize: 10.0, fontWeight: FontWeight.w400),
406
+                                messageTextStyle: TextStyle(
407
+                                    color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600));
408
+                            loading.show();
409
+
410
+                            DownloadSlipGaji_Post.connectToAPI(batchID_List[indexBatchID]).then((valueResult) async {
411
+                              Map<String, dynamic> object = json.decode(valueResult);
412
+                              if (object.containsKey("result").toString() == "true"){
413
+                                String result = object['result'].toString();
414
+                                if (result.contains("failed")) {
415
+                                  loading.hide();
416
+                                  setState(() {
417
+                                    alertDialogFailedDownloadPayslip(context);
418
+                                  });
419
+                                } else if (result.contains("url")){
420
+                                  loading.hide();
421
+                                  setState(() {
422
+                                    //_launchURL(Uri.parse(baseURL + object['result']['url'].toString()));
423
+                                    Uri url = Uri.parse(Uri.encodeFull(baseURL + object['result']['url'.toString()]));
424
+                                    launchUrl(url, mode: LaunchMode.externalApplication);
425
+                                  });
426
+                                }
427
+                              } else {
428
+                                loading.hide();
429
+                                setState((){
430
+                                  alertDialogFailedResponse(context);
431
+                                });
432
+                              }
433
+                            });
395
                           },
434
                           },
396
                           style: ElevatedButton.styleFrom(),
435
                           style: ElevatedButton.styleFrom(),
397
                           child: Text('Download Slip Gaji'),
436
                           child: Text('Download Slip Gaji'),
414
   Color(0xFF03A0FE),
453
   Color(0xFF03A0FE),
415
 ];
454
 ];
416
 
455
 
456
+launchURL(Uri url) async {
457
+  if (await canLaunchUrl(url)) {
458
+    await launchUrl(url);
459
+  } else {
460
+    throw 'Could not launch $url';
461
+  }
462
+}
417
 
463
 
418
 alertDialogFailedRetrievedData(BuildContext context){
464
 alertDialogFailedRetrievedData(BuildContext context){
419
   Widget okButton = TextButton(
465
   Widget okButton = TextButton(
436
 
482
 
437
   // set up the AlertDialog
483
   // set up the AlertDialog
438
   AlertDialog alert = AlertDialog(
484
   AlertDialog alert = AlertDialog(
439
-    title: Text("Employee Self Service"),
485
+    title: Text(appName),
440
     content: Text("Failed to Retrieve Data"),
486
     content: Text("Failed to Retrieve Data"),
441
     actions: [
487
     actions: [
442
       noButton,
488
       noButton,
447
   // show the dialog
493
   // show the dialog
448
   showDialog(
494
   showDialog(
449
     context: context,
495
     context: context,
496
+    barrierDismissible: false,
450
     builder: (BuildContext context) {
497
     builder: (BuildContext context) {
451
       return alert;
498
       return alert;
452
     },
499
     },
474
 
521
 
475
   // set up the AlertDialog
522
   // set up the AlertDialog
476
   AlertDialog alert = AlertDialog(
523
   AlertDialog alert = AlertDialog(
477
-    title: Text("Employee Self Service"),
524
+    title: Text(appName),
478
     content: Text("Server Response Error"),
525
     content: Text("Server Response Error"),
479
     actions: [
526
     actions: [
480
       noButton,
527
       noButton,
485
   // show the dialog
532
   // show the dialog
486
   showDialog(
533
   showDialog(
487
     context: context,
534
     context: context,
535
+    barrierDismissible: false,
536
+    builder: (BuildContext context) {
537
+      return alert;
538
+    },
539
+  );
540
+}
541
+
542
+alertDialogFailedDownloadPayslip(BuildContext context){
543
+  Widget okButton = TextButton(
544
+    child: Text("Try Again"),
545
+    onPressed: () {
546
+      Navigator.of(context, rootNavigator: true).pop();
547
+      Navigator.pop(context);
548
+
549
+    },
550
+  );
551
+
552
+  // set up the AlertDialog
553
+  AlertDialog alert = AlertDialog(
554
+    title: Text(appName),
555
+    content: Text("Failed to Download Payslip"),
556
+    actions: [
557
+      okButton,
558
+    ],
559
+  );
560
+
561
+  // show the dialog
562
+  showDialog(
563
+    context: context,
564
+    barrierDismissible: false,
488
     builder: (BuildContext context) {
565
     builder: (BuildContext context) {
489
       return alert;
566
       return alert;
490
     },
567
     },

+ 4
- 1
lib/Screens/Settings/RequestHttp/changePassword_post.dart View File

13
 
13
 
14
   ChangePassword_Post({required this.password, required this.new_password, required this.session});
14
   ChangePassword_Post({required this.password, required this.new_password, required this.session});
15
 
15
 
16
-  static Future<String> connectToAPI(String password, String new_password, String session) async {
16
+  static Future<String> connectToAPI(String password, String new_password) async {
17
     String URL = baseURL + "/api/v1/change_password";
17
     String URL = baseURL + "/api/v1/change_password";
18
 
18
 
19
+    final SharedPreferences prefs = await SharedPreferences.getInstance();
20
+    final session = prefs.getString('session');
21
+
19
     var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
22
     var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
20
       "data": [
23
       "data": [
21
         {
24
         {

+ 1
- 1
lib/Screens/Settings/RequestHttp/changeprofileimage_post.dart View File

13
   ChangeProfileImage_Post({required this.session,
13
   ChangeProfileImage_Post({required this.session,
14
     required this.imageBase64});
14
     required this.imageBase64});
15
 
15
 
16
-  static Future<String> connectToAPI(String session, String imageBase64) async {
16
+  static Future<String> connectToAPI(String imageBase64) async {
17
     String URL = baseURL + "/api/v1/change_profile";
17
     String URL = baseURL + "/api/v1/change_profile";
18
 
18
 
19
     final SharedPreferences prefs = await SharedPreferences.getInstance();
19
     final SharedPreferences prefs = await SharedPreferences.getInstance();

+ 1
- 2
lib/Screens/Settings/RequestHttp/getDetail_post.dart View File

3
 import 'package:http/http.dart' as http;
3
 import 'package:http/http.dart' as http;
4
 import 'package:hris_selfservice_mobile/constants.dart';
4
 import 'package:hris_selfservice_mobile/constants.dart';
5
 import 'dart:developer' as developer;
5
 import 'dart:developer' as developer;
6
-
7
 import 'package:shared_preferences/shared_preferences.dart';
6
 import 'package:shared_preferences/shared_preferences.dart';
8
 
7
 
9
 class GetDetail_Post {
8
 class GetDetail_Post {
11
 
10
 
12
   GetDetail_Post({required this.session});
11
   GetDetail_Post({required this.session});
13
 
12
 
14
-  static Future<String> connectToAPI(String session) async {
13
+  static Future<String> connectToAPI() async {
15
     String URL = baseURL + "/api/v1/get_detail";
14
     String URL = baseURL + "/api/v1/get_detail";
16
 
15
 
17
     final SharedPreferences prefs = await SharedPreferences.getInstance();
16
     final SharedPreferences prefs = await SharedPreferences.getInstance();

+ 1
- 1
lib/Screens/Settings/RequestHttp/logout_post.dart View File

11
 
11
 
12
   Logout_Post({required this.session});
12
   Logout_Post({required this.session});
13
 
13
 
14
-  static Future<String> connectToAPI(String session) async {
14
+  static Future<String> connectToAPI() async {
15
     String URL = baseURL + "/api/v1/logout";
15
     String URL = baseURL + "/api/v1/logout";
16
 
16
 
17
     final SharedPreferences prefs = await SharedPreferences.getInstance();
17
     final SharedPreferences prefs = await SharedPreferences.getInstance();

+ 55
- 44
lib/Screens/Settings/settings_screen.dart View File

104
         if (status == "success") {
104
         if (status == "success") {
105
           String photo = object['result']['photo'].toString();
105
           String photo = object['result']['photo'].toString();
106
           if (photo == "false") {
106
           if (photo == "false") {
107
-            _imageToShow = AssetImage('assets/images/ic_administrator.png');
108
-            logDev.log("PHOTO RESULT FALSE", name: "DECODED BYTES");
107
+            setState(() {
108
+              _imageToShow = AssetImage('assets/images/ic_administrator.png');
109
+            });
109
           } else if (photo != "false") {
110
           } else if (photo != "false") {
110
             Uint8List decodedBytes = Base64Decoder().convert(photo);
111
             Uint8List decodedBytes = Base64Decoder().convert(photo);
111
             logDev.log(decodedBytes.toString(), name: "DECODED BYTES photo");
112
             logDev.log(decodedBytes.toString(), name: "DECODED BYTES photo");
112
             setState(() {
113
             setState(() {
113
               _imageToShow = Image.memory(decodedBytes, gaplessPlayback: true).image;
114
               _imageToShow = Image.memory(decodedBytes, gaplessPlayback: true).image;
114
             });
115
             });
115
-            //_imageToShow = Image.memory(base64Decode(photo));
116
-            //logDev.log(_imageToShow.toString(), name: "Image to Show");
117
-            //_imageToShow = AssetImage('assets/images/collaboration.png');
118
           }
116
           }
119
         } else if (status == "failed") {
117
         } else if (status == "failed") {
120
           String message = object['result']['message'].toString();
118
           String message = object['result']['message'].toString();
138
         loading.hide();
136
         loading.hide();
139
       }
137
       }
140
     });
138
     });
141
-    //return Image.memory(decodedBytes);
142
     loading.hide();
139
     loading.hide();
143
     return _imageToShow;
140
     return _imageToShow;
144
   }
141
   }
145
 
142
 
146
   //Get Detail
143
   //Get Detail
147
   getDetail() async {
144
   getDetail() async {
148
-    final SharedPreferences prefs = await SharedPreferences.getInstance();
149
-    final session = prefs.getString('session');
150
-    GetDetail_Post.connectToAPI(session!).then((valueResult) async {
145
+    GetDetail_Post.connectToAPI().then((valueResult) async {
151
       Map<String, dynamic> object = json.decode(valueResult);
146
       Map<String, dynamic> object = json.decode(valueResult);
152
       if (object.containsKey("result").toString() == "true") {
147
       if (object.containsKey("result").toString() == "true") {
153
         statusDetail = object['result']['status'].toString();
148
         statusDetail = object['result']['status'].toString();
154
         String message = object['result']['message'].toString();
149
         String message = object['result']['message'].toString();
155
         if (statusDetail == "failed" || message == "User Not Found") {
150
         if (statusDetail == "failed" || message == "User Not Found") {
156
           Fluttertoast.showToast(
151
           Fluttertoast.showToast(
157
-              msg: message + ", Please login again!",
152
+              msg: message + ", Please restart the Application!",
158
               toastLength: Toast.LENGTH_SHORT,
153
               toastLength: Toast.LENGTH_SHORT,
159
               gravity: ToastGravity.CENTER,
154
               gravity: ToastGravity.CENTER,
160
               timeInSecForIosWeb: 1,
155
               timeInSecForIosWeb: 1,
192
             timeInSecForIosWeb: 1,
187
             timeInSecForIosWeb: 1,
193
             textColor: Colors.white,
188
             textColor: Colors.white,
194
             fontSize: 16.0);
189
             fontSize: 16.0);
190
+
195
       }
191
       }
196
     });
192
     });
197
   }
193
   }
305
                           ),
301
                           ),
306
                         ),
302
                         ),
307
                         onTap: () async {
303
                         onTap: () async {
308
-                          final SharedPreferences prefs =
309
-                              await SharedPreferences.getInstance();
310
-                          final String? session = prefs.getString('session');
311
                           final ImagePicker _picker = ImagePicker();
304
                           final ImagePicker _picker = ImagePicker();
312
                           final XFile? imagePicked = await _picker.pickImage(
305
                           final XFile? imagePicked = await _picker.pickImage(
313
                               source: ImageSource.gallery);
306
                               source: ImageSource.gallery);
314
                           if (imagePicked != null) {
307
                           if (imagePicked != null) {
315
                             _imagePath = File(imagePicked.path);
308
                             _imagePath = File(imagePicked.path);
316
-                            List<int> imageBytes =
317
-                                _imagePath!.readAsBytesSync();
309
+                            List<int> imageBytes = _imagePath!.readAsBytesSync();
318
                             String base64Image = base64Encode(imageBytes);
310
                             String base64Image = base64Encode(imageBytes);
319
-                            logDev.log(base64Image, name: "String base64");
311
+                            //logDev.log(base64Image, name: "String base64");
320
                             await loading.show();
312
                             await loading.show();
321
-                            ChangeProfileImage_Post.connectToAPI(
322
-                                    session!, base64Image)
323
-                                .then((valueResult) async {
324
-                              Map<String, dynamic> object =
325
-                                  json.decode(valueResult);
313
+                            ChangeProfileImage_Post.connectToAPI(base64Image).then((valueResult) async {
314
+                              Map<String, dynamic> object = json.decode(valueResult);
326
                               if (object.containsKey("result").toString() == "true") {
315
                               if (object.containsKey("result").toString() == "true") {
327
                                 String status = object['result']['status'].toString();
316
                                 String status = object['result']['status'].toString();
328
                                 String message = object['result']['message'].toString();
317
                                 String message = object['result']['message'].toString();
329
                                 if (status == "success") {
318
                                 if (status == "success") {
330
-                                  _imageToShow =
331
-                                      FileImage(File(imagePicked.path));
332
-                                  Fluttertoast.showToast(
319
+                                  _imageToShow = FileImage(File(imagePicked.path));
320
+                                 /* Fluttertoast.showToast(
333
                                       msg: message,
321
                                       msg: message,
334
                                       toastLength: Toast.LENGTH_LONG,
322
                                       toastLength: Toast.LENGTH_LONG,
335
                                       gravity: ToastGravity.CENTER,
323
                                       gravity: ToastGravity.CENTER,
336
                                       timeInSecForIosWeb: 1,
324
                                       timeInSecForIosWeb: 1,
337
                                       textColor: Colors.white,
325
                                       textColor: Colors.white,
338
-                                      fontSize: 16.0);
326
+                                      fontSize: 16.0);*/
339
                                   await loading.hide();
327
                                   await loading.hide();
328
+                                  showAlertDialogChangeProfile(context, "Success, " + message, "Ok");
340
                                 } else if (status == "failed") {
329
                                 } else if (status == "failed") {
341
-                                  Fluttertoast.showToast(
330
+                                 /* Fluttertoast.showToast(
342
                                       msg: message,
331
                                       msg: message,
343
                                       toastLength: Toast.LENGTH_LONG,
332
                                       toastLength: Toast.LENGTH_LONG,
344
                                       gravity: ToastGravity.CENTER,
333
                                       gravity: ToastGravity.CENTER,
345
                                       timeInSecForIosWeb: 1,
334
                                       timeInSecForIosWeb: 1,
346
                                       textColor: Colors.white,
335
                                       textColor: Colors.white,
347
-                                      fontSize: 16.0);
336
+                                      fontSize: 16.0);*/
348
                                   await loading.hide();
337
                                   await loading.hide();
338
+                                  showAlertDialogChangeProfile(context, "Failed, " + message, "Back");
349
                                 }
339
                                 }
350
                               } else {
340
                               } else {
351
                                 Fluttertoast.showToast(
341
                                 Fluttertoast.showToast(
799
               fontWeight: FontWeight.w600));
789
               fontWeight: FontWeight.w600));
800
       await loading.show();
790
       await loading.show();
801
 
791
 
802
-      final SharedPreferences prefs = await SharedPreferences.getInstance();
803
-      final session = prefs.getString('session');
804
-      ChangePassword_Post.connectToAPI(passwordController.text.toString(),
805
-              newPasswordController.text.toString(), session!)
806
-          .then((valueResult) async {
792
+      ChangePassword_Post.connectToAPI(passwordController.text.toString(), newPasswordController.text.toString()).then((valueResult) async {
807
         Map<String, dynamic> object = json.decode(valueResult);
793
         Map<String, dynamic> object = json.decode(valueResult);
808
         if (object.containsKey("result").toString() == "true") {
794
         if (object.containsKey("result").toString() == "true") {
809
           String status = object['result']['status'].toString();
795
           String status = object['result']['status'].toString();
821
             newPasswordController.clear();
807
             newPasswordController.clear();
822
             retypeNewPasswordController.clear();
808
             retypeNewPasswordController.clear();
823
 
809
 
824
-            final session = await prefs.remove('session');
810
+            final SharedPreferences prefs = await SharedPreferences.getInstance();
811
+            await prefs.remove('session');
825
             await loading.hide();
812
             await loading.hide();
826
             Navigator.of(context, rootNavigator: true).pop();
813
             Navigator.of(context, rootNavigator: true).pop();
827
-            Navigator.pushReplacement(
828
-                context, MaterialPageRoute(builder: (context) => LoginView()));
814
+            Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) => LoginView()));
829
           } else if (status == "failed") {
815
           } else if (status == "failed") {
830
             Fluttertoast.showToast(
816
             Fluttertoast.showToast(
831
                 msg: message,
817
                 msg: message,
868
   // show the dialog
854
   // show the dialog
869
   showDialog(
855
   showDialog(
870
     context: context,
856
     context: context,
857
+    barrierDismissible: false,
871
     builder: (BuildContext context) {
858
     builder: (BuildContext context) {
872
       return alert;
859
       return alert;
873
     },
860
     },
943
               fontWeight: FontWeight.w600));
930
               fontWeight: FontWeight.w600));
944
       await loading.show();
931
       await loading.show();
945
 
932
 
946
-      final SharedPreferences prefs = await SharedPreferences.getInstance();
947
-      final session = prefs.getString('session');
948
-
949
-      Logout_Post.connectToAPI(session!).then((valueResult) async {
933
+      Logout_Post.connectToAPI().then((valueResult) async {
950
         Map<String, dynamic> object = json.decode(valueResult);
934
         Map<String, dynamic> object = json.decode(valueResult);
951
         if (object.containsKey("result").toString() == "true") {
935
         if (object.containsKey("result").toString() == "true") {
952
           String status = object['result']['status'].toString();
936
           String status = object['result']['status'].toString();
953
           if (status == "success") {
937
           if (status == "success") {
954
-            final session = await prefs.remove('session');
938
+            final SharedPreferences prefs = await SharedPreferences.getInstance();
939
+            await prefs.remove('session');
955
             Navigator.of(context, rootNavigator: true).pop();
940
             Navigator.of(context, rootNavigator: true).pop();
956
             await loading.hide();
941
             await loading.hide();
957
-            Navigator.pushAndRemoveUntil(
958
-                context,
959
-                MaterialPageRoute(builder: (context) => LoginView()),
960
-                (route) => false);
942
+            Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LoginView()), (route) => false);
961
           } else if (status == "failed") {
943
           } else if (status == "failed") {
962
             String message = object['result']['message'].toString();
944
             String message = object['result']['message'].toString();
963
             Fluttertoast.showToast(
945
             Fluttertoast.showToast(
1003
   // show the dialog
985
   // show the dialog
1004
   showDialog(
986
   showDialog(
1005
     context: context,
987
     context: context,
988
+    barrierDismissible: false,
989
+    builder: (BuildContext context) {
990
+      return alert;
991
+    },
992
+  );
993
+}
994
+
995
+//Alert Change Profile
996
+showAlertDialogChangeProfile(BuildContext context, String message, String buttonMessage) {
997
+  // set up the button
998
+  Widget okButton = TextButton(
999
+    child: Text(buttonMessage),
1000
+    onPressed: () {
1001
+      Navigator.of(context, rootNavigator: true).pop();
1002
+    },
1003
+  );
1004
+
1005
+  // set up the AlertDialog
1006
+  AlertDialog alert = AlertDialog(
1007
+    title: Text("Employee Self Service"),
1008
+    content: Text(message),
1009
+    actions: [okButton],
1010
+  );
1011
+
1012
+  // show the dialog
1013
+  showDialog(
1014
+    context: context,
1015
+    barrierDismissible: false,
1006
     builder: (BuildContext context) {
1016
     builder: (BuildContext context) {
1007
       return alert;
1017
       return alert;
1008
     },
1018
     },
1009
   );
1019
   );
1010
 }
1020
 }
1021
+

+ 6
- 14
lib/Screens/Splash/loginstatus_post.dart View File

2
 import 'dart:core';
2
 import 'dart:core';
3
 import 'package:http/http.dart' as http;
3
 import 'package:http/http.dart' as http;
4
 import 'package:hris_selfservice_mobile/constants.dart';
4
 import 'package:hris_selfservice_mobile/constants.dart';
5
-import 'package:shared_preferences/shared_preferences.dart';
6
 import 'dart:developer' as logDev;
5
 import 'dart:developer' as logDev;
7
 
6
 
8
 class LoginStatus_Post {
7
 class LoginStatus_Post {
11
   late String session;
10
   late String session;
12
   late String notif_token;
11
   late String notif_token;
13
 
12
 
14
-  LoginStatus_Post(
15
-      {required this.version,
16
-      required this.device,
17
-      required this.session,
18
-      required this.notif_token});
13
+  LoginStatus_Post({
14
+    required this.version,
15
+    required this.device,
16
+    required this.session,
17
+    required this.notif_token});
19
 
18
 
20
-  static Future<String> connectToAPI(
21
-      String version, String device, String session, String notif_token) async {
19
+  static Future<String> connectToAPI(String version, String device, String session, String notif_token) async {
22
     String URL = baseURL + "/api/v1/login_status";
20
     String URL = baseURL + "/api/v1/login_status";
23
     print(URL);
21
     print(URL);
24
 
22
 
38
 
36
 
39
     logDev.log(sendData.body, name: "Login Status");
37
     logDev.log(sendData.body, name: "Login Status");
40
     return sendData.body;
38
     return sendData.body;
41
-
42
-
43
-    // var jsonObject = json.decode(sendData.body);
44
-    //developer.log(jsonObject.toString(), name: 'Log');
45
-    // return jsonObject;
46
-    // return LoginPostResult.createPostResult(jsonObject);
47
   }
39
   }
48
 }
40
 }

+ 34
- 16
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 'package:flutter/material.dart';
4
 import 'package:flutter/material.dart';
4
 import 'package:flutter/services.dart';
5
 import 'package:flutter/services.dart';
5
 import 'package:fluttertoast/fluttertoast.dart';
6
 import 'package:fluttertoast/fluttertoast.dart';
6
 import 'package:google_fonts/google_fonts.dart';
7
 import 'package:google_fonts/google_fonts.dart';
7
 import 'package:hris_selfservice_mobile/Screens/Login/login_screen.dart';
8
 import 'package:hris_selfservice_mobile/Screens/Login/login_screen.dart';
8
 import 'package:hris_selfservice_mobile/Screens/Splash/loginstatus_post.dart';
9
 import 'package:hris_selfservice_mobile/Screens/Splash/loginstatus_post.dart';
10
+import 'package:hris_selfservice_mobile/constants.dart';
9
 import 'package:lottie/lottie.dart';
11
 import 'package:lottie/lottie.dart';
10
 import 'package:shared_preferences/shared_preferences.dart';
12
 import 'package:shared_preferences/shared_preferences.dart';
11
 import '../Home/home_screen.dart';
13
 import '../Home/home_screen.dart';
77
                     repeat: true),
79
                     repeat: true),
78
               ),
80
               ),
79
             ),
81
             ),
80
-            Text('Employee Self Service',
82
+            Text(appName,
81
                 style: GoogleFonts.carterOne(fontSize: 25, color: Colors.white))
83
                 style: GoogleFonts.carterOne(fontSize: 25, color: Colors.white))
82
           ],
84
           ],
83
         ),
85
         ),
94
   String? notif_token = prefs.getString('notif_token');
96
   String? notif_token = prefs.getString('notif_token');
95
 
97
 
96
   if (session == null) {
98
   if (session == null) {
99
+    version = "1.0.0";
97
     session = "";
100
     session = "";
98
-    version = "";
99
-    device = "";
100
     notif_token = "";
101
     notif_token = "";
102
+
103
+    if (Platform.isAndroid){
104
+      device = "android";
105
+    } else if (Platform.isIOS){
106
+      device = "ios";
107
+    }
108
+
101
   }
109
   }
102
 
110
 
103
-  logDev.log(session, name: "SESSIONNYA");
111
+  //logDev.log(session, name: "SESSIONNYA");
104
 
112
 
105
-  LoginStatus_Post.connectToAPI(version!, device!, session, notif_token!)
106
-      .then((valueResult) async {
113
+  LoginStatus_Post.connectToAPI(version!, device!, session, notif_token!).then((valueResult) async {
107
     Map<String, dynamic> object = json.decode(valueResult);
114
     Map<String, dynamic> object = json.decode(valueResult);
108
-    logDev.log(valueResult, name: "LOGIN STATUS!");
109
     if (object.containsKey("result").toString() == "true") {
115
     if (object.containsKey("result").toString() == "true") {
110
       String status = object['result']['status'].toString();
116
       String status = object['result']['status'].toString();
111
       if (status == "success") {
117
       if (status == "success") {
137
           if (block == "false") {
143
           if (block == "false") {
138
             Widget okButton = TextButton(
144
             Widget okButton = TextButton(
139
               child: Text(action),
145
               child: Text(action),
140
-              onPressed: () {
141
-                _launchURL(Uri.parse("https://play.google.com/store/apps"));
142
-                SystemChannels.platform.invokeMethod('SystemNavigator.pop');
146
+              onPressed: () async {
147
+                Uri url = Uri.parse(Uri.encodeFull("https://play.google.com/store/apps"));
148
+                //final Uri uri = Uri(scheme: "https", host: "play.google.com");
149
+                if(!await launchUrl(url, mode: LaunchMode.externalApplication)) {
150
+                  throw "Can not launch url";
151
+                }
143
               },
152
               },
144
             );
153
             );
145
 
154
 
156
 
165
 
157
             // set up the AlertDialog
166
             // set up the AlertDialog
158
             AlertDialog alert = AlertDialog(
167
             AlertDialog alert = AlertDialog(
159
-              title: Text("Employee Self Service"),
168
+              title: Text(appName),
160
               content: Text(title + "\n" + message),
169
               content: Text(title + "\n" + message),
161
               actions: [noButton, okButton],
170
               actions: [noButton, okButton],
171
+
162
             );
172
             );
163
 
173
 
164
             // show the dialog
174
             // show the dialog
165
             showDialog(
175
             showDialog(
166
               context: context,
176
               context: context,
177
+              barrierDismissible: false,
167
               builder: (BuildContext context) {
178
               builder: (BuildContext context) {
168
                 return alert;
179
                 return alert;
169
               },
180
               },
171
           } else if (block == "true") {
182
           } else if (block == "true") {
172
             Widget okButton = TextButton(
183
             Widget okButton = TextButton(
173
               child: Text(action),
184
               child: Text(action),
174
-              onPressed: () {
185
+              onPressed: () async {
175
                 if (action == "update") {
186
                 if (action == "update") {
176
-                  _launchURL(Uri.parse("https://play.google.com/store/apps"));
177
-                  SystemChannels.platform.invokeMethod('SystemNavigator.pop');
187
+                 /* _launchURL(Uri.parse("https://play.google.com/store/apps"));
188
+                  SystemChannels.platform.invokeMethod('SystemNavigator.pop');*/
189
+                  Uri url = Uri.parse(Uri.encodeFull("https://play.google.com/store/apps"));
190
+                  //final Uri uri = Uri(scheme: "https",  host: "play.google.com");
191
+                  if(!await launchUrl(url, mode: LaunchMode.externalApplication)) {
192
+                    throw "Can not launch url";
193
+                  }
178
                 } else if (action == "close") {
194
                 } else if (action == "close") {
179
                   SystemChannels.platform.invokeMethod('SystemNavigator.pop');
195
                   SystemChannels.platform.invokeMethod('SystemNavigator.pop');
180
                 }
196
                 }
183
 
199
 
184
             // set up the AlertDialog
200
             // set up the AlertDialog
185
             AlertDialog alert = AlertDialog(
201
             AlertDialog alert = AlertDialog(
186
-              title: Text("Employee Self Service"),
202
+              title: Text(appName),
187
               content: Text(title + "\n" + message),
203
               content: Text(title + "\n" + message),
188
               actions: [okButton],
204
               actions: [okButton],
189
             );
205
             );
191
             // show the dialog
207
             // show the dialog
192
             showDialog(
208
             showDialog(
193
               context: context,
209
               context: context,
210
+              barrierDismissible: false,
194
               builder: (BuildContext context) {
211
               builder: (BuildContext context) {
195
                 return alert;
212
                 return alert;
196
               },
213
               },
240
 
257
 
241
   // set up the AlertDialog
258
   // set up the AlertDialog
242
   AlertDialog alert = AlertDialog(
259
   AlertDialog alert = AlertDialog(
243
-    title: Text("Employee Self Service"),
260
+    title: Text(appName),
244
     content: Text("Server Response Error"),
261
     content: Text("Server Response Error"),
245
     actions: [
262
     actions: [
246
       noButton,
263
       noButton,
251
   // show the dialog
268
   // show the dialog
252
   showDialog(
269
   showDialog(
253
     context: context,
270
     context: context,
271
+    barrierDismissible: false,
254
     builder: (BuildContext context) {
272
     builder: (BuildContext context) {
255
       return alert;
273
       return alert;
256
     },
274
     },

+ 1
- 1
lib/constants.dart View File

5
 
5
 
6
 const double defaultPadding = 16.0;
6
 const double defaultPadding = 16.0;
7
 
7
 
8
-
8
+String appName = "Employee Self Service";
9
 //String baseURL = "http://10.209.8.49:8090";
9
 //String baseURL = "http://10.209.8.49:8090";
10
 //String baseURL = "https://bisops.globalservice.co.id";
10
 //String baseURL = "https://bisops.globalservice.co.id";
11
 String baseURL = "https://urp.myapps.id";
11
 String baseURL = "https://urp.myapps.id";

+ 52
- 2
lib/main.dart View File

1
+import 'package:firebase_core/firebase_core.dart';
2
+import 'package:firebase_messaging/firebase_messaging.dart';
1
 import 'package:flutter/material.dart';
3
 import 'package:flutter/material.dart';
2
 import 'package:flutter/services.dart';
4
 import 'package:flutter/services.dart';
3
 import 'package:hris_selfservice_mobile/Screens/Splash/splash_screen.dart';
5
 import 'package:hris_selfservice_mobile/Screens/Splash/splash_screen.dart';
4
 //import 'package:hris_selfservice_mobile/Screens/ForgotPassword/forgotPassword_screen.dart';
6
 //import 'package:hris_selfservice_mobile/Screens/ForgotPassword/forgotPassword_screen.dart';
5
 import 'constants.dart';
7
 import 'constants.dart';
8
+import 'firebase_options.dart';
9
+import 'dart:developer' as logDev;
10
+
11
+@pragma('vm:entry-point')
12
+Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
13
+  // If you're going to use other Firebase services in the background, such as Firestore,
14
+  // make sure you call `initializeApp` before using other Firebase services.
15
+  await Firebase.initializeApp();
16
+
17
+  print("Handling a background message: ${message.messageId}");
18
+}
19
+
20
+void main() async{
21
+  WidgetsFlutterBinding.ensureInitialized();
22
+  await Firebase.initializeApp(
23
+    options: DefaultFirebaseOptions.currentPlatform,
24
+  );
25
+
26
+  FirebaseMessaging messaging = FirebaseMessaging.instance;
27
+
28
+  NotificationSettings settings = await messaging.requestPermission(
29
+    alert: true,
30
+    announcement: false,
31
+    badge: true,
32
+    carPlay: false,
33
+    criticalAlert: false,
34
+    provisional: false,
35
+    sound: true,
36
+  );
37
+
38
+  print('User granted permission: ${settings.authorizationStatus}');
39
+
40
+
41
+  FirebaseMessaging.onMessage.listen((RemoteMessage remoteMessage) async {
42
+    Map<String, dynamic> data = remoteMessage.data;
43
+    logDev.log(data.toString(), name: "NOTIF Messaging");
44
+
45
+    String body = data['body'].toString();
46
+    logDev.log(body, name: "NOTIF Body");
47
+
48
+    print('Got a message whilst in the foreground!');
49
+    print('Message data: ${remoteMessage.data}');
50
+
51
+    if (remoteMessage.notification != null) {
52
+      print('Message also contained a notification: ${remoteMessage.notification}');
53
+    }
54
+  });
55
+
6
 
56
 
7
-void main() {
8
   SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
57
   SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
9
     statusBarColor: Colors.transparent,
58
     statusBarColor: Colors.transparent,
10
   ));
59
   ));
60
+
61
+  FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
11
   runApp(MyApp());
62
   runApp(MyApp());
12
 }
63
 }
13
 
64
 
14
 class MyApp extends StatelessWidget {
65
 class MyApp extends StatelessWidget {
15
   const MyApp({super.key});
66
   const MyApp({super.key});
16
 
67
 
17
-
18
   @override
68
   @override
19
   Widget build(BuildContext context) {
69
   Widget build(BuildContext context) {
20
     return MaterialApp(
70
     return MaterialApp(

+ 0
- 0
lib/noInternetConnection.dart View File


+ 108
- 92
pubspec.lock View File

5
     dependency: transitive
5
     dependency: transitive
6
     description:
6
     description:
7
       name: _flutterfire_internals
7
       name: _flutterfire_internals
8
-      sha256: "6215ac7d00ed98300b72f45ed2b38c2ca841f9f4e6965fab33cbd591e45e4473"
8
+      sha256: "64fcb0dbca4386356386c085142fa6e79c00a3326ceaa778a2d25f5d9ba61441"
9
       url: "https://pub.dev"
9
       url: "https://pub.dev"
10
     source: hosted
10
     source: hosted
11
-    version: "1.0.13"
11
+    version: "1.0.16"
12
   animated_splash_screen:
12
   animated_splash_screen:
13
     dependency: "direct main"
13
     dependency: "direct main"
14
     description:
14
     description:
181
     dependency: "direct main"
181
     dependency: "direct main"
182
     description:
182
     description:
183
       name: dio
183
       name: dio
184
-      sha256: "7d328c4d898a61efc3cd93655a0955858e29a0aa647f0f9e02d59b3bb275e2e8"
184
+      sha256: "9fdbf71baeb250fc9da847f6cb2052196f62c19906a3657adfc18631a667d316"
185
       url: "https://pub.dev"
185
       url: "https://pub.dev"
186
     source: hosted
186
     source: hosted
187
-    version: "4.0.6"
187
+    version: "5.0.0"
188
   double_back_to_close:
188
   double_back_to_close:
189
     dependency: "direct main"
189
     dependency: "direct main"
190
     description:
190
     description:
229
     dependency: "direct main"
229
     dependency: "direct main"
230
     description:
230
     description:
231
       name: firebase_core
231
       name: firebase_core
232
-      sha256: be13e431c0c950f0fc66bdb67b41b8059121d7e7d8bbbc21fb59164892d561f8
232
+      sha256: fe30ac230f12f8836bb97e6e09197340d3c584526825b1746ea362a82e1e43f7
233
       url: "https://pub.dev"
233
       url: "https://pub.dev"
234
     source: hosted
234
     source: hosted
235
-    version: "2.5.0"
235
+    version: "2.7.0"
236
   firebase_core_platform_interface:
236
   firebase_core_platform_interface:
237
     dependency: transitive
237
     dependency: transitive
238
     description:
238
     description:
245
     dependency: transitive
245
     dependency: transitive
246
     description:
246
     description:
247
       name: firebase_core_web
247
       name: firebase_core_web
248
-      sha256: "4b3a41410f3313bb95fd560aa5eb761b6ad65c185de772c72231e8b4aeed6d18"
248
+      sha256: "291fbcace608aca6c860652e1358ef89752be8cc3ef227f8bbcd1e62775b833a"
249
       url: "https://pub.dev"
249
       url: "https://pub.dev"
250
     source: hosted
250
     source: hosted
251
-    version: "2.1.1"
251
+    version: "2.2.1"
252
   firebase_messaging:
252
   firebase_messaging:
253
     dependency: "direct main"
253
     dependency: "direct main"
254
     description:
254
     description:
255
       name: firebase_messaging
255
       name: firebase_messaging
256
-      sha256: dbccddc62fef6f3745ba83062bfd1fbf2eb6a931db4c73d03f85c5772dfdec7f
256
+      sha256: "95f7565b8e992d2188cdd8dc5612330f7c309485fe425d3f9844f18e90741e3e"
257
       url: "https://pub.dev"
257
       url: "https://pub.dev"
258
     source: hosted
258
     source: hosted
259
-    version: "14.2.2"
259
+    version: "14.2.5"
260
   firebase_messaging_platform_interface:
260
   firebase_messaging_platform_interface:
261
     dependency: transitive
261
     dependency: transitive
262
     description:
262
     description:
263
       name: firebase_messaging_platform_interface
263
       name: firebase_messaging_platform_interface
264
-      sha256: "564a47ea76db9cd2d17e7d95790428ad3de9d0075795d14c4c901ba0bf518e1a"
264
+      sha256: c5e79e15d1018cafffea1a6e45249db0d6bc42dbe35178634c77488179880e79
265
       url: "https://pub.dev"
265
       url: "https://pub.dev"
266
     source: hosted
266
     source: hosted
267
-    version: "4.2.11"
267
+    version: "4.2.14"
268
   firebase_messaging_web:
268
   firebase_messaging_web:
269
     dependency: transitive
269
     dependency: transitive
270
     description:
270
     description:
271
       name: firebase_messaging_web
271
       name: firebase_messaging_web
272
-      sha256: "76291494583a003d4ce0d613c41cb87c58fab25773317daa66a245f537e1c3f7"
272
+      sha256: cd0cfcab7a63282049dec95a9955e7a487b5e580162310d12a82a10c0c32c546
273
       url: "https://pub.dev"
273
       url: "https://pub.dev"
274
     source: hosted
274
     source: hosted
275
-    version: "3.2.12"
275
+    version: "3.2.15"
276
   flutter:
276
   flutter:
277
     dependency: "direct main"
277
     dependency: "direct main"
278
     description: flutter
278
     description: flutter
306
     dependency: transitive
306
     dependency: transitive
307
     description:
307
     description:
308
       name: flutter_local_notifications_linux
308
       name: flutter_local_notifications_linux
309
-      sha256: "8f6c1611e0c4a88a382691a97bb3c3feb24cc0c0b54152b8b5fb7ffb837f7fbf"
309
+      sha256: ccb08b93703aeedb58856e5637450bf3ffec899adb66dc325630b68994734b89
310
       url: "https://pub.dev"
310
       url: "https://pub.dev"
311
     source: hosted
311
     source: hosted
312
-    version: "3.0.0"
312
+    version: "3.0.0+1"
313
   flutter_local_notifications_platform_interface:
313
   flutter_local_notifications_platform_interface:
314
     dependency: transitive
314
     dependency: transitive
315
     description:
315
     description:
346
     dependency: transitive
346
     dependency: transitive
347
     description:
347
     description:
348
       name: flutter_plugin_android_lifecycle
348
       name: flutter_plugin_android_lifecycle
349
-      sha256: "60fc7b78455b94e6de2333d2f95196d32cf5c22f4b0b0520a628804cb463503b"
349
+      sha256: "4bef634684b2c7f3468c77c766c831229af829a0cd2d4ee6c1b99558bd14e5d2"
350
       url: "https://pub.dev"
350
       url: "https://pub.dev"
351
     source: hosted
351
     source: hosted
352
-    version: "2.0.7"
352
+    version: "2.0.8"
353
   flutter_polyline_points:
353
   flutter_polyline_points:
354
     dependency: "direct main"
354
     dependency: "direct main"
355
     description:
355
     description:
370
     dependency: "direct main"
370
     dependency: "direct main"
371
     description:
371
     description:
372
       name: flutter_svg
372
       name: flutter_svg
373
-      sha256: "6ff9fa12892ae074092de2fa6a9938fb21dbabfdaa2ff57dc697ff912fc8d4b2"
373
+      sha256: "97c5b291b4fd34ae4f55d6a4c05841d4d0ed94952e033c5a6529e1b47b4d2a29"
374
       url: "https://pub.dev"
374
       url: "https://pub.dev"
375
     source: hosted
375
     source: hosted
376
-    version: "1.1.6"
376
+    version: "2.0.2"
377
   flutter_test:
377
   flutter_test:
378
     dependency: "direct dev"
378
     dependency: "direct dev"
379
     description: flutter
379
     description: flutter
396
     dependency: "direct main"
396
     dependency: "direct main"
397
     description:
397
     description:
398
       name: fluttertoast
398
       name: fluttertoast
399
-      sha256: "774fa28b07f3a82c93596bc137be33189fec578ed3447a93a5a11c93435de394"
399
+      sha256: "2f9c4d3f4836421f7067a28f8939814597b27614e021da9d63e5d3fb6e212d25"
400
       url: "https://pub.dev"
400
       url: "https://pub.dev"
401
     source: hosted
401
     source: hosted
402
-    version: "8.1.3"
402
+    version: "8.2.1"
403
   focus_detector:
403
   focus_detector:
404
     dependency: "direct main"
404
     dependency: "direct main"
405
     description:
405
     description:
484
     dependency: "direct main"
484
     dependency: "direct main"
485
     description:
485
     description:
486
       name: google_fonts
486
       name: google_fonts
487
-      sha256: "8f099045e2f2a30e4d4d0a35f40c6bc941a8f2ca0e10ad9d214ee9edd3f37483"
487
+      sha256: "927573f2e8a8d65c17931e21918ad0ab0666b1b636537de7c4932bdb487b190f"
488
       url: "https://pub.dev"
488
       url: "https://pub.dev"
489
     source: hosted
489
     source: hosted
490
-    version: "3.0.1"
490
+    version: "4.0.3"
491
   http:
491
   http:
492
     dependency: "direct main"
492
     dependency: "direct main"
493
     description:
493
     description:
540
     dependency: "direct main"
540
     dependency: "direct main"
541
     description:
541
     description:
542
       name: image_picker
542
       name: image_picker
543
-      sha256: f98d76672d309c8b7030c323b3394669e122d52b307d2bbd8d06bd70f5b2aabe
543
+      sha256: "22207768556b82d55ec70166824350fee32298732d5efa4d6e756f848f51f66a"
544
       url: "https://pub.dev"
544
       url: "https://pub.dev"
545
     source: hosted
545
     source: hosted
546
-    version: "0.8.6+1"
546
+    version: "0.8.6+3"
547
   image_picker_android:
547
   image_picker_android:
548
     dependency: transitive
548
     dependency: transitive
549
     description:
549
     description:
550
       name: image_picker_android
550
       name: image_picker_android
551
-      sha256: "385f12ee9c7288575572c7873a332016ec45ebd092e1c2f6bd421b4a9ad21f1d"
551
+      sha256: "68d067baf7f6e401b1124ee83dd6967e67847314250fd68012aab34a69beb344"
552
       url: "https://pub.dev"
552
       url: "https://pub.dev"
553
     source: hosted
553
     source: hosted
554
-    version: "0.8.5+6"
554
+    version: "0.8.5+7"
555
   image_picker_for_web:
555
   image_picker_for_web:
556
     dependency: transitive
556
     dependency: transitive
557
     description:
557
     description:
558
       name: image_picker_for_web
558
       name: image_picker_for_web
559
-      sha256: "7d319fb74955ca46d9bf7011497860e3923bb67feebcf068f489311065863899"
559
+      sha256: "66fc6e3877bbde82c33d122f3588777c3784ac5bd7d1cdd79213ef7aecb85b34"
560
       url: "https://pub.dev"
560
       url: "https://pub.dev"
561
     source: hosted
561
     source: hosted
562
-    version: "2.1.10"
562
+    version: "2.1.11"
563
   image_picker_ios:
563
   image_picker_ios:
564
     dependency: transitive
564
     dependency: transitive
565
     description:
565
     description:
566
       name: image_picker_ios
566
       name: image_picker_ios
567
-      sha256: "8ffb14b43713d7c43fb21299cc18181cc5b39bd3ea1cc427a085c6400fe5aa52"
567
+      sha256: "39aa70b5f1e5e7c94585b9738632d5fdb764a5655e40cd9e7b95fbd2fc50c519"
568
       url: "https://pub.dev"
568
       url: "https://pub.dev"
569
     source: hosted
569
     source: hosted
570
-    version: "0.8.6+7"
570
+    version: "0.8.6+9"
571
   image_picker_platform_interface:
571
   image_picker_platform_interface:
572
     dependency: transitive
572
     dependency: transitive
573
     description:
573
     description:
574
       name: image_picker_platform_interface
574
       name: image_picker_platform_interface
575
-      sha256: "7cef2f28f4f2fef99180f636c3d446b4ccbafd6ba0fad2adc9a80c4040f656b8"
575
+      sha256: "1991219d9dbc42a99aff77e663af8ca51ced592cd6685c9485e3458302d3d4f8"
576
       url: "https://pub.dev"
576
       url: "https://pub.dev"
577
     source: hosted
577
     source: hosted
578
-    version: "2.6.2"
578
+    version: "2.6.3"
579
   internet_connection_checker:
579
   internet_connection_checker:
580
     dependency: "direct main"
580
     dependency: "direct main"
581
     description:
581
     description:
588
     dependency: "direct main"
588
     dependency: "direct main"
589
     description:
589
     description:
590
       name: intl
590
       name: intl
591
-      sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91"
591
+      sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6
592
       url: "https://pub.dev"
592
       url: "https://pub.dev"
593
     source: hosted
593
     source: hosted
594
-    version: "0.17.0"
594
+    version: "0.18.0"
595
   js:
595
   js:
596
     dependency: transitive
596
     dependency: transitive
597
     description:
597
     description:
720
       url: "https://pub.dev"
720
       url: "https://pub.dev"
721
     source: hosted
721
     source: hosted
722
     version: "1.8.2"
722
     version: "1.8.2"
723
-  path_drawing:
724
-    dependency: transitive
725
-    description:
726
-      name: path_drawing
727
-      sha256: bbb1934c0cbb03091af082a6389ca2080345291ef07a5fa6d6e078ba8682f977
728
-      url: "https://pub.dev"
729
-    source: hosted
730
-    version: "1.0.1"
731
   path_parsing:
723
   path_parsing:
732
     dependency: transitive
724
     dependency: transitive
733
     description:
725
     description:
740
     dependency: transitive
732
     dependency: transitive
741
     description:
733
     description:
742
       name: path_provider
734
       name: path_provider
743
-      sha256: dcea5feb97d8abf90cab9e9030b497fb7c3cbf26b7a1fe9e3ef7dcb0a1ddec95
735
+      sha256: "04890b994ee89bfa80bf3080bfec40d5a92c5c7a785ebb02c13084a099d2b6f9"
744
       url: "https://pub.dev"
736
       url: "https://pub.dev"
745
     source: hosted
737
     source: hosted
746
-    version: "2.0.12"
738
+    version: "2.0.13"
747
   path_provider_android:
739
   path_provider_android:
748
     dependency: transitive
740
     dependency: transitive
749
     description:
741
     description:
750
       name: path_provider_android
742
       name: path_provider_android
751
-      sha256: a776c088d671b27f6e3aa8881d64b87b3e80201c64e8869b811325de7a76c15e
743
+      sha256: "7623b7d4be0f0f7d9a8b5ee6879fc13e4522d4c875ab86801dee4af32b54b83e"
752
       url: "https://pub.dev"
744
       url: "https://pub.dev"
753
     source: hosted
745
     source: hosted
754
-    version: "2.0.22"
746
+    version: "2.0.23"
755
   path_provider_foundation:
747
   path_provider_foundation:
756
     dependency: transitive
748
     dependency: transitive
757
     description:
749
     description:
758
       name: path_provider_foundation
750
       name: path_provider_foundation
759
-      sha256: "62a68e7e1c6c459f9289859e2fae58290c981ce21d1697faf54910fe1faa4c74"
751
+      sha256: eec003594f19fe2456ea965ae36b3fc967bc5005f508890aafe31fa75e41d972
760
       url: "https://pub.dev"
752
       url: "https://pub.dev"
761
     source: hosted
753
     source: hosted
762
-    version: "2.1.1"
754
+    version: "2.1.2"
763
   path_provider_linux:
755
   path_provider_linux:
764
     dependency: transitive
756
     dependency: transitive
765
     description:
757
     description:
766
       name: path_provider_linux
758
       name: path_provider_linux
767
-      sha256: "2e32f1640f07caef0d3cb993680f181c79e54a3827b997d5ee221490d131fbd9"
759
+      sha256: "525ad5e07622d19447ad740b1ed5070031f7a5437f44355ae915ff56e986429a"
768
       url: "https://pub.dev"
760
       url: "https://pub.dev"
769
     source: hosted
761
     source: hosted
770
-    version: "2.1.8"
762
+    version: "2.1.9"
771
   path_provider_platform_interface:
763
   path_provider_platform_interface:
772
     dependency: transitive
764
     dependency: transitive
773
     description:
765
     description:
774
       name: path_provider_platform_interface
766
       name: path_provider_platform_interface
775
-      sha256: f0abc8ebd7253741f05488b4813d936b4d07c6bae3e86148a09e342ee4b08e76
767
+      sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec"
776
       url: "https://pub.dev"
768
       url: "https://pub.dev"
777
     source: hosted
769
     source: hosted
778
-    version: "2.0.5"
770
+    version: "2.0.6"
779
   path_provider_windows:
771
   path_provider_windows:
780
     dependency: transitive
772
     dependency: transitive
781
     description:
773
     description:
782
       name: path_provider_windows
774
       name: path_provider_windows
783
-      sha256: bcabbe399d4042b8ee687e17548d5d3f527255253b4a639f5f8d2094a9c2b45c
775
+      sha256: "642ddf65fde5404f83267e8459ddb4556316d3ee6d511ed193357e25caa3632d"
784
       url: "https://pub.dev"
776
       url: "https://pub.dev"
785
     source: hosted
777
     source: hosted
786
-    version: "2.1.3"
778
+    version: "2.1.4"
787
   petitparser:
779
   petitparser:
788
     dependency: transitive
780
     dependency: transitive
789
     description:
781
     description:
804
     dependency: transitive
796
     dependency: transitive
805
     description:
797
     description:
806
       name: plugin_platform_interface
798
       name: plugin_platform_interface
807
-      sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a
799
+      sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc"
808
       url: "https://pub.dev"
800
       url: "https://pub.dev"
809
     source: hosted
801
     source: hosted
810
-    version: "2.1.3"
802
+    version: "2.1.4"
811
   pointycastle:
803
   pointycastle:
812
     dependency: transitive
804
     dependency: transitive
813
     description:
805
     description:
876
     dependency: "direct main"
868
     dependency: "direct main"
877
     description:
869
     description:
878
       name: shared_preferences
870
       name: shared_preferences
879
-      sha256: "5949029e70abe87f75cfe59d17bf5c397619c4b74a099b10116baeb34786fad9"
871
+      sha256: ee6257848f822b8481691f20c3e6d2bfee2e9eccb2a3d249907fcfb198c55b41
880
       url: "https://pub.dev"
872
       url: "https://pub.dev"
881
     source: hosted
873
     source: hosted
882
-    version: "2.0.17"
874
+    version: "2.0.18"
883
   shared_preferences_android:
875
   shared_preferences_android:
884
     dependency: transitive
876
     dependency: transitive
885
     description:
877
     description:
886
       name: shared_preferences_android
878
       name: shared_preferences_android
887
-      sha256: "955e9736a12ba776bdd261cf030232b30eadfcd9c79b32a3250dd4a494e8c8f7"
879
+      sha256: a51a4f9375097f94df1c6e0a49c0374440d31ab026b59d58a7e7660675879db4
888
       url: "https://pub.dev"
880
       url: "https://pub.dev"
889
     source: hosted
881
     source: hosted
890
-    version: "2.0.15"
882
+    version: "2.0.16"
891
   shared_preferences_foundation:
883
   shared_preferences_foundation:
892
     dependency: transitive
884
     dependency: transitive
893
     description:
885
     description:
894
       name: shared_preferences_foundation
886
       name: shared_preferences_foundation
895
-      sha256: "2b55c18636a4edc529fa5cd44c03d3f3100c00513f518c5127c951978efcccd0"
887
+      sha256: "6b84fdf06b32bb336f972d373cd38b63734f3461ba56ac2ba01b56d052796259"
896
       url: "https://pub.dev"
888
       url: "https://pub.dev"
897
     source: hosted
889
     source: hosted
898
-    version: "2.1.3"
890
+    version: "2.1.4"
899
   shared_preferences_linux:
891
   shared_preferences_linux:
900
     dependency: transitive
892
     dependency: transitive
901
     description:
893
     description:
902
       name: shared_preferences_linux
894
       name: shared_preferences_linux
903
-      sha256: f8ea038aa6da37090093974ebdcf4397010605fd2ff65c37a66f9d28394cb874
895
+      sha256: d7fb71e6e20cd3dfffcc823a28da3539b392e53ed5fc5c2b90b55fdaa8a7e8fa
904
       url: "https://pub.dev"
896
       url: "https://pub.dev"
905
     source: hosted
897
     source: hosted
906
-    version: "2.1.3"
898
+    version: "2.1.4"
907
   shared_preferences_platform_interface:
899
   shared_preferences_platform_interface:
908
     dependency: transitive
900
     dependency: transitive
909
     description:
901
     description:
910
       name: shared_preferences_platform_interface
902
       name: shared_preferences_platform_interface
911
-      sha256: da9431745ede5ece47bc26d5d73a9d3c6936ef6945c101a5aca46f62e52c1cf3
903
+      sha256: "824bfd02713e37603b2bdade0842e47d56e7db32b1dcdd1cae533fb88e2913fc"
912
       url: "https://pub.dev"
904
       url: "https://pub.dev"
913
     source: hosted
905
     source: hosted
914
-    version: "2.1.0"
906
+    version: "2.1.1"
915
   shared_preferences_web:
907
   shared_preferences_web:
916
     dependency: transitive
908
     dependency: transitive
917
     description:
909
     description:
918
       name: shared_preferences_web
910
       name: shared_preferences_web
919
-      sha256: a4b5bc37fe1b368bbc81f953197d55e12f49d0296e7e412dfe2d2d77d6929958
911
+      sha256: "6737b757e49ba93de2a233df229d0b6a87728cea1684da828cbc718b65dcf9d7"
920
       url: "https://pub.dev"
912
       url: "https://pub.dev"
921
     source: hosted
913
     source: hosted
922
-    version: "2.0.4"
914
+    version: "2.0.5"
923
   shared_preferences_windows:
915
   shared_preferences_windows:
924
     dependency: transitive
916
     dependency: transitive
925
     description:
917
     description:
926
       name: shared_preferences_windows
918
       name: shared_preferences_windows
927
-      sha256: "5eaf05ae77658d3521d0e993ede1af962d4b326cd2153d312df716dc250f00c9"
919
+      sha256: bd014168e8484837c39ef21065b78f305810ceabc1d4f90be6e3b392ce81b46d
928
       url: "https://pub.dev"
920
       url: "https://pub.dev"
929
     source: hosted
921
     source: hosted
930
-    version: "2.1.3"
922
+    version: "2.1.4"
931
   sky_engine:
923
   sky_engine:
932
     dependency: transitive
924
     dependency: transitive
933
     description: flutter
925
     description: flutter
993
     dependency: "direct main"
985
     dependency: "direct main"
994
     description:
986
     description:
995
       name: transparent_image
987
       name: transparent_image
996
-      sha256: e566a616922a781489f4d91cc939b1b3203b6e4a093317805f2f82f0bb0f8dec
988
+      sha256: e8991d955a2094e197ca24c645efec2faf4285772a4746126ca12875e54ca02f
997
       url: "https://pub.dev"
989
       url: "https://pub.dev"
998
     source: hosted
990
     source: hosted
999
-    version: "2.0.0"
991
+    version: "2.0.1"
1000
   tuple:
992
   tuple:
1001
     dependency: "direct main"
993
     dependency: "direct main"
1002
     description:
994
     description:
1025
     dependency: "direct main"
1017
     dependency: "direct main"
1026
     description:
1018
     description:
1027
       name: url_launcher
1019
       name: url_launcher
1028
-      sha256: e8f2efc804810c0f2f5b485f49e7942179f56eabcfe81dce3387fec4bb55876b
1020
+      sha256: "75f2846facd11168d007529d6cd8fcb2b750186bea046af9711f10b907e1587e"
1029
       url: "https://pub.dev"
1021
       url: "https://pub.dev"
1030
     source: hosted
1022
     source: hosted
1031
-    version: "6.1.9"
1023
+    version: "6.1.10"
1032
   url_launcher_android:
1024
   url_launcher_android:
1033
     dependency: transitive
1025
     dependency: transitive
1034
     description:
1026
     description:
1035
       name: url_launcher_android
1027
       name: url_launcher_android
1036
-      sha256: "3e2f6dfd2c7d9cd123296cab8ef66cfc2c1a13f5845f42c7a0f365690a8a7dd1"
1028
+      sha256: "1f4d9ebe86f333c15d318f81dcdc08b01d45da44af74552608455ebdc08d9732"
1037
       url: "https://pub.dev"
1029
       url: "https://pub.dev"
1038
     source: hosted
1030
     source: hosted
1039
-    version: "6.0.23"
1031
+    version: "6.0.24"
1040
   url_launcher_ios:
1032
   url_launcher_ios:
1041
     dependency: transitive
1033
     dependency: transitive
1042
     description:
1034
     description:
1043
       name: url_launcher_ios
1035
       name: url_launcher_ios
1044
-      sha256: "0a5af0aefdd8cf820dd739886efb1637f1f24489900204f50984634c07a54815"
1036
+      sha256: c9cd648d2f7ab56968e049d4e9116f96a85517f1dd806b96a86ea1018a3a82e5
1045
       url: "https://pub.dev"
1037
       url: "https://pub.dev"
1046
     source: hosted
1038
     source: hosted
1047
-    version: "6.1.0"
1039
+    version: "6.1.1"
1048
   url_launcher_linux:
1040
   url_launcher_linux:
1049
     dependency: transitive
1041
     dependency: transitive
1050
     description:
1042
     description:
1051
       name: url_launcher_linux
1043
       name: url_launcher_linux
1052
-      sha256: "318c42cba924e18180c029be69caf0a1a710191b9ec49bb42b5998fdcccee3cc"
1044
+      sha256: e29039160ab3730e42f3d811dc2a6d5f2864b90a70fb765ea60144b03307f682
1053
       url: "https://pub.dev"
1045
       url: "https://pub.dev"
1054
     source: hosted
1046
     source: hosted
1055
-    version: "3.0.2"
1047
+    version: "3.0.3"
1056
   url_launcher_macos:
1048
   url_launcher_macos:
1057
     dependency: transitive
1049
     dependency: transitive
1058
     description:
1050
     description:
1059
       name: url_launcher_macos
1051
       name: url_launcher_macos
1060
-      sha256: "41988b55570df53b3dd2a7fc90c76756a963de6a8c5f8e113330cb35992e2094"
1052
+      sha256: "2dddb3291a57b074dade66b5e07e64401dd2487caefd4e9e2f467138d8c7eb06"
1061
       url: "https://pub.dev"
1053
       url: "https://pub.dev"
1062
     source: hosted
1054
     source: hosted
1063
-    version: "3.0.2"
1055
+    version: "3.0.3"
1064
   url_launcher_platform_interface:
1056
   url_launcher_platform_interface:
1065
     dependency: transitive
1057
     dependency: transitive
1066
     description:
1058
     description:
1067
       name: url_launcher_platform_interface
1059
       name: url_launcher_platform_interface
1068
-      sha256: "4eae912628763eb48fc214522e58e942fd16ce195407dbf45638239523c759a6"
1060
+      sha256: "6c9ca697a5ae218ce56cece69d46128169a58aa8653c1b01d26fcd4aad8c4370"
1069
       url: "https://pub.dev"
1061
       url: "https://pub.dev"
1070
     source: hosted
1062
     source: hosted
1071
-    version: "2.1.1"
1063
+    version: "2.1.2"
1072
   url_launcher_web:
1064
   url_launcher_web:
1073
     dependency: transitive
1065
     dependency: transitive
1074
     description:
1066
     description:
1075
       name: url_launcher_web
1067
       name: url_launcher_web
1076
-      sha256: "44d79408ce9f07052095ef1f9a693c258d6373dc3944249374e30eff7219ccb0"
1068
+      sha256: "574cfbe2390666003c3a1d129bdc4574aaa6728f0c00a4829a81c316de69dd9b"
1077
       url: "https://pub.dev"
1069
       url: "https://pub.dev"
1078
     source: hosted
1070
     source: hosted
1079
-    version: "2.0.14"
1071
+    version: "2.0.15"
1080
   url_launcher_windows:
1072
   url_launcher_windows:
1081
     dependency: transitive
1073
     dependency: transitive
1082
     description:
1074
     description:
1083
       name: url_launcher_windows
1075
       name: url_launcher_windows
1084
-      sha256: b6217370f8eb1fd85c8890c539f5a639a01ab209a36db82c921ebeacefc7a615
1076
+      sha256: "97c9067950a0d09cbd93e2e3f0383d1403989362b97102fbf446473a48079a4b"
1085
       url: "https://pub.dev"
1077
       url: "https://pub.dev"
1086
     source: hosted
1078
     source: hosted
1087
-    version: "3.0.3"
1079
+    version: "3.0.4"
1080
+  vector_graphics:
1081
+    dependency: transitive
1082
+    description:
1083
+      name: vector_graphics
1084
+      sha256: "254348b40251c995cf8301ac715486c8cfa0a93b7fdc4dbd495a30f04db1fb44"
1085
+      url: "https://pub.dev"
1086
+    source: hosted
1087
+    version: "1.1.0"
1088
+  vector_graphics_codec:
1089
+    dependency: transitive
1090
+    description:
1091
+      name: vector_graphics_codec
1092
+      sha256: "143c290b762646c696c63be5d976bde7379ea892cb6868ddc5a17cbc56e71411"
1093
+      url: "https://pub.dev"
1094
+    source: hosted
1095
+    version: "1.1.0"
1096
+  vector_graphics_compiler:
1097
+    dependency: transitive
1098
+    description:
1099
+      name: vector_graphics_compiler
1100
+      sha256: "3190cc26d9ebda686bafb9721bb6a74c6d358700f4fc978a0f2cba6912daff86"
1101
+      url: "https://pub.dev"
1102
+    source: hosted
1103
+    version: "1.1.0"
1088
   vector_math:
1104
   vector_math:
1089
     dependency: "direct main"
1105
     dependency: "direct main"
1090
     description:
1106
     description:
1142
     source: hosted
1158
     source: hosted
1143
     version: "3.1.1"
1159
     version: "3.1.1"
1144
 sdks:
1160
 sdks:
1145
-  dart: ">=2.18.4 <3.0.0"
1146
-  flutter: ">=3.3.0"
1161
+  dart: ">=2.19.0-0 <3.0.0"
1162
+  flutter: ">=3.7.0-0"

+ 10
- 9
pubspec.yaml View File

31
 dependencies:
31
 dependencies:
32
   flutter:
32
   flutter:
33
     sdk: flutter
33
     sdk: flutter
34
-  google_fonts: ^3.0.1
34
+  google_fonts: ^4.0.3
35
 
35
 
36
   # The following adds the Cupertino Icons font to your application.
36
   # The following adds the Cupertino Icons font to your application.
37
   # Use with the CupertinoIcons class for iOS style icons.
37
   # Use with the CupertinoIcons class for iOS style icons.
38
   cupertino_icons: ^1.0.2
38
   cupertino_icons: ^1.0.2
39
-  flutter_svg: ^1.1.6
39
+  flutter_svg: ^2.0.1
40
   flutter_staggered_grid_view: ^0.6.2
40
   flutter_staggered_grid_view: ^0.6.2
41
   double_back_to_close: ^2.0.0
41
   double_back_to_close: ^2.0.0
42
   animated_splash_screen: ^1.3.0
42
   animated_splash_screen: ^1.3.0
44
   fluttertoast: ^8.1.1
44
   fluttertoast: ^8.1.1
45
   #google_maps_flutter: ^2.2.1
45
   #google_maps_flutter: ^2.2.1
46
   http: ^0.13.5
46
   http: ^0.13.5
47
-  intl: ^0.17.0
48
-  dio: ^4.0.6
47
+  intl: ^0.18.0
48
+  dio: ^5.0.0
49
   get_it: ^7.2.0
49
   get_it: ^7.2.0
50
   shared_preferences: ^2.0.15
50
   shared_preferences: ^2.0.15
51
   # device_information: ^0.0.4
51
   # device_information: ^0.0.4
54
   flutter_udid: ^2.0.1
54
   flutter_udid: ^2.0.1
55
   image_picker: ^0.8.6
55
   image_picker: ^0.8.6
56
   image_cropper: ^3.0.1
56
   image_cropper: ^3.0.1
57
-  url_launcher: ^6.1.7
58
   #progress_dialog: ^1.2.4
57
   #progress_dialog: ^1.2.4
59
   progress_dialog_null_safe: ^1.0.4
58
   progress_dialog_null_safe: ^1.0.4
60
   #mapbox_gl: ^0.16.0
59
   #mapbox_gl: ^0.16.0
73
   async: ^2.9.0
72
   async: ^2.9.0
74
   flutter_image: ^4.1.4
73
   flutter_image: ^4.1.4
75
   vector_math: ^2.1.2
74
   vector_math: ^2.1.2
76
-  meta: ^1.1.0
77
-  collection: ^1.16.0
75
+  meta: ^1.8.0
76
+  collection: ^1.17.0
78
   flutter_map_marker_cluster: ^1.0.1
77
   flutter_map_marker_cluster: ^1.0.1
79
   flutter_polyline_points: ^1.0.0
78
   flutter_polyline_points: ^1.0.0
80
   provider: ^6.0.5
79
   provider: ^6.0.5
82
   internet_connection_checker: ^1.0.0+1
81
   internet_connection_checker: ^1.0.0+1
83
   #plain_notification_token: ^0.0.4
82
   #plain_notification_token: ^0.0.4
84
   focus_detector: ^2.0.1
83
   focus_detector: ^2.0.1
85
-  firebase_core: ^2.4.1
84
+  firebase_core: ^2.6.1
86
   flutter_local_notifications: ^13.0.0
85
   flutter_local_notifications: ^13.0.0
87
-  firebase_messaging: ^14.1.3
86
+  firebase_messaging: ^14.2.4
87
+  url_launcher: ^6.1.9
88
+
88
 
89
 
89
 dev_dependencies:
90
 dev_dependencies:
90
   flutter_test:
91
   flutter_test:

Loading…
Cancel
Save