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
3e1c8bd8
Commit
3e1c8bd8
authored
Sep 01, 2022
by
r.manan@eksad.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
977d1623
7289d3c7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
204 additions
and
59 deletions
+204
-59
contact_api.dart
lib/api/contact_api.dart
+6
-6
main_dashboard.dart
lib/dashboard/main_dashboard.dart
+174
-0
main.dart
lib/main.dart
+2
-0
contact_us2.dart
lib/screen/contact_us/contact_us2.dart
+4
-27
small_contact_us2.dart
lib/screen_small/small_contact/small_contact_us2.dart
+3
-26
pubspec.lock
pubspec.lock
+14
-0
pubspec.yaml
pubspec.yaml
+1
-0
No files found.
lib/api/contact_api.dart
View file @
3e1c8bd8
...
...
@@ -3,7 +3,7 @@ import 'dart:convert';
import
'package:http/http.dart'
as
http
;
import
'package:medapp_eksad/model/contact_model.dart'
;
Future
<
bool
>
savecontact
(
nama
,
email
,
nohp
,
message
)
async
{
Future
savecontact
(
nama
,
email
,
nohp
,
message
)
async
{
final
response
=
await
http
.
post
(
Uri
.
parse
(
'http://10.107.121.210:8081/medapp/v1/api/contact/save'
),
body:
jsonEncode
({
...
...
@@ -14,11 +14,11 @@ Future<bool> savecontact(nama, email, nohp, message) async {
headers:
{
'Content-type'
:
'application/json; charset=UTF-8'
,
});
if
(
response
.
statusCode
==
200
)
{
return
true
;
}
else
{
return
false
;
}
//
if (response.statusCode == 200) {
//
return true;
//
} else {
//
return false;
//
}
}
Future
<
List
<
contact
>>
showcontact
()
async
{
...
...
lib/dashboard/main_dashboard.dart
0 → 100644
View file @
3e1c8bd8
import
'package:flutter/material.dart'
;
import
'package:easy_sidemenu/easy_sidemenu.dart'
;
class
Dashboard
extends
StatefulWidget
{
const
Dashboard
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
Dashboard
>
createState
()
=>
_DashboardState
();
}
class
_DashboardState
extends
State
<
Dashboard
>
{
PageController
page
=
PageController
();
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
toolbarHeight:
60
,
backgroundColor:
Colors
.
white
,
leadingWidth:
230
,
leading:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
8
,
horizontal:
30
),
child:
Container
(
width:
200
,
decoration:
BoxDecoration
(
image:
DecorationImage
(
image:
AssetImage
(
'assets/logo/medapp-logo.png'
),
fit:
BoxFit
.
fill
)),
),
),
actions:
[
TextButton
.
icon
(
onPressed:
(){},
icon:
Icon
(
Icons
.
remove_red_eye
),
label:
Text
(
'Site Online'
),)
],
),
body:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
SideMenu
(
showToggle:
true
,
controller:
page
,
// onDisplayModeChanged: (mode) {
// print(mode);
// },
style:
SideMenuStyle
(
openSideMenuWidth:
220
,
displayMode:
SideMenuDisplayMode
.
auto
,
hoverColor:
Colors
.
blue
[
100
],
selectedColor:
Colors
.
white
,
selectedTitleTextStyle:
const
TextStyle
(
color:
Colors
.
blueAccent
),
selectedIconColor:
Colors
.
blueAccent
[
700
],
// decoration: BoxDecoration(
// borderRadius: BorderRadius.all(Radius.circular(10)),
// ),
backgroundColor:
Colors
.
blue
,
),
title:
Column
(
children:
[
// ConstrainedBox(
// constraints: const BoxConstraints(
// maxHeight: 150,
// maxWidth: 150,
// ),
// child: Image.asset(
// 'assets/logo/medapp-logo.png',
// ),
// ),
// const Divider(
// indent: 8.0,
// endIndent: 8.0,
// ),
Container
(
height:
20
,)
],
),
footer:
const
Padding
(
padding:
EdgeInsets
.
all
(
8.0
),
child:
Text
(
'Medapp By Eksad'
,
style:
TextStyle
(
fontSize:
15
),
),
),
items:
[
SideMenuItem
(
priority:
0
,
title:
'Dashboard'
,
onTap:
()
{
page
.
jumpToPage
(
0
);
},
icon:
const
Icon
(
Icons
.
home
),
// badgeContent: const Text(
// '3',
// style: TextStyle(color: Colors.white),
// ),
),
SideMenuItem
(
priority:
2
,
title:
'Files'
,
onTap:
()
{
page
.
jumpToPage
(
2
);
},
icon:
const
Icon
(
Icons
.
file_copy_rounded
),
),
SideMenuItem
(
priority:
3
,
title:
'WhatsApp Number'
,
onTap:
()
{
page
.
jumpToPage
(
3
);
},
icon:
const
Icon
(
Icons
.
whatsapp
),
),
SideMenuItem
(
priority:
4
,
title:
'Settings'
,
onTap:
()
{
page
.
jumpToPage
(
4
);
},
icon:
const
Icon
(
Icons
.
settings
),
),
],
),
Expanded
(
child:
PageView
(
controller:
page
,
children:
[
Container
(
color:
Colors
.
white
,
child:
const
Center
(
child:
Text
(
'Dashboard'
,
style:
TextStyle
(
fontSize:
35
),
),
),
),
Container
(
color:
Colors
.
white
,
child:
const
Center
(
child:
Text
(
'Users'
,
style:
TextStyle
(
fontSize:
35
),
),
),
),
Container
(
color:
Colors
.
white
,
child:
const
Center
(
child:
Text
(
'Files'
,
style:
TextStyle
(
fontSize:
35
),
),
),
),
Container
(
color:
Colors
.
white
,
child:
const
Center
(
child:
Text
(
'Download'
,
style:
TextStyle
(
fontSize:
35
),
),
),
),
Container
(
color:
Colors
.
white
,
child:
const
Center
(
child:
Text
(
'Settings'
,
style:
TextStyle
(
fontSize:
35
),
),
),
),
],
),
),
],
),
);
}
}
lib/main.dart
View file @
3e1c8bd8
import
'package:flutter/material.dart'
;
import
'package:medapp_eksad/dashboard/main_dashboard.dart'
;
import
'package:medapp_eksad/homepage.dart'
;
import
'package:medapp_eksad/login.dart'
;
import
'package:medapp_eksad/register.dart'
;
...
...
@@ -25,6 +26,7 @@ class MyApp extends StatelessWidget {
'/contact'
:
(
context
)
=>
const
ContactUs
(),
'/login'
:
(
context
)
=>
const
login
(),
'/register'
:
(
context
)
=>
const
Register
(),
'/dashboard'
:
(
context
)
=>
const
Dashboard
()
},
);
}
...
...
lib/screen/contact_us/contact_us2.dart
View file @
3e1c8bd8
...
...
@@ -4,6 +4,7 @@ import 'package:google_fonts/google_fonts.dart';
// import 'package:mcs_flutter/const/conts.dart';
import
'dart:convert'
;
import
'package:http/http.dart'
as
http
;
import
'package:medapp_eksad/api/contact_api.dart'
;
import
'package:medapp_eksad/widget/button_color.dart'
;
class
ContactUs2
extends
StatelessWidget
{
...
...
@@ -54,7 +55,7 @@ class ContactUs2 extends StatelessWidget {
'
\n
'
'an outsourcing partner '
'you can trust and thrive with'
,
textAlign:
TextAlign
.
justify
,
textAlign:
TextAlign
.
left
,
style:
GoogleFonts
.
poppins
(
color:
Colors
.
white
,
fontSize:
30
,
...
...
@@ -251,10 +252,10 @@ class ContactUs2 extends StatelessWidget {
style:
Btn_Submit
(),
onPressed:
()
async
{
if
(
_formKey
.
currentState
!.
validate
())
{
final
response
=
await
SendEmail
(
final
response
=
await
savecontact
(
nameController
.
value
.
text
,
phoneController
.
value
.
text
,
emailController
.
value
.
text
,
phoneController
.
value
.
text
,
messageController
.
value
.
text
);
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
response
==
200
...
...
@@ -289,28 +290,4 @@ class ContactUs2 extends StatelessWidget {
),
);
}
Future
SendEmail
(
String
name
,
String
phone
,
String
email
,
String
message
)
async
{
final
url
=
Uri
.
parse
(
'https://api.emailjs.com/api/v1.0/email/send'
);
const
serviceId
=
'service_wava70j'
;
const
templateId
=
'template_koc73cj'
;
const
userId
=
'h4BmDnyWlm3OziBDx'
;
final
response
=
await
http
.
post
(
url
,
headers:
{
'Content-Type'
:
'application/json'
},
//This line makes sure it works for all platforms.
body:
json
.
encode
({
'service_id'
:
serviceId
,
'template_id'
:
templateId
,
'user_id'
:
userId
,
'template_params'
:
{
'from_name'
:
name
,
'from_phone'
:
phone
,
'to_email'
:
email
,
'message'
:
message
}
}));
return
response
.
statusCode
;
}
}
lib/screen_small/small_contact/small_contact_us2.dart
View file @
3e1c8bd8
...
...
@@ -4,6 +4,7 @@ import 'package:google_fonts/google_fonts.dart';
// import 'package:mcs_flutter/const/conts.dart';
import
'dart:convert'
;
import
'package:http/http.dart'
as
http
;
import
'package:medapp_eksad/api/contact_api.dart'
;
import
'package:medapp_eksad/widget/button_color.dart'
;
...
...
@@ -232,10 +233,10 @@ class _ContactUs2_smallState extends State<ContactUs2_small> {
style:
Btn_Submit
(),
onPressed:
()
async
{
if
(
_formKey
.
currentState
!.
validate
())
{
final
response
=
await
SendEmail
(
final
response
=
await
savecontact
(
nameController
.
value
.
text
,
phoneController
.
value
.
text
,
emailController
.
value
.
text
,
phoneController
.
value
.
text
,
messageController
.
value
.
text
);
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
response
==
200
...
...
@@ -267,30 +268,6 @@ class _ContactUs2_smallState extends State<ContactUs2_small> {
),
);
}
Future
SendEmail
(
String
name
,
String
phone
,
String
email
,
String
message
)
async
{
final
url
=
Uri
.
parse
(
'https://api.emailjs.com/api/v1.0/email/send'
);
const
serviceId
=
'service_wava70j'
;
const
templateId
=
'template_koc73cj'
;
const
userId
=
'h4BmDnyWlm3OziBDx'
;
final
response
=
await
http
.
post
(
url
,
headers:
{
'Content-Type'
:
'application/json'
},
//This line makes sure it works for all platforms.
body:
json
.
encode
({
'service_id'
:
serviceId
,
'template_id'
:
templateId
,
'user_id'
:
userId
,
'template_params'
:
{
'from_name'
:
name
,
'from_phone'
:
phone
,
'to_email'
:
email
,
'message'
:
message
}
}));
return
response
.
statusCode
;
}
}
pubspec.lock
View file @
3e1c8bd8
...
...
@@ -8,6 +8,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.2"
badges:
dependency: transitive
description:
name: badges
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3"
boolean_selector:
dependency: transitive
description:
...
...
@@ -78,6 +85,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.2"
easy_sidemenu:
dependency: "direct main"
description:
name: easy_sidemenu
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.1"
fake_async:
dependency: transitive
description:
...
...
pubspec.yaml
View file @
3e1c8bd8
...
...
@@ -35,6 +35,7 @@ dependencies:
font_awesome_flutter
:
^10.1.0
intl
:
^0.17.0
dropdown_search
:
^5.0.2
easy_sidemenu
:
^0.3.1
sidebarx
:
^0.7.0
flutter_web_plugins
:
sdk
:
flutter
...
...
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