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
Android Studio Plugin for Bloc Generation #116
Comments
@fvisticot There is currently support for VSCode and I am planning on extending the extension to create the bloc as well as the states and events. Not sure when I'll get to Android Studio but you're more than welcome to contribute 😄 Ideally, the Android Studio Plugin functionality should align with the VSCode extension (#118). Use Uber's RIBs Plugin for reference. |
I have some experience with code templates in IntelliJ... I can work on it ;) |
@felangel we should agree on some conventions first before we do any coding, so we keep the IntelliJ plugin and VS Code in sync. What about? Files generated (XXX represents the name of your bloc, we will have to sanitize this in the generators to be camelCase on code and snake_case for file names)
and contents: bloc.dartexport 'XXX_bloc.dart';
export 'XXX_event.dart';
export 'XXX_state.dart'; XXX_event.dartimport 'package:equatable/equatable.dart';
abstract class XXXEvent extends Equatable {
XXXEvent([List props = const []]) : super(props);
} XXX_state.dartimport 'package:equatable/equatable.dart';
abstract class XXXState extends Equatable {
XXXState([List props = const []]) : super(props);
} XXX_bloc.dartimport 'dart:async';
import 'package:bloc/bloc.dart';
class XXXBloc
extends Bloc<XXXEvent, XXXState> {
@override
ResetPasswordUiState get initialState => throw Exception('Complete your initialState');
@override
Stream<XXXState> mapEventToState(
XXXState state, XXXEvent event) async* {
throw Exception('Complete your mapEventToState');
}
} I think that might be all we need, right? |
@jorgecoca that looks good to me 👍 |
Hello everyone, import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'dart:async';
class $NAME$Bloc extends Bloc<$NAME$Event, $NAME$State> {
@override
$NAME$State get initialState => null;// TODO: initial state
@override
Stream<$NAME$State> mapEventToState($NAME$State currentState, $NAME$Event event) async* {
// TODO: implement mapEventToState
}
}
abstract class $NAME$State extends Equatable {
$NAME$State([List props = const []]) : super(props);
}
abstract class $NAME$Event extends Equatable {
$NAME$Event([List props = const []]) : super(props);
} Have a nice day! |
Good job, |
Totally agree. |
@jorgecoca will most likely have the permanent solution done relatively quickly 🎉💯 |
By the end of this I hope to have something up and running ;) |
You guys are awesome! |
@jorgecoca is awesome 🥇 |
I opened #148 ;) |
merged in #148 |
For Android Studio user, it would be fine to have template for bloc generation.
Is it in your plans ?
The text was updated successfully, but these errors were encountered: