Commit 7289d3c7 authored by Budi Prasetyo's avatar Budi Prasetyo

Merge branch 'master' of http://103.44.149.204/qorridi/medapp_eksad

 Conflicts:
	lib/main.dart
parents 5b81d029 3b8b2765
......@@ -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 {
......
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,
......
......@@ -2,6 +2,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';
......@@ -24,6 +25,7 @@ class MyApp extends StatelessWidget {
'/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 {
......@@ -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';
import 'package:medapp_eksad/widget/button_color.dart';
class SmallHome4 extends StatelessWidget {
const SmallHome4({Key? key}) : super(key: key);
......@@ -10,7 +9,7 @@ class SmallHome4 extends StatelessWidget {
return Container(
padding: EdgeInsets.symmetric(horizontal: 15),
width: ScreenSize.width,
height: ScreenSize.height * 1.5,
height: ScreenSize.height * 1.7,
color: Colors.white,
child: Container(
width: ScreenSize.width * 0.20,
......@@ -21,8 +20,7 @@ class SmallHome4 extends StatelessWidget {
color: Colors.blue[900],
boxShadow: [
BoxShadow(
color:
const Color.fromARGB(255, 10, 116, 255).withAlpha(60),
color: const Color.fromARGB(255, 10, 116, 255).withAlpha(60),
blurRadius: 15.0,
spreadRadius: 10.0,
offset: const Offset(
......@@ -32,119 +30,72 @@ class SmallHome4 extends StatelessWidget {
),
],
),
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
width: ScreenSize.width * 0.36,
height: ScreenSize.height * 0.69,
color: Colors.blue[900],
child: Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.all(30),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
SizedBox(height: 40,),
Row(
children: [
Text("Mobile & Web Apps",
style: TextStyle(
color: Colors.white,
fontSize: 34
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
width: ScreenSize.width * 0.36,
height: ScreenSize.height * 0.7,
color: Colors.blue[900],
child: Column(
children: <Widget>[
Column(
children: [
Container(
height: ScreenSize.height*0.3,
width: ScreenSize.width * 0.30,
child: Text(
"Mobile & Web Apps",
style: TextStyle(color: Colors.white, fontSize: 34),
textAlign: TextAlign.center,
),
),
Container(
height: ScreenSize.height*0.3,
width: ScreenSize.width * 0.30,
child: Text(
"MedApps menyediakan Aplikasi Mobile dan juga website yang bisa anda kunjungi",
style: TextStyle(fontSize: 18, color: Colors.white),
)),
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)),
),
textAlign: TextAlign.left,
),
],
),
SizedBox(height: 30,),
Row(
children: [
Container(
height: 100,
width: ScreenSize.width *0.30,
child: Text(
"MedApps menyediakan Aplikasi Mobile dan juga website yang bisa anda kunjungi",
style: TextStyle(
fontSize: 18,
color: Colors.white
),
)
child: Text(
"LEARN MORE",
style: TextStyle(fontSize: 18, letterSpacing: 2),
),
],
),
),
// SizedBox(height: 10,),
Row(
children: [
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
),
),
),
// child: ElevatedButton(
// onPressed: (){},
// style: DefaultColors(),
// // ElevatedButton.styleFrom(
// // primary: Colors.blue,
// // fixedSize: Size(170, 85),
// // onPrimary: Colors.white,
// // shape: RoundedRectangleBorder(
// // borderRadius: BorderRadius.all(Radius.circular(30),
// // )
// // )
// // ),
// child: Text("LEARN MORE",
// style: TextStyle(
// fontSize: 18,
// letterSpacing: 2
// ),
// ),
// ),
),
],
Container(
width: ScreenSize.width * 0.3,
height: ScreenSize.height * 0.69,
// color: Colors.white,
decoration: BoxDecoration(
color: Colors.white,
image: DecorationImage(
image: AssetImage('assets/images/medaps3.png')),
borderRadius: BorderRadius.circular(20)),
),
],
),
),
],
),
SizedBox(width: 40,),
Container(
width: ScreenSize.width * 0.3,
height: ScreenSize.height * 0.69,
// color: Colors.white,
decoration: BoxDecoration(
color: Colors.white,
image: DecorationImage(
image: AssetImage('assets/images/medaps3.png')
),
borderRadius: BorderRadius.circular(20)
),
),
],
),
),
],
),
),
);
}
}
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