New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VSCode Extension for Bloc Generation #118
Comments
Hello A full-blown VSCode extension that:
And then generates:
// blocs.dart
export 'todo/todo.dart'; And when we want to add new bloc: A full-blown VSCode extension that:
And then the blocs folder have:
And add at the end of line of // blocs.dart
export 'todo/todo.dart';
export 'theme/theme.dart'; Also you recommend use Equatable, and I used too, so you can create the next flow A full-blown VSCode extension that:
So now, if the user select Yes for use Equatable, Event and State files are like this: // todo_state.dart
import 'package:equatable/equatable.dart';
abstract class TodoState extends Equatable {
TodoState([List props = const []]) : super(props);
}
class LoadingTodoState extends TodoState {}
class LoadedTodoState extends TodoState {}
class FailureTodoState extends TodoState {} // todo_event.dart
import 'package:equatable/equatable.dart';
abstract class TodoEvent extends Equatable {
TodoEvent ([List props = const []]) : super(props);
}
class AddTodoEvent extends TodoEvent {}
class RemoveTodoEvent extends TodoEvent {} Thank you and congratulations for your great work with this library. |
v0.2.0 of the Bloc VSCode Extension is published 🎉 |
@felangel Thanks for the awesome lib and extension. I actually came to this issue from the search. It is unclear to me how the extension could help if I want to have more than one bloc (which is 99.999% of the cases I suppose)? Renaming each file doesn't seem a good solution. |
@agordeev thanks for the input. I would generally recommend structuring your project by feature and not by component type. That way instead of having a blocs directory you would have a bloc directory in the necessary feature directories. Let me know if that makes sense. I have also been meaning to make the vscode extension more configurable via a bloc_options.yaml (or something similar) so that might be a case where we can make this behavior customizable. Thoughts? |
@felangel clearly makes sense, thanks for your prompt answer. I didn't think that way (feature-based architecture), will try. Wouldn't it be better to have extension settings instead of |
No problem! Yeah we could do extension settings but it’d be nice to be able to have a configuration per repo so that different projects can have different structures/preferences and to be able to reuse the configuration for the intellij plugin as well 😛 |
Is your feature request related to a problem? Please describe.
Currently the VSCode extension for bloc just supports snippets for creating a bloc but it doesn't:
Describe the solution you'd like
A full-blown VSCode extension that:
Todo
)Add, Remove
)Loading, Loaded, Failure
)And then generates:
Additional context
#117
The text was updated successfully, but these errors were encountered: