feat: create password page

This commit is contained in:
efrilm
2025-08-29 16:14:02 +07:00
parent f70b43c6ab
commit 5f0284a9e5
6 changed files with 291 additions and 140 deletions
@@ -0,0 +1,50 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import '../../../components/button/button.dart';
import '../../../components/field/field.dart';
import '../../../router/app_router.gr.dart';
@RoutePage()
class CreatePasswordPage extends StatelessWidget {
const CreatePasswordPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Buat Kata Sandi')),
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 24.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 40),
// Title
AppPasswordTextFormField(
title: 'Masukkan kata sandi',
hintText: '********',
),
SizedBox(height: 24),
AppPasswordTextFormField(
title: 'Ulangi kata sandi',
hintText: '********',
),
const SizedBox(height: 50),
Spacer(),
// Continue Button
AppElevatedButton(
onPressed: () => context.router.push(const MainRoute()),
title: 'Konfirmasi',
),
const SizedBox(height: 24),
],
),
),
);
}
}
+1 -17
View File
@@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../../../../common/theme/theme.dart';
import '../../../components/button/button.dart';
import '../../../router/app_router.gr.dart';
@RoutePage()
@@ -83,7 +82,7 @@ class _OtpPageState extends State<OtpPage> {
void _verifyCode() {
String code = _controllers.map((controller) => controller.text).join();
if (code.length == 6) {
context.router.push(PinRoute(isCreatePin: true));
context.router.push(CreatePasswordRoute());
}
}
@@ -228,21 +227,6 @@ class _OtpPageState extends State<OtpPage> {
),
],
const Spacer(),
// Continue Button
AppElevatedButton(
title: 'Verifikasi',
onPressed: () {
String code = _controllers
.map((controller) => controller.text)
.join();
if (code.length == 6) {
_verifyCode();
}
},
),
const SizedBox(height: 24),
],
),