Commit aa8c7591 authored by Arham Aulia Nugraha's avatar Arham Aulia Nugraha

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

 Conflicts:
	lib/main.dart
parents 460b1cf3 be5db7ae
......@@ -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/homepage.dart';
import 'package:medapp_eksad/register.dart';
import 'package:medapp_eksad/login.dart';
import 'package:medapp_eksad/screen/contact_us/contact_us.dart';
import 'package:medapp_eksad/screen/solution.dart';
......@@ -22,7 +22,7 @@ class MyApp extends StatelessWidget {
'/about': (context) => const HomePage(),
'/solutions': (context) => const Solutions(),
'/contact': (context) => const ContactUs(),
'/register':(context) => const Register(),
'/login': (context) => const login(),
},
);
}
......
import 'package:flutter/material.dart';
import 'package:medapp_eksad/widget/button_color.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: 15),
width: ScreenSize.width,
height: ScreenSize.height * 1.5,
color: Colors.white,
child: Container(
width: ScreenSize.width * 0.20,
height: ScreenSize.height * 0.75,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
//color: Color.fromARGB(200, 9, 47, 171),
color: Colors.blue[900],
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: 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
),
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
),
)
),
],
),
// 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
// ),
// ),
// ),
),
],
),
],
),
),
),
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