Skip to content

Commit

Permalink
Merge pull request #49 from koji-1009/update
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
koji-1009 authored Jun 28, 2023
2 parents a3adffb + 87aae5d commit f276993
Show file tree
Hide file tree
Showing 16 changed files with 97 additions and 397 deletions.
9 changes: 8 additions & 1 deletion build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@ targets:
include_if_null: false
freezed:
options:
maybe_when: false
map:
map: false
map_or_null: false
maybe_map: false
when:
when: false
when_or_null: false
maybe_when: false
2 changes: 1 addition & 1 deletion lib/model/entity/api_exception.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ part 'api_exception.freezed.dart';
part 'api_exception.g.dart';

@freezed
class ApiException with _$ApiException implements Exception {
sealed class ApiException with _$ApiException implements Exception {
const factory ApiException.error({
required String message,
@Default([]) List<String> details,
Expand Down
162 changes: 0 additions & 162 deletions lib/model/entity/api_exception.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,44 +29,6 @@ ApiException _$ApiExceptionFromJson(Map<String, dynamic> json) {

/// @nodoc
mixin _$ApiException {
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function(String message, List<String> details) error,
required TResult Function() other,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult? Function(String message, List<String> details)? error,
TResult? Function()? other,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function(String message, List<String> details)? error,
TResult Function()? other,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(ApiExceptionError value) error,
required TResult Function(ApiExceptionOther value) other,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult? Function(ApiExceptionError value)? error,
TResult? Function(ApiExceptionOther value)? other,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(ApiExceptionError value)? error,
TResult Function(ApiExceptionOther value)? other,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
}

Expand Down Expand Up @@ -187,68 +149,6 @@ class _$ApiExceptionError
_$$ApiExceptionErrorCopyWith<_$ApiExceptionError> get copyWith =>
__$$ApiExceptionErrorCopyWithImpl<_$ApiExceptionError>(this, _$identity);

@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function(String message, List<String> details) error,
required TResult Function() other,
}) {
return error(message, details);
}

@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult? Function(String message, List<String> details)? error,
TResult? Function()? other,
}) {
return error?.call(message, details);
}

@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function(String message, List<String> details)? error,
TResult Function()? other,
required TResult orElse(),
}) {
if (error != null) {
return error(message, details);
}
return orElse();
}

@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(ApiExceptionError value) error,
required TResult Function(ApiExceptionOther value) other,
}) {
return error(this);
}

@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult? Function(ApiExceptionError value)? error,
TResult? Function(ApiExceptionOther value)? other,
}) {
return error?.call(this);
}

@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(ApiExceptionError value)? error,
TResult Function(ApiExceptionOther value)? other,
required TResult orElse(),
}) {
if (error != null) {
return error(this);
}
return orElse();
}

@override
Map<String, dynamic> toJson() {
return _$$ApiExceptionErrorToJson(
Expand Down Expand Up @@ -322,68 +222,6 @@ class _$ApiExceptionOther
@override
int get hashCode => runtimeType.hashCode;

@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function(String message, List<String> details) error,
required TResult Function() other,
}) {
return other();
}

@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult? Function(String message, List<String> details)? error,
TResult? Function()? other,
}) {
return other?.call();
}

@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function(String message, List<String> details)? error,
TResult Function()? other,
required TResult orElse(),
}) {
if (other != null) {
return other();
}
return orElse();
}

@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(ApiExceptionError value) error,
required TResult Function(ApiExceptionOther value) other,
}) {
return other(this);
}

@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult? Function(ApiExceptionError value)? error,
TResult? Function(ApiExceptionOther value)? other,
}) {
return other?.call(this);
}

@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(ApiExceptionError value)? error,
TResult Function(ApiExceptionOther value)? other,
required TResult orElse(),
}) {
if (other != null) {
return other(this);
}
return orElse();
}

@override
Map<String, dynamic> toJson() {
return _$$ApiExceptionOtherToJson(
Expand Down
6 changes: 3 additions & 3 deletions lib/model/entity/memo_result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'memo_result.freezed.dart';

@freezed
class MemoResult with _$MemoResult {
sealed class MemoResult with _$MemoResult {
const factory MemoResult({
required String memo,
}) = _MemoResult;
}) = MemoResultSuccess;

const factory MemoResult.cancel() = _MemoResultCanecel;
const factory MemoResult.cancel() = MemoResultCancel;
}
Loading

0 comments on commit f276993

Please sign in to comment.