Commit 752658f0 authored by Budi Prasetyo's avatar Budi Prasetyo
parents f8e46b5a 5317d055
...@@ -4,6 +4,7 @@ import 'package:medapp_eksad/dashboard/admin/main_dashboard_admin.dart'; ...@@ -4,6 +4,7 @@ import 'package:medapp_eksad/dashboard/admin/main_dashboard_admin.dart';
import 'package:medapp_eksad/homepage.dart'; import 'package:medapp_eksad/homepage.dart';
import 'package:medapp_eksad/login.dart'; import 'package:medapp_eksad/login.dart';
import 'package:medapp_eksad/register.dart'; import 'package:medapp_eksad/register.dart';
import 'package:medapp_eksad/register_pic.dart';
import 'package:medapp_eksad/screen/contact_us/contact_us.dart'; import 'package:medapp_eksad/screen/contact_us/contact_us.dart';
import 'package:medapp_eksad/screen/solution.dart'; import 'package:medapp_eksad/screen/solution.dart';
import 'package:medapp_eksad/screen_user/demo_user.dart'; import 'package:medapp_eksad/screen_user/demo_user.dart';
...@@ -30,7 +31,8 @@ class MyApp extends StatelessWidget { ...@@ -30,7 +31,8 @@ class MyApp extends StatelessWidget {
'/register': (context) => const Register(), '/register': (context) => const Register(),
'/dashboard': (context) => const DashboardAdmin(), '/dashboard': (context) => const DashboardAdmin(),
'/reset_password': (context) => const ForgotPassword(), '/reset_password': (context) => const ForgotPassword(),
'/demo': (context) => const DemoUser() '/demo': (context) => const DemoUser(),
'/register_pic': (context) => const RegisterPic(),
}, },
); );
} }
......
import 'package:flutter/material.dart';
import 'package:medapp_eksad/api/user_api.dart';
class RegisterPic extends StatefulWidget {
const RegisterPic({Key? key}) : super(key: key);
@override
State<RegisterPic> createState() => _RegisterPicState();
}
class _RegisterPicState extends State<RegisterPic> {
bool _isObscure = true;
final _formKey = GlobalKey<FormState>();
final nameRSController = TextEditingController();
final phoneRSController = TextEditingController();
final addressRSController = TextEditingController();
final namePICController = TextEditingController();
final phonePICController = TextEditingController();
final addressPICController = TextEditingController();
final emailPICController = TextEditingController();
final passwordController = TextEditingController();
@override
Widget build(BuildContext context) {
var screenize = MediaQuery.of(context).size;
return Scaffold(
body: Container(
height: screenize.height,
width: screenize.width,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/bg-medapp.png"),
fit: BoxFit.fill,
)
),
padding: EdgeInsets.only(
left: screenize.width * 0.13,
top: screenize.height * 0.05,
bottom: screenize.height * 0.05
),
child: Stack(
children: [
Padding(
padding: EdgeInsets.symmetric(vertical: screenize.height*0.15),
// child: Container(
// decoration: BoxDecoration(
// color: const Color.fromARGB(255, 10, 116, 255),
// borderRadius: BorderRadius.circular(20),
// ),
// width: screenize.width * 0.36,
// height: screenize.height * 0.7,
// child: Image.asset(
// "assets/logo/logo-eksad.png",
// ),
// ),
child: Image.asset(
"assets/logo/logo-eksad.png",
),
),
Padding(
padding: EdgeInsets.only(
left: screenize.width * 0.35,
),
child: Container(
width: screenize.width * 0.30,
height: screenize.height * 1,
alignment: Alignment.center,
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: screenize.width * 0.045,
top: screenize.height * 0.01
),
width: screenize.width * 0.36,
height: screenize.height * 1,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
const Spacer(),
Container(
padding: EdgeInsets.only(
left: screenize.width * 0.05
),
height: screenize.width * 0.03,
child: Image.asset("assets/logo/medapp-logo.png"),
),
const SizedBox(height: 20,),
// ===============nama rs=============
Row(
children: [
Icon(
Icons.drive_file_rename_outline,
color: Colors.grey[500],
size: screenize.width * 0.01,
),
const SizedBox(
width: 10,
),
const Text("Nama Rumah Sakit",
style: TextStyle(
fontSize: 13
),
),
],
),
const SizedBox(height: 5,),
Row(
children: [
SizedBox(
height: 60,
width: screenize.width * 0.2,
child: TextFormField(
controller: nameRSController,
textAlign: TextAlign.start,
decoration: InputDecoration(
labelText: "Nama Rumah Sakit",
labelStyle: TextStyle(
fontSize: 13
),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0),
)
),
validator: (value){
if (value == null || value.isEmpty){
return "Nama Rumah Sakit tidak boleh kosong";
}
return null;
},
),
)
],
),
// ===============akhir nama rs=============
const SizedBox(height: 5 ,),
// ===============telepon rs==========
Row(
children: [
Icon(
Icons.phone_android,
color: Colors.grey[500],
size: screenize.width * 0.01,
),
const SizedBox(
width: 10,
),
const Text("No Telepon Rumah Sakit",
style: TextStyle(
fontSize: 13
),
),
],
),
const SizedBox(height: 5,),
Row(
children: [
SizedBox(
height: 60,
width: screenize.width * 0.2,
child: TextFormField(
controller: phoneRSController,
textAlign: TextAlign.start,
validator: (value){
if (value == null || value.isEmpty){
return "Nomor Telepon Rumah Sakit tidak boleh kosong";
}
return null;
},
decoration: InputDecoration(
labelText: "Nomor Telepon Rumah Sakit",
labelStyle: TextStyle(
fontSize: 13
),
hintStyle: const TextStyle(),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0),
)
),
),
)
],
),
// ===============akhir telepon rs==========
const SizedBox(height: 5,),
// ===============alamat rs==========
Row(
children: [
Icon(
Icons.phone_android,
color: Colors.grey[500],
size: screenize.width * 0.01,
),
const SizedBox(
width: 10,
),
const Text("Alamat Rumah Sakit",
style: TextStyle(
fontSize: 13
),
),
],
),
const SizedBox(height: 5,),
Row(
children: [
SizedBox(
height: 60,
width: screenize.width * 0.2,
child: TextFormField(
controller: addressRSController,
textAlign: TextAlign.start,
validator: (value){
if (value == null || value.isEmpty){
return "Nomor Alamat Rumah Sakit tidak boleh kosong";
}
return null;
},
decoration: InputDecoration(
labelText: "Nomor Alamat Rumah Sakit",
labelStyle: TextStyle(
fontSize: 13
),
hintStyle: const TextStyle(),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0),
)
),
),
)
],
),
// ===============akhir alamat rs==========
const SizedBox(height: 5,),
// ===============nama pic=============
Row(
children: [
Icon(
Icons.drive_file_rename_outline,
color: Colors.grey[500],
size: screenize.width * 0.01,
),
const SizedBox(
width: 10,
),
const Text("Nama PIC",
style: TextStyle(
fontSize: 13
),
),
],
),
const SizedBox(height: 5,),
Row(
children: [
SizedBox(
height: 60,
width: screenize.width * 0.2,
child: TextFormField(
controller: namePICController,
textAlign: TextAlign.start,
decoration: InputDecoration(
labelText: "Nama PIC",
labelStyle: TextStyle(
fontSize: 13
),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0),
)
),
validator: (value){
if (value == null || value.isEmpty){
return "Nama PIC tidak boleh kosong";
}
return null;
},
),
)
],
),
// ===============akhir nama pic=============
const SizedBox(height: 5 ,),
// ===============telepon rs==========
Row(
children: [
Icon(
Icons.phone_android,
color: Colors.grey[500],
size: screenize.width * 0.01,
),
const SizedBox(
width: 10,
),
const Text("No Telepon PIC",
style: TextStyle(
fontSize: 13
),
),
],
),
const SizedBox(height: 5,),
Row(
children: [
SizedBox(
height: 60,
width: screenize.width * 0.2,
child: TextFormField(
controller: phonePICController,
textAlign: TextAlign.start,
validator: (value){
if (value == null || value.isEmpty){
return "Nomor Telepon PIC tidak boleh kosong";
}
return null;
},
decoration: InputDecoration(
labelText: "Nomor Telepon PIC",
labelStyle: TextStyle(
fontSize: 13
),
hintStyle: const TextStyle(),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0),
)
),
),
)
],
),
// ===============akhir telepon pic==========
const SizedBox(height: 5,),
// ===============email pic==========
Row(
children: [
Icon(
Icons.email_outlined,
color: Colors.grey[500],
size: screenize.width * 0.01,
),
const SizedBox(
width: 10,
),
const Text("Email PIC",
style: TextStyle(
fontSize: 13
),
),
],
),
const SizedBox(height: 5,),
Row(
children: [
SizedBox(
height: 60,
width: screenize.width * 0.2,
child: TextFormField(
controller: emailPICController,
textAlign: TextAlign.start,
validator: (value){
if (value == null || value.isEmpty){
return "Email PIC tidak boleh kosong";
}
return null;
},
decoration: InputDecoration(
labelText: "Email PIC",
labelStyle: TextStyle(
fontSize:13
),
hintStyle: const TextStyle(),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0),
)
),
),
)
],
),
// ===============akhir email pic==========
const SizedBox(height: 5,),
// ===============password==========
Row(
children: [
Icon(
Icons.vpn_key_off_sharp,
color: Colors.grey[500],
size: screenize.width * 0.01,
),
const SizedBox(
width: 10,
),
const Text("Password",
style: TextStyle(
fontSize: 13
),
),
],
),
const SizedBox(height: 5,),
SizedBox(
height: 60,
width: screenize.width * 0.2,
child: TextFormField(
controller: passwordController,
textAlign: TextAlign.start,
validator: (value){
if (value == null || value.isEmpty){
return "Password tidak boleh kosong";
}
return null;
},
obscureText: _isObscure,
decoration: InputDecoration(
labelText: "Password",
labelStyle: TextStyle(
fontSize: 13
),
suffixIcon: IconButton(
icon: Icon(_isObscure
? Icons.visibility
: Icons.visibility_off
),
onPressed: (){
setState(() {
_isObscure = !_isObscure;
});
},
),
hintStyle: const TextStyle(),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0)
),
),
),
),
// ===============akhir password==========
const Spacer(
flex: 4,
),
Row(
children: [
SizedBox(
height: 30,
width: screenize.width * 0.09,
child: ElevatedButton(
onPressed: (){
Navigator.pushNamed(context, '/login');
},
child: const Text("LOGIN"),
),
),
SizedBox(
width: screenize.width * 0.02,
),
SizedBox(
height: 30,
width: screenize.width * 0.09,
child: ElevatedButton(
onPressed: () {},
// onPressed: () async {
// if (_formKey.currentState!.validate()){
// final response = await signUp(
// nameRSController.value.text,
// phoneRSController.value.text,
// addressRSController.value.text,
// namePICController.value.text,
// phonePICController.value.text,
// emailPICController.value.text,
// passwordController.value.text);
// ScaffoldMessenger.of(context).showSnackBar(
// response == true
// ? const SnackBar(
// content: Text("Registrasi berhasil ! cek email untuk validasi"),
// backgroundColor: Colors.green,)
// : const SnackBar(
// content: Text("Registrasi gagal"),
// backgroundColor: Colors.red,)
// );
// print(
// nameRSController.value.text + phoneRSController.value.text + addressPICController.value.text + namePICController.value.text + phonePICController.value.text + emailPICController.value.text + passwordController.value.text
// );
// nameRSController.clear();
// phoneRSController.clear();
// addressPICController.clear();
// namePICController.clear();
// phonePICController.clear();
// emailPICController.clear();
// passwordController.clear();
// }
// },
child: const Text("REGISTER"),
),
)
],
),
const Spacer(
flex: 4,
)
],
),
),
),
),
),
],
),
),
);
}
}
...@@ -125,7 +125,7 @@ class Home4 extends StatelessWidget { ...@@ -125,7 +125,7 @@ class Home4 extends StatelessWidget {
width : 180, width : 180,
child: ElevatedButton( child: ElevatedButton(
onPressed: (){ onPressed: (){
Navigator.pushNamed(context, '/register'); Navigator.pushNamed(context, '/register_pic');
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
primary: Colors.blue[900], primary: Colors.blue[900],
......
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