Skip to content

feat(Core): Update core dependencies and logic #107

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

Merged
merged 5 commits into from
Oct 10, 2024

Conversation

Coloud1
Copy link
Collaborator

@Coloud1 Coloud1 commented Oct 9, 2024

No description provided.

@@ -3,6 +3,7 @@ enum SwaggerPathRequestType {
post,
put,
delete,
patch,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cozvtieg9, one swagger did not work properly and fell on an unimplemented orElse

@@ -24,6 +24,12 @@ sealed class SwaggerType {
String? getFileImportName(DataFileType fileType);

String? getDefaultReturnType(DataFileType fileType);

String? getFullFileImport(String projectName, DataFileType fileType) {
final importName = getFileImportName(fileType);
Copy link
Collaborator Author

@Coloud1 Coloud1 Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cozvtieg9, added a null check so as not to break your existing logic of checking for import == null || imports.contains(import);

@@ -150,6 +150,9 @@ class DataObjectComponent with _$DataObjectComponent {
}
codeLines.addNewLine();
final classNamePrefix = fileReference.getTypeDeclaration(DataFileType.none);
final objects =
_getMapperObjectVariablesContent(MapperType.mapEntityToRequest);
final classModifier = objects.isEmpty ? 'const ' : '';
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cozvtieg9, added logic to the const constructor to have fewer hints in the analyzer

final responseFileImport =
request.response.type.getFileImportName(DataFileType.response);
final responseFileImport = request.response.type
.getFullFileImport(projectName, DataFileType.response);
Copy link
Collaborator Author

@Coloud1 Coloud1 Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cozvtieg9, replaced getFileImportName with getFullFileImport to support paging. You can change the name if it doesn't quite fit

if (_baseConstructorProperties.isEmpty) {
lines.add('factory $classFullName() = _$classFullName;');
lines.add('const factory $classFullName() = _$classFullName;');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cozvtieg9, I mentioned above that I added const constructors, this const factory has been updated for this

@@ -86,15 +86,15 @@ class ComponentGeneratorService
final declarationFilePath =
sourceComponent.getDeclarationFilePath(projectLibFolder);

final declarationBody = sourceComponent.getDeclarationBody(projectName);
final declarationBody = sourceComponent.getSourceDeclarationBody(projectName);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cozvtieg9, changed the name from getDecralationBody to getSourceDeclarationBody to make it easier to understand where the surfaces are and where the repos are

@@ -154,7 +154,7 @@ class GenerationScreenBloc extends BaseBloc<GenerationScreenEvent,

if (!state.config.graphql) {
await Directory(
'${state.config.projectPath}/${state.config.projectName}/lib/core/arch/data/remote/clients/graph_ql',
'${state.config.projectPath}/${state.config.projectName}/lib/core/arch/data/remote/graph_ql',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cozvtieg9, removed the clients directory

@@ -70,7 +68,7 @@ class FirebaseAuthSourceImpl extends FirebaseAuthSource {
return const DataResponse.unauthorized();
}
} on FirebaseAuthException catch (e) {
return DataResponse.firebaseError(e.code);
return DataResponse.undefinedError(e);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cozvtieg9, I removed the firebaseError. There is no way to extend the freezed class

@Coloud1 Coloud1 merged commit 1310417 into dev Oct 10, 2024
@Coloud1 Coloud1 deleted the feature/core-improvements branch October 10, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants