Commit c7e3394b authored by rizky ramadhan's avatar rizky ramadhan
parents 1b4be560 0c807ebe
......@@ -3,9 +3,9 @@ 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.3.4.231:8081/medapp/v1/api/contact/save'),
Uri.parse('http://10.107.121.210:8081/medapp/v1/api/contact/save'),
body: jsonEncode({
"nama": nama,
"email": email,
......@@ -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 {
......
import 'package:flutter/material.dart';
import 'package:medapp_eksad/widget/button_appbar.dart';
import 'package:medapp_eksad/register.dart';
AppBar AppbarHomeLarge(Size screenSize, BuildContext context, Color home,
......
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),
),
),
),
],
),
),
],
),
);
}
}
......@@ -11,6 +11,7 @@ import 'package:medapp_eksad/screen_small/small_footer.dart';
import 'package:medapp_eksad/screen_small/small_home/small_home1.dart';
import 'package:medapp_eksad/screen_small/small_home/small_home2.dart';
import 'package:medapp_eksad/screen_small/small_home/small_home3.dart';
import 'package:medapp_eksad/screen_small/small_home/small_home4.dart';
import 'package:medapp_eksad/widget/drawer.dart';
import 'package:medapp_eksad/widget/responsive.dart';
import 'package:medapp_eksad/widget/whatsapp.dart';
......@@ -50,6 +51,7 @@ class _HomePageState extends State<HomePage> {
SmallHome1(),
SmallHome2(),
SmallHome3(),
SmallHome4(),
ContactUs2_small(),
FooterSmall(),
],
......
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void setPageTitle(String title, BuildContext context) {
SystemChrome.setApplicationSwitcherDescription(ApplicationSwitcherDescription(
label: title,
primaryColor: Theme.of(context).primaryColor.value, // This line is required
));
}
class login extends StatefulWidget {
const login({Key? key}) : super(key: key);
@override
State<login> createState() => _loginState();
}
class _loginState extends State<login> {
bool _isObscure = true;
final formKey = GlobalKey<FormState>();
String _usmail = '';
String _uspswd = '';
TextEditingController _editingController = TextEditingController();
TextEditingController _editingController2 = TextEditingController();
@override
Widget build(BuildContext context) {
setPageTitle('Login MedApps', context);
var screenSize = MediaQuery.of(context).size;
return Scaffold(
body: Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/bg-medapp.png"),
fit: BoxFit.fill,
)),
height: screenSize.height,
width: screenSize.width,
padding: EdgeInsets.only(
left: screenSize.width * 0.15,
top: screenSize.height * 0.13,
bottom: screenSize.height * 0.13),
child: Stack(
children: [
Container(
decoration: BoxDecoration(
color: const Color.fromARGB(255, 10, 116, 255),
borderRadius: BorderRadius.circular(20),
),
width: screenSize.width * 0.36,
height: screenSize.height * 0.9,
child: Image.asset(
"assets/logo/eksad.jpg",
),
),
Padding(
padding: EdgeInsets.only(
left: screenSize.width * 0.33, top: screenSize.height * 0.07),
child: Container(
width: screenSize.width * 0.3,
height: screenSize.height * 0.6,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
border: Border.all(
width: 5,
color: const Color.fromARGB(255, 10, 116, 255),
),
boxShadow: [
BoxShadow(
color: const Color.fromARGB(255, 10, 116, 255)
.withAlpha(60),
blurRadius: 15.0,
spreadRadius: 20.0,
offset: const Offset(
0.0,
3.0,
),
),
]),
child: Form(
key: formKey,
child: Container(
padding: EdgeInsets.only(
left: screenSize.width * 0.045,
top: screenSize.height * 0.05),
width: screenSize.width * 0.36,
height: screenSize.height * 0.9,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding:
EdgeInsets.only(left: screenSize.width * 0.055),
height: screenSize.width * 0.02,
child: Image.asset("assets/logo/medapp-logo.png"),
),
const Spacer(
flex: 1,
),
Row(
children: [
Icon(
Icons.email_outlined,
color: Colors.grey[500],
size: screenSize.width * 0.01,
),
const SizedBox(
width: 10,
),
const Text("Email"),
],
),
const Spacer(
flex: 1,
),
Container(
height: 40,
width: screenSize.width * 0.2,
child: TextFormField(
controller: _editingController,
textAlign: TextAlign.start,
decoration: InputDecoration(
labelText: "Enter Your Email",
hintStyle: const TextStyle(),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0),
),
),
validator: (value) {
if (value == null || value.trim().isEmpty) {
_editingController.clear();
return "please enter your email address";
} else if (!RegExp(r'\S+@\S+\.\S+')
.hasMatch(value)) {
return 'Please enter a valid email address';
} else {
return null;
}
},
onChanged: (value) => _usmail = value,
),
),
const Spacer(
flex: 2,
),
Row(
children: [
Icon(
Icons.vpn_key_outlined,
color: Colors.grey[500],
size: screenSize.width * 0.01,
),
const SizedBox(
width: 10,
),
const Text("Password"),
],
),
const Spacer(
flex: 1,
),
Container(
height: 40,
width: screenSize.width * 0.2,
child: TextFormField(
controller: _editingController2,
textAlign: TextAlign.start,
obscureText: _isObscure,
decoration: InputDecoration(
labelText: "Password",
suffixIcon: IconButton(
icon: Icon(_isObscure
? Icons.visibility
: Icons.visibility_off),
onPressed: () {
setState(
() {
_isObscure = !_isObscure;
},
);
},
),
hintStyle: const TextStyle(),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0)),
),
validator: (value) {
if (value == null || value.trim().isEmpty) {
_editingController2.clear();
return 'This field is required';
} else if (value.trim().length < 8) {
return 'Password must be at least 8 characters in length';
}
return null;
},
onChanged: (value) => _uspswd = value,
),
),
const Spacer(
flex: 3,
),
Row(
children: [
Container(
height: 30,
width: screenSize.width * 0.08,
child: ElevatedButton(
onPressed: () {
if (_usmail == 'admin@admin.com' &&
_uspswd != 'administrator') {
showDialog<String>(
context: context,
builder: (BuildContext context) =>
AlertDialog(
title: const Text('Gagal login'),
content: const Text(
'Password anda salah!!!'),
actions: <Widget>[
TextButton(
onPressed: () =>
Navigator.pop(context, 'OK'),
child: const Text('OK'),
),
],
),
);
} else if (_usmail == 'client@client.com' &&
_uspswd != 'clientpage') {
showDialog<String>(
context: context,
builder: (BuildContext context) =>
AlertDialog(
title: const Text('Gagal login'),
content: const Text(
'Password anda salah!!!'),
actions: <Widget>[
TextButton(
onPressed: () =>
Navigator.pop(context, 'OK'),
child: const Text('OK'),
),
],
),
);
} else if (_usmail == 'admin@admin.com' &&
_uspswd == 'administrator') {
Navigator.pushNamed(context, '/admin');
} else if (_usmail == 'client@client.com' &&
_uspswd == 'clientpage') {
Navigator.pushNamed(context, '/client');
} else {
showDialog<String>(
context: context,
builder: (BuildContext context) =>
AlertDialog(
title: const Text('Gagal login'),
content: const Text(
'Akun Belum terdaftar, Silahkan Registrasi'),
actions: <Widget>[
TextButton(
onPressed: () =>
Navigator.pop(context, 'OK'),
child: const Text('OK'),
),
],
),
);
}
},
child: const Text("LOGIN"),
),
),
SizedBox(
width: screenSize.width * 0.04,
),
Container(
height: 30,
width: screenSize.width * 0.08,
child: ElevatedButton(
onPressed: () {
Navigator.pushNamed(context, '/register');
},
child: const Text("REGISTER"),
),
),
],
),
const Spacer(
flex: 7,
),
],
),
),
),
),
),
],
),
),
);
}
}
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';
import 'package:medapp_eksad/screen/contact_us/contact_us.dart';
import 'package:medapp_eksad/screen/solution.dart';
......@@ -21,6 +24,9 @@ class MyApp extends StatelessWidget {
'/about': (context) => const HomePage(),
'/solutions': (context) => const Solutions(),
'/contact': (context) => const ContactUs(),
'/login': (context) => const login(),
'/register': (context) => const Register(),
'/dashboard': (context) => const Dashboard()
},
);
}
......
import 'package:flutter/material.dart';
class Register extends StatefulWidget {
const Register({Key? key}) : super(key: key);
@override
State<Register> createState() => _RegisterState();
}
class _RegisterState extends State<Register> {
@override
Widget build(BuildContext context) {
var screenize = MediaQuery.of(context).size;
return Scaffold(
body: Container(
height: screenize.height,
width: screenize.width,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/register.jpg"),
fit: BoxFit.fill,
)
),
),
);
}
}
......@@ -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;
}
}
......@@ -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;
}
}
import 'package:flutter/material.dart';
class SmallHome4 extends StatelessWidget {
const SmallHome4({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
var ScreenSize = MediaQuery.of(context).size;
return Container(
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 20),
width: ScreenSize.width,
height: ScreenSize.height * 1.2,
color: Colors.white,
child: Container(
width: ScreenSize.width * 0.20,
height: ScreenSize.height * 1,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Color.fromARGB(200, 9, 47, 171),
gradient: LinearGradient(
colors: <Color>[
Color(0xff137fc2),
Color(0xff3958d5),
Color(0xff184b80),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
boxShadow: [
BoxShadow(
color: const Color.fromARGB(255, 10, 116, 255).withAlpha(60),
blurRadius: 15.0,
spreadRadius: 10.0,
offset: const Offset(
0.0,
3.0,
),
),
],
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
height: ScreenSize.height * 0.1,
width: ScreenSize.width,
child: Text(
"Mobile & Web Apps",
style: TextStyle(color: Colors.white, fontSize: 36),
textAlign: TextAlign.center,
),
),
Container(
width: ScreenSize.width * 0.85,
height: ScreenSize.height * 0.6,
// color: Colors.white,
decoration: BoxDecoration(
color: Colors.white,
image: DecorationImage(
image: AssetImage('assets/images/medaps3.png'),
fit: BoxFit.fill),
borderRadius: BorderRadius.circular(20)),
),
Container(
height: ScreenSize.height * 0.13,
width: ScreenSize.width,
child: Text(
"MedApps menyediakan Aplikasi Mobile dan juga website yang bisa anda kunjungi",
style: TextStyle(fontSize: 20, color: Colors.white),
textAlign: TextAlign.justify,
)),
Center(
child: Container(
height: 50,
width: 200,
child: ElevatedButton(
onPressed: () {},
style: ElevatedButton.styleFrom(
primary: Colors.blue[900],
onSurface: Colors.white,
side: BorderSide(color: Colors.white),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(30)),
),
),
child: Text(
"LEARN MORE",
style: TextStyle(fontSize: 18, letterSpacing: 2),
),
),
),
),
],
),
),
),
);
}
}
export 'package:medapp_eksad/widget/button_appbar.dart';
export 'package:medapp_eksad/widget/button_color.dart';
export 'package:medapp_eksad/widget/drawer.dart';
export 'package:medapp_eksad/widget/image_slide.dart';
export 'package:medapp_eksad/widget/responsive.dart';
export 'package:medapp_eksad/widget/whatsapp.dart';
export 'package:medapp_eksad/appbar/appbar_home.dart';
export 'package:medapp_eksad/screen/footer.dart';
export 'package:medapp_eksad/screen/solution.dart';
export 'package:medapp_eksad/screen/solution/our_solution.dart';
export 'package:medapp_eksad/screen/solution/our_solution2.dart';
export 'package:medapp_eksad/screen/contact_us/contact_us1.dart';
export 'package:medapp_eksad/screen/contact_us/contact_us2.dart';
export 'package:medapp_eksad/screen_small/small_footer.dart';
export 'package:medapp_eksad/screen_small/small_contact/small_contact_us1.dart';
export 'package:medapp_eksad/screen_small/small_contact/small_contact_us2.dart';
export 'package:medapp_eksad/screen_small/small_home/small_home1.dart';
export 'package:medapp_eksad/screen_small/small_home/small_home2.dart';
export 'package:medapp_eksad/screen_small/small_home/small_home3.dart';
export 'package:medapp_eksad/animation/animasi_kanan_kiri.dart';
export 'package:medapp_eksad/animation/animasi_kiri_kanan.dart';
export 'package:medapp_eksad/animation/kanan_kiri_small.dart';
export 'package:medapp_eksad/animation/kiri_kanan_small.dart';
String varA ='';
String varB ='';
String varC ='';
String varD ='';
String varE ='';
String varF ='';
......@@ -2,11 +2,11 @@ import 'package:flutter/material.dart';
import 'package:carousel_slider/carousel_slider.dart';
final List<String> imgList = [
'/images/homepage.png',
'/images/solution.jpg',
'/images/contactus1.jpg',
'/images/solution1.jpg',
'/images/solution2.jpg',
'images/homepage.png',
'images/solution.jpg',
'images/contactus1.jpg',
'images/solution1.jpg',
'images/solution2.jpg',
];
......
......@@ -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:
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment