Skip to content

Commit 717618b

Browse files
committed
refactor(authentication): simplify buildWhen condition
- Remove unnecessary checks for specific AuthenticationStatus values - Simplify the condition to only compare previous and current status
1 parent b9c53b0 commit 717618b

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/authentication/view/request_code_page.dart

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,7 @@ class _RequestCodeView extends StatelessWidget {
9191
}
9292
},
9393
// BuildWhen prevents unnecessary rebuilds if only listening
94-
buildWhen: (previous, current) =>
95-
current.status != previous.status &&
96-
(current.status == AuthenticationStatus.initial ||
97-
current.status ==
98-
AuthenticationStatus.requestCodeInProgress ||
99-
current.status == AuthenticationStatus.failure),
94+
buildWhen: (previous, current) => previous.status != current.status,
10095
builder: (context, state) {
10196
final isLoading =
10297
state.status == AuthenticationStatus.requestCodeInProgress;

0 commit comments

Comments
 (0)