fix: analyzer issue

This commit is contained in:
misha
2025-11-28 01:00:56 +03:00
parent 9ca09e8137
commit cbeb91a9f0
9 changed files with 75 additions and 75 deletions

View File

@@ -14,17 +14,17 @@ void main() {
MyPlansCubit? myPlansCubit;
late MockMyPlansRepository mockMyPlansRepository;
final testPlan = PlanModel(
const testPlan = PlanModel(
id: 1,
slug: 'test-plan',
name: 'Test Plan',
image: 'https://someurl.com/img.jpg',
duration: 30,
state: 'active',
type: const PlanType(fit: true, slim: false, behavior: false, wellness: false),
type: PlanType(fit: true, slim: false, behavior: false, wellness: false),
details: 'Test plan description',
packetsCount: 1,
author: const Author(authorSlug: '', authorName: '', authorProfileIcon: '', authorIsMe: false),
author: Author(authorSlug: '', authorName: '', authorProfileIcon: '', authorIsMe: false),
totalLikes: 1,
totalViews: 1,
totalComments: 1,
@@ -34,9 +34,9 @@ void main() {
wasLikedByMe: false,
);
final testPlansPagination = PlanPaginationModel(
const testPlansPagination = PlanPaginationModel(
data: [testPlan],
links: const Links(first: '', last: '', prev: null, next: null),
links: Links(first: '', last: '', prev: null, next: null),
meta: Meta(currentPage: 1, lastPage: 1, total: 1, perPage: 10, from: null, links: [Link(url: null, label: null, active: null)], to: null, totalMinPrice: 100, totalMaxPrice: 500),
);

View File

@@ -26,17 +26,17 @@ void main() {
late MockMyPlansRepository mockMyPlansRepository;
late MyPlansCubit myPlansCubit;
final testPlan = PlanModel(
const testPlan = PlanModel(
id: 1,
slug: 'test-plan',
name: 'Test Plan',
image: 'test-image.jpg',
duration: 30,
state: 'active',
type: const PlanType(fit: true, slim: false, behavior: false, wellness: false),
type: PlanType(fit: true, slim: false, behavior: false, wellness: false),
details: 'Test plan description',
packetsCount: 1,
author: const Author(authorSlug: '', authorName: '', authorProfileIcon: '', authorIsMe: false),
author: Author(authorSlug: '', authorName: '', authorProfileIcon: '', authorIsMe: false),
totalLikes: 1,
totalViews: 1,
totalComments: 1,
@@ -96,7 +96,7 @@ void main() {
testWidgets('should display MyPlanWidget with plan name', (WidgetTester tester) async {
// Arrange
myPlansCubit.emit(MyPlansState(selectedStateIndex: 0));
final widget = MyPlanWidget(plan: testPlan);
const widget = MyPlanWidget(plan: testPlan);
// Act
await tester.pumpWidget(createTestWidget(widget));
@@ -112,7 +112,7 @@ void main() {
testWidgets('should display MyPlanWidget with description when details are present', (WidgetTester tester) async {
// Arrange
myPlansCubit.emit(MyPlansState(selectedStateIndex: 0));
final widget = MyPlanWidget(plan: testPlan);
const widget = MyPlanWidget(plan: testPlan);
// Act
await tester.pumpWidget(createTestWidget(widget));
@@ -128,7 +128,7 @@ void main() {
testWidgets('should display MyPlanWidget with price', (WidgetTester tester) async {
// Arrange
myPlansCubit.emit(MyPlansState(selectedStateIndex: 0));
final widget = MyPlanWidget(plan: testPlan);
const widget = MyPlanWidget(plan: testPlan);
// Act
await tester.pumpWidget(createTestWidget(widget));
@@ -144,7 +144,7 @@ void main() {
testWidgets('should display MyPlanWidget buttons', (WidgetTester tester) async {
// Arrange
myPlansCubit.emit(MyPlansState(selectedStateIndex: 0));
final widget = MyPlanWidget(plan: testPlan);
const widget = MyPlanWidget(plan: testPlan);
// Act
await tester.pumpWidget(createTestWidget(widget));
@@ -160,7 +160,7 @@ void main() {
testWidgets('should display MyPlanWidget structure correctly', (WidgetTester tester) async {
// Arrange
myPlansCubit.emit(MyPlansState(selectedStateIndex: 0));
final widget = MyPlanWidget(plan: testPlan);
const widget = MyPlanWidget(plan: testPlan);
// Act
await tester.pumpWidget(createTestWidget(widget));

View File

@@ -85,7 +85,7 @@ void main() {
});
test('getPlans returns pagination with default parameters', () async {
final expected = PlanPaginationModel(
const expected = PlanPaginationModel(
data: [
PlanModel(
id: 2,
@@ -94,10 +94,10 @@ void main() {
image: 'https://someurl.com/img2.jpg',
duration: 14,
state: 'draft',
type: const PlanType(fit: false, slim: true, behavior: false, wellness: false),
type: PlanType(fit: false, slim: true, behavior: false, wellness: false),
details: '',
packetsCount: 2,
author: const Author(authorSlug: 'author-slug', authorName: 'Author Name', authorProfileIcon: '', authorIsMe: true),
author: Author(authorSlug: 'author-slug', authorName: 'Author Name', authorProfileIcon: '', authorIsMe: true),
totalLikes: 5,
totalViews: 10,
totalComments: 2,
@@ -107,8 +107,8 @@ void main() {
wasLikedByMe: true,
),
],
links: const Links(first: '', last: '', prev: null, next: null),
meta: const Meta(currentPage: 1, lastPage: 1, total: 1, perPage: 10, from: null, links: [Link(url: null, label: null, active: null)], to: null),
links: Links(first: '', last: '', prev: null, next: null),
meta: Meta(currentPage: 1, lastPage: 1, total: 1, perPage: 10, from: null, links: [Link(url: null, label: null, active: null)], to: null),
);
when(mockMyPlansService.getPlans(
@@ -139,10 +139,10 @@ void main() {
const page = 2;
const query = 'wellness';
const duration = 21;
final expected = PlanPaginationModel(
const expected = PlanPaginationModel(
data: [],
links: const Links(first: '', last: '', prev: null, next: null),
meta: const Meta(currentPage: 2, lastPage: 2, total: 0, perPage: 10, from: null, links: [Link(url: null, label: null, active: null)], to: null),
links: Links(first: '', last: '', prev: null, next: null),
meta: Meta(currentPage: 2, lastPage: 2, total: 0, perPage: 10, from: null, links: [Link(url: null, label: null, active: null)], to: null),
);
when(mockMyPlansService.getPlans(