41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
import flet as ft
|
|
|
|
class ForgotPassword:
|
|
def __init__(self, page: ft.Page, auth, login):
|
|
self.page = page
|
|
self.auth = auth
|
|
self.login = login
|
|
self.email = ft.TextField(label="E-mail")
|
|
self.code = ft.TextField(label="Code")
|
|
self.password = ft.TextField(
|
|
label="Password",
|
|
password=True,
|
|
can_reveal_password=True
|
|
)
|
|
self.confirm_password = ft.TextField(
|
|
label="Confirm Password",
|
|
password=True,
|
|
can_reveal_password=True
|
|
)
|
|
self.error = ft.Text(color=ft.Colors.RED)
|
|
|
|
def on_login_btn_click(self, e):
|
|
self.auth.placeholder.content.clean()
|
|
self.auth.placeholder.content = self.login.build()
|
|
self.auth.placeholder.update()
|
|
|
|
def build(self):
|
|
return ft.Container(
|
|
ft.Column(
|
|
[
|
|
ft.Text("Forgot Password?"),
|
|
self.email,
|
|
ft.Button("Recover"),
|
|
self.error,
|
|
ft.TextButton("Back to Login", on_click=self.on_login_btn_click)
|
|
],
|
|
spacing=20,
|
|
horizontal_alignment=ft.CrossAxisAlignment.CENTER
|
|
),
|
|
width=400,
|
|
) |