1
0
mirror of https://github.com/flutter/samples.git synced 2026-04-19 21:41:43 +00:00

Dispose email and password controllers in the login screen (#2741)

This PR ensures proper disposal of the TextEditingController instances
for the email and password fields in the login screen to prevent memory
leaks.


## Pre-launch Checklist

- [x] I read the [Flutter Style Guide] _recently_, and have followed its
advice.
- [x] I signed the [CLA].
- [x] I read the [Contributors Guide].
- [x] I have added sample code updates to the [changelog].
- [x] I updated/added relevant documentation (doc comments with `///`).

Co-authored-by: Eric Windmill <eric@ericwindmill.com>
This commit is contained in:
Masum Billah Sanjid
2026-04-15 22:19:57 +06:00
committed by GitHub
parent 7a04286eb7
commit 6957e4ad04

View File

@@ -43,6 +43,8 @@ class _LoginScreenState extends State<LoginScreen> {
@override
void dispose() {
_email.dispose();
_password.dispose();
widget.viewModel.login.removeListener(_onResult);
super.dispose();
}