change area to kecamatan and some changes

This commit is contained in:
kicap
2023-11-24 23:17:46 +08:00
parent 2f9e6703ef
commit 880ffeaea1
33 changed files with 855 additions and 749 deletions

View File

@ -1,9 +1,10 @@
import 'package:cek_suara/app/themes/app_colors.dart';
import 'package:cek_suara/ui/widgets/my_button.dart';
import 'package:cek_suara/ui/widgets/my_textformfield.dart';
import 'package:flutter/material.dart';
import 'package:stacked/stacked.dart';
import 'package:validatorless/validatorless.dart';
import '../../../app/themes/app_colors.dart';
import '../../widgets/my_button.dart';
import '../../widgets/my_textformfield.dart';
import './login_screen_view_model.dart';
class LoginScreenView extends StatelessWidget {
@ -37,59 +38,80 @@ class LoginScreenView extends StatelessWidget {
padding:
const EdgeInsets.symmetric(horizontal: 15, vertical: 10),
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(
height: 50,
),
Center(
child: Image.asset(
'assets/logo.png',
width: 200,
height: 200,
child: Form(
key: model.formKey,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(
height: 50,
),
),
const SizedBox(
height: 10,
),
const Text(
'Halaman Login',
),
const SizedBox(
height: 20,
),
const MyTextFormField(
// controller: model.usernameController,
hintText: 'Username',
// prefixIcon: Icons.person,
obscureText: false,
),
const SizedBox(
height: 15,
),
const MyTextFormField(
// controller: model.passwordController,
hintText: 'Password',
suffixIcon: Icon(Icons.lock),
obscureText: true,
),
const SizedBox(
height: 20,
),
SizedBox(
width: 250,
child: MyButton(
// theBackgroundColor: lightColor,
textColor: fontColor,
text: 'Login',
onPressed: () {
model.login();
},
Center(
child: Image.asset(
'assets/logo.png',
width: 200,
height: 200,
),
),
),
],
const SizedBox(
height: 10,
),
const Text(
'Halaman Login',
),
const SizedBox(
height: 20,
),
MyTextFormField(
controller: model.usernameController,
hintText: 'Username',
validator: Validatorless.required(
'Username tidak boleh kosong'),
// prefixIcon: Icons.person,
obscureText: false,
),
const SizedBox(
height: 15,
),
MyTextFormField(
controller: model.passwordController,
hintText: 'Password',
validator: Validatorless.required(
'Password tidak boleh kosong'),
suffixIcon: GestureDetector(
onTap: () {
model.isPasswordVisible =
!model.isPasswordVisible;
},
child: Icon(
model.isPasswordVisible
? Icons.visibility
: Icons.visibility_off,
color: fontColor,
),
),
obscureText: true,
),
const SizedBox(
height: 20,
),
SizedBox(
width: 250,
child: MyButton(
// theBackgroundColor: lightColor,
textColor: fontColor,
text: 'Login',
onPressed: () {
if (model.formKey.currentState!.validate()) {
model.login();
}
// model.login();
},
),
),
],
),
),
),
),