Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
Crm Attendance
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dio Maulana
Crm Attendance
Commits
d31b1ca6
Commit
d31b1ca6
authored
Jun 05, 2023
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perbaharui dialog home
parent
b1f93059
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
363 additions
and
140 deletions
+363
-140
api.dart
lib/api/api.dart
+16
-0
pref.dart
lib/helper/pref.dart
+9
-0
home.dart
lib/page/home/home.dart
+329
-140
pubspec.lock
pubspec.lock
+8
-0
pubspec.yaml
pubspec.yaml
+1
-0
No files found.
lib/api/api.dart
View file @
d31b1ca6
...
...
@@ -146,6 +146,14 @@ class Api {
return
ApiResponse
(
error:
true
,
msg:
Strings
.
cantConnectToServer
);
}
else
{
if
(
jsonObject
[
'status'
]
==
"ok"
)
{
// simpan NIK user
List
<
String
>
listAbsentUser
=
getListAbsentUser
();
int
indexList
=
listAbsentUser
.
indexWhere
((
element
)
=>
element
==
nik
);
if
(
indexList
==
-
1
)
{
listAbsentUser
.
add
(
nik
);
setListAbsentUser
(
listAbsentUser
);
}
return
ApiResponse
(
error:
false
,
msg:
Strings
.
succesGetData
,
...
...
@@ -184,6 +192,14 @@ class Api {
return
ApiResponse
(
error:
true
,
msg:
Strings
.
cantConnectToServer
);
}
else
{
if
(
jsonObject
[
'status'
]
==
"ok"
)
{
// simpan NIK user
List
<
String
>
listAbsentUser
=
getListAbsentUser
();
int
indexList
=
listAbsentUser
.
indexWhere
((
element
)
=>
element
==
nik
);
if
(
indexList
==
-
1
)
{
listAbsentUser
.
add
(
nik
);
setListAbsentUser
(
listAbsentUser
);
}
return
ApiResponse
(
error:
false
,
msg:
Strings
.
succesGetData
,
...
...
lib/helper/pref.dart
View file @
d31b1ca6
...
...
@@ -2,6 +2,7 @@ import 'package:excelso_attendance/main.dart';
const
String
_latitude
=
'laU'
;
const
String
_longitude
=
'loU'
;
const
String
_listAbsent
=
'listAbsent'
;
String
?
getLatitude
()
{
return
prefs
.
getString
(
_latitude
);
...
...
@@ -20,3 +21,11 @@ Future<String> setLongitude(String value) async {
prefs
.
setString
(
_longitude
,
value
);
return
value
;
}
Future
<
void
>
setListAbsentUser
(
List
<
String
>
value
)
async
{
prefs
.
setStringList
(
_listAbsent
,
value
);
}
List
<
String
>
getListAbsentUser
()
{
return
prefs
.
getStringList
(
_listAbsent
)
??
[];
}
lib/page/home/home.dart
View file @
d31b1ca6
This diff is collapsed.
Click to expand it.
pubspec.lock
View file @
d31b1ca6
...
...
@@ -145,6 +145,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.5"
dropdown_button2:
dependency: "direct main"
description:
name: dropdown_button2
sha256: "374f2390161bf782b4896f0b1b24cbb2b5daaa1cfb11047c3307461dcdf44e07"
url: "https://pub.dev"
source: hosted
version: "2.1.3"
fake_async:
dependency: transitive
description:
...
...
pubspec.yaml
View file @
d31b1ca6
...
...
@@ -32,6 +32,7 @@ dependencies:
autocomplete_textfield
:
^2.0.1
camera
:
^0.10.5+2
cupertino_icons
:
^1.0.2
dropdown_button2
:
^2.1.3
flutter
:
sdk
:
flutter
flutter_easyloading
:
^3.0.5
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment