Skip to content

Commit

Permalink
refactor: change the module name to snake case
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Pham committed Jul 15, 2024
1 parent a1e0aba commit 933486c
Show file tree
Hide file tree
Showing 14 changed files with 299 additions and 23 deletions.
6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

263 changes: 263 additions & 0 deletions .idea/other.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:injectable/injectable.dart';
import '../../../../common/mixin/cancelable_base_bloc.dart';
import '../../../../core/infrastructure/datasources/remote/api/base/api_error.dart';
import '../../domain/entities/{{name.snakeCase()}}.dart';
import '../../domain/interfaces/{{name.snakeCase()}}_interface.dart';
import '../../domain/repositories/{{name.snakeCase()}}_repository.dart';

part '{{name.snakeCase()}}_state.dart';
part '{{name.snakeCase()}}_cubit.freezed.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:flutter/foundation.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

import '../../domain/entities/{{name.snakeCase()}}.dart';

part '{{name.snakeCase()}}_dto.freezed.dart';
part '{{name.snakeCase()}}_dto.g.dart';

@freezed
class {{name.pascalCase()}}Dto with _${{name.pascalCase()}}Dto implements I{{name.pascalCase()}} {

const factory {{name.pascalCase()}}Dto({
@JsonKey(name: 'id') @Default(-1) int id,
}) = _{{name.pascalCase()}}Dto;

factory {{name.pascalCase()}}Dto.fromJson(json) => _${{name.pascalCase()}}DtoFromJson(json);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import 'package:injectable/injectable.dart';
import 'package:dio/dio.dart';
import 'package:result_dart/result_dart.dart';

import '../../domain/interfaces/{{name.snakeCase()}}_interface.dart';
import '../../domain/repositories/{{name.snakeCase()}}_repository.dart';
import '../../../../common/utils/app_environment.dart';
import '../../../../core/infrastructure/datasources/remote/api/base/api_error.dart';
import '../../../{{name.snakeCase()}}/domain/entities/{{name.snakeCase()}}.dart';

@LazySingleton(
as: {{name.pascalCase()}}Repository,
env: AppEnvironment.environments,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:injectable/injectable.dart';
import 'package:dio/dio.dart';
import 'package:result_dart/result_dart.dart';

import '../../domain/interfaces/{{name.snakeCase()}}_interface.dart';
import '../../domain/repositories/{{name.snakeCase()}}_repository.dart';
import '../../../../common/utils/app_environment.dart';
import '../../../../core/infrastructure/datasources/remote/api/base/api_error.dart';
import '../../../{{name.snakeCase()}}/domain/entities/{{name.snakeCase()}}.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

import '../../../../common/utils/getit_utils.dart';
import '../../application/cubit/{{name.snakeCase()}}_cubit.dart';
import '../../application/{{name.snakeCase()}}_cubit/{{name.snakeCase()}}_cubit.dart';
import '../widgets/{{name.snakeCase()}}_body.dart';

class {{name.pascalCase()}}Page extends StatelessWidget {
Expand All @@ -11,7 +11,7 @@ class {{name.pascalCase()}}Page extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context)=> getIt<{{name.pascalCase()}}Cubit>(),
create: (context) => getIt<{{name.pascalCase()}}Cubit>(),
child: Scaffold(
appBar: AppBar(),
body: const {{name.pascalCase()}}Body(),
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion bricks/ddd/brick.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repository: https://github.com/cogivn/ddd.git
# The following defines the version and build number for your brick.
# A version number is three numbers separated by dots, like 1.2.34
# followed by an optional build number (separated by a +).
version: 0.1.1+4
version: 0.1.2+5

# The following defines the environment for the current brick.
# It includes the version of mason that the brick requires.
Expand Down

0 comments on commit 933486c

Please sign in to comment.