Commit 85d2ba63 authored by Arham Aulia Nugraha's avatar Arham Aulia Nugraha

register v2

belom validasi
parent 697b8c40
...@@ -54,11 +54,11 @@ class _RegisterState extends State<Register> { ...@@ -54,11 +54,11 @@ class _RegisterState extends State<Register> {
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: screenize.width * 0.33, left: screenize.width * 0.33,
top: screenize.height * 0.07
), ),
child: Container( child: Container(
width: screenize.width * 0.3, width: screenize.width * 0.30,
height: screenize.height * 0.6, height: screenize.height * 0.9,
alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
...@@ -82,7 +82,7 @@ class _RegisterState extends State<Register> { ...@@ -82,7 +82,7 @@ class _RegisterState extends State<Register> {
child: Container( child: Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: screenize.width * 0.045, left: screenize.width * 0.045,
top: screenize.height * 0.02 top: screenize.height * 0.01
), ),
width: screenize.width * 0.36, width: screenize.width * 0.36,
height: screenize.height * 0.8, height: screenize.height * 0.8,
...@@ -107,7 +107,8 @@ class _RegisterState extends State<Register> { ...@@ -107,7 +107,8 @@ class _RegisterState extends State<Register> {
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),
const Text("Nama"), const Text("Nama",
),
], ],
), ),
const SizedBox(height: 5,), const SizedBox(height: 5,),
...@@ -126,6 +127,12 @@ class _RegisterState extends State<Register> { ...@@ -126,6 +127,12 @@ class _RegisterState extends State<Register> {
borderRadius: BorderRadius.circular(5.0), borderRadius: BorderRadius.circular(5.0),
) )
), ),
validator: (value){
if (value == null || value.isEmpty){
return "Nama tidak boleh kosong";
}
return null;
},
), ),
) )
], ],
...@@ -154,6 +161,12 @@ class _RegisterState extends State<Register> { ...@@ -154,6 +161,12 @@ class _RegisterState extends State<Register> {
child: TextFormField( child: TextFormField(
controller: emailController, controller: emailController,
textAlign: TextAlign.start, textAlign: TextAlign.start,
validator: (value){
if (value == null || value.isEmpty){
return "Email tidak boleh kosong";
}
return null;
},
decoration: InputDecoration( decoration: InputDecoration(
labelText: "Email Valid", labelText: "Email Valid",
hintStyle: const TextStyle(), hintStyle: const TextStyle(),
...@@ -189,6 +202,12 @@ class _RegisterState extends State<Register> { ...@@ -189,6 +202,12 @@ class _RegisterState extends State<Register> {
child: TextFormField( child: TextFormField(
controller: phoneController, controller: phoneController,
textAlign: TextAlign.start, textAlign: TextAlign.start,
validator: (value){
if (value == null || value.isEmpty){
return "Nomor handphone tidak boleh kosong";
}
return null;
},
decoration: InputDecoration( decoration: InputDecoration(
labelText: "Nomor Handphone", labelText: "Nomor Handphone",
hintStyle: const TextStyle(), hintStyle: const TextStyle(),
...@@ -223,6 +242,12 @@ class _RegisterState extends State<Register> { ...@@ -223,6 +242,12 @@ class _RegisterState extends State<Register> {
child: TextFormField( child: TextFormField(
controller: usernameController, controller: usernameController,
textAlign: TextAlign.start, textAlign: TextAlign.start,
validator: (value){
if (value == null || value.isEmpty){
return "Username tidak boleh kosong";
}
return null;
},
decoration: InputDecoration( decoration: InputDecoration(
labelText: "Username", labelText: "Username",
hintStyle: const TextStyle(), hintStyle: const TextStyle(),
...@@ -256,6 +281,12 @@ class _RegisterState extends State<Register> { ...@@ -256,6 +281,12 @@ class _RegisterState extends State<Register> {
child: TextFormField( child: TextFormField(
controller: pwController, controller: pwController,
textAlign: TextAlign.start, textAlign: TextAlign.start,
validator: (value){
if (value == null || value.isEmpty){
return "Nama tidak boleh kosong";
}
return null;
},
obscureText: _isObscure, obscureText: _isObscure,
decoration: InputDecoration( decoration: InputDecoration(
labelText: "Password", labelText: "Password",
......
...@@ -2,8 +2,6 @@ import 'package:flutter/material.dart'; ...@@ -2,8 +2,6 @@ import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
// import 'package:mcs_flutter/widget/botton.dart'; // import 'package:mcs_flutter/widget/botton.dart';
// import 'package:mcs_flutter/const/conts.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/api/contact_api.dart';
import 'package:medapp_eksad/widget/button_color.dart'; import 'package:medapp_eksad/widget/button_color.dart';
...@@ -65,7 +63,7 @@ class ContactUs2 extends StatelessWidget { ...@@ -65,7 +63,7 @@ class ContactUs2 extends StatelessWidget {
flex: 1, flex: 1,
), ),
SizedBox( SizedBox(
height: screenSize.height * 0.3, height: screenSize.height * 0.2,
child: Text( child: Text(
'Go for the one who knows what they are doing, those who you share values with, ' 'Go for the one who knows what they are doing, those who you share values with, '
'and those who will celebrate your success, and help you win over your biggest challenges. ' 'and those who will celebrate your success, and help you win over your biggest challenges. '
......
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