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:
committed by
GitHub
parent
7a04286eb7
commit
6957e4ad04
@@ -43,6 +43,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
|
_email.dispose();
|
||||||
|
_password.dispose();
|
||||||
widget.viewModel.login.removeListener(_onResult);
|
widget.viewModel.login.removeListener(_onResult);
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user