Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
medapp_eksad
Project
Project
Details
Activity
Releases
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
qorri_di
medapp_eksad
Commits
41df0161
Commit
41df0161
authored
Sep 28, 2022
by
Tohap Maruli Pasaribu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/qorridi/medapp_eksad
into develop
parents
1ecf54e9
dfc1191d
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
505 additions
and
342 deletions
+505
-342
sosmed_api.dart
lib/api/sosmed_api.dart
+140
-2
user_api.dart
lib/api/user_api.dart
+1
-0
appbar_home.dart
lib/appbar/appbar_home.dart
+3
-0
admin_sosmed.dart
lib/dashboard/admin/admin_sosmed.dart
+324
-319
whatsapp.dart
lib/widget/whatsapp.dart
+37
-21
No files found.
lib/api/sosmed_api.dart
View file @
41df0161
...
@@ -26,10 +26,11 @@ Future<bool> createSosmed (wa, ln, tw, ig, yt) async{
...
@@ -26,10 +26,11 @@ Future<bool> createSosmed (wa, ln, tw, ig, yt) async{
}
}
}
}
Future
<
bool
>
updateSosmed
(
wa
,
ln
,
tw
,
ig
,
yt
)
async
{
Future
<
bool
>
updateSosmed
(
id
,
wa
,
ln
,
tw
,
ig
,
yt
)
async
{
final
response
=
await
http
final
response
=
await
http
.
p
ut
(
Uri
.
parse
(
'
$cmd
/settingsosmed/updat
eSettingSosmed'
),
.
p
ost
(
Uri
.
parse
(
'
$cmd
/settingsosmed/sav
eSettingSosmed'
),
body:
jsonEncode
({
body:
jsonEncode
({
'idSettingSosmed'
:
id
,
'whatsapp'
:
wa
,
'whatsapp'
:
wa
,
'linkedin'
:
ln
,
'linkedin'
:
ln
,
'twitter'
:
tw
,
'twitter'
:
tw
,
...
@@ -52,4 +53,141 @@ Future<List<dynamic>> getSosmedDesc() async {
...
@@ -52,4 +53,141 @@ Future<List<dynamic>> getSosmedDesc() async {
//Uri.parse('$qry/settingsosmed/getSettingSosmedById'));
//Uri.parse('$qry/settingsosmed/getSettingSosmedById'));
Uri
.
parse
(
'
$qry
/settingsosmed/getSettingSosmedByIdDesc'
));
Uri
.
parse
(
'
$qry
/settingsosmed/getSettingSosmedByIdDesc'
));
return
jsonDecode
(
response
.
body
)[
'data'
];
return
jsonDecode
(
response
.
body
)[
'data'
];
}
Future
<
bool
>
createWA
(
wa
)
async
{
final
response
=
await
http
.
post
(
Uri
.
parse
(
'
$cmd
/settingsosmed/saveWhatsapp'
),
body:
jsonEncode
(
{
"whatsapp"
:
wa
,
// "linkedin": ln,
// "twitter": tw,
// "instagram": ig,
// "youtube": yt,
}),
headers:
{
'Content-type'
:
'application/json; charset=UTF-8'
,
});
if
(
response
.
statusCode
==
200
)
{
return
true
;
}
else
{
return
false
;
}
}
Future
<
bool
>
createLN
(
ln
)
async
{
final
response
=
await
http
.
post
(
Uri
.
parse
(
'
$cmd
/settingsosmed/saveLinkedin'
),
body:
jsonEncode
(
{
// "whatsapp": wa,
"linkedin"
:
ln
,
// "twitter": tw,
// "instagram": ig,
// "youtube": yt,
}),
headers:
{
'Content-type'
:
'application/json; charset=UTF-8'
,
});
if
(
response
.
statusCode
==
200
)
{
return
true
;
}
else
{
return
false
;
}
}
Future
<
bool
>
createTW
(
tw
)
async
{
final
response
=
await
http
.
post
(
Uri
.
parse
(
'
$cmd
/settingsosmed/saveTwitter'
),
body:
jsonEncode
(
{
// "whatsapp": wa,
// "linkedin": ln,
"twitter"
:
tw
,
// "instagram": ig,
// "youtube": yt,
}),
headers:
{
'Content-type'
:
'application/json; charset=UTF-8'
,
});
if
(
response
.
statusCode
==
200
)
{
return
true
;
}
else
{
return
false
;
}
}
Future
<
bool
>
createIG
(
ig
)
async
{
final
response
=
await
http
.
post
(
Uri
.
parse
(
'
$cmd
/settingsosmed/saveInstagram'
),
body:
jsonEncode
(
{
// "whatsapp": wa,
// "linkedin": ln,
// "twitter": tw,
"instagram"
:
ig
,
// "youtube": yt,
}),
headers:
{
'Content-type'
:
'application/json; charset=UTF-8'
,
});
if
(
response
.
statusCode
==
200
)
{
return
true
;
}
else
{
return
false
;
}
}
Future
<
bool
>
createYT
(
yt
)
async
{
final
response
=
await
http
.
post
(
Uri
.
parse
(
'
$cmd
/settingsosmed/saveYoutube'
),
body:
jsonEncode
(
{
// "whatsapp": wa,
// "linkedin": ln,
// "twitter": tw,
// "instagram": ig,
"youtube"
:
yt
,
}),
headers:
{
'Content-type'
:
'application/json; charset=UTF-8'
,
});
if
(
response
.
statusCode
==
200
)
{
return
true
;
}
else
{
return
false
;
}
}
Future
<
List
<
dynamic
>>
getWaDesc
()
async
{
var
response
=
await
http
.
get
(
Uri
.
parse
(
'
$qry
/settingsosmed/getWhatsappByIdDesc'
));
return
jsonDecode
(
response
.
body
)[
'data'
];
}
Future
<
List
<
dynamic
>>
getLnDesc
()
async
{
var
response
=
await
http
.
get
(
Uri
.
parse
(
'
$qry
/settingsosmed/getLinkedinByIdDesc'
));
return
jsonDecode
(
response
.
body
)[
'data'
];
}
Future
<
List
<
dynamic
>>
getTwDesc
()
async
{
var
response
=
await
http
.
get
(
Uri
.
parse
(
'
$qry
/settingsosmed/getTwitterByIdDesc'
));
return
jsonDecode
(
response
.
body
)[
'data'
];
}
Future
<
List
<
dynamic
>>
getIgDesc
()
async
{
var
response
=
await
http
.
get
(
Uri
.
parse
(
'
$qry
/settingsosmed/getInstagramByIdDesc'
));
return
jsonDecode
(
response
.
body
)[
'data'
];
}
Future
<
List
<
dynamic
>>
getYtDesc
()
async
{
var
response
=
await
http
.
get
(
Uri
.
parse
(
'
$qry
/settingsosmed/getYoutubeByIdDesc'
));
return
jsonDecode
(
response
.
body
)[
'data'
];
}
}
\ No newline at end of file
lib/api/user_api.dart
View file @
41df0161
...
@@ -29,6 +29,7 @@ Future<bool> signUp(namars,nors,alamatrs,namapic,nopic,email, password)async{
...
@@ -29,6 +29,7 @@ Future<bool> signUp(namars,nors,alamatrs,namapic,nopic,email, password)async{
}
}
// return response.statusCode;
// return response.statusCode;
}
}
Future
<
bool
>
signIn
(
username
,
password
)
async
{
Future
<
bool
>
signIn
(
username
,
password
)
async
{
final
response
=
await
http
.
post
(
final
response
=
await
http
.
post
(
Uri
.
parse
(
'
$cmd
/user/signin'
),
Uri
.
parse
(
'
$cmd
/user/signin'
),
...
...
lib/appbar/appbar_home.dart
View file @
41df0161
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:medapp_eksad/firebase/firebase_auth_methods.dart'
;
import
'package:medapp_eksad/widget/button_appbar.dart'
;
import
'package:medapp_eksad/widget/button_appbar.dart'
;
import
'package:medapp_eksad/register.dart'
;
import
'package:medapp_eksad/register.dart'
;
import
'package:provider/provider.dart'
;
AppBar
AppbarHomeLarge
(
Size
screenSize
,
BuildContext
context
,
Color
home
,
AppBar
AppbarHomeLarge
(
Size
screenSize
,
BuildContext
context
,
Color
home
,
...
@@ -144,6 +146,7 @@ AppBar AppbarHomeLargeUser(Size screenSize, BuildContext context, Color home,
...
@@ -144,6 +146,7 @@ AppBar AppbarHomeLargeUser(Size screenSize, BuildContext context, Color home,
),
),
ElevatedButton
(
ElevatedButton
(
onPressed:
()
{
onPressed:
()
{
context
.
read
<
FirebaseAuthMethods
>().
signOut
(
context
);
Navigator
.
pushNamed
(
context
,
'/'
);
Navigator
.
pushNamed
(
context
,
'/'
);
},
},
style:
ElevatedButton
.
styleFrom
(
style:
ElevatedButton
.
styleFrom
(
...
...
lib/dashboard/admin/admin_sosmed.dart
View file @
41df0161
This diff is collapsed.
Click to expand it.
lib/widget/whatsapp.dart
View file @
41df0161
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:medapp_eksad/api/sosmed_api.dart'
;
import
'package:url_launcher/url_launcher.dart'
;
import
'package:url_launcher/url_launcher.dart'
;
import
'package:spring/spring.dart'
;
import
'package:spring/spring.dart'
;
...
@@ -6,7 +7,7 @@ class WAChat extends StatelessWidget {
...
@@ -6,7 +7,7 @@ class WAChat extends StatelessWidget {
WAChat
({
Key
?
key
})
:
super
(
key:
key
);
WAChat
({
Key
?
key
})
:
super
(
key:
key
);
void
launchWhatsApp
({
void
launchWhatsApp
({
required
final
int
phone
,
required
final
String
phone
,
required
String
message
,
required
String
message
,
})
async
{
})
async
{
String
url
()
{
String
url
()
{
...
@@ -21,32 +22,47 @@ class WAChat extends StatelessWidget {
...
@@ -21,32 +22,47 @@ class WAChat extends StatelessWidget {
}
}
final
SpringController
springController
=
final
SpringController
springController
=
SpringController
(
initialAnim:
Motion
.
play
);
SpringController
(
initialAnim:
Motion
.
play
);
String
wa
=
''
;
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
FloatingActionButton
(
return
FloatingActionButton
(
onPressed:
()
{},
backgroundColor:
Colors
.
green
,
backgroundColor:
Colors
.
green
,
onPressed:
(){
child:
FutureBuilder
<
List
<
dynamic
>>(
springController
.
play
(
future:
getSosmedDesc
(),
motion:
Motion
.
reverse
,
builder:
(
BuildContext
context
,
AsyncSnapshot
snapshot
)
{
animDuration:
const
Duration
(
milliseconds:
1000
),
var
pgm
=
snapshot
.
data
[
0
];
curve:
Curves
.
easeInBack
,
if
(
snapshot
.
hasError
||
delay:
const
Duration
(
milliseconds:
100
));
snapshot
.
data
==
null
||
launchWhatsApp
(
snapshot
.
connectionState
==
ConnectionState
.
waiting
)
{
phone:
6287701892981
,
return
const
CircularProgressIndicator
();
message:
}
'Hallo, saya tertarik dan saya ingin tahu lebih lanjut tentang program Medapp dari EKSAD'
);
return
GestureDetector
(
},
onTap:
()
{
child:
Spring
.
rotate
(
wa
=
pgm
[
'whatsapp'
];
endAngle:
360
*
10
,
springController
.
play
(
animDuration:
const
Duration
(
seconds:
3
*
10
),
motion:
Motion
.
reverse
,
springController:
springController
,
animDuration:
const
Duration
(
milliseconds:
1000
),
alignment:
Alignment
.
center
,
curve:
Curves
.
easeInBack
,
animStatus:
(
AnimStatus
status
)
{},
delay:
const
Duration
(
milliseconds:
100
));
child:
const
Icon
(
Icons
.
whatsapp
,
size:
40
,
color:
Colors
.
white
,),
launchWhatsApp
(
phone:
wa
,
message:
'Hallo, saya tertarik dan saya ingin tahu lebih lanjut tentang program Medapp dari EKSAD'
);
},
child:
Spring
.
rotate
(
endAngle:
360
*
10
,
animDuration:
const
Duration
(
seconds:
3
*
10
),
springController:
springController
,
alignment:
Alignment
.
center
,
animStatus:
(
AnimStatus
status
)
{},
child:
const
Icon
(
Icons
.
whatsapp
,
size:
30
),
),
);
},
),
),
);
);
}
}
}
}
//phone: 81807890777,
\ No newline at end of file
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