Commit 5c06fa7d authored by Fikri's avatar Fikri

merapikan register_pic

parent 5317d055
...@@ -9,7 +9,6 @@ class RegisterPic extends StatefulWidget { ...@@ -9,7 +9,6 @@ class RegisterPic extends StatefulWidget {
} }
class _RegisterPicState extends State<RegisterPic> { class _RegisterPicState extends State<RegisterPic> {
bool _isObscure = true; bool _isObscure = true;
final _formKey = GlobalKey<FormState>(); final _formKey = GlobalKey<FormState>();
...@@ -30,21 +29,19 @@ class _RegisterPicState extends State<RegisterPic> { ...@@ -30,21 +29,19 @@ class _RegisterPicState extends State<RegisterPic> {
body: Container( body: Container(
height: screenize.height, height: screenize.height,
width: screenize.width, width: screenize.width,
decoration: const BoxDecoration( decoration: const BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage("assets/images/bg-medapp.png"), image: AssetImage("assets/images/bg-medapp.png"),
fit: BoxFit.fill, fit: BoxFit.fill,
) )),
),
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: screenize.width * 0.13, left: screenize.width * 0.13,
top: screenize.height * 0.05, top: screenize.height * 0.05,
bottom: screenize.height * 0.05 bottom: screenize.height * 0.05),
),
child: Stack( child: Stack(
children: [ children: [
Padding( Padding(
padding: EdgeInsets.symmetric(vertical: screenize.height*0.15), padding: EdgeInsets.symmetric(vertical: screenize.height * 0.15),
// child: Container( // child: Container(
// decoration: BoxDecoration( // decoration: BoxDecoration(
// color: const Color.fromARGB(255, 10, 116, 255), // color: const Color.fromARGB(255, 10, 116, 255),
...@@ -57,15 +54,15 @@ class _RegisterPicState extends State<RegisterPic> { ...@@ -57,15 +54,15 @@ class _RegisterPicState extends State<RegisterPic> {
// ), // ),
// ), // ),
child: Image.asset( child: Image.asset(
"assets/logo/logo-eksad.png", "assets/logo/logo-eksad.png",
), ),
), ),
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: screenize.width * 0.35, left: screenize.width * 0.35,
), ),
child: Container( child: Container(
width: screenize.width * 0.30, width: screenize.width * 0.50,
height: screenize.height * 1, height: screenize.height * 1,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
...@@ -77,23 +74,24 @@ class _RegisterPicState extends State<RegisterPic> { ...@@ -77,23 +74,24 @@ class _RegisterPicState extends State<RegisterPic> {
), ),
boxShadow: [ boxShadow: [
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, blurRadius: 15.0,
spreadRadius: 20.0, spreadRadius: 20.0,
offset: const Offset( offset: const Offset(
0.0, 0.0,
3.0, 3.0,
), ),
),], ),
],
), ),
child: Form( child: Form(
key: _formKey, key: _formKey,
child: Container( child: Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: screenize.width * 0.045, left: screenize.width * 0.045,
top: screenize.height * 0.01 top: screenize.height * 0.01),
), width: screenize.width * 0.50,
width: screenize.width * 0.36,
height: screenize.height * 1, height: screenize.height * 1,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -101,317 +99,360 @@ class _RegisterPicState extends State<RegisterPic> { ...@@ -101,317 +99,360 @@ class _RegisterPicState extends State<RegisterPic> {
children: [ children: [
const Spacer(), const Spacer(),
Container( Container(
padding: EdgeInsets.only( padding:
left: screenize.width * 0.05 EdgeInsets.only(left: screenize.width * 0.15),
),
height: screenize.width * 0.03, height: screenize.width * 0.03,
child: Image.asset("assets/logo/medapp-logo.png"), child: Image.asset("assets/logo/medapp-logo.png"),
), ),
const SizedBox(height: 20,), 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( Row(
children: [ children: [
SizedBox( Column(
height: 60, crossAxisAlignment: CrossAxisAlignment.start,
width: screenize.width * 0.2, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
child: TextFormField( children: [
controller: nameRSController, // ===============nama rs=============
textAlign: TextAlign.start, Row(
decoration: InputDecoration( children: [
labelText: "Nama Rumah Sakit", Icon(
labelStyle: TextStyle( Icons.drive_file_rename_outline,
fontSize: 13 color: Colors.grey[500],
), size: screenize.width * 0.01,
border: OutlineInputBorder( ),
borderRadius: BorderRadius.circular(5.0), const SizedBox(
) width: 10,
),
const Text(
"Nama Rumah Sakit",
style: TextStyle(fontSize: 13),
),
],
), ),
validator: (value){ const SizedBox(
if (value == null || value.isEmpty){ height: 5,
return "Nama Rumah Sakit tidak boleh kosong"; ),
} Row(
return null; children: [
}, SizedBox(
), height: 60,
) width: screenize.width * 0.2,
], child: TextFormField(
), controller: nameRSController,
// ===============akhir nama rs============= textAlign: TextAlign.start,
decoration: InputDecoration(
const SizedBox(height: 5 ,), labelText: "Nama Rumah Sakit",
labelStyle: TextStyle(fontSize: 13),
// ===============telepon rs========== border: OutlineInputBorder(
Row( borderRadius:
children: [ BorderRadius.circular(5.0),
Icon( )),
Icons.phone_android, validator: (value) {
color: Colors.grey[500], if (value == null || value.isEmpty) {
size: screenize.width * 0.01, return "Nama Rumah Sakit tidak boleh kosong";
}
return null;
},
),
)
],
),
// ===============akhir nama rs=============
],
), ),
const SizedBox( const SizedBox(
width: 10, width: 30,
),
const Text("No Telepon Rumah Sakit",
style: TextStyle(
fontSize: 13
),
), ),
], Column(
), crossAxisAlignment: CrossAxisAlignment.start,
const SizedBox(height: 5,), mainAxisAlignment: MainAxisAlignment.spaceEvenly,
Row( children: [
children: [ // ===============telepon rs==========
SizedBox( Row(
height: 60, children: [
width: screenize.width * 0.2, Icon(
child: TextFormField( Icons.phone_android,
controller: phoneRSController, color: Colors.grey[500],
textAlign: TextAlign.start, size: screenize.width * 0.01,
validator: (value){ ),
if (value == null || value.isEmpty){ const SizedBox(
return "Nomor Telepon Rumah Sakit tidak boleh kosong"; width: 10,
}
return null;
},
decoration: InputDecoration(
labelText: "Nomor Telepon Rumah Sakit",
labelStyle: TextStyle(
fontSize: 13
), ),
hintStyle: const TextStyle(), const Text(
border: OutlineInputBorder( "No Telepon Rumah Sakit",
borderRadius: BorderRadius.circular(5.0), 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==========
) ],
],
),
// ===============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( Row(
children: [ children: [
SizedBox( Column(
height: 60, crossAxisAlignment: CrossAxisAlignment.start,
width: screenize.width * 0.2, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
child: TextFormField( children: [
controller: addressRSController, // ===============alamat rs==========
textAlign: TextAlign.start, Row(
validator: (value){ children: [
if (value == null || value.isEmpty){ Icon(
return "Nomor Alamat Rumah Sakit tidak boleh kosong"; Icons.add_home_work_sharp,
} color: Colors.grey[500],
return null; size: screenize.width * 0.01,
}, ),
decoration: InputDecoration( const SizedBox(
labelText: "Nomor Alamat Rumah Sakit", width: 10,
labelStyle: TextStyle( ),
fontSize: 13 const Text(
"Alamat Rumah Sakit",
style: TextStyle(fontSize: 13),
), ),
hintStyle: const TextStyle(), ],
border: OutlineInputBorder( ),
borderRadius: BorderRadius.circular(5.0), 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==========
) ],
],
),
// ===============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( const SizedBox(
width: 10, width: 30,
),
const Text("Nama PIC",
style: TextStyle(
fontSize: 13
),
), ),
], Column(
), crossAxisAlignment: CrossAxisAlignment.start,
const SizedBox(height: 5,), mainAxisAlignment: MainAxisAlignment.spaceEvenly,
Row( children: [
children: [ // ===============nama pic=============
SizedBox( Row(
height: 60, children: [
width: screenize.width * 0.2, Icon(
child: TextFormField( Icons.drive_file_rename_outline,
controller: namePICController, color: Colors.grey[500],
textAlign: TextAlign.start, size: screenize.width * 0.01,
decoration: InputDecoration( ),
labelText: "Nama PIC", const SizedBox(
labelStyle: TextStyle( width: 10,
fontSize: 13 ),
), const Text(
border: OutlineInputBorder( "Nama PIC",
borderRadius: BorderRadius.circular(5.0), style: TextStyle(fontSize: 13),
) ),
],
), ),
validator: (value){ const SizedBox(
if (value == null || value.isEmpty){ height: 5,
return "Nama PIC tidak boleh kosong"; ),
} Row(
return null; children: [
}, SizedBox(
), height: 60,
) width: screenize.width * 0.2,
], child: TextFormField(
), controller: namePICController,
// ===============akhir nama pic============= textAlign: TextAlign.start,
decoration: InputDecoration(
const SizedBox(height: 5 ,), labelText: "Nama PIC",
labelStyle: TextStyle(fontSize: 13),
// ===============telepon rs========== border: OutlineInputBorder(
Row( borderRadius:
children: [ BorderRadius.circular(5.0),
Icon( )),
Icons.phone_android, validator: (value) {
color: Colors.grey[500], if (value == null || value.isEmpty) {
size: screenize.width * 0.01, return "Nama PIC tidak boleh kosong";
), }
const SizedBox( return null;
width: 10, },
), ),
const Text("No Telepon PIC", )
style: TextStyle( ],
fontSize: 13 ),
), // ===============akhir nama pic=============
],
), ),
], ],
), ),
const SizedBox(height: 5,),
Row( Row(
children: [ children: [
SizedBox( Column(
height: 60, crossAxisAlignment: CrossAxisAlignment.start,
width: screenize.width * 0.2, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
child: TextFormField( children: [
controller: phonePICController, // ===============telepon pic==========
textAlign: TextAlign.start, Row(
validator: (value){ children: [
if (value == null || value.isEmpty){ Icon(
return "Nomor Telepon PIC tidak boleh kosong"; Icons.phone_android,
} color: Colors.grey[500],
return null; size: screenize.width * 0.01,
}, ),
decoration: InputDecoration( const SizedBox(
labelText: "Nomor Telepon PIC", width: 10,
labelStyle: TextStyle(
fontSize: 13
), ),
hintStyle: const TextStyle(), const Text(
border: OutlineInputBorder( "No Telepon PIC",
borderRadius: BorderRadius.circular(5.0), 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==========
) ],
],
),
// ===============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( const SizedBox(
width: 10, width: 30,
), ),
const Text("Email PIC", Column(
style: TextStyle( crossAxisAlignment: CrossAxisAlignment.start,
fontSize: 13 mainAxisAlignment: MainAxisAlignment.spaceEvenly,
), children: [
), // ===============email pic==========
], Row(
), children: [
const SizedBox(height: 5,), Icon(
Row( Icons.email_outlined,
children: [ color: Colors.grey[500],
SizedBox( size: screenize.width * 0.01,
height: 60, ),
width: screenize.width * 0.2, const SizedBox(
child: TextFormField( width: 10,
controller: emailPICController, ),
textAlign: TextAlign.start, const Text(
validator: (value){ "Email PIC",
if (value == null || value.isEmpty){ style: TextStyle(fontSize: 13),
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), 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==========
) ],
),
], ],
), ),
// ===============akhir email pic========== Row(
children: [
const SizedBox(height: 5,), Column(
crossAxisAlignment: CrossAxisAlignment.start,
// ===============password========== mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
// ===============password==========
Row( Row(
children: [ children: [
Icon( Icon(
...@@ -467,67 +508,75 @@ class _RegisterPicState extends State<RegisterPic> { ...@@ -467,67 +508,75 @@ class _RegisterPicState extends State<RegisterPic> {
), ),
), ),
// ===============akhir password========== // ===============akhir password==========
],
),
],
),
const Spacer( const Spacer(
flex: 4, flex: 4,
), ),
Row( Container(
children: [ padding:
EdgeInsets.only(left: screenize.width * 0.10),
SizedBox( height: screenize.width * 0.03,
height: 30, child: Row(
width: screenize.width * 0.09, children: [
child: ElevatedButton( SizedBox(
onPressed: (){ height: 30,
Navigator.pushNamed(context, '/login'); width: screenize.width * 0.09,
}, child: ElevatedButton(
child: const Text("LOGIN"), onPressed: () {
Navigator.pushNamed(context, '/login');
},
child: const Text("LOGIN"),
),
), ),
), SizedBox(
SizedBox( width: screenize.width * 0.02,
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"),
), ),
) 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( const Spacer(
flex: 4, flex: 4,
......
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