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

@@ -18,7 +18,7 @@ void main() {
}); });
test('creates loaded state with comment', () { test('creates loaded state with comment', () {
final comment = CommentModel( const comment = CommentModel(
data: [], data: [],
links: Links(first: '', last: '', prev: null, next: null), links: Links(first: '', last: '', prev: null, next: null),
meta: Meta( meta: Meta(
@@ -33,14 +33,14 @@ void main() {
), ),
); );
final state = CommentsState.loaded(comment: comment); const state = CommentsState.loaded(comment: comment);
expect(state, isA<CommentsStateLoaded>()); expect(state, isA<CommentsStateLoaded>());
expect((state as CommentsStateLoaded).comment, comment); expect((state as CommentsStateLoaded).comment, comment);
}); });
test('creates loaded state with replyId', () { test('creates loaded state with replyId', () {
final comment = CommentModel( const comment = CommentModel(
data: [], data: [],
links: Links(first: '', last: '', prev: null, next: null), links: Links(first: '', last: '', prev: null, next: null),
meta: Meta( meta: Meta(
@@ -55,7 +55,7 @@ void main() {
), ),
); );
final state = CommentsState.loaded( const state = CommentsState.loaded(
comment: comment, comment: comment,
replyId: 123, replyId: 123,
); );
@@ -64,7 +64,7 @@ void main() {
}); });
test('creates loaded state with editedCommentId', () { test('creates loaded state with editedCommentId', () {
final comment = CommentModel( const comment = CommentModel(
data: [], data: [],
links: Links(first: '', last: '', prev: null, next: null), links: Links(first: '', last: '', prev: null, next: null),
meta: Meta( meta: Meta(
@@ -79,7 +79,7 @@ void main() {
), ),
); );
final state = CommentsState.loaded( const state = CommentsState.loaded(
comment: comment, comment: comment,
editedCommentId: 456, editedCommentId: 456,
); );

View File

@@ -10,7 +10,7 @@ void main() {
Widget createTestWidget(Widget child) { Widget createTestWidget(Widget child) {
return MaterialApp( return MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,

View File

@@ -31,17 +31,17 @@ void main() {
group('Animations', () { group('Animations', () {
test('has correct animation durations', () { test('has correct animation durations', () {
expect(AppConstants.defaultAnimationDuration, Duration(milliseconds: 300)); expect(AppConstants.defaultAnimationDuration, const Duration(milliseconds: 300));
expect(AppConstants.fastAnimationDuration, Duration(milliseconds: 150)); expect(AppConstants.fastAnimationDuration, const Duration(milliseconds: 150));
expect(AppConstants.slowAnimationDuration, Duration(milliseconds: 500)); expect(AppConstants.slowAnimationDuration, const Duration(milliseconds: 500));
}); });
}); });
group('Timeouts', () { group('Timeouts', () {
test('has correct timeout durations', () { test('has correct timeout durations', () {
expect(AppConstants.defaultTimeout, Duration(seconds: 30)); expect(AppConstants.defaultTimeout, const Duration(seconds: 30));
expect(AppConstants.shortTimeout, Duration(seconds: 10)); expect(AppConstants.shortTimeout, const Duration(seconds: 10));
expect(AppConstants.longTimeout, Duration(minutes: 2)); expect(AppConstants.longTimeout, const Duration(minutes: 2));
}); });
}); });
@@ -127,4 +127,3 @@ void main() {
}); });
}); });
} }

View File

@@ -11,7 +11,7 @@ class TestCubit extends BaseCubit<String> {
Future<String?> executeOperation() async { Future<String?> executeOperation() async {
return await safeExecute(() async { return await safeExecute(() async {
await Future.delayed(Duration(milliseconds: 10)); await Future.delayed(const Duration(milliseconds: 10));
return 'success'; return 'success';
}); });
} }
@@ -19,7 +19,7 @@ class TestCubit extends BaseCubit<String> {
Future<String?> executeOperationWithState() async { Future<String?> executeOperationWithState() async {
return await safeExecuteWithState( return await safeExecuteWithState(
() async { () async {
await Future.delayed(Duration(milliseconds: 10)); await Future.delayed(const Duration(milliseconds: 10));
return 'result'; return 'result';
}, },
loadingState: 'loading', loadingState: 'loading',

View File

@@ -49,7 +49,7 @@ void main() {
}); });
test('getErrorMessage extracts error message from error state', () { test('getErrorMessage extracts error message from error state', () {
final errorState = 'error: Something went wrong'; const errorState = 'error: Something went wrong';
final message = StateUtils.getErrorMessage(errorState); final message = StateUtils.getErrorMessage(errorState);
expect(message, isNotNull); expect(message, isNotNull);
expect(message, contains('Something')); expect(message, contains('Something'));

View File

@@ -4,7 +4,7 @@ import 'package:flutter_test/flutter_test.dart';
void main() { void main() {
group('SelectionPopupModel', () { group('SelectionPopupModel', () {
test('creates model with all parameters', () { test('creates model with all parameters', () {
final model = SelectionPopupModel( const model = SelectionPopupModel(
id: 1, id: 1,
title: 'Test Title', title: 'Test Title',
value: 'Test Value', value: 'Test Value',
@@ -18,7 +18,7 @@ void main() {
}); });
test('creates model with default isSelected value', () { test('creates model with default isSelected value', () {
final model = SelectionPopupModel( const model = SelectionPopupModel(
title: 'Test Title', title: 'Test Title',
value: 'Test Value', value: 'Test Value',
); );
@@ -27,7 +27,7 @@ void main() {
}); });
test('creates model with null id', () { test('creates model with null id', () {
final model = SelectionPopupModel( const model = SelectionPopupModel(
id: null, id: null,
title: 'Test Title', title: 'Test Title',
value: 'Test Value', value: 'Test Value',
@@ -38,17 +38,17 @@ void main() {
}); });
test('creates model with different value types', () { test('creates model with different value types', () {
final model1 = SelectionPopupModel( const model1 = SelectionPopupModel(
title: 'Test', title: 'Test',
value: 123, value: 123,
); );
final model2 = SelectionPopupModel( const model2 = SelectionPopupModel(
title: 'Test', title: 'Test',
value: 'String Value', value: 'String Value',
); );
final model3 = SelectionPopupModel( const model3 = SelectionPopupModel(
title: 'Test', title: 'Test',
value: true, value: true,
); );
@@ -59,13 +59,13 @@ void main() {
}); });
test('can be compared', () { test('can be compared', () {
final model1 = SelectionPopupModel( const model1 = SelectionPopupModel(
id: 1, id: 1,
title: 'Test', title: 'Test',
value: 'Value', value: 'Value',
); );
final model2 = SelectionPopupModel( const model2 = SelectionPopupModel(
id: 1, id: 1,
title: 'Test', title: 'Test',
value: 'Value', value: 'Value',

View File

@@ -4,7 +4,7 @@ import 'package:flutter_test/flutter_test.dart';
void main() { void main() {
group('Links', () { group('Links', () {
test('creates Links with all parameters', () { test('creates Links with all parameters', () {
final links = Links( const links = Links(
first: 'http://example.com?page=1', first: 'http://example.com?page=1',
last: 'http://example.com?page=10', last: 'http://example.com?page=10',
prev: 'http://example.com?page=2', prev: 'http://example.com?page=2',
@@ -18,7 +18,7 @@ void main() {
}); });
test('creates Links with null prev and next', () { test('creates Links with null prev and next', () {
final links = Links( const links = Links(
first: 'http://example.com?page=1', first: 'http://example.com?page=1',
last: 'http://example.com?page=10', last: 'http://example.com?page=10',
prev: null, prev: null,
@@ -32,7 +32,7 @@ void main() {
group('Link', () { group('Link', () {
test('creates Link with all parameters', () { test('creates Link with all parameters', () {
final link = Link( const link = Link(
url: 'http://example.com?page=1', url: 'http://example.com?page=1',
label: '1', label: '1',
active: true, active: true,
@@ -44,7 +44,7 @@ void main() {
}); });
test('creates Link with null values', () { test('creates Link with null values', () {
final link = Link( const link = Link(
url: null, url: null,
label: null, label: null,
active: null, active: null,
@@ -58,7 +58,7 @@ void main() {
group('Meta', () { group('Meta', () {
test('creates Meta with all parameters', () { test('creates Meta with all parameters', () {
final meta = Meta( const meta = Meta(
currentPage: 1, currentPage: 1,
from: 1, from: 1,
lastPage: 10, lastPage: 10,
@@ -80,7 +80,7 @@ void main() {
}); });
test('creates Meta with null optional values', () { test('creates Meta with null optional values', () {
final meta = Meta( const meta = Meta(
currentPage: 1, currentPage: 1,
from: null, from: null,
lastPage: 10, lastPage: 10,
@@ -99,12 +99,12 @@ void main() {
}); });
test('creates Meta with links list', () { test('creates Meta with links list', () {
final links = [ const links = [
Link(url: 'http://example.com?page=1', label: '1', active: true), Link(url: 'http://example.com?page=1', label: '1', active: true),
Link(url: 'http://example.com?page=2', label: '2', active: false), Link(url: 'http://example.com?page=2', label: '2', active: false),
]; ];
final meta = Meta( const meta = Meta(
currentPage: 1, currentPage: 1,
from: 1, from: 1,
lastPage: 10, lastPage: 10,

View File

@@ -165,19 +165,19 @@ void main() {
}); });
test('primaryColorScheme has primary color', () { test('primaryColorScheme has primary color', () {
final colorScheme = ColorSchemes.primaryColorScheme; const colorScheme = ColorSchemes.primaryColorScheme;
expect(colorScheme.primary, isA<Color>()); expect(colorScheme.primary, isA<Color>());
}); });
test('primaryColorScheme has onPrimary color', () { test('primaryColorScheme has onPrimary color', () {
final colorScheme = ColorSchemes.primaryColorScheme; const colorScheme = ColorSchemes.primaryColorScheme;
expect(colorScheme.onPrimary, isA<Color>()); expect(colorScheme.onPrimary, isA<Color>());
}); });
test('primaryColorScheme has onPrimaryContainer color', () { test('primaryColorScheme has onPrimaryContainer color', () {
final colorScheme = ColorSchemes.primaryColorScheme; const colorScheme = ColorSchemes.primaryColorScheme;
expect(colorScheme.onPrimaryContainer, isA<Color>()); expect(colorScheme.onPrimaryContainer, isA<Color>());
}); });

View File

@@ -30,7 +30,7 @@ void main() {
); );
// Scroll to trigger notification // Scroll to trigger notification
await tester.drag(find.byType(SingleChildScrollView), Offset(0, -100)); await tester.drag(find.byType(SingleChildScrollView), const Offset(0, -100));
await tester.pump(); await tester.pump();
expect(loadNewContent, isA<Function>()); expect(loadNewContent, isA<Function>());

View File

@@ -9,7 +9,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: AddItemButton(), body: AddItemButton(),
), ),
), ),
@@ -44,7 +44,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: AddItemButton(), body: AddItemButton(),
), ),
), ),

View File

@@ -73,7 +73,7 @@ void main() {
text: 'Option 1', text: 'Option 1',
isSelected: false, isSelected: false,
onTap: () {}, onTap: () {},
textStyle: TextStyle(fontSize: 20), textStyle: const TextStyle(fontSize: 20),
), ),
), ),
), ),

View File

@@ -27,12 +27,12 @@ void main() {
body: BaseButton( body: BaseButton(
text: 'Test Button', text: 'Test Button',
onPressed: () {}, onPressed: () {},
buttonStyle: ButtonStyle(), buttonStyle: const ButtonStyle(),
buttonTextStyle: TextStyle(), buttonTextStyle: const TextStyle(),
isDisabled: false, isDisabled: false,
height: 50.0, height: 50.0,
width: 100.0, width: 100.0,
margin: EdgeInsets.all(10), margin: const EdgeInsets.all(10),
alignment: Alignment.center, alignment: Alignment.center,
), ),
), ),

View File

@@ -9,7 +9,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: BottomSheetHandlerBar(), body: BottomSheetHandlerBar(),
), ),
), ),
@@ -23,7 +23,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: BottomSheetHandlerBar(), body: BottomSheetHandlerBar(),
), ),
), ),

View File

@@ -16,10 +16,10 @@ void main() {
onPressed: () { onPressed: () {
showBottomSheetWithBlur( showBottomSheetWithBlur(
context: context, context: context,
child: Text('Test Content'), child: const Text('Test Content'),
); );
}, },
child: Text('Show Bottom Sheet'), child: const Text('Show Bottom Sheet'),
), ),
); );
}, },
@@ -44,11 +44,11 @@ void main() {
onPressed: () { onPressed: () {
showBottomSheetWithBlur( showBottomSheetWithBlur(
context: context, context: context,
child: Text('Test Content'), child: const Text('Test Content'),
hasBlur: false, hasBlur: false,
); );
}, },
child: Text('Show Bottom Sheet'), child: const Text('Show Bottom Sheet'),
), ),
); );
}, },
@@ -73,11 +73,11 @@ void main() {
onPressed: () { onPressed: () {
showBottomSheetWithBlur( showBottomSheetWithBlur(
context: context, context: context,
child: Text('Test Content'), child: const Text('Test Content'),
height: 300.0, height: 300.0,
); );
}, },
child: Text('Show Bottom Sheet'), child: const Text('Show Bottom Sheet'),
), ),
); );
}, },
@@ -102,10 +102,10 @@ void main() {
onPressed: () { onPressed: () {
showBottomSheetWithBlur( showBottomSheetWithBlur(
context: context, context: context,
child: Text('Test Content'), child: const Text('Test Content'),
); );
}, },
child: Text('Show Bottom Sheet'), child: const Text('Show Bottom Sheet'),
), ),
); );
}, },
@@ -118,7 +118,7 @@ void main() {
expect(find.text('Test Content'), findsOneWidget); expect(find.text('Test Content'), findsOneWidget);
await tester.tapAt(Offset(0, 0)); await tester.tapAt(const Offset(0, 0));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(find.text('Test Content'), findsNothing); expect(find.text('Test Content'), findsNothing);

View File

@@ -15,7 +15,7 @@ void main() {
}) { }) {
return MaterialApp( return MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,

View File

@@ -9,7 +9,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: CustomDivider(), body: CustomDivider(),
), ),
), ),
@@ -23,7 +23,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: CustomDivider(), body: CustomDivider(),
), ),
), ),

View File

@@ -12,7 +12,7 @@ void main() {
home: Scaffold( home: Scaffold(
body: Form( body: Form(
child: CustomDropDownButton<String>( child: CustomDropDownButton<String>(
items: [ items: const [
DropdownMenuItem(value: 'option1', child: Text('Option 1')), DropdownMenuItem(value: 'option1', child: Text('Option 1')),
DropdownMenuItem(value: 'option2', child: Text('Option 2')), DropdownMenuItem(value: 'option2', child: Text('Option 2')),
], ],
@@ -35,11 +35,11 @@ void main() {
home: Scaffold( home: Scaffold(
body: Form( body: Form(
child: CustomDropDownButton<String>( child: CustomDropDownButton<String>(
items: [ items: const [
DropdownMenuItem(value: 'option1', child: Text('Option 1')), DropdownMenuItem(value: 'option1', child: Text('Option 1')),
DropdownMenuItem(value: 'option2', child: Text('Option 2')), DropdownMenuItem(value: 'option2', child: Text('Option 2')),
], ],
hint: Text('Select option'), hint: const Text('Select option'),
onChanged: (value) {}, onChanged: (value) {},
), ),
), ),
@@ -59,7 +59,7 @@ void main() {
home: Scaffold( home: Scaffold(
body: Form( body: Form(
child: CustomDropDownButton<String>( child: CustomDropDownButton<String>(
items: [ items: const [
DropdownMenuItem(value: 'option1', child: Text('Option 1')), DropdownMenuItem(value: 'option1', child: Text('Option 1')),
DropdownMenuItem(value: 'option2', child: Text('Option 2')), DropdownMenuItem(value: 'option2', child: Text('Option 2')),
], ],
@@ -83,7 +83,7 @@ void main() {
home: Scaffold( home: Scaffold(
body: Form( body: Form(
child: CustomDropDownButton<String>( child: CustomDropDownButton<String>(
items: [ items: const [
DropdownMenuItem(value: 'option1', child: Text('Option 1')), DropdownMenuItem(value: 'option1', child: Text('Option 1')),
DropdownMenuItem(value: 'option2', child: Text('Option 2')), DropdownMenuItem(value: 'option2', child: Text('Option 2')),
], ],

View File

@@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart';
void main() { void main() {
group('CustomDropDown', () { group('CustomDropDown', () {
final items = [ const items = [
SelectionPopupModel(id: 1, title: 'Option 1'), SelectionPopupModel(id: 1, title: 'Option 1'),
SelectionPopupModel(id: 2, title: 'Option 2'), SelectionPopupModel(id: 2, title: 'Option 2'),
]; ];

View File

@@ -104,7 +104,7 @@ void main() {
home: Scaffold( home: Scaffold(
body: CustomOutlinedButton( body: CustomOutlinedButton(
text: 'Test Button', text: 'Test Button',
leftIcon: Icon(Icons.add), leftIcon: const Icon(Icons.add),
buttonStyle: OutlinedButton.styleFrom(), buttonStyle: OutlinedButton.styleFrom(),
onPressed: () {}, onPressed: () {},
), ),
@@ -124,7 +124,7 @@ void main() {
home: Scaffold( home: Scaffold(
body: CustomOutlinedButton( body: CustomOutlinedButton(
text: 'Test Button', text: 'Test Button',
rightIcon: Icon(Icons.arrow_forward), rightIcon: const Icon(Icons.arrow_forward),
buttonStyle: OutlinedButton.styleFrom(), buttonStyle: OutlinedButton.styleFrom(),
onPressed: () {}, onPressed: () {},
), ),

View File

@@ -10,7 +10,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: CustomTextFormField(), body: CustomTextFormField(),
), ),
), ),
@@ -24,7 +24,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: CustomTextFormField( body: CustomTextFormField(
hintText: 'Enter text', hintText: 'Enter text',
), ),
@@ -39,7 +39,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: CustomTextFormField( body: CustomTextFormField(
initialValue: 'Initial text', initialValue: 'Initial text',
), ),
@@ -75,7 +75,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: CustomTextFormField( body: CustomTextFormField(
suffixText: 'kg', suffixText: 'kg',
), ),
@@ -90,7 +90,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: CustomTextFormField( body: CustomTextFormField(
hasError: true, hasError: true,
), ),
@@ -105,7 +105,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: CustomTextFormField( body: CustomTextFormField(
readOnly: true, readOnly: true,
initialValue: 'Read only text', initialValue: 'Read only text',
@@ -121,7 +121,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: CustomTextFormField( body: CustomTextFormField(
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
), ),
@@ -151,7 +151,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: CustomTextFormField( body: CustomTextFormField(
maxLength: 10, maxLength: 10,
), ),

View File

@@ -15,7 +15,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
@@ -35,13 +35,13 @@ void main() {
testWidgets('shows loader when reloading', (tester) async { testWidgets('shows loader when reloading', (tester) async {
Future<void> onReload() async { Future<void> onReload() async {
await Future.delayed(Duration(milliseconds: 100)); await Future.delayed(const Duration(milliseconds: 100));
} }
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,

View File

@@ -10,7 +10,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: FeedIconButton( body: FeedIconButton(
icon: Icons.favorite, icon: Icons.favorite,
), ),
@@ -41,7 +41,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: FeedIconButton( body: FeedIconButton(
text: 'Like', text: 'Like',
), ),
@@ -79,7 +79,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: FeedIconButton( body: FeedIconButton(
icon: Icons.favorite, icon: Icons.favorite,
text: 'Like', text: 'Like',
@@ -97,7 +97,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: FeedIconButton( body: FeedIconButton(
icon: Icons.favorite, icon: Icons.favorite,
), ),

View File

@@ -11,7 +11,7 @@ void main() {
Widget createTestWidget(Widget child) { Widget createTestWidget(Widget child) {
return MaterialApp( return MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
@@ -27,7 +27,7 @@ void main() {
testWidgets('displays info row widget', (tester) async { testWidgets('displays info row widget', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
createTestWidget( createTestWidget(
InfoRow( const InfoRow(
type: ProductType.diet, type: ProductType.diet,
), ),
), ),
@@ -39,7 +39,7 @@ void main() {
testWidgets('displays info row for plan type', (tester) async { testWidgets('displays info row for plan type', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
createTestWidget( createTestWidget(
InfoRow( const InfoRow(
type: ProductType.plan, type: ProductType.plan,
), ),
), ),
@@ -51,7 +51,7 @@ void main() {
testWidgets('displays info row for recipe type', (tester) async { testWidgets('displays info row for recipe type', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
createTestWidget( createTestWidget(
InfoRow( const InfoRow(
type: ProductType.recipe, type: ProductType.recipe,
), ),
), ),

View File

@@ -9,7 +9,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: ItemWidget(text: 'Test item'), body: ItemWidget(text: 'Test item'),
), ),
), ),
@@ -23,7 +23,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: ItemWidget(text: 'Test item', reversed: true), body: ItemWidget(text: 'Test item', reversed: true),
), ),
), ),
@@ -37,7 +37,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: ItemWidget(text: 'Test item', iconSize: 30), body: ItemWidget(text: 'Test item', iconSize: 30),
), ),
), ),

View File

@@ -6,7 +6,7 @@ void main() {
group('Loader', () { group('Loader', () {
testWidgets('displays loader widget', (tester) async { testWidgets('displays loader widget', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( const MaterialApp(
home: Scaffold( home: Scaffold(
body: Loader(), body: Loader(),
), ),
@@ -19,7 +19,7 @@ void main() {
testWidgets('has correct dimensions', (tester) async { testWidgets('has correct dimensions', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( const MaterialApp(
home: Scaffold( home: Scaffold(
body: Loader(), body: Loader(),
), ),

View File

@@ -9,7 +9,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: MainBackgroundBouble( body: MainBackgroundBouble(
child: Text('Test'), child: Text('Test'),
), ),
@@ -25,7 +25,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: MainBackgroundBouble( body: MainBackgroundBouble(
width: 200, width: 200,
child: Text('Test'), child: Text('Test'),
@@ -41,7 +41,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: MainBackgroundBouble( body: MainBackgroundBouble(
enableShadow: true, enableShadow: true,
child: Text('Test'), child: Text('Test'),
@@ -57,7 +57,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: MainBackgroundBouble( body: MainBackgroundBouble(
hasError: true, hasError: true,
child: Text('Test'), child: Text('Test'),
@@ -73,7 +73,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: MainBackgroundBouble( body: MainBackgroundBouble(
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),
child: Text('Test'), child: Text('Test'),

View File

@@ -10,7 +10,7 @@ void main() {
Widget createTestWidget(Widget child) { Widget createTestWidget(Widget child) {
return MaterialApp( return MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
@@ -26,7 +26,7 @@ void main() {
testWidgets('displays marketing bottom sheet', (tester) async { testWidgets('displays marketing bottom sheet', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
createTestWidget( createTestWidget(
MarketingBottomSheet(), const MarketingBottomSheet(),
), ),
); );
@@ -37,7 +37,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
@@ -51,7 +51,7 @@ void main() {
onPressed: () { onPressed: () {
showMarketingBottomSheet(context); showMarketingBottomSheet(context);
}, },
child: Text('Show'), child: const Text('Show'),
), ),
); );
}, },

View File

@@ -11,50 +11,28 @@ void main() {
Widget createTestWidget(Widget child) { Widget createTestWidget(Widget child) {
return MaterialApp( return MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate, GlobalCupertinoLocalizations.delegate,
], ],
supportedLocales: S.delegate.supportedLocales, supportedLocales: S.delegate.supportedLocales,
home: Scaffold( home: Scaffold(body: child),
body: child,
),
); );
} }
testWidgets('returns SizedBox.shrink when option is null', (tester) async { testWidgets('returns SizedBox.shrink when option is null', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(createTestWidget(const OptionWidget(option: null, duration: 7)));
createTestWidget(
OptionWidget(
option: null,
duration: 7,
),
),
);
expect(find.byType(OptionWidget), findsOneWidget); expect(find.byType(OptionWidget), findsOneWidget);
expect(find.byType(SizedBox), findsWidgets); expect(find.byType(SizedBox), findsWidgets);
}); });
testWidgets('displays option widget with option', (tester) async { testWidgets('displays option widget with option', (tester) async {
final option = PacketOptions( const option = PacketOptions(items: ['Item 1', 'Item 2'], price: 1000.0, short: 'Short', description: 'Description', hasPersonalDiet: false);
items: ['Item 1', 'Item 2'],
price: 1000.0,
short: 'Short',
description: 'Description',
hasPersonalDiet: false,
);
await tester.pumpWidget( await tester.pumpWidget(createTestWidget(const OptionWidget(option: option, duration: 7)));
createTestWidget(
OptionWidget(
option: option,
duration: 7,
),
),
);
expect(find.byType(OptionWidget), findsOneWidget); expect(find.byType(OptionWidget), findsOneWidget);
expect(find.text('Short'), findsOneWidget); expect(find.text('Short'), findsOneWidget);
@@ -62,47 +40,19 @@ void main() {
}); });
testWidgets('displays option widget with personal diet', (tester) async { testWidgets('displays option widget with personal diet', (tester) async {
final option = PacketOptions( const option = PacketOptions(items: ['Item 1'], price: 1000.0, short: 'Short', description: 'Description', hasPersonalDiet: true);
items: ['Item 1'],
price: 1000.0,
short: 'Short',
description: 'Description',
hasPersonalDiet: true,
);
await tester.pumpWidget( await tester.pumpWidget(createTestWidget(const OptionWidget(option: option, duration: 7)));
createTestWidget(
OptionWidget(
option: option,
duration: 7,
),
),
);
expect(find.byType(OptionWidget), findsOneWidget); expect(find.byType(OptionWidget), findsOneWidget);
}); });
testWidgets('hides duration when disableDuration is true', (tester) async { testWidgets('hides duration when disableDuration is true', (tester) async {
final option = PacketOptions( const option = PacketOptions(items: ['Item 1'], price: 1000.0, short: 'Short', description: 'Description', hasPersonalDiet: false);
items: ['Item 1'],
price: 1000.0,
short: 'Short',
description: 'Description',
hasPersonalDiet: false,
);
await tester.pumpWidget( await tester.pumpWidget(createTestWidget(const OptionWidget(option: option, duration: 7, disableDuration: true)));
createTestWidget(
OptionWidget(
option: option,
duration: 7,
disableDuration: true,
),
),
);
expect(find.byType(OptionWidget), findsOneWidget); expect(find.byType(OptionWidget), findsOneWidget);
}); });
}); });
} }

View File

@@ -9,7 +9,7 @@ void main() {
testWidgets('displays error dialog with default title and description', (tester) async { testWidgets('displays error dialog with default title and description', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
@@ -23,7 +23,7 @@ void main() {
onPressed: () { onPressed: () {
showErrorDialog(context); showErrorDialog(context);
}, },
child: Text('Show Error'), child: const Text('Show Error'),
), ),
); );
}, },
@@ -42,7 +42,7 @@ void main() {
testWidgets('displays error dialog with custom title and description', (tester) async { testWidgets('displays error dialog with custom title and description', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
@@ -60,7 +60,7 @@ void main() {
description: 'Custom Description', description: 'Custom Description',
); );
}, },
child: Text('Show Error'), child: const Text('Show Error'),
), ),
); );
}, },
@@ -78,7 +78,7 @@ void main() {
testWidgets('displays error dialog with custom button title', (tester) async { testWidgets('displays error dialog with custom button title', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
@@ -95,7 +95,7 @@ void main() {
buttonTitle: 'Close', buttonTitle: 'Close',
); );
}, },
child: Text('Show Error'), child: const Text('Show Error'),
), ),
); );
}, },
@@ -112,7 +112,7 @@ void main() {
testWidgets('closes dialog when button is tapped', (tester) async { testWidgets('closes dialog when button is tapped', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
@@ -126,7 +126,7 @@ void main() {
onPressed: () { onPressed: () {
showErrorDialog(context); showErrorDialog(context);
}, },
child: Text('Show Error'), child: const Text('Show Error'),
), ),
); );
}, },

View File

@@ -10,7 +10,7 @@ void main() {
Widget createTestWidget(Widget child) { Widget createTestWidget(Widget child) {
return MaterialApp( return MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
@@ -26,7 +26,7 @@ void main() {
testWidgets('displays success published diet bottom sheet', (tester) async { testWidgets('displays success published diet bottom sheet', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
createTestWidget( createTestWidget(
SuccessPublishedDietOrPlanBottomSheet( const SuccessPublishedDietOrPlanBottomSheet(
title: 'Test Diet', title: 'Test Diet',
), ),
), ),
@@ -39,7 +39,7 @@ void main() {
testWidgets('displays diet published text when isPlan is false', (tester) async { testWidgets('displays diet published text when isPlan is false', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
createTestWidget( createTestWidget(
SuccessPublishedDietOrPlanBottomSheet( const SuccessPublishedDietOrPlanBottomSheet(
title: 'Test Diet', title: 'Test Diet',
isPlan: false, isPlan: false,
), ),
@@ -52,7 +52,7 @@ void main() {
testWidgets('displays plan published text when isPlan is true', (tester) async { testWidgets('displays plan published text when isPlan is true', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
createTestWidget( createTestWidget(
SuccessPublishedDietOrPlanBottomSheet( const SuccessPublishedDietOrPlanBottomSheet(
title: 'Test Plan', title: 'Test Plan',
isPlan: true, isPlan: true,
), ),
@@ -65,7 +65,7 @@ void main() {
testWidgets('displays plan title', (tester) async { testWidgets('displays plan title', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
createTestWidget( createTestWidget(
SuccessPublishedDietOrPlanBottomSheet( const SuccessPublishedDietOrPlanBottomSheet(
title: 'My Plan', title: 'My Plan',
isPlan: true, isPlan: true,
), ),

View File

@@ -10,7 +10,7 @@ void main() {
Widget createTestWidget(Widget child) { Widget createTestWidget(Widget child) {
return MaterialApp( return MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
@@ -26,7 +26,7 @@ void main() {
testWidgets('displays success published recipe bottom sheet', (tester) async { testWidgets('displays success published recipe bottom sheet', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
createTestWidget( createTestWidget(
SuccessPublishedRecipeBottomSheet( const SuccessPublishedRecipeBottomSheet(
title: 'Test Recipe', title: 'Test Recipe',
), ),
), ),
@@ -41,7 +41,7 @@ void main() {
testWidgets('displays recipe title', (tester) async { testWidgets('displays recipe title', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
createTestWidget( createTestWidget(
SuccessPublishedRecipeBottomSheet( const SuccessPublishedRecipeBottomSheet(
title: 'My Recipe', title: 'My Recipe',
), ),
), ),
@@ -55,7 +55,7 @@ void main() {
testWidgets('has ok button', (tester) async { testWidgets('has ok button', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
createTestWidget( createTestWidget(
SuccessPublishedRecipeBottomSheet( const SuccessPublishedRecipeBottomSheet(
title: 'Test Recipe', title: 'Test Recipe',
), ),
), ),

View File

@@ -57,7 +57,7 @@ void main() {
routes: [ routes: [
GoRoute( GoRoute(
path: '/home', path: '/home',
builder: (context, state) => Scaffold( builder: (context, state) => const Scaffold(
body: Center(child: Text('Home')), body: Center(child: Text('Home')),
), ),
), ),
@@ -81,7 +81,7 @@ void main() {
return MaterialApp.router( return MaterialApp.router(
routerConfig: router, routerConfig: router,
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,

View File

@@ -33,7 +33,7 @@ void main() {
}) { }) {
return MaterialApp( return MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,

View File

@@ -16,7 +16,7 @@ void main() {
Widget createTestWidget(ChatRoom chatRoom) { Widget createTestWidget(ChatRoom chatRoom) {
return MaterialApp.router( return MaterialApp.router(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
@@ -47,7 +47,7 @@ void main() {
} }
testWidgets('displays chat room with user name', (tester) async { testWidgets('displays chat room with user name', (tester) async {
final chatRoom = ChatRoom( const chatRoom = ChatRoom(
id: 'test-id', id: 'test-id',
users: Users( users: Users(
fromChatUser: ChatUser( fromChatUser: ChatUser(
@@ -79,7 +79,7 @@ void main() {
testWidgets('displays chat room with last message', (tester) async { testWidgets('displays chat room with last message', (tester) async {
final chatRoom = ChatRoom( final chatRoom = ChatRoom(
id: 'test-id', id: 'test-id',
users: Users( users: const Users(
fromChatUser: ChatUser( fromChatUser: ChatUser(
id: 1, id: 1,
name: 'From User', name: 'From User',
@@ -116,7 +116,7 @@ void main() {
}); });
testWidgets('displays chat room with unread messages count', (tester) async { testWidgets('displays chat room with unread messages count', (tester) async {
final chatRoom = ChatRoom( const chatRoom = ChatRoom(
id: 'test-id', id: 'test-id',
users: Users( users: Users(
fromChatUser: ChatUser( fromChatUser: ChatUser(
@@ -148,7 +148,7 @@ void main() {
testWidgets('displays message from current user', (tester) async { testWidgets('displays message from current user', (tester) async {
final chatRoom = ChatRoom( final chatRoom = ChatRoom(
id: 'test-id', id: 'test-id',
users: Users( users: const Users(
fromChatUser: ChatUser( fromChatUser: ChatUser(
id: 1, id: 1,
name: 'From User', name: 'From User',
@@ -187,7 +187,7 @@ void main() {
testWidgets('displays media attachment message', (tester) async { testWidgets('displays media attachment message', (tester) async {
final chatRoom = ChatRoom( final chatRoom = ChatRoom(
id: 'test-id', id: 'test-id',
users: Users( users: const Users(
fromChatUser: ChatUser( fromChatUser: ChatUser(
id: 1, id: 1,
name: 'From User', name: 'From User',
@@ -228,7 +228,7 @@ void main() {
final chatRoom = ChatRoom( final chatRoom = ChatRoom(
id: 'test-id', id: 'test-id',
users: Users( users: Users(
fromChatUser: ChatUser( fromChatUser: const ChatUser(
id: 1, id: 1,
name: 'From User', name: 'From User',
profilePhotoPath: null, profilePhotoPath: null,

View File

@@ -9,7 +9,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: ValidationErrorWidget(error: 'Test error message'), body: ValidationErrorWidget(error: 'Test error message'),
), ),
), ),
@@ -23,7 +23,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: ValidationErrorWidget(error: 'Test error'), body: ValidationErrorWidget(error: 'Test error'),
), ),
), ),
@@ -51,7 +51,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: ValidationErrorWidget(error: ''), body: ValidationErrorWidget(error: ''),
), ),
), ),

View File

@@ -24,7 +24,7 @@ void main() {
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: BlocProvider<CreatePlanCubit>.value( home: BlocProvider<CreatePlanCubit>.value(
value: mockCubit, value: mockCubit,
child: Scaffold( child: const Scaffold(
body: SelectExactOptionWidget(), body: SelectExactOptionWidget(),
), ),
), ),

View File

@@ -25,7 +25,7 @@ void main() {
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: BlocProvider<CreateRecipeCubit>.value( home: BlocProvider<CreateRecipeCubit>.value(
value: mockCubit, value: mockCubit,
child: Scaffold( child: const Scaffold(
body: TagsWidget(), body: TagsWidget(),
), ),
), ),
@@ -33,7 +33,7 @@ void main() {
} }
testWidgets('displays tags widget', (tester) async { testWidgets('displays tags widget', (tester) async {
final initialState = CreateRecipeState( const initialState = CreateRecipeState(
entity: RecipeCreateEntity( entity: RecipeCreateEntity(
ingredients: [], ingredients: [],
steps: [], steps: [],
@@ -55,7 +55,7 @@ void main() {
}); });
testWidgets('displays existing tags', (tester) async { testWidgets('displays existing tags', (tester) async {
final stateWithTags = CreateRecipeState( const stateWithTags = CreateRecipeState(
entity: RecipeCreateEntity( entity: RecipeCreateEntity(
ingredients: [], ingredients: [],
steps: [], steps: [],
@@ -78,7 +78,7 @@ void main() {
}); });
testWidgets('calls addTag when add button is tapped', (tester) async { testWidgets('calls addTag when add button is tapped', (tester) async {
final initialState = CreateRecipeState( const initialState = CreateRecipeState(
entity: RecipeCreateEntity( entity: RecipeCreateEntity(
ingredients: [], ingredients: [],
steps: [], steps: [],

View File

@@ -24,7 +24,7 @@ void main() {
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: BlocProvider<DiaryCubit>.value( home: BlocProvider<DiaryCubit>.value(
value: mockCubit, value: mockCubit,
child: Scaffold( child: const Scaffold(
body: AddProductButtonWidget(), body: AddProductButtonWidget(),
), ),
), ),
@@ -32,7 +32,7 @@ void main() {
} }
testWidgets('displays add product button widget', (tester) async { testWidgets('displays add product button widget', (tester) async {
final loadingState = DiaryState.loading(); const loadingState = DiaryState.loading();
when(mockCubit.state).thenReturn(loadingState); when(mockCubit.state).thenReturn(loadingState);
when(mockCubit.stream).thenAnswer((_) => Stream.value(loadingState)); when(mockCubit.stream).thenAnswer((_) => Stream.value(loadingState));

View File

@@ -10,7 +10,7 @@ void main() {
Widget createTestWidget(Widget child) { Widget createTestWidget(Widget child) {
return MaterialApp( return MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
@@ -26,7 +26,7 @@ void main() {
testWidgets('displays chosen diet widget content', (tester) async { testWidgets('displays chosen diet widget content', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
createTestWidget( createTestWidget(
ChosenDietWidgetContent( const ChosenDietWidgetContent(
currentDietDay: 5, currentDietDay: 5,
dietName: 'Test Diet', dietName: 'Test Diet',
dietDuration: 14, dietDuration: 14,
@@ -42,7 +42,7 @@ void main() {
testWidgets('displays current day and duration', (tester) async { testWidgets('displays current day and duration', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
createTestWidget( createTestWidget(
ChosenDietWidgetContent( const ChosenDietWidgetContent(
currentDietDay: 7, currentDietDay: 7,
dietName: 'Test Diet', dietName: 'Test Diet',
dietDuration: 21, dietDuration: 21,
@@ -57,7 +57,7 @@ void main() {
testWidgets('displays diet name with underline', (tester) async { testWidgets('displays diet name with underline', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
createTestWidget( createTestWidget(
ChosenDietWidgetContent( const ChosenDietWidgetContent(
currentDietDay: 1, currentDietDay: 1,
dietName: 'My Diet', dietName: 'My Diet',
dietDuration: 7, dietDuration: 7,

View File

@@ -9,7 +9,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: CommentContainer(comment: 'Test comment'), body: CommentContainer(comment: 'Test comment'),
), ),
), ),
@@ -23,7 +23,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: CommentContainer(comment: ''), body: CommentContainer(comment: ''),
), ),
), ),
@@ -37,7 +37,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: CommentContainer(comment: longComment), body: CommentContainer(comment: longComment),
), ),
), ),

View File

@@ -7,7 +7,7 @@ void main() {
group('ProductLoaderWidget', () { group('ProductLoaderWidget', () {
testWidgets('displays product loader widget', (tester) async { testWidgets('displays product loader widget', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( const MaterialApp(
home: Scaffold( home: Scaffold(
body: ProductLoaderWidget(), body: ProductLoaderWidget(),
), ),
@@ -20,7 +20,7 @@ void main() {
testWidgets('displays ListTile with activity indicator', (tester) async { testWidgets('displays ListTile with activity indicator', (tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( const MaterialApp(
home: Scaffold( home: Scaffold(
body: ProductLoaderWidget(), body: ProductLoaderWidget(),
), ),

View File

@@ -9,7 +9,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: InfoBouble( body: InfoBouble(
children: [ children: [
Text('Test'), Text('Test'),
@@ -29,7 +29,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: InfoBouble( body: InfoBouble(
backgroundColor: Colors.blue, backgroundColor: Colors.blue,
children: [ children: [
@@ -47,7 +47,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: InfoBouble( body: InfoBouble(
radius: 20, radius: 20,
children: [ children: [
@@ -65,7 +65,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: InfoBouble( body: InfoBouble(
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),
children: [ children: [
@@ -83,7 +83,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: InfoBouble( body: InfoBouble(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [

View File

@@ -27,7 +27,7 @@ void main() {
}) { }) {
return MaterialApp( return MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,

View File

@@ -12,7 +12,7 @@ void main() {
home: Scaffold( home: Scaffold(
body: ChipGroup( body: ChipGroup(
selectedChipIndex: 0, selectedChipIndex: 0,
chipsLabelList: ['All', 'Recipes', 'Diets'], chipsLabelList: const ['All', 'Recipes', 'Diets'],
setSelectedChipIndex: (index) {}, setSelectedChipIndex: (index) {},
), ),
), ),
@@ -29,7 +29,7 @@ void main() {
home: Scaffold( home: Scaffold(
body: ChipGroup( body: ChipGroup(
selectedChipIndex: 0, selectedChipIndex: 0,
chipsLabelList: ['All', 'Recipes', 'Diets', 'Plans'], chipsLabelList: const ['All', 'Recipes', 'Diets', 'Plans'],
setSelectedChipIndex: (index) {}, setSelectedChipIndex: (index) {},
), ),
), ),
@@ -51,7 +51,7 @@ void main() {
home: Scaffold( home: Scaffold(
body: ChipGroup( body: ChipGroup(
selectedChipIndex: 0, selectedChipIndex: 0,
chipsLabelList: ['All', 'Recipes', 'Diets'], chipsLabelList: const ['All', 'Recipes', 'Diets'],
setSelectedChipIndex: (index) { setSelectedChipIndex: (index) {
selectedIndex = index; selectedIndex = index;
}, },
@@ -73,7 +73,7 @@ void main() {
home: Scaffold( home: Scaffold(
body: ChipGroup( body: ChipGroup(
selectedChipIndex: 0, selectedChipIndex: 0,
chipsLabelList: [], chipsLabelList: const [],
setSelectedChipIndex: (index) {}, setSelectedChipIndex: (index) {},
), ),
), ),

View File

@@ -11,7 +11,7 @@ void main() {
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: Scaffold(
body: ChoiceChipWidget( body: ChoiceChipWidget(
chipsLabelList: ['Option 1', 'Option 2'], chipsLabelList: const ['Option 1', 'Option 2'],
index: 0, index: 0,
selectedChipIndex: 0, selectedChipIndex: 0,
onSelected: (selected) {}, onSelected: (selected) {},
@@ -30,7 +30,7 @@ void main() {
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: Scaffold(
body: ChoiceChipWidget( body: ChoiceChipWidget(
chipsLabelList: ['Option 1', 'Option 2'], chipsLabelList: const ['Option 1', 'Option 2'],
index: 0, index: 0,
selectedChipIndex: 0, selectedChipIndex: 0,
onSelected: (selected) {}, onSelected: (selected) {},
@@ -50,7 +50,7 @@ void main() {
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: Scaffold(
body: ChoiceChipWidget( body: ChoiceChipWidget(
chipsLabelList: ['Option 1', 'Option 2'], chipsLabelList: const ['Option 1', 'Option 2'],
index: 1, index: 1,
selectedChipIndex: 0, selectedChipIndex: 0,
onSelected: (selected) {}, onSelected: (selected) {},
@@ -70,10 +70,10 @@ void main() {
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: Scaffold(
body: ChoiceChipWidget( body: ChoiceChipWidget(
chipsLabelList: ['Option 1'], chipsLabelList: const ['Option 1'],
index: 0, index: 0,
selectedChipIndex: 0, selectedChipIndex: 0,
padding: EdgeInsets.all(16), padding: const EdgeInsets.all(16),
onSelected: (selected) {}, onSelected: (selected) {},
), ),
), ),
@@ -89,7 +89,7 @@ void main() {
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: Scaffold(
body: ChoiceChipWidget( body: ChoiceChipWidget(
chipsLabelList: ['Option 1'], chipsLabelList: const ['Option 1'],
index: 0, index: 0,
selectedChipIndex: 0, selectedChipIndex: 0,
activeColor: Colors.blue, activeColor: Colors.blue,
@@ -110,7 +110,7 @@ void main() {
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: Scaffold(
body: ChoiceChipWidget( body: ChoiceChipWidget(
chipsLabelList: ['Option 1'], chipsLabelList: const ['Option 1'],
index: 0, index: 0,
selectedChipIndex: 0, selectedChipIndex: 0,
onSelected: (selected) { onSelected: (selected) {

View File

@@ -34,7 +34,7 @@ void main() {
Widget createTestWidget(FeedConsultantModel consultant) { Widget createTestWidget(FeedConsultantModel consultant) {
return MaterialApp.router( return MaterialApp.router(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
@@ -66,7 +66,7 @@ void main() {
testWidgets('displays consultant information', (tester) async { testWidgets('displays consultant information', (tester) async {
await mockNetworkImagesFor(() async { await mockNetworkImagesFor(() async {
final consultant = FeedConsultantModel( const consultant = FeedConsultantModel(
slug: 'test-consultant', slug: 'test-consultant',
name: 'Test Consultant', name: 'Test Consultant',
photo: 'https://example.com/photo.jpg', photo: 'https://example.com/photo.jpg',
@@ -87,7 +87,7 @@ void main() {
testWidgets('displays consultant with badges', (tester) async { testWidgets('displays consultant with badges', (tester) async {
await mockNetworkImagesFor(() async { await mockNetworkImagesFor(() async {
final consultant = FeedConsultantModel( const consultant = FeedConsultantModel(
slug: 'test-consultant', slug: 'test-consultant',
name: 'Test Consultant', name: 'Test Consultant',
photo: 'https://example.com/photo.jpg', photo: 'https://example.com/photo.jpg',
@@ -110,7 +110,7 @@ void main() {
testWidgets('displays rating place', (tester) async { testWidgets('displays rating place', (tester) async {
await mockNetworkImagesFor(() async { await mockNetworkImagesFor(() async {
final consultant = FeedConsultantModel( const consultant = FeedConsultantModel(
slug: 'test-consultant', slug: 'test-consultant',
name: 'Test Consultant', name: 'Test Consultant',
photo: 'https://example.com/photo.jpg', photo: 'https://example.com/photo.jpg',
@@ -129,7 +129,7 @@ void main() {
testWidgets('handles photo with https URL', (tester) async { testWidgets('handles photo with https URL', (tester) async {
await mockNetworkImagesFor(() async { await mockNetworkImagesFor(() async {
final consultant = FeedConsultantModel( const consultant = FeedConsultantModel(
slug: 'test-consultant', slug: 'test-consultant',
name: 'Test Consultant', name: 'Test Consultant',
photo: 'https://example.com/photo.jpg', photo: 'https://example.com/photo.jpg',
@@ -148,7 +148,7 @@ void main() {
testWidgets('handles photo without https URL', (tester) async { testWidgets('handles photo without https URL', (tester) async {
await mockNetworkImagesFor(() async { await mockNetworkImagesFor(() async {
final consultant = FeedConsultantModel( const consultant = FeedConsultantModel(
slug: 'test-consultant', slug: 'test-consultant',
name: 'Test Consultant', name: 'Test Consultant',
photo: '/storage/photo.jpg', photo: '/storage/photo.jpg',

View File

@@ -41,7 +41,7 @@ void main() {
Widget createTestWidget(Widget child) { Widget createTestWidget(Widget child) {
return MaterialApp( return MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,

View File

@@ -9,11 +9,9 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: FilterBadge( body: FilterBadge(
filterBottomSheet: Container( filterBottomSheet: Text('Filter Bottom Sheet'),
child: Text('Filter Bottom Sheet'),
),
), ),
), ),
), ),
@@ -27,11 +25,9 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: FilterBadge( body: FilterBadge(
filterBottomSheet: Container( filterBottomSheet: Text('Filter Bottom Sheet'),
child: Text('Filter Bottom Sheet'),
),
), ),
), ),
), ),

View File

@@ -31,7 +31,7 @@ void main() {
Widget createTestWidget(Widget child) { Widget createTestWidget(Widget child) {
return MaterialApp( return MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,

View File

@@ -41,7 +41,7 @@ void main() {
Widget createTestWidget(Widget child) { Widget createTestWidget(Widget child) {
return MaterialApp( return MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
localizationsDelegates: [ localizationsDelegates: const [
S.delegate, S.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,

View File

@@ -9,7 +9,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: StatusWidget(status: Status.canceled), body: StatusWidget(status: Status.canceled),
), ),
), ),
@@ -23,7 +23,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: StatusWidget(status: Status.success), body: StatusWidget(status: Status.success),
), ),
), ),
@@ -37,7 +37,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeHelper().themeData(), theme: ThemeHelper().themeData(),
home: Scaffold( home: const Scaffold(
body: StatusWidget(status: Status.inProgress), body: StatusWidget(status: Status.inProgress),
), ),
), ),

View File

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

View File

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

View File

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

View File

@@ -33,7 +33,7 @@ void main() {
supportedLocales: const [Locale('ru')], supportedLocales: const [Locale('ru')],
home: BlocProvider<RegistrationCubitV2>.value( home: BlocProvider<RegistrationCubitV2>.value(
value: mockCubit, value: mockCubit,
child: Scaffold( child: const Scaffold(
body: SexWidget(), body: SexWidget(),
), ),
), ),

View File

@@ -34,7 +34,7 @@ void main() {
locale: const Locale('ru'), locale: const Locale('ru'),
home: BlocProvider<RegistrationCubitV2>.value( home: BlocProvider<RegistrationCubitV2>.value(
value: mockCubit, value: mockCubit,
child: Scaffold( child: const Scaffold(
body: StepWidget(), body: StepWidget(),
), ),
), ),