Commit b0dd22fa authored by Dio Maulana's avatar Dio Maulana

reset password

parent f9d67f7d
import 'package:flutter/material.dart';
import 'package:tour_travel_agr/helper/components_widget/custom_appbar.dart';
import 'package:tour_travel_agr/helper/components_widget/password_input.dart';
import 'package:tour_travel_agr/helper/components_widget/widget_button.dart';
import 'package:tour_travel_agr/helper/components_widget/widget_text_field.dart';
import 'package:tour_travel_agr/resource/assets.dart';
import 'package:tour_travel_agr/resource/colors.dart';
import 'package:tour_travel_agr/resource/size.dart';
import 'package:tour_travel_agr/resource/style.dart';
class ResetPasswordView extends StatefulWidget {
const ResetPasswordView({super.key});
@override
State<ResetPasswordView> createState() => _ResetPasswordViewState();
}
class _ResetPasswordViewState extends State<ResetPasswordView> {
final TextEditingController passwordController = TextEditingController();
final TextEditingController newPasswordController = TextEditingController();
bool buttonActive = false;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: ColorManager.backgroundColor,
body: Container(
padding: EdgeInsets.only(
top: AppPadding.safeAreaTop(context),
left: AppPadding.p20,
right: AppPadding.p20,
bottom: AppPadding.safeAreaBot(context),
),
child: Column(
children: [
const CustomAppBar(
text: "Reset Password",
),
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(
top: AppMargin.m10,
),
child: Center(
child: Image(
width: 216,
height: 216,
image: AssetImage(
Assets.resetPassword,
),
),
),
),
Container(
margin: EdgeInsets.only(
top: AppMargin.m25,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Reset",
style: getSemiBoldStyle(
color: Colors.black,
fontSize: 32,
),
),
Text(
"Password",
style: getSemiBoldStyle(
color: Colors.black,
fontSize: 32,
),
)
],
),
),
PasswordInput(
passwordController: passwordController,
labelText: "New Password",
marginTop: AppMargin.m20,
onChanged: (val) {
if (passwordController.text.isNotEmpty &&
newPasswordController.text.isNotEmpty) {
setState(() {
buttonActive = true;
});
} else {
setState(() {
buttonActive = false;
});
}
},
),
PasswordInput(
passwordController: newPasswordController,
labelText: "Confirm New Password",
marginTop: AppMargin.m20,
onChanged: (val) {
if (passwordController.text.isNotEmpty &&
newPasswordController.text.isNotEmpty) {
setState(() {
buttonActive = true;
});
} else {
setState(() {
buttonActive = false;
});
}
},
),
SizedBox(
height: AppMargin.m20,
),
CustomButton(
text: "Submit",
colorButton: (!buttonActive) ? Colors.grey : null,
onTap: () {
if (buttonActive) {
// TODO: do something here
}
},
)
],
),
),
)
],
),
),
);
}
}
......@@ -6,4 +6,5 @@ class Assets {
static String elipse = "${rootImage}elipse.png";
static String verificationHeadImage = "${rootImage}otp_verification.png";
static String forgotPassword = "${rootImage}forgot_password.png";
static String resetPassword = "${rootImage}reset_password.png";
}
......@@ -3,6 +3,7 @@ import 'package:tour_travel_agr/page/forgot_password/forgot_password.dart';
import 'package:tour_travel_agr/page/login/login.dart';
import 'package:tour_travel_agr/page/otp_verification/otp_verification.dart';
import 'package:tour_travel_agr/page/register/register.dart';
import 'package:tour_travel_agr/page/reset_password/reset_password.dart';
import 'package:tour_travel_agr/page/splash/splash.dart';
class Routes {
......@@ -30,6 +31,8 @@ class RouteGenerator {
return pageRouteCustom(const OtpVerificationView());
case Routes.forgotPasswordRoute:
return pageRouteCustom(const ForgotPasswordView());
case Routes.resetPasswordRoute:
return pageRouteCustom(const ResetPasswordView());
default:
return unDefinedRoute();
}
......
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