felangel / felangel/bloc

feat: Possibility to create cubit class without the cubit suffix

Open
#3,025 0 comments 1 reaction 0 assignees View on GitHub
enhancement candidate extension
Dominant language
Dart
Stars
12.5k
Forks
3.4k
PR merge metrics
No merged PRs in 30d

Description

**Description**

In my projects I prefer to have my Cubit/Bloc classes being called Presenters/ViewModel, to make it easy for every non-Flutter developer (native android for instance) to understand the code more easily.

Since the IntelliJ IDEA extension always attach a Cubit keyword at the end of the class/file-name I always have to refactor it myself which is a real pain.

**Desired Solution**

### Solution 1
Add a checkbox in the file creation dialog to attach the Cubit keyword at the end of the class/file name. That checkbox could be checked by default but once unchecked, the class name will be created as-is.

![Screen Shot 2021-12-02 at 9 55 57 AM](https://user-images.githubusercontent.com/33294549/144389645-7b6a512e-1d57-4c93-ad06-37b44d1bd32a.png)

### Solution 2
Add a new option to create a Cubit class/file without the cubit suffix, we could call it "Cubit class as Presenter" (or a good name for it).

![Screen Shot 2021-12-02 at 9 53 36 AM](https://user-images.githubusercontent.com/33294549/144389298-b3518c00-d0c5-460e-8acc-f4de7f2f1814.png)

I would go with the solution 1 as it is more generic and may cover other people’s needs.

**Additional Context**

Let's give a option to suffix their class, from my experience coming from Android dev, people give their view’s manager class different names, be it LoginPresenter, LoginViewModel, LoginController, and some would still like to keep using those concepts as it makes it easier for some coming from different backgrounds.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.