refactor(tests): replace 'final' with 'const' for improved performance in various test files

This commit is contained in:
mso7nueh
2025-12-08 11:32:40 +03:00
parent c2a506cdbf
commit 746d366c18
56 changed files with 199 additions and 254 deletions

View File

@@ -36,7 +36,7 @@ void main() {
Widget createTestWidget(UserRegistrationSheet sheet) {
return MaterialApp(
theme: ThemeHelper().themeData(),
localizationsDelegates: [
localizationsDelegates: const [
S.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
@@ -54,7 +54,7 @@ void main() {
}
testWidgets('displays blood pressure screen', (tester) async {
final sheet = UserRegistrationSheet(
const sheet = UserRegistrationSheet(
firstName: 'Test',
lastName: 'User',
email: 'test@example.com',
@@ -90,7 +90,7 @@ void main() {
});
testWidgets('displays existing blood pressure values', (tester) async {
final sheet = UserRegistrationSheet(
const sheet = UserRegistrationSheet(
firstName: 'Test',
lastName: 'User',
email: 'test@example.com',
@@ -126,7 +126,7 @@ void main() {
});
testWidgets('displays dropdowns for hypo and hyper', (tester) async {
final sheet = UserRegistrationSheet(
const sheet = UserRegistrationSheet(
firstName: 'Test',
lastName: 'User',
email: 'test@example.com',

View File

@@ -36,7 +36,7 @@ void main() {
Widget createTestWidget(UserRegistrationSheet sheet) {
return MaterialApp(
theme: ThemeHelper().themeData(),
localizationsDelegates: [
localizationsDelegates: const [
S.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
@@ -54,7 +54,7 @@ void main() {
}
testWidgets('displays email field', (tester) async {
final sheet = UserRegistrationSheet(
const sheet = UserRegistrationSheet(
firstName: 'Test',
lastName: 'User',
email: '',
@@ -90,7 +90,7 @@ void main() {
});
testWidgets('displays password fields', (tester) async {
final sheet = UserRegistrationSheet(
const sheet = UserRegistrationSheet(
firstName: 'Test',
lastName: 'User',
email: 'test@example.com',
@@ -126,7 +126,7 @@ void main() {
});
testWidgets('initializes with existing values', (tester) async {
final sheet = UserRegistrationSheet(
const sheet = UserRegistrationSheet(
firstName: 'Test',
lastName: 'User',
email: 'test@example.com',

View File

@@ -36,7 +36,7 @@ void main() {
Widget createTestWidget(UserRegistrationSheet sheet) {
return MaterialApp(
theme: ThemeHelper().themeData(),
localizationsDelegates: [
localizationsDelegates: const [
S.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
@@ -54,7 +54,7 @@ void main() {
}
testWidgets('displays date of birth screen', (tester) async {
final sheet = UserRegistrationSheet(
const sheet = UserRegistrationSheet(
firstName: 'Test',
lastName: 'User',
email: 'test@example.com',
@@ -90,7 +90,7 @@ void main() {
});
testWidgets('displays existing birthdate when provided', (tester) async {
final sheet = UserRegistrationSheet(
const sheet = UserRegistrationSheet(
firstName: 'Test',
lastName: 'User',
email: 'test@example.com',
@@ -126,7 +126,7 @@ void main() {
});
testWidgets('displays calendar icon', (tester) async {
final sheet = UserRegistrationSheet(
const sheet = UserRegistrationSheet(
firstName: 'Test',
lastName: 'User',
email: 'test@example.com',