Home > Back-end >  Extending class with Mixin declaration
Extending class with Mixin declaration

Time:09-09

consider following code:

class BookStore1 = _BookStoreBase with BookStoreMixin;

class BookStore2 extends _BookStoreBase with BookStoreMixin {}

abstract class _BookStoreBase {}

mixin BookStoreMixin {}

I would like to know if declaration of BookStore1 is still appropriate. Issue with it is that I can no longer find it in documentation. It also causes lint warning over _BookStoreBase, saying "Avoid using private types in public APIs": https://dart-lang.github.io/linter/lints/library_private_types_in_public_api.html

CodePudding user response:

There is nothing wrong with the BookStore1 class declaration, and you should not be getting any warnings from it, at least not any that you don't also get from BookStore2.

Seems like a bug in the lint.

  •  Tags:  
  • dart
  • Related