Skip to content

[Bug]: Cannot mock EasyDialogsController due to final modifier #45

@Bogdan108

Description

@Bogdan108

What happened?

Description

The EasyDialogsController class is marked as final, which prevents implementing or extending it for mocking purposes in tests. This makes it impossible to properly unit test code that depends on the controller.

Environment

  • flutter_easy_dialogs: 4.0.5
  • mocktail: 1.0.4
  • flutter_test: (SDK)
  • Dart: 3.9.2
  • Flutter: 3.35.6

Current Behavior

When trying to create a mock implementation of EasyDialogsController, the Dart compiler throws an error:

import 'package:flutter_easy_dialogs/flutter_easy_dialogs.dart';
import 'package:mocktail/mocktail.dart';

// ❌ Error: The class 'EasyDialogsController' can't be extended,
// implemented, or mixed in outside of its library because it's a final class.
class MockEasyDialogsController extends Mock implements EasyDialogsController {}

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions