From 399d18eff775f019e5e4de094845ec206b78b186 Mon Sep 17 00:00:00 2001 From: Seungpyo1007 Date: Fri, 7 Aug 2026 15:18:26 +0900 Subject: [PATCH 1/2] feat: add TechAPI data layer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v1에는 도메인 데이터 계층이 없었다. 제품 정보가 화면 코드 안에 Map 리터럴로 박혀 있었고 모델 클래스도 리포지토리도 없었다. 위젯을 짓기 전에 데이터 계층부터 세운다. 소스 추상화 - TechApiSource: DumpSource(GitHub Pages 정적 덤프) / RestSource(api.techapi.dev) - 덤프는 실제 엔드포인트를 인프로세스로 replay해 생성되므로 REST와 응답 스키마가 같다. 차이는 URL 조립뿐이라 그 지점만 흡수한다 - api.techapi.dev는 아직 미배포라 DumpSource가 기본값 DTO (freezed + json_serializable) - Smartphone, Cpu, Gpu, Soc, Brand, CollectionPage - score는 컬렉션마다 축이 다르다. 공통 ScoreMetric을 두고 SmartphoneScore(5축) / CpuScore(single·multi) / GpuScore(graphics) / SocScore(cpu·system)로 나눴다 - 데이터셋 특성상 거의 모든 필드가 nullable이다. score 객체가 있어도 개별 축이 null인 레코드가 흔하다 - build.yaml에서 field_rename: snake 전역 적용 오류 처리 - Failure를 NetworkFailure / NotFoundFailure / ParseFailure / ServerFailure로 분류 - 리포지토리는 예외를 던지지 않고 Result를 반환한다. DTO 파싱 중 터지는 TypeError도 ParseFailure로 감싸 밖으로 새지 않게 한다 테스트 25건 - 픽스처는 손으로 만든 가짜가 아니라 실제 덤프에서 내려받은 응답이다. 스키마가 바뀌면 테스트가 깨지고 그게 의도다 - 완료 기준 충족: 위젯 없이 테스트만으로 galaxy-s25의 score 5축과 overall을 뽑아낸다 - tool/smoke_techapi.dart로 실제 원격 왕복도 확인 Closes #4 --- build.yaml | 13 + lib/core/failure.dart | 41 + lib/core/network/tech_api_client.dart | 68 + lib/core/network/tech_api_source.dart | 69 + lib/core/result.dart | 58 + lib/data/dto/brand.dart | 38 + lib/data/dto/brand.freezed.dart | 612 ++++ lib/data/dto/brand.g.dart | 38 + lib/data/dto/collection_page.dart | 39 + lib/data/dto/collection_page.freezed.dart | 714 +++++ lib/data/dto/collection_page.g.dart | 39 + lib/data/dto/cpu.dart | 47 + lib/data/dto/cpu.freezed.dart | 1057 +++++++ lib/data/dto/cpu.g.dart | 70 + lib/data/dto/gpu.dart | 43 + lib/data/dto/gpu.freezed.dart | 1057 +++++++ lib/data/dto/gpu.g.dart | 70 + lib/data/dto/score.dart | 102 + lib/data/dto/score.freezed.dart | 2167 +++++++++++++ lib/data/dto/score.g.dart | 100 + lib/data/dto/smartphone.dart | 126 + lib/data/dto/smartphone.freezed.dart | 2850 ++++++++++++++++++ lib/data/dto/smartphone.g.dart | 162 + lib/data/dto/soc.dart | 61 + lib/data/dto/soc.freezed.dart | 1265 ++++++++ lib/data/dto/soc.g.dart | 74 + lib/data/repository/tech_api_repository.dart | 78 + lib/domain/repository/device_repository.dart | 47 + pubspec.lock | 256 +- pubspec.yaml | 9 +- test/fixtures/brand_samsung.json | 15 + test/fixtures/brands_list.json | 30 + test/fixtures/cpu_ryzen_9950x3d.json | 57 + test/fixtures/fixtures.dart | 14 + test/fixtures/gpu_rtx_5090.json | 48 + test/fixtures/smartphone_galaxy_s25.json | 113 + test/fixtures/smartphone_unscored.json | 79 + test/fixtures/soc_snapdragon_8_elite.json | 53 + test/fixtures/v1_index.json | 57 + test/unit/dto_parsing_test.dart | 182 ++ test/unit/tech_api_repository_test.dart | 143 + test/unit/tech_api_source_test.dart | 74 + tool/smoke_techapi.dart | 45 + 43 files changed, 12275 insertions(+), 5 deletions(-) create mode 100644 build.yaml create mode 100644 lib/core/failure.dart create mode 100644 lib/core/network/tech_api_client.dart create mode 100644 lib/core/network/tech_api_source.dart create mode 100644 lib/core/result.dart create mode 100644 lib/data/dto/brand.dart create mode 100644 lib/data/dto/brand.freezed.dart create mode 100644 lib/data/dto/brand.g.dart create mode 100644 lib/data/dto/collection_page.dart create mode 100644 lib/data/dto/collection_page.freezed.dart create mode 100644 lib/data/dto/collection_page.g.dart create mode 100644 lib/data/dto/cpu.dart create mode 100644 lib/data/dto/cpu.freezed.dart create mode 100644 lib/data/dto/cpu.g.dart create mode 100644 lib/data/dto/gpu.dart create mode 100644 lib/data/dto/gpu.freezed.dart create mode 100644 lib/data/dto/gpu.g.dart create mode 100644 lib/data/dto/score.dart create mode 100644 lib/data/dto/score.freezed.dart create mode 100644 lib/data/dto/score.g.dart create mode 100644 lib/data/dto/smartphone.dart create mode 100644 lib/data/dto/smartphone.freezed.dart create mode 100644 lib/data/dto/smartphone.g.dart create mode 100644 lib/data/dto/soc.dart create mode 100644 lib/data/dto/soc.freezed.dart create mode 100644 lib/data/dto/soc.g.dart create mode 100644 lib/data/repository/tech_api_repository.dart create mode 100644 lib/domain/repository/device_repository.dart create mode 100644 test/fixtures/brand_samsung.json create mode 100644 test/fixtures/brands_list.json create mode 100644 test/fixtures/cpu_ryzen_9950x3d.json create mode 100644 test/fixtures/fixtures.dart create mode 100644 test/fixtures/gpu_rtx_5090.json create mode 100644 test/fixtures/smartphone_galaxy_s25.json create mode 100644 test/fixtures/smartphone_unscored.json create mode 100644 test/fixtures/soc_snapdragon_8_elite.json create mode 100644 test/fixtures/v1_index.json create mode 100644 test/unit/dto_parsing_test.dart create mode 100644 test/unit/tech_api_repository_test.dart create mode 100644 test/unit/tech_api_source_test.dart create mode 100644 tool/smoke_techapi.dart diff --git a/build.yaml b/build.yaml new file mode 100644 index 0000000..b429de2 --- /dev/null +++ b/build.yaml @@ -0,0 +1,13 @@ +targets: + $default: + builders: + json_serializable: + options: + # TechAPI의 필드는 모두 snake_case다 (SPEC §14 컨벤션). + field_rename: snake + # 중첩 객체를 직렬화할 때 toJson()을 명시적으로 호출한다. + explicit_to_json: true + # 데이터셋에는 큐레이션이 덜 된 레코드가 많아 어떤 필드든 누락될 수 있다. + # 알 수 없는 키가 들어와도 파싱을 실패시키지 않는다. + disallow_unrecognized_keys: false + create_to_json: true diff --git a/lib/core/failure.dart b/lib/core/failure.dart new file mode 100644 index 0000000..81f941d --- /dev/null +++ b/lib/core/failure.dart @@ -0,0 +1,41 @@ +/// 데이터 계층에서 발생할 수 있는 실패의 분류. +/// +/// UI가 "무엇이 잘못됐는지"에 따라 다르게 반응할 수 있도록 원인을 나눈다. +/// 네트워크 문제는 재시도 버튼을, 없는 레코드는 빈 상태를 보여야 한다. +sealed class Failure implements Exception { + const Failure(this.message, {this.cause}); + + final String message; + final Object? cause; + + @override + String toString() => '$runtimeType: $message'; +} + +/// 연결 실패·타임아웃 등 요청이 서버에 닿지 못한 경우. +class NetworkFailure extends Failure { + const NetworkFailure(super.message, {super.cause}); +} + +/// 해당 slug의 레코드가 없다 (HTTP 404). +/// +/// TechAPI 데이터셋은 큐레이션 중이라 상위 목록에 있어도 상세가 없을 수 있다. +class NotFoundFailure extends Failure { + const NotFoundFailure(this.collection, this.slug) + : super('$collection/$slug 레코드를 찾을 수 없다'); + + final String collection; + final String slug; +} + +/// 응답은 왔지만 JSON이 기대한 형태가 아니다. +class ParseFailure extends Failure { + const ParseFailure(super.message, {super.cause}); +} + +/// 위 어디에도 속하지 않는 서버 오류. +class ServerFailure extends Failure { + const ServerFailure(super.message, {this.statusCode, super.cause}); + + final int? statusCode; +} diff --git a/lib/core/network/tech_api_client.dart b/lib/core/network/tech_api_client.dart new file mode 100644 index 0000000..7510f4d --- /dev/null +++ b/lib/core/network/tech_api_client.dart @@ -0,0 +1,68 @@ +import 'dart:convert'; + +import 'package:dio/dio.dart'; + +import '../failure.dart'; +import 'tech_api_source.dart'; + +/// TechAPI에서 JSON을 가져오는 얇은 클라이언트. +/// +/// 파싱은 하지 않는다. HTTP 결과를 [Failure]로 번역하는 것까지가 책임이다. +class TechApiClient { + TechApiClient({TechApiSource? source, Dio? dio}) + : source = source ?? const DumpSource(), + _dio = dio ?? Dio() { + _dio.options + ..connectTimeout = const Duration(seconds: 15) + ..receiveTimeout = const Duration(seconds: 30) + // 상태 코드 판단은 아래에서 직접 한다. + // 람다를 괄호로 감싸지 않으면 뒤따르는 캐스케이드를 람다 본문이 삼킨다. + ..validateStatus = ((_) => true) + ..responseType = ResponseType.json; + } + + final TechApiSource source; + final Dio _dio; + + /// [uri]에서 JSON 객체를 받아온다. + /// + /// [collection]과 [slug]는 404를 [NotFoundFailure]로 만들 때만 쓰인다. + Future> getJson( + Uri uri, { + String? collection, + String? slug, + }) async { + final Response response; + try { + response = await _dio.getUri(uri); + } on DioException catch (e) { + throw NetworkFailure('$uri 요청에 실패했다', cause: e); + } + + final status = response.statusCode ?? 0; + if (status == 404) { + throw NotFoundFailure(collection ?? uri.path, slug ?? ''); + } + if (status < 200 || status >= 300) { + throw ServerFailure('$uri 가 $status 를 반환했다', statusCode: status); + } + + final data = response.data; + if (data is Map) return data; + + // GitHub Pages가 Content-Type을 text/plain으로 줄 때 dio는 문자열을 넘긴다. + if (data is String) { + final Object? decoded; + try { + decoded = jsonDecode(data); + } on FormatException catch (e) { + throw ParseFailure('$uri 응답이 올바른 JSON이 아니다', cause: e); + } + if (decoded is Map) return decoded; + } + + throw ParseFailure('$uri 응답이 JSON 객체가 아니다 (${data.runtimeType})'); + } + + void close() => _dio.close(); +} diff --git a/lib/core/network/tech_api_source.dart b/lib/core/network/tech_api_source.dart new file mode 100644 index 0000000..568d10f --- /dev/null +++ b/lib/core/network/tech_api_source.dart @@ -0,0 +1,69 @@ +/// TechAPI 데이터를 어디서 가져올지 결정하는 전략. +/// +/// TechAPI는 두 가지 형태로 같은 데이터를 제공한다. +/// +/// * **정적 덤프** — `GetTechAPI/TechEngine`의 `app/dump.py`가 실제 FastAPI +/// 엔드포인트를 인프로세스로 replay해 생성한 JSON 트리. GitHub Pages로 +/// 서빙된다. 서버가 필요 없고 지금 유일하게 살아 있는 경로다. +/// * **REST API** — `api.techapi.dev`. 2026-08-07 기준 미배포(DNS 미해결). +/// +/// 덤프가 replay로 만들어지기 때문에 **두 경로의 응답 스키마는 동일하다.** +/// 차이는 URL 조립 규칙 하나뿐이므로 그 부분만 여기서 흡수한다. +/// +/// ``` +/// REST GET /v1/smartphones/galaxy-s25 +/// 덤프 GET /v1/smartphones/galaxy-s25/index.json +/// ``` +abstract class TechApiSource { + const TechApiSource(); + + /// 단일 레코드 URI. [collection]은 복수형(`smartphones`, `cpus` …). + Uri detail(String collection, String slug); + + /// 컬렉션 목록 URI. + Uri list(String collection); + + /// API 버전 인덱스 — 컬렉션별 레코드 수를 담고 있다. + Uri index(); +} + +/// GitHub Pages 정적 덤프. v2의 기본 소스. +class DumpSource extends TechApiSource { + const DumpSource({this.baseUrl = defaultBaseUrl}); + + static const String defaultBaseUrl = 'https://gettechapi.github.io/TechAPI'; + + final String baseUrl; + + @override + Uri detail(String collection, String slug) => + Uri.parse('$baseUrl/v1/$collection/$slug/index.json'); + + @override + Uri list(String collection) => Uri.parse('$baseUrl/v1/$collection/index.json'); + + @override + Uri index() => Uri.parse('$baseUrl/v1/index.json'); +} + +/// `api.techapi.dev` 배포 후 전환할 소스. +/// +/// 덤프와 달리 쿼리 파라미터(`?limit`, `?brand`, `/search`, `/compare`)를 +/// 지원하지만, 그 기능은 실제 배포 이후에 붙인다. +class RestSource extends TechApiSource { + const RestSource({this.baseUrl = defaultBaseUrl}); + + static const String defaultBaseUrl = 'https://api.techapi.dev'; + + final String baseUrl; + + @override + Uri detail(String collection, String slug) => + Uri.parse('$baseUrl/v1/$collection/$slug'); + + @override + Uri list(String collection) => Uri.parse('$baseUrl/v1/$collection'); + + @override + Uri index() => Uri.parse('$baseUrl/v1'); +} diff --git a/lib/core/result.dart b/lib/core/result.dart new file mode 100644 index 0000000..fc5951d --- /dev/null +++ b/lib/core/result.dart @@ -0,0 +1,58 @@ +import 'failure.dart'; + +/// 성공 또는 [Failure] 중 하나. +/// +/// 리포지토리는 예외를 던지지 않고 이 타입을 돌려준다. 호출부가 실패 처리를 +/// 잊는 것을 컴파일 단계에서 막기 위해서다. +sealed class Result { + const Result(); + + const factory Result.ok(T value) = Ok; + const factory Result.err(Failure failure) = Err; + + bool get isOk => this is Ok; + bool get isErr => this is Err; + + /// 성공이면 값, 실패면 null. + T? get valueOrNull => switch (this) { + Ok(:final value) => value, + Err() => null, + }; + + /// 실패면 [Failure], 성공이면 null. + Failure? get failureOrNull => switch (this) { + Ok() => null, + Err(:final failure) => failure, + }; + + /// 성공 값을 변환한다. 실패는 그대로 통과시킨다. + Result map(R Function(T value) transform) => switch (this) { + Ok(:final value) => Ok(transform(value)), + Err(:final failure) => Err(failure), + }; + + /// 두 갈래를 모두 처리해 하나의 값으로 접는다. + R fold(R Function(T value) onOk, R Function(Failure failure) onErr) => + switch (this) { + Ok(:final value) => onOk(value), + Err(:final failure) => onErr(failure), + }; +} + +final class Ok extends Result { + const Ok(this.value); + + final T value; + + @override + String toString() => 'Ok($value)'; +} + +final class Err extends Result { + const Err(this.failure); + + final Failure failure; + + @override + String toString() => 'Err($failure)'; +} diff --git a/lib/data/dto/brand.dart b/lib/data/dto/brand.dart new file mode 100644 index 0000000..3c11f3f --- /dev/null +++ b/lib/data/dto/brand.dart @@ -0,0 +1,38 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'brand.freezed.dart'; +part 'brand.g.dart'; + +/// 제조사. +/// +/// 같은 구조가 두 자리에서 쓰이는데 채워지는 필드가 다르다. +/// +/// * `/v1/brands/{slug}` 상세 — 모든 필드 +/// * 다른 레코드에 임베드될 때 — `slug`/`name`/`url` 정도만. +/// SoC의 `manufacturer`는 `id`조차 없다. +/// +/// 그래서 `slug`와 `name`을 제외한 전부가 nullable이다. +@freezed +abstract class Brand with _$Brand { + const factory Brand({ + required String slug, + required String name, + int? id, + + /// ISO 3166-1 alpha-2 (예: `KR`). + String? country, + int? foundedYear, + String? logoUrl, + String? website, + + /// 설명은 언어별로 따로 온다. `?lang=` 파라미터가 아니라 별도 필드다. + String? descriptionEn, + String? descriptionKo, + + /// API 내부 상대 경로 (예: `/v1/brands/samsung`). + String? url, + @Default([]) List sourceUrls, + }) = _Brand; + + factory Brand.fromJson(Map json) => _$BrandFromJson(json); +} diff --git a/lib/data/dto/brand.freezed.dart b/lib/data/dto/brand.freezed.dart new file mode 100644 index 0000000..d4be904 --- /dev/null +++ b/lib/data/dto/brand.freezed.dart @@ -0,0 +1,612 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'brand.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$Brand { + String get slug; + String get name; + int? get id; + + /// ISO 3166-1 alpha-2 (예: `KR`). + String? get country; + int? get foundedYear; + String? get logoUrl; + String? get website; + + /// 설명은 언어별로 따로 온다. `?lang=` 파라미터가 아니라 별도 필드다. + String? get descriptionEn; + String? get descriptionKo; + + /// API 내부 상대 경로 (예: `/v1/brands/samsung`). + String? get url; + List get sourceUrls; + + /// Create a copy of Brand + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $BrandCopyWith get copyWith => + _$BrandCopyWithImpl(this as Brand, _$identity); + + /// Serializes this Brand to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is Brand && + (identical(other.slug, slug) || other.slug == slug) && + (identical(other.name, name) || other.name == name) && + (identical(other.id, id) || other.id == id) && + (identical(other.country, country) || other.country == country) && + (identical(other.foundedYear, foundedYear) || + other.foundedYear == foundedYear) && + (identical(other.logoUrl, logoUrl) || other.logoUrl == logoUrl) && + (identical(other.website, website) || other.website == website) && + (identical(other.descriptionEn, descriptionEn) || + other.descriptionEn == descriptionEn) && + (identical(other.descriptionKo, descriptionKo) || + other.descriptionKo == descriptionKo) && + (identical(other.url, url) || other.url == url) && + const DeepCollectionEquality() + .equals(other.sourceUrls, sourceUrls)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + slug, + name, + id, + country, + foundedYear, + logoUrl, + website, + descriptionEn, + descriptionKo, + url, + const DeepCollectionEquality().hash(sourceUrls)); + + @override + String toString() { + return 'Brand(slug: $slug, name: $name, id: $id, country: $country, foundedYear: $foundedYear, logoUrl: $logoUrl, website: $website, descriptionEn: $descriptionEn, descriptionKo: $descriptionKo, url: $url, sourceUrls: $sourceUrls)'; + } +} + +/// @nodoc +abstract mixin class $BrandCopyWith<$Res> { + factory $BrandCopyWith(Brand value, $Res Function(Brand) _then) = + _$BrandCopyWithImpl; + @useResult + $Res call( + {String slug, + String name, + int? id, + String? country, + int? foundedYear, + String? logoUrl, + String? website, + String? descriptionEn, + String? descriptionKo, + String? url, + List sourceUrls}); +} + +/// @nodoc +class _$BrandCopyWithImpl<$Res> implements $BrandCopyWith<$Res> { + _$BrandCopyWithImpl(this._self, this._then); + + final Brand _self; + final $Res Function(Brand) _then; + + /// Create a copy of Brand + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? slug = null, + Object? name = null, + Object? id = freezed, + Object? country = freezed, + Object? foundedYear = freezed, + Object? logoUrl = freezed, + Object? website = freezed, + Object? descriptionEn = freezed, + Object? descriptionKo = freezed, + Object? url = freezed, + Object? sourceUrls = null, + }) { + return _then(_self.copyWith( + slug: null == slug + ? _self.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _self.name + : name // ignore: cast_nullable_to_non_nullable + as String, + id: freezed == id + ? _self.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + country: freezed == country + ? _self.country + : country // ignore: cast_nullable_to_non_nullable + as String?, + foundedYear: freezed == foundedYear + ? _self.foundedYear + : foundedYear // ignore: cast_nullable_to_non_nullable + as int?, + logoUrl: freezed == logoUrl + ? _self.logoUrl + : logoUrl // ignore: cast_nullable_to_non_nullable + as String?, + website: freezed == website + ? _self.website + : website // ignore: cast_nullable_to_non_nullable + as String?, + descriptionEn: freezed == descriptionEn + ? _self.descriptionEn + : descriptionEn // ignore: cast_nullable_to_non_nullable + as String?, + descriptionKo: freezed == descriptionKo + ? _self.descriptionKo + : descriptionKo // ignore: cast_nullable_to_non_nullable + as String?, + url: freezed == url + ? _self.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + sourceUrls: null == sourceUrls + ? _self.sourceUrls + : sourceUrls // ignore: cast_nullable_to_non_nullable + as List, + )); + } +} + +/// Adds pattern-matching-related methods to [Brand]. +extension BrandPatterns on Brand { + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap( + TResult Function(_Brand value)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Brand() when $default != null: + return $default(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map( + TResult Function(_Brand value) $default, + ) { + final _that = this; + switch (_that) { + case _Brand(): + return $default(_that); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_Brand value)? $default, + ) { + final _that = this; + switch (_that) { + case _Brand() when $default != null: + return $default(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen( + TResult Function( + String slug, + String name, + int? id, + String? country, + int? foundedYear, + String? logoUrl, + String? website, + String? descriptionEn, + String? descriptionKo, + String? url, + List sourceUrls)? + $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Brand() when $default != null: + return $default( + _that.slug, + _that.name, + _that.id, + _that.country, + _that.foundedYear, + _that.logoUrl, + _that.website, + _that.descriptionEn, + _that.descriptionKo, + _that.url, + _that.sourceUrls); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when( + TResult Function( + String slug, + String name, + int? id, + String? country, + int? foundedYear, + String? logoUrl, + String? website, + String? descriptionEn, + String? descriptionKo, + String? url, + List sourceUrls) + $default, + ) { + final _that = this; + switch (_that) { + case _Brand(): + return $default( + _that.slug, + _that.name, + _that.id, + _that.country, + _that.foundedYear, + _that.logoUrl, + _that.website, + _that.descriptionEn, + _that.descriptionKo, + _that.url, + _that.sourceUrls); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function( + String slug, + String name, + int? id, + String? country, + int? foundedYear, + String? logoUrl, + String? website, + String? descriptionEn, + String? descriptionKo, + String? url, + List sourceUrls)? + $default, + ) { + final _that = this; + switch (_that) { + case _Brand() when $default != null: + return $default( + _that.slug, + _that.name, + _that.id, + _that.country, + _that.foundedYear, + _that.logoUrl, + _that.website, + _that.descriptionEn, + _that.descriptionKo, + _that.url, + _that.sourceUrls); + case _: + return null; + } + } +} + +/// @nodoc +@JsonSerializable() +class _Brand implements Brand { + const _Brand( + {required this.slug, + required this.name, + this.id, + this.country, + this.foundedYear, + this.logoUrl, + this.website, + this.descriptionEn, + this.descriptionKo, + this.url, + final List sourceUrls = const []}) + : _sourceUrls = sourceUrls; + factory _Brand.fromJson(Map json) => _$BrandFromJson(json); + + @override + final String slug; + @override + final String name; + @override + final int? id; + + /// ISO 3166-1 alpha-2 (예: `KR`). + @override + final String? country; + @override + final int? foundedYear; + @override + final String? logoUrl; + @override + final String? website; + + /// 설명은 언어별로 따로 온다. `?lang=` 파라미터가 아니라 별도 필드다. + @override + final String? descriptionEn; + @override + final String? descriptionKo; + + /// API 내부 상대 경로 (예: `/v1/brands/samsung`). + @override + final String? url; + final List _sourceUrls; + @override + @JsonKey() + List get sourceUrls { + if (_sourceUrls is EqualUnmodifiableListView) return _sourceUrls; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_sourceUrls); + } + + /// Create a copy of Brand + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$BrandCopyWith<_Brand> get copyWith => + __$BrandCopyWithImpl<_Brand>(this, _$identity); + + @override + Map toJson() { + return _$BrandToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _Brand && + (identical(other.slug, slug) || other.slug == slug) && + (identical(other.name, name) || other.name == name) && + (identical(other.id, id) || other.id == id) && + (identical(other.country, country) || other.country == country) && + (identical(other.foundedYear, foundedYear) || + other.foundedYear == foundedYear) && + (identical(other.logoUrl, logoUrl) || other.logoUrl == logoUrl) && + (identical(other.website, website) || other.website == website) && + (identical(other.descriptionEn, descriptionEn) || + other.descriptionEn == descriptionEn) && + (identical(other.descriptionKo, descriptionKo) || + other.descriptionKo == descriptionKo) && + (identical(other.url, url) || other.url == url) && + const DeepCollectionEquality() + .equals(other._sourceUrls, _sourceUrls)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + slug, + name, + id, + country, + foundedYear, + logoUrl, + website, + descriptionEn, + descriptionKo, + url, + const DeepCollectionEquality().hash(_sourceUrls)); + + @override + String toString() { + return 'Brand(slug: $slug, name: $name, id: $id, country: $country, foundedYear: $foundedYear, logoUrl: $logoUrl, website: $website, descriptionEn: $descriptionEn, descriptionKo: $descriptionKo, url: $url, sourceUrls: $sourceUrls)'; + } +} + +/// @nodoc +abstract mixin class _$BrandCopyWith<$Res> implements $BrandCopyWith<$Res> { + factory _$BrandCopyWith(_Brand value, $Res Function(_Brand) _then) = + __$BrandCopyWithImpl; + @override + @useResult + $Res call( + {String slug, + String name, + int? id, + String? country, + int? foundedYear, + String? logoUrl, + String? website, + String? descriptionEn, + String? descriptionKo, + String? url, + List sourceUrls}); +} + +/// @nodoc +class __$BrandCopyWithImpl<$Res> implements _$BrandCopyWith<$Res> { + __$BrandCopyWithImpl(this._self, this._then); + + final _Brand _self; + final $Res Function(_Brand) _then; + + /// Create a copy of Brand + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? slug = null, + Object? name = null, + Object? id = freezed, + Object? country = freezed, + Object? foundedYear = freezed, + Object? logoUrl = freezed, + Object? website = freezed, + Object? descriptionEn = freezed, + Object? descriptionKo = freezed, + Object? url = freezed, + Object? sourceUrls = null, + }) { + return _then(_Brand( + slug: null == slug + ? _self.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _self.name + : name // ignore: cast_nullable_to_non_nullable + as String, + id: freezed == id + ? _self.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + country: freezed == country + ? _self.country + : country // ignore: cast_nullable_to_non_nullable + as String?, + foundedYear: freezed == foundedYear + ? _self.foundedYear + : foundedYear // ignore: cast_nullable_to_non_nullable + as int?, + logoUrl: freezed == logoUrl + ? _self.logoUrl + : logoUrl // ignore: cast_nullable_to_non_nullable + as String?, + website: freezed == website + ? _self.website + : website // ignore: cast_nullable_to_non_nullable + as String?, + descriptionEn: freezed == descriptionEn + ? _self.descriptionEn + : descriptionEn // ignore: cast_nullable_to_non_nullable + as String?, + descriptionKo: freezed == descriptionKo + ? _self.descriptionKo + : descriptionKo // ignore: cast_nullable_to_non_nullable + as String?, + url: freezed == url + ? _self.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + sourceUrls: null == sourceUrls + ? _self._sourceUrls + : sourceUrls // ignore: cast_nullable_to_non_nullable + as List, + )); + } +} + +// dart format on diff --git a/lib/data/dto/brand.g.dart b/lib/data/dto/brand.g.dart new file mode 100644 index 0000000..b3b5c86 --- /dev/null +++ b/lib/data/dto/brand.g.dart @@ -0,0 +1,38 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'brand.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_Brand _$BrandFromJson(Map json) => _Brand( + slug: json['slug'] as String, + name: json['name'] as String, + id: (json['id'] as num?)?.toInt(), + country: json['country'] as String?, + foundedYear: (json['founded_year'] as num?)?.toInt(), + logoUrl: json['logo_url'] as String?, + website: json['website'] as String?, + descriptionEn: json['description_en'] as String?, + descriptionKo: json['description_ko'] as String?, + url: json['url'] as String?, + sourceUrls: (json['source_urls'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], + ); + +Map _$BrandToJson(_Brand instance) => { + 'slug': instance.slug, + 'name': instance.name, + 'id': instance.id, + 'country': instance.country, + 'founded_year': instance.foundedYear, + 'logo_url': instance.logoUrl, + 'website': instance.website, + 'description_en': instance.descriptionEn, + 'description_ko': instance.descriptionKo, + 'url': instance.url, + 'source_urls': instance.sourceUrls, + }; diff --git a/lib/data/dto/collection_page.dart b/lib/data/dto/collection_page.dart new file mode 100644 index 0000000..1ff0979 --- /dev/null +++ b/lib/data/dto/collection_page.dart @@ -0,0 +1,39 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'collection_page.freezed.dart'; +part 'collection_page.g.dart'; + +/// 목록에 실리는 최소 정보. +/// +/// 상세를 받으려면 [slug]로 다시 요청해야 한다. +@freezed +abstract class ResourceRef with _$ResourceRef { + const factory ResourceRef({ + required String slug, + required String name, + String? url, + }) = _ResourceRef; + + factory ResourceRef.fromJson(Map json) => + _$ResourceRefFromJson(json); +} + +/// 컬렉션 목록 응답. +/// +/// 정적 덤프는 **한 파일에 전체 목록**을 담는다. REST의 `?limit`/`?offset` +/// 페이지네이션과 달리 [next]/[previous]가 항상 null이다. +/// +/// 스마트폰은 93,000건이 넘으므로 이 응답을 통째로 메모리에 올리기 전에 +/// 크기를 반드시 계측할 것 (issue #8). +@freezed +abstract class CollectionPage with _$CollectionPage { + const factory CollectionPage({ + @Default(0) int count, + @Default([]) List results, + String? next, + String? previous, + }) = _CollectionPage; + + factory CollectionPage.fromJson(Map json) => + _$CollectionPageFromJson(json); +} diff --git a/lib/data/dto/collection_page.freezed.dart b/lib/data/dto/collection_page.freezed.dart new file mode 100644 index 0000000..0e27a79 --- /dev/null +++ b/lib/data/dto/collection_page.freezed.dart @@ -0,0 +1,714 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'collection_page.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$ResourceRef { + String get slug; + String get name; + String? get url; + + /// Create a copy of ResourceRef + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $ResourceRefCopyWith get copyWith => + _$ResourceRefCopyWithImpl(this as ResourceRef, _$identity); + + /// Serializes this ResourceRef to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is ResourceRef && + (identical(other.slug, slug) || other.slug == slug) && + (identical(other.name, name) || other.name == name) && + (identical(other.url, url) || other.url == url)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, slug, name, url); + + @override + String toString() { + return 'ResourceRef(slug: $slug, name: $name, url: $url)'; + } +} + +/// @nodoc +abstract mixin class $ResourceRefCopyWith<$Res> { + factory $ResourceRefCopyWith( + ResourceRef value, $Res Function(ResourceRef) _then) = + _$ResourceRefCopyWithImpl; + @useResult + $Res call({String slug, String name, String? url}); +} + +/// @nodoc +class _$ResourceRefCopyWithImpl<$Res> implements $ResourceRefCopyWith<$Res> { + _$ResourceRefCopyWithImpl(this._self, this._then); + + final ResourceRef _self; + final $Res Function(ResourceRef) _then; + + /// Create a copy of ResourceRef + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? slug = null, + Object? name = null, + Object? url = freezed, + }) { + return _then(_self.copyWith( + slug: null == slug + ? _self.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _self.name + : name // ignore: cast_nullable_to_non_nullable + as String, + url: freezed == url + ? _self.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// Adds pattern-matching-related methods to [ResourceRef]. +extension ResourceRefPatterns on ResourceRef { + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap( + TResult Function(_ResourceRef value)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _ResourceRef() when $default != null: + return $default(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map( + TResult Function(_ResourceRef value) $default, + ) { + final _that = this; + switch (_that) { + case _ResourceRef(): + return $default(_that); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_ResourceRef value)? $default, + ) { + final _that = this; + switch (_that) { + case _ResourceRef() when $default != null: + return $default(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen( + TResult Function(String slug, String name, String? url)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _ResourceRef() when $default != null: + return $default(_that.slug, _that.name, _that.url); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when( + TResult Function(String slug, String name, String? url) $default, + ) { + final _that = this; + switch (_that) { + case _ResourceRef(): + return $default(_that.slug, _that.name, _that.url); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function(String slug, String name, String? url)? $default, + ) { + final _that = this; + switch (_that) { + case _ResourceRef() when $default != null: + return $default(_that.slug, _that.name, _that.url); + case _: + return null; + } + } +} + +/// @nodoc +@JsonSerializable() +class _ResourceRef implements ResourceRef { + const _ResourceRef({required this.slug, required this.name, this.url}); + factory _ResourceRef.fromJson(Map json) => + _$ResourceRefFromJson(json); + + @override + final String slug; + @override + final String name; + @override + final String? url; + + /// Create a copy of ResourceRef + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$ResourceRefCopyWith<_ResourceRef> get copyWith => + __$ResourceRefCopyWithImpl<_ResourceRef>(this, _$identity); + + @override + Map toJson() { + return _$ResourceRefToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _ResourceRef && + (identical(other.slug, slug) || other.slug == slug) && + (identical(other.name, name) || other.name == name) && + (identical(other.url, url) || other.url == url)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, slug, name, url); + + @override + String toString() { + return 'ResourceRef(slug: $slug, name: $name, url: $url)'; + } +} + +/// @nodoc +abstract mixin class _$ResourceRefCopyWith<$Res> + implements $ResourceRefCopyWith<$Res> { + factory _$ResourceRefCopyWith( + _ResourceRef value, $Res Function(_ResourceRef) _then) = + __$ResourceRefCopyWithImpl; + @override + @useResult + $Res call({String slug, String name, String? url}); +} + +/// @nodoc +class __$ResourceRefCopyWithImpl<$Res> implements _$ResourceRefCopyWith<$Res> { + __$ResourceRefCopyWithImpl(this._self, this._then); + + final _ResourceRef _self; + final $Res Function(_ResourceRef) _then; + + /// Create a copy of ResourceRef + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? slug = null, + Object? name = null, + Object? url = freezed, + }) { + return _then(_ResourceRef( + slug: null == slug + ? _self.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _self.name + : name // ignore: cast_nullable_to_non_nullable + as String, + url: freezed == url + ? _self.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +mixin _$CollectionPage { + int get count; + List get results; + String? get next; + String? get previous; + + /// Create a copy of CollectionPage + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $CollectionPageCopyWith get copyWith => + _$CollectionPageCopyWithImpl( + this as CollectionPage, _$identity); + + /// Serializes this CollectionPage to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is CollectionPage && + (identical(other.count, count) || other.count == count) && + const DeepCollectionEquality().equals(other.results, results) && + (identical(other.next, next) || other.next == next) && + (identical(other.previous, previous) || + other.previous == previous)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, count, + const DeepCollectionEquality().hash(results), next, previous); + + @override + String toString() { + return 'CollectionPage(count: $count, results: $results, next: $next, previous: $previous)'; + } +} + +/// @nodoc +abstract mixin class $CollectionPageCopyWith<$Res> { + factory $CollectionPageCopyWith( + CollectionPage value, $Res Function(CollectionPage) _then) = + _$CollectionPageCopyWithImpl; + @useResult + $Res call( + {int count, List results, String? next, String? previous}); +} + +/// @nodoc +class _$CollectionPageCopyWithImpl<$Res> + implements $CollectionPageCopyWith<$Res> { + _$CollectionPageCopyWithImpl(this._self, this._then); + + final CollectionPage _self; + final $Res Function(CollectionPage) _then; + + /// Create a copy of CollectionPage + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? count = null, + Object? results = null, + Object? next = freezed, + Object? previous = freezed, + }) { + return _then(_self.copyWith( + count: null == count + ? _self.count + : count // ignore: cast_nullable_to_non_nullable + as int, + results: null == results + ? _self.results + : results // ignore: cast_nullable_to_non_nullable + as List, + next: freezed == next + ? _self.next + : next // ignore: cast_nullable_to_non_nullable + as String?, + previous: freezed == previous + ? _self.previous + : previous // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// Adds pattern-matching-related methods to [CollectionPage]. +extension CollectionPagePatterns on CollectionPage { + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap( + TResult Function(_CollectionPage value)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _CollectionPage() when $default != null: + return $default(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map( + TResult Function(_CollectionPage value) $default, + ) { + final _that = this; + switch (_that) { + case _CollectionPage(): + return $default(_that); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_CollectionPage value)? $default, + ) { + final _that = this; + switch (_that) { + case _CollectionPage() when $default != null: + return $default(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen( + TResult Function(int count, List results, String? next, + String? previous)? + $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _CollectionPage() when $default != null: + return $default(_that.count, _that.results, _that.next, _that.previous); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when( + TResult Function(int count, List results, String? next, + String? previous) + $default, + ) { + final _that = this; + switch (_that) { + case _CollectionPage(): + return $default(_that.count, _that.results, _that.next, _that.previous); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function(int count, List results, String? next, + String? previous)? + $default, + ) { + final _that = this; + switch (_that) { + case _CollectionPage() when $default != null: + return $default(_that.count, _that.results, _that.next, _that.previous); + case _: + return null; + } + } +} + +/// @nodoc +@JsonSerializable() +class _CollectionPage implements CollectionPage { + const _CollectionPage( + {this.count = 0, + final List results = const [], + this.next, + this.previous}) + : _results = results; + factory _CollectionPage.fromJson(Map json) => + _$CollectionPageFromJson(json); + + @override + @JsonKey() + final int count; + final List _results; + @override + @JsonKey() + List get results { + if (_results is EqualUnmodifiableListView) return _results; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_results); + } + + @override + final String? next; + @override + final String? previous; + + /// Create a copy of CollectionPage + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$CollectionPageCopyWith<_CollectionPage> get copyWith => + __$CollectionPageCopyWithImpl<_CollectionPage>(this, _$identity); + + @override + Map toJson() { + return _$CollectionPageToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _CollectionPage && + (identical(other.count, count) || other.count == count) && + const DeepCollectionEquality().equals(other._results, _results) && + (identical(other.next, next) || other.next == next) && + (identical(other.previous, previous) || + other.previous == previous)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, count, + const DeepCollectionEquality().hash(_results), next, previous); + + @override + String toString() { + return 'CollectionPage(count: $count, results: $results, next: $next, previous: $previous)'; + } +} + +/// @nodoc +abstract mixin class _$CollectionPageCopyWith<$Res> + implements $CollectionPageCopyWith<$Res> { + factory _$CollectionPageCopyWith( + _CollectionPage value, $Res Function(_CollectionPage) _then) = + __$CollectionPageCopyWithImpl; + @override + @useResult + $Res call( + {int count, List results, String? next, String? previous}); +} + +/// @nodoc +class __$CollectionPageCopyWithImpl<$Res> + implements _$CollectionPageCopyWith<$Res> { + __$CollectionPageCopyWithImpl(this._self, this._then); + + final _CollectionPage _self; + final $Res Function(_CollectionPage) _then; + + /// Create a copy of CollectionPage + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? count = null, + Object? results = null, + Object? next = freezed, + Object? previous = freezed, + }) { + return _then(_CollectionPage( + count: null == count + ? _self.count + : count // ignore: cast_nullable_to_non_nullable + as int, + results: null == results + ? _self._results + : results // ignore: cast_nullable_to_non_nullable + as List, + next: freezed == next + ? _self.next + : next // ignore: cast_nullable_to_non_nullable + as String?, + previous: freezed == previous + ? _self.previous + : previous // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +// dart format on diff --git a/lib/data/dto/collection_page.g.dart b/lib/data/dto/collection_page.g.dart new file mode 100644 index 0000000..eefec78 --- /dev/null +++ b/lib/data/dto/collection_page.g.dart @@ -0,0 +1,39 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'collection_page.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_ResourceRef _$ResourceRefFromJson(Map json) => _ResourceRef( + slug: json['slug'] as String, + name: json['name'] as String, + url: json['url'] as String?, + ); + +Map _$ResourceRefToJson(_ResourceRef instance) => + { + 'slug': instance.slug, + 'name': instance.name, + 'url': instance.url, + }; + +_CollectionPage _$CollectionPageFromJson(Map json) => + _CollectionPage( + count: (json['count'] as num?)?.toInt() ?? 0, + results: (json['results'] as List?) + ?.map((e) => ResourceRef.fromJson(e as Map)) + .toList() ?? + const [], + next: json['next'] as String?, + previous: json['previous'] as String?, + ); + +Map _$CollectionPageToJson(_CollectionPage instance) => + { + 'count': instance.count, + 'results': instance.results.map((e) => e.toJson()).toList(), + 'next': instance.next, + 'previous': instance.previous, + }; diff --git a/lib/data/dto/cpu.dart b/lib/data/dto/cpu.dart new file mode 100644 index 0000000..eb4c0ac --- /dev/null +++ b/lib/data/dto/cpu.dart @@ -0,0 +1,47 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +import 'brand.dart'; +import 'score.dart'; + +part 'cpu.freezed.dart'; +part 'cpu.g.dart'; + +/// 데스크톱·노트북 CPU. +@freezed +abstract class Cpu with _$Cpu { + const factory Cpu({ + required String slug, + required String name, + int? id, + Brand? manufacturer, + String? releaseDate, + + /// `desktop` / `laptop` / `server` 등. + String? segment, + String? architecture, + String? socket, + + /// 공정. CPU는 `TSMC N4` 같은 문자열이라 SoC의 `processNm`과 타입이 다르다. + String? processNode, + int? cores, + int? threads, + + /// 하이브리드 구조에서만 채워진다. + int? pCores, + int? eCores, + double? baseClockGhz, + double? boostClockGhz, + double? l3CacheMb, + int? tdpW, + int? maxTdpW, + String? integratedGraphics, + String? memorySupport, + int? msrpUsd, + CpuScore? score, + @Default(false) bool verified, + @Default([]) List sourceUrls, + String? url, + }) = _Cpu; + + factory Cpu.fromJson(Map json) => _$CpuFromJson(json); +} diff --git a/lib/data/dto/cpu.freezed.dart b/lib/data/dto/cpu.freezed.dart new file mode 100644 index 0000000..bdf238a --- /dev/null +++ b/lib/data/dto/cpu.freezed.dart @@ -0,0 +1,1057 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'cpu.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$Cpu { + String get slug; + String get name; + int? get id; + Brand? get manufacturer; + String? get releaseDate; + + /// `desktop` / `laptop` / `server` 등. + String? get segment; + String? get architecture; + String? get socket; + + /// 공정. CPU는 `TSMC N4` 같은 문자열이라 SoC의 `processNm`과 타입이 다르다. + String? get processNode; + int? get cores; + int? get threads; + + /// 하이브리드 구조에서만 채워진다. + int? get pCores; + int? get eCores; + double? get baseClockGhz; + double? get boostClockGhz; + double? get l3CacheMb; + int? get tdpW; + int? get maxTdpW; + String? get integratedGraphics; + String? get memorySupport; + int? get msrpUsd; + CpuScore? get score; + bool get verified; + List get sourceUrls; + String? get url; + + /// Create a copy of Cpu + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $CpuCopyWith get copyWith => + _$CpuCopyWithImpl(this as Cpu, _$identity); + + /// Serializes this Cpu to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is Cpu && + (identical(other.slug, slug) || other.slug == slug) && + (identical(other.name, name) || other.name == name) && + (identical(other.id, id) || other.id == id) && + (identical(other.manufacturer, manufacturer) || + other.manufacturer == manufacturer) && + (identical(other.releaseDate, releaseDate) || + other.releaseDate == releaseDate) && + (identical(other.segment, segment) || other.segment == segment) && + (identical(other.architecture, architecture) || + other.architecture == architecture) && + (identical(other.socket, socket) || other.socket == socket) && + (identical(other.processNode, processNode) || + other.processNode == processNode) && + (identical(other.cores, cores) || other.cores == cores) && + (identical(other.threads, threads) || other.threads == threads) && + (identical(other.pCores, pCores) || other.pCores == pCores) && + (identical(other.eCores, eCores) || other.eCores == eCores) && + (identical(other.baseClockGhz, baseClockGhz) || + other.baseClockGhz == baseClockGhz) && + (identical(other.boostClockGhz, boostClockGhz) || + other.boostClockGhz == boostClockGhz) && + (identical(other.l3CacheMb, l3CacheMb) || + other.l3CacheMb == l3CacheMb) && + (identical(other.tdpW, tdpW) || other.tdpW == tdpW) && + (identical(other.maxTdpW, maxTdpW) || other.maxTdpW == maxTdpW) && + (identical(other.integratedGraphics, integratedGraphics) || + other.integratedGraphics == integratedGraphics) && + (identical(other.memorySupport, memorySupport) || + other.memorySupport == memorySupport) && + (identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd) && + (identical(other.score, score) || other.score == score) && + (identical(other.verified, verified) || + other.verified == verified) && + const DeepCollectionEquality() + .equals(other.sourceUrls, sourceUrls) && + (identical(other.url, url) || other.url == url)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hashAll([ + runtimeType, + slug, + name, + id, + manufacturer, + releaseDate, + segment, + architecture, + socket, + processNode, + cores, + threads, + pCores, + eCores, + baseClockGhz, + boostClockGhz, + l3CacheMb, + tdpW, + maxTdpW, + integratedGraphics, + memorySupport, + msrpUsd, + score, + verified, + const DeepCollectionEquality().hash(sourceUrls), + url + ]); + + @override + String toString() { + return 'Cpu(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, releaseDate: $releaseDate, segment: $segment, architecture: $architecture, socket: $socket, processNode: $processNode, cores: $cores, threads: $threads, pCores: $pCores, eCores: $eCores, baseClockGhz: $baseClockGhz, boostClockGhz: $boostClockGhz, l3CacheMb: $l3CacheMb, tdpW: $tdpW, maxTdpW: $maxTdpW, integratedGraphics: $integratedGraphics, memorySupport: $memorySupport, msrpUsd: $msrpUsd, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; + } +} + +/// @nodoc +abstract mixin class $CpuCopyWith<$Res> { + factory $CpuCopyWith(Cpu value, $Res Function(Cpu) _then) = _$CpuCopyWithImpl; + @useResult + $Res call( + {String slug, + String name, + int? id, + Brand? manufacturer, + String? releaseDate, + String? segment, + String? architecture, + String? socket, + String? processNode, + int? cores, + int? threads, + int? pCores, + int? eCores, + double? baseClockGhz, + double? boostClockGhz, + double? l3CacheMb, + int? tdpW, + int? maxTdpW, + String? integratedGraphics, + String? memorySupport, + int? msrpUsd, + CpuScore? score, + bool verified, + List sourceUrls, + String? url}); + + $BrandCopyWith<$Res>? get manufacturer; + $CpuScoreCopyWith<$Res>? get score; +} + +/// @nodoc +class _$CpuCopyWithImpl<$Res> implements $CpuCopyWith<$Res> { + _$CpuCopyWithImpl(this._self, this._then); + + final Cpu _self; + final $Res Function(Cpu) _then; + + /// Create a copy of Cpu + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? slug = null, + Object? name = null, + Object? id = freezed, + Object? manufacturer = freezed, + Object? releaseDate = freezed, + Object? segment = freezed, + Object? architecture = freezed, + Object? socket = freezed, + Object? processNode = freezed, + Object? cores = freezed, + Object? threads = freezed, + Object? pCores = freezed, + Object? eCores = freezed, + Object? baseClockGhz = freezed, + Object? boostClockGhz = freezed, + Object? l3CacheMb = freezed, + Object? tdpW = freezed, + Object? maxTdpW = freezed, + Object? integratedGraphics = freezed, + Object? memorySupport = freezed, + Object? msrpUsd = freezed, + Object? score = freezed, + Object? verified = null, + Object? sourceUrls = null, + Object? url = freezed, + }) { + return _then(_self.copyWith( + slug: null == slug + ? _self.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _self.name + : name // ignore: cast_nullable_to_non_nullable + as String, + id: freezed == id + ? _self.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + manufacturer: freezed == manufacturer + ? _self.manufacturer + : manufacturer // ignore: cast_nullable_to_non_nullable + as Brand?, + releaseDate: freezed == releaseDate + ? _self.releaseDate + : releaseDate // ignore: cast_nullable_to_non_nullable + as String?, + segment: freezed == segment + ? _self.segment + : segment // ignore: cast_nullable_to_non_nullable + as String?, + architecture: freezed == architecture + ? _self.architecture + : architecture // ignore: cast_nullable_to_non_nullable + as String?, + socket: freezed == socket + ? _self.socket + : socket // ignore: cast_nullable_to_non_nullable + as String?, + processNode: freezed == processNode + ? _self.processNode + : processNode // ignore: cast_nullable_to_non_nullable + as String?, + cores: freezed == cores + ? _self.cores + : cores // ignore: cast_nullable_to_non_nullable + as int?, + threads: freezed == threads + ? _self.threads + : threads // ignore: cast_nullable_to_non_nullable + as int?, + pCores: freezed == pCores + ? _self.pCores + : pCores // ignore: cast_nullable_to_non_nullable + as int?, + eCores: freezed == eCores + ? _self.eCores + : eCores // ignore: cast_nullable_to_non_nullable + as int?, + baseClockGhz: freezed == baseClockGhz + ? _self.baseClockGhz + : baseClockGhz // ignore: cast_nullable_to_non_nullable + as double?, + boostClockGhz: freezed == boostClockGhz + ? _self.boostClockGhz + : boostClockGhz // ignore: cast_nullable_to_non_nullable + as double?, + l3CacheMb: freezed == l3CacheMb + ? _self.l3CacheMb + : l3CacheMb // ignore: cast_nullable_to_non_nullable + as double?, + tdpW: freezed == tdpW + ? _self.tdpW + : tdpW // ignore: cast_nullable_to_non_nullable + as int?, + maxTdpW: freezed == maxTdpW + ? _self.maxTdpW + : maxTdpW // ignore: cast_nullable_to_non_nullable + as int?, + integratedGraphics: freezed == integratedGraphics + ? _self.integratedGraphics + : integratedGraphics // ignore: cast_nullable_to_non_nullable + as String?, + memorySupport: freezed == memorySupport + ? _self.memorySupport + : memorySupport // ignore: cast_nullable_to_non_nullable + as String?, + msrpUsd: freezed == msrpUsd + ? _self.msrpUsd + : msrpUsd // ignore: cast_nullable_to_non_nullable + as int?, + score: freezed == score + ? _self.score + : score // ignore: cast_nullable_to_non_nullable + as CpuScore?, + verified: null == verified + ? _self.verified + : verified // ignore: cast_nullable_to_non_nullable + as bool, + sourceUrls: null == sourceUrls + ? _self.sourceUrls + : sourceUrls // ignore: cast_nullable_to_non_nullable + as List, + url: freezed == url + ? _self.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + )); + } + + /// Create a copy of Cpu + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $BrandCopyWith<$Res>? get manufacturer { + if (_self.manufacturer == null) { + return null; + } + + return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { + return _then(_self.copyWith(manufacturer: value)); + }); + } + + /// Create a copy of Cpu + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $CpuScoreCopyWith<$Res>? get score { + if (_self.score == null) { + return null; + } + + return $CpuScoreCopyWith<$Res>(_self.score!, (value) { + return _then(_self.copyWith(score: value)); + }); + } +} + +/// Adds pattern-matching-related methods to [Cpu]. +extension CpuPatterns on Cpu { + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap( + TResult Function(_Cpu value)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Cpu() when $default != null: + return $default(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map( + TResult Function(_Cpu value) $default, + ) { + final _that = this; + switch (_that) { + case _Cpu(): + return $default(_that); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_Cpu value)? $default, + ) { + final _that = this; + switch (_that) { + case _Cpu() when $default != null: + return $default(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen( + TResult Function( + String slug, + String name, + int? id, + Brand? manufacturer, + String? releaseDate, + String? segment, + String? architecture, + String? socket, + String? processNode, + int? cores, + int? threads, + int? pCores, + int? eCores, + double? baseClockGhz, + double? boostClockGhz, + double? l3CacheMb, + int? tdpW, + int? maxTdpW, + String? integratedGraphics, + String? memorySupport, + int? msrpUsd, + CpuScore? score, + bool verified, + List sourceUrls, + String? url)? + $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Cpu() when $default != null: + return $default( + _that.slug, + _that.name, + _that.id, + _that.manufacturer, + _that.releaseDate, + _that.segment, + _that.architecture, + _that.socket, + _that.processNode, + _that.cores, + _that.threads, + _that.pCores, + _that.eCores, + _that.baseClockGhz, + _that.boostClockGhz, + _that.l3CacheMb, + _that.tdpW, + _that.maxTdpW, + _that.integratedGraphics, + _that.memorySupport, + _that.msrpUsd, + _that.score, + _that.verified, + _that.sourceUrls, + _that.url); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when( + TResult Function( + String slug, + String name, + int? id, + Brand? manufacturer, + String? releaseDate, + String? segment, + String? architecture, + String? socket, + String? processNode, + int? cores, + int? threads, + int? pCores, + int? eCores, + double? baseClockGhz, + double? boostClockGhz, + double? l3CacheMb, + int? tdpW, + int? maxTdpW, + String? integratedGraphics, + String? memorySupport, + int? msrpUsd, + CpuScore? score, + bool verified, + List sourceUrls, + String? url) + $default, + ) { + final _that = this; + switch (_that) { + case _Cpu(): + return $default( + _that.slug, + _that.name, + _that.id, + _that.manufacturer, + _that.releaseDate, + _that.segment, + _that.architecture, + _that.socket, + _that.processNode, + _that.cores, + _that.threads, + _that.pCores, + _that.eCores, + _that.baseClockGhz, + _that.boostClockGhz, + _that.l3CacheMb, + _that.tdpW, + _that.maxTdpW, + _that.integratedGraphics, + _that.memorySupport, + _that.msrpUsd, + _that.score, + _that.verified, + _that.sourceUrls, + _that.url); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function( + String slug, + String name, + int? id, + Brand? manufacturer, + String? releaseDate, + String? segment, + String? architecture, + String? socket, + String? processNode, + int? cores, + int? threads, + int? pCores, + int? eCores, + double? baseClockGhz, + double? boostClockGhz, + double? l3CacheMb, + int? tdpW, + int? maxTdpW, + String? integratedGraphics, + String? memorySupport, + int? msrpUsd, + CpuScore? score, + bool verified, + List sourceUrls, + String? url)? + $default, + ) { + final _that = this; + switch (_that) { + case _Cpu() when $default != null: + return $default( + _that.slug, + _that.name, + _that.id, + _that.manufacturer, + _that.releaseDate, + _that.segment, + _that.architecture, + _that.socket, + _that.processNode, + _that.cores, + _that.threads, + _that.pCores, + _that.eCores, + _that.baseClockGhz, + _that.boostClockGhz, + _that.l3CacheMb, + _that.tdpW, + _that.maxTdpW, + _that.integratedGraphics, + _that.memorySupport, + _that.msrpUsd, + _that.score, + _that.verified, + _that.sourceUrls, + _that.url); + case _: + return null; + } + } +} + +/// @nodoc +@JsonSerializable() +class _Cpu implements Cpu { + const _Cpu( + {required this.slug, + required this.name, + this.id, + this.manufacturer, + this.releaseDate, + this.segment, + this.architecture, + this.socket, + this.processNode, + this.cores, + this.threads, + this.pCores, + this.eCores, + this.baseClockGhz, + this.boostClockGhz, + this.l3CacheMb, + this.tdpW, + this.maxTdpW, + this.integratedGraphics, + this.memorySupport, + this.msrpUsd, + this.score, + this.verified = false, + final List sourceUrls = const [], + this.url}) + : _sourceUrls = sourceUrls; + factory _Cpu.fromJson(Map json) => _$CpuFromJson(json); + + @override + final String slug; + @override + final String name; + @override + final int? id; + @override + final Brand? manufacturer; + @override + final String? releaseDate; + + /// `desktop` / `laptop` / `server` 등. + @override + final String? segment; + @override + final String? architecture; + @override + final String? socket; + + /// 공정. CPU는 `TSMC N4` 같은 문자열이라 SoC의 `processNm`과 타입이 다르다. + @override + final String? processNode; + @override + final int? cores; + @override + final int? threads; + + /// 하이브리드 구조에서만 채워진다. + @override + final int? pCores; + @override + final int? eCores; + @override + final double? baseClockGhz; + @override + final double? boostClockGhz; + @override + final double? l3CacheMb; + @override + final int? tdpW; + @override + final int? maxTdpW; + @override + final String? integratedGraphics; + @override + final String? memorySupport; + @override + final int? msrpUsd; + @override + final CpuScore? score; + @override + @JsonKey() + final bool verified; + final List _sourceUrls; + @override + @JsonKey() + List get sourceUrls { + if (_sourceUrls is EqualUnmodifiableListView) return _sourceUrls; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_sourceUrls); + } + + @override + final String? url; + + /// Create a copy of Cpu + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$CpuCopyWith<_Cpu> get copyWith => + __$CpuCopyWithImpl<_Cpu>(this, _$identity); + + @override + Map toJson() { + return _$CpuToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _Cpu && + (identical(other.slug, slug) || other.slug == slug) && + (identical(other.name, name) || other.name == name) && + (identical(other.id, id) || other.id == id) && + (identical(other.manufacturer, manufacturer) || + other.manufacturer == manufacturer) && + (identical(other.releaseDate, releaseDate) || + other.releaseDate == releaseDate) && + (identical(other.segment, segment) || other.segment == segment) && + (identical(other.architecture, architecture) || + other.architecture == architecture) && + (identical(other.socket, socket) || other.socket == socket) && + (identical(other.processNode, processNode) || + other.processNode == processNode) && + (identical(other.cores, cores) || other.cores == cores) && + (identical(other.threads, threads) || other.threads == threads) && + (identical(other.pCores, pCores) || other.pCores == pCores) && + (identical(other.eCores, eCores) || other.eCores == eCores) && + (identical(other.baseClockGhz, baseClockGhz) || + other.baseClockGhz == baseClockGhz) && + (identical(other.boostClockGhz, boostClockGhz) || + other.boostClockGhz == boostClockGhz) && + (identical(other.l3CacheMb, l3CacheMb) || + other.l3CacheMb == l3CacheMb) && + (identical(other.tdpW, tdpW) || other.tdpW == tdpW) && + (identical(other.maxTdpW, maxTdpW) || other.maxTdpW == maxTdpW) && + (identical(other.integratedGraphics, integratedGraphics) || + other.integratedGraphics == integratedGraphics) && + (identical(other.memorySupport, memorySupport) || + other.memorySupport == memorySupport) && + (identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd) && + (identical(other.score, score) || other.score == score) && + (identical(other.verified, verified) || + other.verified == verified) && + const DeepCollectionEquality() + .equals(other._sourceUrls, _sourceUrls) && + (identical(other.url, url) || other.url == url)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hashAll([ + runtimeType, + slug, + name, + id, + manufacturer, + releaseDate, + segment, + architecture, + socket, + processNode, + cores, + threads, + pCores, + eCores, + baseClockGhz, + boostClockGhz, + l3CacheMb, + tdpW, + maxTdpW, + integratedGraphics, + memorySupport, + msrpUsd, + score, + verified, + const DeepCollectionEquality().hash(_sourceUrls), + url + ]); + + @override + String toString() { + return 'Cpu(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, releaseDate: $releaseDate, segment: $segment, architecture: $architecture, socket: $socket, processNode: $processNode, cores: $cores, threads: $threads, pCores: $pCores, eCores: $eCores, baseClockGhz: $baseClockGhz, boostClockGhz: $boostClockGhz, l3CacheMb: $l3CacheMb, tdpW: $tdpW, maxTdpW: $maxTdpW, integratedGraphics: $integratedGraphics, memorySupport: $memorySupport, msrpUsd: $msrpUsd, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; + } +} + +/// @nodoc +abstract mixin class _$CpuCopyWith<$Res> implements $CpuCopyWith<$Res> { + factory _$CpuCopyWith(_Cpu value, $Res Function(_Cpu) _then) = + __$CpuCopyWithImpl; + @override + @useResult + $Res call( + {String slug, + String name, + int? id, + Brand? manufacturer, + String? releaseDate, + String? segment, + String? architecture, + String? socket, + String? processNode, + int? cores, + int? threads, + int? pCores, + int? eCores, + double? baseClockGhz, + double? boostClockGhz, + double? l3CacheMb, + int? tdpW, + int? maxTdpW, + String? integratedGraphics, + String? memorySupport, + int? msrpUsd, + CpuScore? score, + bool verified, + List sourceUrls, + String? url}); + + @override + $BrandCopyWith<$Res>? get manufacturer; + @override + $CpuScoreCopyWith<$Res>? get score; +} + +/// @nodoc +class __$CpuCopyWithImpl<$Res> implements _$CpuCopyWith<$Res> { + __$CpuCopyWithImpl(this._self, this._then); + + final _Cpu _self; + final $Res Function(_Cpu) _then; + + /// Create a copy of Cpu + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? slug = null, + Object? name = null, + Object? id = freezed, + Object? manufacturer = freezed, + Object? releaseDate = freezed, + Object? segment = freezed, + Object? architecture = freezed, + Object? socket = freezed, + Object? processNode = freezed, + Object? cores = freezed, + Object? threads = freezed, + Object? pCores = freezed, + Object? eCores = freezed, + Object? baseClockGhz = freezed, + Object? boostClockGhz = freezed, + Object? l3CacheMb = freezed, + Object? tdpW = freezed, + Object? maxTdpW = freezed, + Object? integratedGraphics = freezed, + Object? memorySupport = freezed, + Object? msrpUsd = freezed, + Object? score = freezed, + Object? verified = null, + Object? sourceUrls = null, + Object? url = freezed, + }) { + return _then(_Cpu( + slug: null == slug + ? _self.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _self.name + : name // ignore: cast_nullable_to_non_nullable + as String, + id: freezed == id + ? _self.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + manufacturer: freezed == manufacturer + ? _self.manufacturer + : manufacturer // ignore: cast_nullable_to_non_nullable + as Brand?, + releaseDate: freezed == releaseDate + ? _self.releaseDate + : releaseDate // ignore: cast_nullable_to_non_nullable + as String?, + segment: freezed == segment + ? _self.segment + : segment // ignore: cast_nullable_to_non_nullable + as String?, + architecture: freezed == architecture + ? _self.architecture + : architecture // ignore: cast_nullable_to_non_nullable + as String?, + socket: freezed == socket + ? _self.socket + : socket // ignore: cast_nullable_to_non_nullable + as String?, + processNode: freezed == processNode + ? _self.processNode + : processNode // ignore: cast_nullable_to_non_nullable + as String?, + cores: freezed == cores + ? _self.cores + : cores // ignore: cast_nullable_to_non_nullable + as int?, + threads: freezed == threads + ? _self.threads + : threads // ignore: cast_nullable_to_non_nullable + as int?, + pCores: freezed == pCores + ? _self.pCores + : pCores // ignore: cast_nullable_to_non_nullable + as int?, + eCores: freezed == eCores + ? _self.eCores + : eCores // ignore: cast_nullable_to_non_nullable + as int?, + baseClockGhz: freezed == baseClockGhz + ? _self.baseClockGhz + : baseClockGhz // ignore: cast_nullable_to_non_nullable + as double?, + boostClockGhz: freezed == boostClockGhz + ? _self.boostClockGhz + : boostClockGhz // ignore: cast_nullable_to_non_nullable + as double?, + l3CacheMb: freezed == l3CacheMb + ? _self.l3CacheMb + : l3CacheMb // ignore: cast_nullable_to_non_nullable + as double?, + tdpW: freezed == tdpW + ? _self.tdpW + : tdpW // ignore: cast_nullable_to_non_nullable + as int?, + maxTdpW: freezed == maxTdpW + ? _self.maxTdpW + : maxTdpW // ignore: cast_nullable_to_non_nullable + as int?, + integratedGraphics: freezed == integratedGraphics + ? _self.integratedGraphics + : integratedGraphics // ignore: cast_nullable_to_non_nullable + as String?, + memorySupport: freezed == memorySupport + ? _self.memorySupport + : memorySupport // ignore: cast_nullable_to_non_nullable + as String?, + msrpUsd: freezed == msrpUsd + ? _self.msrpUsd + : msrpUsd // ignore: cast_nullable_to_non_nullable + as int?, + score: freezed == score + ? _self.score + : score // ignore: cast_nullable_to_non_nullable + as CpuScore?, + verified: null == verified + ? _self.verified + : verified // ignore: cast_nullable_to_non_nullable + as bool, + sourceUrls: null == sourceUrls + ? _self._sourceUrls + : sourceUrls // ignore: cast_nullable_to_non_nullable + as List, + url: freezed == url + ? _self.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + )); + } + + /// Create a copy of Cpu + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $BrandCopyWith<$Res>? get manufacturer { + if (_self.manufacturer == null) { + return null; + } + + return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { + return _then(_self.copyWith(manufacturer: value)); + }); + } + + /// Create a copy of Cpu + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $CpuScoreCopyWith<$Res>? get score { + if (_self.score == null) { + return null; + } + + return $CpuScoreCopyWith<$Res>(_self.score!, (value) { + return _then(_self.copyWith(score: value)); + }); + } +} + +// dart format on diff --git a/lib/data/dto/cpu.g.dart b/lib/data/dto/cpu.g.dart new file mode 100644 index 0000000..9142413 --- /dev/null +++ b/lib/data/dto/cpu.g.dart @@ -0,0 +1,70 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'cpu.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_Cpu _$CpuFromJson(Map json) => _Cpu( + slug: json['slug'] as String, + name: json['name'] as String, + id: (json['id'] as num?)?.toInt(), + manufacturer: json['manufacturer'] == null + ? null + : Brand.fromJson(json['manufacturer'] as Map), + releaseDate: json['release_date'] as String?, + segment: json['segment'] as String?, + architecture: json['architecture'] as String?, + socket: json['socket'] as String?, + processNode: json['process_node'] as String?, + cores: (json['cores'] as num?)?.toInt(), + threads: (json['threads'] as num?)?.toInt(), + pCores: (json['p_cores'] as num?)?.toInt(), + eCores: (json['e_cores'] as num?)?.toInt(), + baseClockGhz: (json['base_clock_ghz'] as num?)?.toDouble(), + boostClockGhz: (json['boost_clock_ghz'] as num?)?.toDouble(), + l3CacheMb: (json['l3_cache_mb'] as num?)?.toDouble(), + tdpW: (json['tdp_w'] as num?)?.toInt(), + maxTdpW: (json['max_tdp_w'] as num?)?.toInt(), + integratedGraphics: json['integrated_graphics'] as String?, + memorySupport: json['memory_support'] as String?, + msrpUsd: (json['msrp_usd'] as num?)?.toInt(), + score: json['score'] == null + ? null + : CpuScore.fromJson(json['score'] as Map), + verified: json['verified'] as bool? ?? false, + sourceUrls: (json['source_urls'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], + url: json['url'] as String?, + ); + +Map _$CpuToJson(_Cpu instance) => { + 'slug': instance.slug, + 'name': instance.name, + 'id': instance.id, + 'manufacturer': instance.manufacturer?.toJson(), + 'release_date': instance.releaseDate, + 'segment': instance.segment, + 'architecture': instance.architecture, + 'socket': instance.socket, + 'process_node': instance.processNode, + 'cores': instance.cores, + 'threads': instance.threads, + 'p_cores': instance.pCores, + 'e_cores': instance.eCores, + 'base_clock_ghz': instance.baseClockGhz, + 'boost_clock_ghz': instance.boostClockGhz, + 'l3_cache_mb': instance.l3CacheMb, + 'tdp_w': instance.tdpW, + 'max_tdp_w': instance.maxTdpW, + 'integrated_graphics': instance.integratedGraphics, + 'memory_support': instance.memorySupport, + 'msrp_usd': instance.msrpUsd, + 'score': instance.score?.toJson(), + 'verified': instance.verified, + 'source_urls': instance.sourceUrls, + 'url': instance.url, + }; diff --git a/lib/data/dto/gpu.dart b/lib/data/dto/gpu.dart new file mode 100644 index 0000000..dd29100 --- /dev/null +++ b/lib/data/dto/gpu.dart @@ -0,0 +1,43 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +import 'brand.dart'; +import 'score.dart'; + +part 'gpu.freezed.dart'; +part 'gpu.g.dart'; + +/// 외장 그래픽카드. +/// +/// NVIDIA는 `cudaCores`, AMD는 `streamProcessors`를 쓴다. 둘 중 하나만 채워진다. +@freezed +abstract class Gpu with _$Gpu { + const factory Gpu({ + required String slug, + required String name, + int? id, + Brand? manufacturer, + String? architecture, + String? releaseDate, + int? msrpUsd, + int? cudaCores, + int? streamProcessors, + int? rtCores, + int? tensorCores, + double? memoryGb, + String? memoryType, + int? memoryBusBit, + double? memoryBandwidthGbps, + int? baseClockMhz, + int? boostClockMhz, + int? tdpW, + String? pcieVersion, + double? fp32Tflops, + double? blenderScore, + GpuScore? score, + @Default(false) bool verified, + @Default([]) List sourceUrls, + String? url, + }) = _Gpu; + + factory Gpu.fromJson(Map json) => _$GpuFromJson(json); +} diff --git a/lib/data/dto/gpu.freezed.dart b/lib/data/dto/gpu.freezed.dart new file mode 100644 index 0000000..cbcf226 --- /dev/null +++ b/lib/data/dto/gpu.freezed.dart @@ -0,0 +1,1057 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'gpu.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$Gpu { + String get slug; + String get name; + int? get id; + Brand? get manufacturer; + String? get architecture; + String? get releaseDate; + int? get msrpUsd; + int? get cudaCores; + int? get streamProcessors; + int? get rtCores; + int? get tensorCores; + double? get memoryGb; + String? get memoryType; + int? get memoryBusBit; + double? get memoryBandwidthGbps; + int? get baseClockMhz; + int? get boostClockMhz; + int? get tdpW; + String? get pcieVersion; + double? get fp32Tflops; + double? get blenderScore; + GpuScore? get score; + bool get verified; + List get sourceUrls; + String? get url; + + /// Create a copy of Gpu + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $GpuCopyWith get copyWith => + _$GpuCopyWithImpl(this as Gpu, _$identity); + + /// Serializes this Gpu to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is Gpu && + (identical(other.slug, slug) || other.slug == slug) && + (identical(other.name, name) || other.name == name) && + (identical(other.id, id) || other.id == id) && + (identical(other.manufacturer, manufacturer) || + other.manufacturer == manufacturer) && + (identical(other.architecture, architecture) || + other.architecture == architecture) && + (identical(other.releaseDate, releaseDate) || + other.releaseDate == releaseDate) && + (identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd) && + (identical(other.cudaCores, cudaCores) || + other.cudaCores == cudaCores) && + (identical(other.streamProcessors, streamProcessors) || + other.streamProcessors == streamProcessors) && + (identical(other.rtCores, rtCores) || other.rtCores == rtCores) && + (identical(other.tensorCores, tensorCores) || + other.tensorCores == tensorCores) && + (identical(other.memoryGb, memoryGb) || + other.memoryGb == memoryGb) && + (identical(other.memoryType, memoryType) || + other.memoryType == memoryType) && + (identical(other.memoryBusBit, memoryBusBit) || + other.memoryBusBit == memoryBusBit) && + (identical(other.memoryBandwidthGbps, memoryBandwidthGbps) || + other.memoryBandwidthGbps == memoryBandwidthGbps) && + (identical(other.baseClockMhz, baseClockMhz) || + other.baseClockMhz == baseClockMhz) && + (identical(other.boostClockMhz, boostClockMhz) || + other.boostClockMhz == boostClockMhz) && + (identical(other.tdpW, tdpW) || other.tdpW == tdpW) && + (identical(other.pcieVersion, pcieVersion) || + other.pcieVersion == pcieVersion) && + (identical(other.fp32Tflops, fp32Tflops) || + other.fp32Tflops == fp32Tflops) && + (identical(other.blenderScore, blenderScore) || + other.blenderScore == blenderScore) && + (identical(other.score, score) || other.score == score) && + (identical(other.verified, verified) || + other.verified == verified) && + const DeepCollectionEquality() + .equals(other.sourceUrls, sourceUrls) && + (identical(other.url, url) || other.url == url)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hashAll([ + runtimeType, + slug, + name, + id, + manufacturer, + architecture, + releaseDate, + msrpUsd, + cudaCores, + streamProcessors, + rtCores, + tensorCores, + memoryGb, + memoryType, + memoryBusBit, + memoryBandwidthGbps, + baseClockMhz, + boostClockMhz, + tdpW, + pcieVersion, + fp32Tflops, + blenderScore, + score, + verified, + const DeepCollectionEquality().hash(sourceUrls), + url + ]); + + @override + String toString() { + return 'Gpu(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, architecture: $architecture, releaseDate: $releaseDate, msrpUsd: $msrpUsd, cudaCores: $cudaCores, streamProcessors: $streamProcessors, rtCores: $rtCores, tensorCores: $tensorCores, memoryGb: $memoryGb, memoryType: $memoryType, memoryBusBit: $memoryBusBit, memoryBandwidthGbps: $memoryBandwidthGbps, baseClockMhz: $baseClockMhz, boostClockMhz: $boostClockMhz, tdpW: $tdpW, pcieVersion: $pcieVersion, fp32Tflops: $fp32Tflops, blenderScore: $blenderScore, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; + } +} + +/// @nodoc +abstract mixin class $GpuCopyWith<$Res> { + factory $GpuCopyWith(Gpu value, $Res Function(Gpu) _then) = _$GpuCopyWithImpl; + @useResult + $Res call( + {String slug, + String name, + int? id, + Brand? manufacturer, + String? architecture, + String? releaseDate, + int? msrpUsd, + int? cudaCores, + int? streamProcessors, + int? rtCores, + int? tensorCores, + double? memoryGb, + String? memoryType, + int? memoryBusBit, + double? memoryBandwidthGbps, + int? baseClockMhz, + int? boostClockMhz, + int? tdpW, + String? pcieVersion, + double? fp32Tflops, + double? blenderScore, + GpuScore? score, + bool verified, + List sourceUrls, + String? url}); + + $BrandCopyWith<$Res>? get manufacturer; + $GpuScoreCopyWith<$Res>? get score; +} + +/// @nodoc +class _$GpuCopyWithImpl<$Res> implements $GpuCopyWith<$Res> { + _$GpuCopyWithImpl(this._self, this._then); + + final Gpu _self; + final $Res Function(Gpu) _then; + + /// Create a copy of Gpu + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? slug = null, + Object? name = null, + Object? id = freezed, + Object? manufacturer = freezed, + Object? architecture = freezed, + Object? releaseDate = freezed, + Object? msrpUsd = freezed, + Object? cudaCores = freezed, + Object? streamProcessors = freezed, + Object? rtCores = freezed, + Object? tensorCores = freezed, + Object? memoryGb = freezed, + Object? memoryType = freezed, + Object? memoryBusBit = freezed, + Object? memoryBandwidthGbps = freezed, + Object? baseClockMhz = freezed, + Object? boostClockMhz = freezed, + Object? tdpW = freezed, + Object? pcieVersion = freezed, + Object? fp32Tflops = freezed, + Object? blenderScore = freezed, + Object? score = freezed, + Object? verified = null, + Object? sourceUrls = null, + Object? url = freezed, + }) { + return _then(_self.copyWith( + slug: null == slug + ? _self.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _self.name + : name // ignore: cast_nullable_to_non_nullable + as String, + id: freezed == id + ? _self.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + manufacturer: freezed == manufacturer + ? _self.manufacturer + : manufacturer // ignore: cast_nullable_to_non_nullable + as Brand?, + architecture: freezed == architecture + ? _self.architecture + : architecture // ignore: cast_nullable_to_non_nullable + as String?, + releaseDate: freezed == releaseDate + ? _self.releaseDate + : releaseDate // ignore: cast_nullable_to_non_nullable + as String?, + msrpUsd: freezed == msrpUsd + ? _self.msrpUsd + : msrpUsd // ignore: cast_nullable_to_non_nullable + as int?, + cudaCores: freezed == cudaCores + ? _self.cudaCores + : cudaCores // ignore: cast_nullable_to_non_nullable + as int?, + streamProcessors: freezed == streamProcessors + ? _self.streamProcessors + : streamProcessors // ignore: cast_nullable_to_non_nullable + as int?, + rtCores: freezed == rtCores + ? _self.rtCores + : rtCores // ignore: cast_nullable_to_non_nullable + as int?, + tensorCores: freezed == tensorCores + ? _self.tensorCores + : tensorCores // ignore: cast_nullable_to_non_nullable + as int?, + memoryGb: freezed == memoryGb + ? _self.memoryGb + : memoryGb // ignore: cast_nullable_to_non_nullable + as double?, + memoryType: freezed == memoryType + ? _self.memoryType + : memoryType // ignore: cast_nullable_to_non_nullable + as String?, + memoryBusBit: freezed == memoryBusBit + ? _self.memoryBusBit + : memoryBusBit // ignore: cast_nullable_to_non_nullable + as int?, + memoryBandwidthGbps: freezed == memoryBandwidthGbps + ? _self.memoryBandwidthGbps + : memoryBandwidthGbps // ignore: cast_nullable_to_non_nullable + as double?, + baseClockMhz: freezed == baseClockMhz + ? _self.baseClockMhz + : baseClockMhz // ignore: cast_nullable_to_non_nullable + as int?, + boostClockMhz: freezed == boostClockMhz + ? _self.boostClockMhz + : boostClockMhz // ignore: cast_nullable_to_non_nullable + as int?, + tdpW: freezed == tdpW + ? _self.tdpW + : tdpW // ignore: cast_nullable_to_non_nullable + as int?, + pcieVersion: freezed == pcieVersion + ? _self.pcieVersion + : pcieVersion // ignore: cast_nullable_to_non_nullable + as String?, + fp32Tflops: freezed == fp32Tflops + ? _self.fp32Tflops + : fp32Tflops // ignore: cast_nullable_to_non_nullable + as double?, + blenderScore: freezed == blenderScore + ? _self.blenderScore + : blenderScore // ignore: cast_nullable_to_non_nullable + as double?, + score: freezed == score + ? _self.score + : score // ignore: cast_nullable_to_non_nullable + as GpuScore?, + verified: null == verified + ? _self.verified + : verified // ignore: cast_nullable_to_non_nullable + as bool, + sourceUrls: null == sourceUrls + ? _self.sourceUrls + : sourceUrls // ignore: cast_nullable_to_non_nullable + as List, + url: freezed == url + ? _self.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + )); + } + + /// Create a copy of Gpu + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $BrandCopyWith<$Res>? get manufacturer { + if (_self.manufacturer == null) { + return null; + } + + return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { + return _then(_self.copyWith(manufacturer: value)); + }); + } + + /// Create a copy of Gpu + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $GpuScoreCopyWith<$Res>? get score { + if (_self.score == null) { + return null; + } + + return $GpuScoreCopyWith<$Res>(_self.score!, (value) { + return _then(_self.copyWith(score: value)); + }); + } +} + +/// Adds pattern-matching-related methods to [Gpu]. +extension GpuPatterns on Gpu { + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap( + TResult Function(_Gpu value)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Gpu() when $default != null: + return $default(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map( + TResult Function(_Gpu value) $default, + ) { + final _that = this; + switch (_that) { + case _Gpu(): + return $default(_that); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_Gpu value)? $default, + ) { + final _that = this; + switch (_that) { + case _Gpu() when $default != null: + return $default(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen( + TResult Function( + String slug, + String name, + int? id, + Brand? manufacturer, + String? architecture, + String? releaseDate, + int? msrpUsd, + int? cudaCores, + int? streamProcessors, + int? rtCores, + int? tensorCores, + double? memoryGb, + String? memoryType, + int? memoryBusBit, + double? memoryBandwidthGbps, + int? baseClockMhz, + int? boostClockMhz, + int? tdpW, + String? pcieVersion, + double? fp32Tflops, + double? blenderScore, + GpuScore? score, + bool verified, + List sourceUrls, + String? url)? + $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Gpu() when $default != null: + return $default( + _that.slug, + _that.name, + _that.id, + _that.manufacturer, + _that.architecture, + _that.releaseDate, + _that.msrpUsd, + _that.cudaCores, + _that.streamProcessors, + _that.rtCores, + _that.tensorCores, + _that.memoryGb, + _that.memoryType, + _that.memoryBusBit, + _that.memoryBandwidthGbps, + _that.baseClockMhz, + _that.boostClockMhz, + _that.tdpW, + _that.pcieVersion, + _that.fp32Tflops, + _that.blenderScore, + _that.score, + _that.verified, + _that.sourceUrls, + _that.url); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when( + TResult Function( + String slug, + String name, + int? id, + Brand? manufacturer, + String? architecture, + String? releaseDate, + int? msrpUsd, + int? cudaCores, + int? streamProcessors, + int? rtCores, + int? tensorCores, + double? memoryGb, + String? memoryType, + int? memoryBusBit, + double? memoryBandwidthGbps, + int? baseClockMhz, + int? boostClockMhz, + int? tdpW, + String? pcieVersion, + double? fp32Tflops, + double? blenderScore, + GpuScore? score, + bool verified, + List sourceUrls, + String? url) + $default, + ) { + final _that = this; + switch (_that) { + case _Gpu(): + return $default( + _that.slug, + _that.name, + _that.id, + _that.manufacturer, + _that.architecture, + _that.releaseDate, + _that.msrpUsd, + _that.cudaCores, + _that.streamProcessors, + _that.rtCores, + _that.tensorCores, + _that.memoryGb, + _that.memoryType, + _that.memoryBusBit, + _that.memoryBandwidthGbps, + _that.baseClockMhz, + _that.boostClockMhz, + _that.tdpW, + _that.pcieVersion, + _that.fp32Tflops, + _that.blenderScore, + _that.score, + _that.verified, + _that.sourceUrls, + _that.url); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function( + String slug, + String name, + int? id, + Brand? manufacturer, + String? architecture, + String? releaseDate, + int? msrpUsd, + int? cudaCores, + int? streamProcessors, + int? rtCores, + int? tensorCores, + double? memoryGb, + String? memoryType, + int? memoryBusBit, + double? memoryBandwidthGbps, + int? baseClockMhz, + int? boostClockMhz, + int? tdpW, + String? pcieVersion, + double? fp32Tflops, + double? blenderScore, + GpuScore? score, + bool verified, + List sourceUrls, + String? url)? + $default, + ) { + final _that = this; + switch (_that) { + case _Gpu() when $default != null: + return $default( + _that.slug, + _that.name, + _that.id, + _that.manufacturer, + _that.architecture, + _that.releaseDate, + _that.msrpUsd, + _that.cudaCores, + _that.streamProcessors, + _that.rtCores, + _that.tensorCores, + _that.memoryGb, + _that.memoryType, + _that.memoryBusBit, + _that.memoryBandwidthGbps, + _that.baseClockMhz, + _that.boostClockMhz, + _that.tdpW, + _that.pcieVersion, + _that.fp32Tflops, + _that.blenderScore, + _that.score, + _that.verified, + _that.sourceUrls, + _that.url); + case _: + return null; + } + } +} + +/// @nodoc +@JsonSerializable() +class _Gpu implements Gpu { + const _Gpu( + {required this.slug, + required this.name, + this.id, + this.manufacturer, + this.architecture, + this.releaseDate, + this.msrpUsd, + this.cudaCores, + this.streamProcessors, + this.rtCores, + this.tensorCores, + this.memoryGb, + this.memoryType, + this.memoryBusBit, + this.memoryBandwidthGbps, + this.baseClockMhz, + this.boostClockMhz, + this.tdpW, + this.pcieVersion, + this.fp32Tflops, + this.blenderScore, + this.score, + this.verified = false, + final List sourceUrls = const [], + this.url}) + : _sourceUrls = sourceUrls; + factory _Gpu.fromJson(Map json) => _$GpuFromJson(json); + + @override + final String slug; + @override + final String name; + @override + final int? id; + @override + final Brand? manufacturer; + @override + final String? architecture; + @override + final String? releaseDate; + @override + final int? msrpUsd; + @override + final int? cudaCores; + @override + final int? streamProcessors; + @override + final int? rtCores; + @override + final int? tensorCores; + @override + final double? memoryGb; + @override + final String? memoryType; + @override + final int? memoryBusBit; + @override + final double? memoryBandwidthGbps; + @override + final int? baseClockMhz; + @override + final int? boostClockMhz; + @override + final int? tdpW; + @override + final String? pcieVersion; + @override + final double? fp32Tflops; + @override + final double? blenderScore; + @override + final GpuScore? score; + @override + @JsonKey() + final bool verified; + final List _sourceUrls; + @override + @JsonKey() + List get sourceUrls { + if (_sourceUrls is EqualUnmodifiableListView) return _sourceUrls; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_sourceUrls); + } + + @override + final String? url; + + /// Create a copy of Gpu + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$GpuCopyWith<_Gpu> get copyWith => + __$GpuCopyWithImpl<_Gpu>(this, _$identity); + + @override + Map toJson() { + return _$GpuToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _Gpu && + (identical(other.slug, slug) || other.slug == slug) && + (identical(other.name, name) || other.name == name) && + (identical(other.id, id) || other.id == id) && + (identical(other.manufacturer, manufacturer) || + other.manufacturer == manufacturer) && + (identical(other.architecture, architecture) || + other.architecture == architecture) && + (identical(other.releaseDate, releaseDate) || + other.releaseDate == releaseDate) && + (identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd) && + (identical(other.cudaCores, cudaCores) || + other.cudaCores == cudaCores) && + (identical(other.streamProcessors, streamProcessors) || + other.streamProcessors == streamProcessors) && + (identical(other.rtCores, rtCores) || other.rtCores == rtCores) && + (identical(other.tensorCores, tensorCores) || + other.tensorCores == tensorCores) && + (identical(other.memoryGb, memoryGb) || + other.memoryGb == memoryGb) && + (identical(other.memoryType, memoryType) || + other.memoryType == memoryType) && + (identical(other.memoryBusBit, memoryBusBit) || + other.memoryBusBit == memoryBusBit) && + (identical(other.memoryBandwidthGbps, memoryBandwidthGbps) || + other.memoryBandwidthGbps == memoryBandwidthGbps) && + (identical(other.baseClockMhz, baseClockMhz) || + other.baseClockMhz == baseClockMhz) && + (identical(other.boostClockMhz, boostClockMhz) || + other.boostClockMhz == boostClockMhz) && + (identical(other.tdpW, tdpW) || other.tdpW == tdpW) && + (identical(other.pcieVersion, pcieVersion) || + other.pcieVersion == pcieVersion) && + (identical(other.fp32Tflops, fp32Tflops) || + other.fp32Tflops == fp32Tflops) && + (identical(other.blenderScore, blenderScore) || + other.blenderScore == blenderScore) && + (identical(other.score, score) || other.score == score) && + (identical(other.verified, verified) || + other.verified == verified) && + const DeepCollectionEquality() + .equals(other._sourceUrls, _sourceUrls) && + (identical(other.url, url) || other.url == url)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hashAll([ + runtimeType, + slug, + name, + id, + manufacturer, + architecture, + releaseDate, + msrpUsd, + cudaCores, + streamProcessors, + rtCores, + tensorCores, + memoryGb, + memoryType, + memoryBusBit, + memoryBandwidthGbps, + baseClockMhz, + boostClockMhz, + tdpW, + pcieVersion, + fp32Tflops, + blenderScore, + score, + verified, + const DeepCollectionEquality().hash(_sourceUrls), + url + ]); + + @override + String toString() { + return 'Gpu(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, architecture: $architecture, releaseDate: $releaseDate, msrpUsd: $msrpUsd, cudaCores: $cudaCores, streamProcessors: $streamProcessors, rtCores: $rtCores, tensorCores: $tensorCores, memoryGb: $memoryGb, memoryType: $memoryType, memoryBusBit: $memoryBusBit, memoryBandwidthGbps: $memoryBandwidthGbps, baseClockMhz: $baseClockMhz, boostClockMhz: $boostClockMhz, tdpW: $tdpW, pcieVersion: $pcieVersion, fp32Tflops: $fp32Tflops, blenderScore: $blenderScore, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; + } +} + +/// @nodoc +abstract mixin class _$GpuCopyWith<$Res> implements $GpuCopyWith<$Res> { + factory _$GpuCopyWith(_Gpu value, $Res Function(_Gpu) _then) = + __$GpuCopyWithImpl; + @override + @useResult + $Res call( + {String slug, + String name, + int? id, + Brand? manufacturer, + String? architecture, + String? releaseDate, + int? msrpUsd, + int? cudaCores, + int? streamProcessors, + int? rtCores, + int? tensorCores, + double? memoryGb, + String? memoryType, + int? memoryBusBit, + double? memoryBandwidthGbps, + int? baseClockMhz, + int? boostClockMhz, + int? tdpW, + String? pcieVersion, + double? fp32Tflops, + double? blenderScore, + GpuScore? score, + bool verified, + List sourceUrls, + String? url}); + + @override + $BrandCopyWith<$Res>? get manufacturer; + @override + $GpuScoreCopyWith<$Res>? get score; +} + +/// @nodoc +class __$GpuCopyWithImpl<$Res> implements _$GpuCopyWith<$Res> { + __$GpuCopyWithImpl(this._self, this._then); + + final _Gpu _self; + final $Res Function(_Gpu) _then; + + /// Create a copy of Gpu + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? slug = null, + Object? name = null, + Object? id = freezed, + Object? manufacturer = freezed, + Object? architecture = freezed, + Object? releaseDate = freezed, + Object? msrpUsd = freezed, + Object? cudaCores = freezed, + Object? streamProcessors = freezed, + Object? rtCores = freezed, + Object? tensorCores = freezed, + Object? memoryGb = freezed, + Object? memoryType = freezed, + Object? memoryBusBit = freezed, + Object? memoryBandwidthGbps = freezed, + Object? baseClockMhz = freezed, + Object? boostClockMhz = freezed, + Object? tdpW = freezed, + Object? pcieVersion = freezed, + Object? fp32Tflops = freezed, + Object? blenderScore = freezed, + Object? score = freezed, + Object? verified = null, + Object? sourceUrls = null, + Object? url = freezed, + }) { + return _then(_Gpu( + slug: null == slug + ? _self.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _self.name + : name // ignore: cast_nullable_to_non_nullable + as String, + id: freezed == id + ? _self.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + manufacturer: freezed == manufacturer + ? _self.manufacturer + : manufacturer // ignore: cast_nullable_to_non_nullable + as Brand?, + architecture: freezed == architecture + ? _self.architecture + : architecture // ignore: cast_nullable_to_non_nullable + as String?, + releaseDate: freezed == releaseDate + ? _self.releaseDate + : releaseDate // ignore: cast_nullable_to_non_nullable + as String?, + msrpUsd: freezed == msrpUsd + ? _self.msrpUsd + : msrpUsd // ignore: cast_nullable_to_non_nullable + as int?, + cudaCores: freezed == cudaCores + ? _self.cudaCores + : cudaCores // ignore: cast_nullable_to_non_nullable + as int?, + streamProcessors: freezed == streamProcessors + ? _self.streamProcessors + : streamProcessors // ignore: cast_nullable_to_non_nullable + as int?, + rtCores: freezed == rtCores + ? _self.rtCores + : rtCores // ignore: cast_nullable_to_non_nullable + as int?, + tensorCores: freezed == tensorCores + ? _self.tensorCores + : tensorCores // ignore: cast_nullable_to_non_nullable + as int?, + memoryGb: freezed == memoryGb + ? _self.memoryGb + : memoryGb // ignore: cast_nullable_to_non_nullable + as double?, + memoryType: freezed == memoryType + ? _self.memoryType + : memoryType // ignore: cast_nullable_to_non_nullable + as String?, + memoryBusBit: freezed == memoryBusBit + ? _self.memoryBusBit + : memoryBusBit // ignore: cast_nullable_to_non_nullable + as int?, + memoryBandwidthGbps: freezed == memoryBandwidthGbps + ? _self.memoryBandwidthGbps + : memoryBandwidthGbps // ignore: cast_nullable_to_non_nullable + as double?, + baseClockMhz: freezed == baseClockMhz + ? _self.baseClockMhz + : baseClockMhz // ignore: cast_nullable_to_non_nullable + as int?, + boostClockMhz: freezed == boostClockMhz + ? _self.boostClockMhz + : boostClockMhz // ignore: cast_nullable_to_non_nullable + as int?, + tdpW: freezed == tdpW + ? _self.tdpW + : tdpW // ignore: cast_nullable_to_non_nullable + as int?, + pcieVersion: freezed == pcieVersion + ? _self.pcieVersion + : pcieVersion // ignore: cast_nullable_to_non_nullable + as String?, + fp32Tflops: freezed == fp32Tflops + ? _self.fp32Tflops + : fp32Tflops // ignore: cast_nullable_to_non_nullable + as double?, + blenderScore: freezed == blenderScore + ? _self.blenderScore + : blenderScore // ignore: cast_nullable_to_non_nullable + as double?, + score: freezed == score + ? _self.score + : score // ignore: cast_nullable_to_non_nullable + as GpuScore?, + verified: null == verified + ? _self.verified + : verified // ignore: cast_nullable_to_non_nullable + as bool, + sourceUrls: null == sourceUrls + ? _self._sourceUrls + : sourceUrls // ignore: cast_nullable_to_non_nullable + as List, + url: freezed == url + ? _self.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + )); + } + + /// Create a copy of Gpu + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $BrandCopyWith<$Res>? get manufacturer { + if (_self.manufacturer == null) { + return null; + } + + return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { + return _then(_self.copyWith(manufacturer: value)); + }); + } + + /// Create a copy of Gpu + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $GpuScoreCopyWith<$Res>? get score { + if (_self.score == null) { + return null; + } + + return $GpuScoreCopyWith<$Res>(_self.score!, (value) { + return _then(_self.copyWith(score: value)); + }); + } +} + +// dart format on diff --git a/lib/data/dto/gpu.g.dart b/lib/data/dto/gpu.g.dart new file mode 100644 index 0000000..2082bc0 --- /dev/null +++ b/lib/data/dto/gpu.g.dart @@ -0,0 +1,70 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'gpu.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_Gpu _$GpuFromJson(Map json) => _Gpu( + slug: json['slug'] as String, + name: json['name'] as String, + id: (json['id'] as num?)?.toInt(), + manufacturer: json['manufacturer'] == null + ? null + : Brand.fromJson(json['manufacturer'] as Map), + architecture: json['architecture'] as String?, + releaseDate: json['release_date'] as String?, + msrpUsd: (json['msrp_usd'] as num?)?.toInt(), + cudaCores: (json['cuda_cores'] as num?)?.toInt(), + streamProcessors: (json['stream_processors'] as num?)?.toInt(), + rtCores: (json['rt_cores'] as num?)?.toInt(), + tensorCores: (json['tensor_cores'] as num?)?.toInt(), + memoryGb: (json['memory_gb'] as num?)?.toDouble(), + memoryType: json['memory_type'] as String?, + memoryBusBit: (json['memory_bus_bit'] as num?)?.toInt(), + memoryBandwidthGbps: (json['memory_bandwidth_gbps'] as num?)?.toDouble(), + baseClockMhz: (json['base_clock_mhz'] as num?)?.toInt(), + boostClockMhz: (json['boost_clock_mhz'] as num?)?.toInt(), + tdpW: (json['tdp_w'] as num?)?.toInt(), + pcieVersion: json['pcie_version'] as String?, + fp32Tflops: (json['fp32_tflops'] as num?)?.toDouble(), + blenderScore: (json['blender_score'] as num?)?.toDouble(), + score: json['score'] == null + ? null + : GpuScore.fromJson(json['score'] as Map), + verified: json['verified'] as bool? ?? false, + sourceUrls: (json['source_urls'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], + url: json['url'] as String?, + ); + +Map _$GpuToJson(_Gpu instance) => { + 'slug': instance.slug, + 'name': instance.name, + 'id': instance.id, + 'manufacturer': instance.manufacturer?.toJson(), + 'architecture': instance.architecture, + 'release_date': instance.releaseDate, + 'msrp_usd': instance.msrpUsd, + 'cuda_cores': instance.cudaCores, + 'stream_processors': instance.streamProcessors, + 'rt_cores': instance.rtCores, + 'tensor_cores': instance.tensorCores, + 'memory_gb': instance.memoryGb, + 'memory_type': instance.memoryType, + 'memory_bus_bit': instance.memoryBusBit, + 'memory_bandwidth_gbps': instance.memoryBandwidthGbps, + 'base_clock_mhz': instance.baseClockMhz, + 'boost_clock_mhz': instance.boostClockMhz, + 'tdp_w': instance.tdpW, + 'pcie_version': instance.pcieVersion, + 'fp32_tflops': instance.fp32Tflops, + 'blender_score': instance.blenderScore, + 'score': instance.score?.toJson(), + 'verified': instance.verified, + 'source_urls': instance.sourceUrls, + 'url': instance.url, + }; diff --git a/lib/data/dto/score.dart b/lib/data/dto/score.dart new file mode 100644 index 0000000..8797f78 --- /dev/null +++ b/lib/data/dto/score.dart @@ -0,0 +1,102 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'score.freezed.dart'; +part 'score.g.dart'; + +/// 벤치마크 하나에서 나온 지표. +/// +/// 어느 컬렉션이든 이 구조는 동일하다. 다만 **모든 필드가 null일 수 있다** — +/// 구형 기기는 벤치마크 원본이 없어 `era`만 채워지고 나머지가 비어 온다. +/// +/// ```json +/// { "index": null, "percentile": null, "tier": null, +/// "era": "2014-2016", "source": null } +/// ``` +@freezed +abstract class ScoreMetric with _$ScoreMetric { + const factory ScoreMetric({ + /// 0–100 정규화 지수. + double? index, + + /// 같은 세대 안에서의 백분위. + double? percentile, + + /// S / A / B / C … 등급. + String? tier, + + /// 비교 기준이 된 세대 (예: `2024-2026`). + String? era, + + /// 원본 벤치마크 (예: `geekbench`, `timespy_score`). + String? source, + }) = _ScoreMetric; + + factory ScoreMetric.fromJson(Map json) => + _$ScoreMetricFromJson(json); +} + +/// 스마트폰 점수. 5개 축 + 종합. +/// +/// `score` 객체가 있어도 개별 축은 null일 수 있다. 저가·구형 기기에서 +/// `performance`와 `value`가 비는 경우가 흔하다. +@freezed +abstract class SmartphoneScore with _$SmartphoneScore { + const factory SmartphoneScore({ + String? algorithmVersion, + double? overall, + double? performance, + double? camera, + double? battery, + double? display, + + /// 가격 대비 가치. `msrp_usd`가 없으면 산출되지 않는다. + double? value, + + /// 성능 축의 근거가 된 벤치마크 지표. + ScoreMetric? perf, + }) = _SmartphoneScore; + + factory SmartphoneScore.fromJson(Map json) => + _$SmartphoneScoreFromJson(json); +} + +/// CPU 점수 — 싱글/멀티 코어로 나뉜다. +@freezed +abstract class CpuScore with _$CpuScore { + const factory CpuScore({ + String? algorithmVersion, + double? overall, + ScoreMetric? single, + ScoreMetric? multi, + }) = _CpuScore; + + factory CpuScore.fromJson(Map json) => + _$CpuScoreFromJson(json); +} + +/// GPU 점수 — 그래픽 단일 축. +@freezed +abstract class GpuScore with _$GpuScore { + const factory GpuScore({ + String? algorithmVersion, + double? overall, + ScoreMetric? graphics, + }) = _GpuScore; + + factory GpuScore.fromJson(Map json) => + _$GpuScoreFromJson(json); +} + +/// SoC 점수 — CPU와 시스템 전체. +@freezed +abstract class SocScore with _$SocScore { + const factory SocScore({ + String? algorithmVersion, + double? overall, + ScoreMetric? cpu, + ScoreMetric? system, + }) = _SocScore; + + factory SocScore.fromJson(Map json) => + _$SocScoreFromJson(json); +} diff --git a/lib/data/dto/score.freezed.dart b/lib/data/dto/score.freezed.dart new file mode 100644 index 0000000..b291b24 --- /dev/null +++ b/lib/data/dto/score.freezed.dart @@ -0,0 +1,2167 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'score.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$ScoreMetric { + /// 0–100 정규화 지수. + double? get index; + + /// 같은 세대 안에서의 백분위. + double? get percentile; + + /// S / A / B / C … 등급. + String? get tier; + + /// 비교 기준이 된 세대 (예: `2024-2026`). + String? get era; + + /// 원본 벤치마크 (예: `geekbench`, `timespy_score`). + String? get source; + + /// Create a copy of ScoreMetric + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $ScoreMetricCopyWith get copyWith => + _$ScoreMetricCopyWithImpl(this as ScoreMetric, _$identity); + + /// Serializes this ScoreMetric to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is ScoreMetric && + (identical(other.index, index) || other.index == index) && + (identical(other.percentile, percentile) || + other.percentile == percentile) && + (identical(other.tier, tier) || other.tier == tier) && + (identical(other.era, era) || other.era == era) && + (identical(other.source, source) || other.source == source)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, index, percentile, tier, era, source); + + @override + String toString() { + return 'ScoreMetric(index: $index, percentile: $percentile, tier: $tier, era: $era, source: $source)'; + } +} + +/// @nodoc +abstract mixin class $ScoreMetricCopyWith<$Res> { + factory $ScoreMetricCopyWith( + ScoreMetric value, $Res Function(ScoreMetric) _then) = + _$ScoreMetricCopyWithImpl; + @useResult + $Res call( + {double? index, + double? percentile, + String? tier, + String? era, + String? source}); +} + +/// @nodoc +class _$ScoreMetricCopyWithImpl<$Res> implements $ScoreMetricCopyWith<$Res> { + _$ScoreMetricCopyWithImpl(this._self, this._then); + + final ScoreMetric _self; + final $Res Function(ScoreMetric) _then; + + /// Create a copy of ScoreMetric + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? index = freezed, + Object? percentile = freezed, + Object? tier = freezed, + Object? era = freezed, + Object? source = freezed, + }) { + return _then(_self.copyWith( + index: freezed == index + ? _self.index + : index // ignore: cast_nullable_to_non_nullable + as double?, + percentile: freezed == percentile + ? _self.percentile + : percentile // ignore: cast_nullable_to_non_nullable + as double?, + tier: freezed == tier + ? _self.tier + : tier // ignore: cast_nullable_to_non_nullable + as String?, + era: freezed == era + ? _self.era + : era // ignore: cast_nullable_to_non_nullable + as String?, + source: freezed == source + ? _self.source + : source // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// Adds pattern-matching-related methods to [ScoreMetric]. +extension ScoreMetricPatterns on ScoreMetric { + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap( + TResult Function(_ScoreMetric value)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _ScoreMetric() when $default != null: + return $default(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map( + TResult Function(_ScoreMetric value) $default, + ) { + final _that = this; + switch (_that) { + case _ScoreMetric(): + return $default(_that); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_ScoreMetric value)? $default, + ) { + final _that = this; + switch (_that) { + case _ScoreMetric() when $default != null: + return $default(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen( + TResult Function(double? index, double? percentile, String? tier, + String? era, String? source)? + $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _ScoreMetric() when $default != null: + return $default( + _that.index, _that.percentile, _that.tier, _that.era, _that.source); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when( + TResult Function(double? index, double? percentile, String? tier, + String? era, String? source) + $default, + ) { + final _that = this; + switch (_that) { + case _ScoreMetric(): + return $default( + _that.index, _that.percentile, _that.tier, _that.era, _that.source); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function(double? index, double? percentile, String? tier, + String? era, String? source)? + $default, + ) { + final _that = this; + switch (_that) { + case _ScoreMetric() when $default != null: + return $default( + _that.index, _that.percentile, _that.tier, _that.era, _that.source); + case _: + return null; + } + } +} + +/// @nodoc +@JsonSerializable() +class _ScoreMetric implements ScoreMetric { + const _ScoreMetric( + {this.index, this.percentile, this.tier, this.era, this.source}); + factory _ScoreMetric.fromJson(Map json) => + _$ScoreMetricFromJson(json); + + /// 0–100 정규화 지수. + @override + final double? index; + + /// 같은 세대 안에서의 백분위. + @override + final double? percentile; + + /// S / A / B / C … 등급. + @override + final String? tier; + + /// 비교 기준이 된 세대 (예: `2024-2026`). + @override + final String? era; + + /// 원본 벤치마크 (예: `geekbench`, `timespy_score`). + @override + final String? source; + + /// Create a copy of ScoreMetric + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$ScoreMetricCopyWith<_ScoreMetric> get copyWith => + __$ScoreMetricCopyWithImpl<_ScoreMetric>(this, _$identity); + + @override + Map toJson() { + return _$ScoreMetricToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _ScoreMetric && + (identical(other.index, index) || other.index == index) && + (identical(other.percentile, percentile) || + other.percentile == percentile) && + (identical(other.tier, tier) || other.tier == tier) && + (identical(other.era, era) || other.era == era) && + (identical(other.source, source) || other.source == source)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, index, percentile, tier, era, source); + + @override + String toString() { + return 'ScoreMetric(index: $index, percentile: $percentile, tier: $tier, era: $era, source: $source)'; + } +} + +/// @nodoc +abstract mixin class _$ScoreMetricCopyWith<$Res> + implements $ScoreMetricCopyWith<$Res> { + factory _$ScoreMetricCopyWith( + _ScoreMetric value, $Res Function(_ScoreMetric) _then) = + __$ScoreMetricCopyWithImpl; + @override + @useResult + $Res call( + {double? index, + double? percentile, + String? tier, + String? era, + String? source}); +} + +/// @nodoc +class __$ScoreMetricCopyWithImpl<$Res> implements _$ScoreMetricCopyWith<$Res> { + __$ScoreMetricCopyWithImpl(this._self, this._then); + + final _ScoreMetric _self; + final $Res Function(_ScoreMetric) _then; + + /// Create a copy of ScoreMetric + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? index = freezed, + Object? percentile = freezed, + Object? tier = freezed, + Object? era = freezed, + Object? source = freezed, + }) { + return _then(_ScoreMetric( + index: freezed == index + ? _self.index + : index // ignore: cast_nullable_to_non_nullable + as double?, + percentile: freezed == percentile + ? _self.percentile + : percentile // ignore: cast_nullable_to_non_nullable + as double?, + tier: freezed == tier + ? _self.tier + : tier // ignore: cast_nullable_to_non_nullable + as String?, + era: freezed == era + ? _self.era + : era // ignore: cast_nullable_to_non_nullable + as String?, + source: freezed == source + ? _self.source + : source // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +mixin _$SmartphoneScore { + String? get algorithmVersion; + double? get overall; + double? get performance; + double? get camera; + double? get battery; + double? get display; + + /// 가격 대비 가치. `msrp_usd`가 없으면 산출되지 않는다. + double? get value; + + /// 성능 축의 근거가 된 벤치마크 지표. + ScoreMetric? get perf; + + /// Create a copy of SmartphoneScore + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $SmartphoneScoreCopyWith get copyWith => + _$SmartphoneScoreCopyWithImpl( + this as SmartphoneScore, _$identity); + + /// Serializes this SmartphoneScore to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is SmartphoneScore && + (identical(other.algorithmVersion, algorithmVersion) || + other.algorithmVersion == algorithmVersion) && + (identical(other.overall, overall) || other.overall == overall) && + (identical(other.performance, performance) || + other.performance == performance) && + (identical(other.camera, camera) || other.camera == camera) && + (identical(other.battery, battery) || other.battery == battery) && + (identical(other.display, display) || other.display == display) && + (identical(other.value, value) || other.value == value) && + (identical(other.perf, perf) || other.perf == perf)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, algorithmVersion, overall, + performance, camera, battery, display, value, perf); + + @override + String toString() { + return 'SmartphoneScore(algorithmVersion: $algorithmVersion, overall: $overall, performance: $performance, camera: $camera, battery: $battery, display: $display, value: $value, perf: $perf)'; + } +} + +/// @nodoc +abstract mixin class $SmartphoneScoreCopyWith<$Res> { + factory $SmartphoneScoreCopyWith( + SmartphoneScore value, $Res Function(SmartphoneScore) _then) = + _$SmartphoneScoreCopyWithImpl; + @useResult + $Res call( + {String? algorithmVersion, + double? overall, + double? performance, + double? camera, + double? battery, + double? display, + double? value, + ScoreMetric? perf}); + + $ScoreMetricCopyWith<$Res>? get perf; +} + +/// @nodoc +class _$SmartphoneScoreCopyWithImpl<$Res> + implements $SmartphoneScoreCopyWith<$Res> { + _$SmartphoneScoreCopyWithImpl(this._self, this._then); + + final SmartphoneScore _self; + final $Res Function(SmartphoneScore) _then; + + /// Create a copy of SmartphoneScore + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? algorithmVersion = freezed, + Object? overall = freezed, + Object? performance = freezed, + Object? camera = freezed, + Object? battery = freezed, + Object? display = freezed, + Object? value = freezed, + Object? perf = freezed, + }) { + return _then(_self.copyWith( + algorithmVersion: freezed == algorithmVersion + ? _self.algorithmVersion + : algorithmVersion // ignore: cast_nullable_to_non_nullable + as String?, + overall: freezed == overall + ? _self.overall + : overall // ignore: cast_nullable_to_non_nullable + as double?, + performance: freezed == performance + ? _self.performance + : performance // ignore: cast_nullable_to_non_nullable + as double?, + camera: freezed == camera + ? _self.camera + : camera // ignore: cast_nullable_to_non_nullable + as double?, + battery: freezed == battery + ? _self.battery + : battery // ignore: cast_nullable_to_non_nullable + as double?, + display: freezed == display + ? _self.display + : display // ignore: cast_nullable_to_non_nullable + as double?, + value: freezed == value + ? _self.value + : value // ignore: cast_nullable_to_non_nullable + as double?, + perf: freezed == perf + ? _self.perf + : perf // ignore: cast_nullable_to_non_nullable + as ScoreMetric?, + )); + } + + /// Create a copy of SmartphoneScore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ScoreMetricCopyWith<$Res>? get perf { + if (_self.perf == null) { + return null; + } + + return $ScoreMetricCopyWith<$Res>(_self.perf!, (value) { + return _then(_self.copyWith(perf: value)); + }); + } +} + +/// Adds pattern-matching-related methods to [SmartphoneScore]. +extension SmartphoneScorePatterns on SmartphoneScore { + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap( + TResult Function(_SmartphoneScore value)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _SmartphoneScore() when $default != null: + return $default(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map( + TResult Function(_SmartphoneScore value) $default, + ) { + final _that = this; + switch (_that) { + case _SmartphoneScore(): + return $default(_that); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_SmartphoneScore value)? $default, + ) { + final _that = this; + switch (_that) { + case _SmartphoneScore() when $default != null: + return $default(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen( + TResult Function( + String? algorithmVersion, + double? overall, + double? performance, + double? camera, + double? battery, + double? display, + double? value, + ScoreMetric? perf)? + $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _SmartphoneScore() when $default != null: + return $default( + _that.algorithmVersion, + _that.overall, + _that.performance, + _that.camera, + _that.battery, + _that.display, + _that.value, + _that.perf); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when( + TResult Function( + String? algorithmVersion, + double? overall, + double? performance, + double? camera, + double? battery, + double? display, + double? value, + ScoreMetric? perf) + $default, + ) { + final _that = this; + switch (_that) { + case _SmartphoneScore(): + return $default( + _that.algorithmVersion, + _that.overall, + _that.performance, + _that.camera, + _that.battery, + _that.display, + _that.value, + _that.perf); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function( + String? algorithmVersion, + double? overall, + double? performance, + double? camera, + double? battery, + double? display, + double? value, + ScoreMetric? perf)? + $default, + ) { + final _that = this; + switch (_that) { + case _SmartphoneScore() when $default != null: + return $default( + _that.algorithmVersion, + _that.overall, + _that.performance, + _that.camera, + _that.battery, + _that.display, + _that.value, + _that.perf); + case _: + return null; + } + } +} + +/// @nodoc +@JsonSerializable() +class _SmartphoneScore implements SmartphoneScore { + const _SmartphoneScore( + {this.algorithmVersion, + this.overall, + this.performance, + this.camera, + this.battery, + this.display, + this.value, + this.perf}); + factory _SmartphoneScore.fromJson(Map json) => + _$SmartphoneScoreFromJson(json); + + @override + final String? algorithmVersion; + @override + final double? overall; + @override + final double? performance; + @override + final double? camera; + @override + final double? battery; + @override + final double? display; + + /// 가격 대비 가치. `msrp_usd`가 없으면 산출되지 않는다. + @override + final double? value; + + /// 성능 축의 근거가 된 벤치마크 지표. + @override + final ScoreMetric? perf; + + /// Create a copy of SmartphoneScore + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$SmartphoneScoreCopyWith<_SmartphoneScore> get copyWith => + __$SmartphoneScoreCopyWithImpl<_SmartphoneScore>(this, _$identity); + + @override + Map toJson() { + return _$SmartphoneScoreToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _SmartphoneScore && + (identical(other.algorithmVersion, algorithmVersion) || + other.algorithmVersion == algorithmVersion) && + (identical(other.overall, overall) || other.overall == overall) && + (identical(other.performance, performance) || + other.performance == performance) && + (identical(other.camera, camera) || other.camera == camera) && + (identical(other.battery, battery) || other.battery == battery) && + (identical(other.display, display) || other.display == display) && + (identical(other.value, value) || other.value == value) && + (identical(other.perf, perf) || other.perf == perf)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, algorithmVersion, overall, + performance, camera, battery, display, value, perf); + + @override + String toString() { + return 'SmartphoneScore(algorithmVersion: $algorithmVersion, overall: $overall, performance: $performance, camera: $camera, battery: $battery, display: $display, value: $value, perf: $perf)'; + } +} + +/// @nodoc +abstract mixin class _$SmartphoneScoreCopyWith<$Res> + implements $SmartphoneScoreCopyWith<$Res> { + factory _$SmartphoneScoreCopyWith( + _SmartphoneScore value, $Res Function(_SmartphoneScore) _then) = + __$SmartphoneScoreCopyWithImpl; + @override + @useResult + $Res call( + {String? algorithmVersion, + double? overall, + double? performance, + double? camera, + double? battery, + double? display, + double? value, + ScoreMetric? perf}); + + @override + $ScoreMetricCopyWith<$Res>? get perf; +} + +/// @nodoc +class __$SmartphoneScoreCopyWithImpl<$Res> + implements _$SmartphoneScoreCopyWith<$Res> { + __$SmartphoneScoreCopyWithImpl(this._self, this._then); + + final _SmartphoneScore _self; + final $Res Function(_SmartphoneScore) _then; + + /// Create a copy of SmartphoneScore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? algorithmVersion = freezed, + Object? overall = freezed, + Object? performance = freezed, + Object? camera = freezed, + Object? battery = freezed, + Object? display = freezed, + Object? value = freezed, + Object? perf = freezed, + }) { + return _then(_SmartphoneScore( + algorithmVersion: freezed == algorithmVersion + ? _self.algorithmVersion + : algorithmVersion // ignore: cast_nullable_to_non_nullable + as String?, + overall: freezed == overall + ? _self.overall + : overall // ignore: cast_nullable_to_non_nullable + as double?, + performance: freezed == performance + ? _self.performance + : performance // ignore: cast_nullable_to_non_nullable + as double?, + camera: freezed == camera + ? _self.camera + : camera // ignore: cast_nullable_to_non_nullable + as double?, + battery: freezed == battery + ? _self.battery + : battery // ignore: cast_nullable_to_non_nullable + as double?, + display: freezed == display + ? _self.display + : display // ignore: cast_nullable_to_non_nullable + as double?, + value: freezed == value + ? _self.value + : value // ignore: cast_nullable_to_non_nullable + as double?, + perf: freezed == perf + ? _self.perf + : perf // ignore: cast_nullable_to_non_nullable + as ScoreMetric?, + )); + } + + /// Create a copy of SmartphoneScore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ScoreMetricCopyWith<$Res>? get perf { + if (_self.perf == null) { + return null; + } + + return $ScoreMetricCopyWith<$Res>(_self.perf!, (value) { + return _then(_self.copyWith(perf: value)); + }); + } +} + +/// @nodoc +mixin _$CpuScore { + String? get algorithmVersion; + double? get overall; + ScoreMetric? get single; + ScoreMetric? get multi; + + /// Create a copy of CpuScore + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $CpuScoreCopyWith get copyWith => + _$CpuScoreCopyWithImpl(this as CpuScore, _$identity); + + /// Serializes this CpuScore to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is CpuScore && + (identical(other.algorithmVersion, algorithmVersion) || + other.algorithmVersion == algorithmVersion) && + (identical(other.overall, overall) || other.overall == overall) && + (identical(other.single, single) || other.single == single) && + (identical(other.multi, multi) || other.multi == multi)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, algorithmVersion, overall, single, multi); + + @override + String toString() { + return 'CpuScore(algorithmVersion: $algorithmVersion, overall: $overall, single: $single, multi: $multi)'; + } +} + +/// @nodoc +abstract mixin class $CpuScoreCopyWith<$Res> { + factory $CpuScoreCopyWith(CpuScore value, $Res Function(CpuScore) _then) = + _$CpuScoreCopyWithImpl; + @useResult + $Res call( + {String? algorithmVersion, + double? overall, + ScoreMetric? single, + ScoreMetric? multi}); + + $ScoreMetricCopyWith<$Res>? get single; + $ScoreMetricCopyWith<$Res>? get multi; +} + +/// @nodoc +class _$CpuScoreCopyWithImpl<$Res> implements $CpuScoreCopyWith<$Res> { + _$CpuScoreCopyWithImpl(this._self, this._then); + + final CpuScore _self; + final $Res Function(CpuScore) _then; + + /// Create a copy of CpuScore + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? algorithmVersion = freezed, + Object? overall = freezed, + Object? single = freezed, + Object? multi = freezed, + }) { + return _then(_self.copyWith( + algorithmVersion: freezed == algorithmVersion + ? _self.algorithmVersion + : algorithmVersion // ignore: cast_nullable_to_non_nullable + as String?, + overall: freezed == overall + ? _self.overall + : overall // ignore: cast_nullable_to_non_nullable + as double?, + single: freezed == single + ? _self.single + : single // ignore: cast_nullable_to_non_nullable + as ScoreMetric?, + multi: freezed == multi + ? _self.multi + : multi // ignore: cast_nullable_to_non_nullable + as ScoreMetric?, + )); + } + + /// Create a copy of CpuScore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ScoreMetricCopyWith<$Res>? get single { + if (_self.single == null) { + return null; + } + + return $ScoreMetricCopyWith<$Res>(_self.single!, (value) { + return _then(_self.copyWith(single: value)); + }); + } + + /// Create a copy of CpuScore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ScoreMetricCopyWith<$Res>? get multi { + if (_self.multi == null) { + return null; + } + + return $ScoreMetricCopyWith<$Res>(_self.multi!, (value) { + return _then(_self.copyWith(multi: value)); + }); + } +} + +/// Adds pattern-matching-related methods to [CpuScore]. +extension CpuScorePatterns on CpuScore { + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap( + TResult Function(_CpuScore value)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _CpuScore() when $default != null: + return $default(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map( + TResult Function(_CpuScore value) $default, + ) { + final _that = this; + switch (_that) { + case _CpuScore(): + return $default(_that); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_CpuScore value)? $default, + ) { + final _that = this; + switch (_that) { + case _CpuScore() when $default != null: + return $default(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen( + TResult Function(String? algorithmVersion, double? overall, + ScoreMetric? single, ScoreMetric? multi)? + $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _CpuScore() when $default != null: + return $default( + _that.algorithmVersion, _that.overall, _that.single, _that.multi); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when( + TResult Function(String? algorithmVersion, double? overall, + ScoreMetric? single, ScoreMetric? multi) + $default, + ) { + final _that = this; + switch (_that) { + case _CpuScore(): + return $default( + _that.algorithmVersion, _that.overall, _that.single, _that.multi); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function(String? algorithmVersion, double? overall, + ScoreMetric? single, ScoreMetric? multi)? + $default, + ) { + final _that = this; + switch (_that) { + case _CpuScore() when $default != null: + return $default( + _that.algorithmVersion, _that.overall, _that.single, _that.multi); + case _: + return null; + } + } +} + +/// @nodoc +@JsonSerializable() +class _CpuScore implements CpuScore { + const _CpuScore( + {this.algorithmVersion, this.overall, this.single, this.multi}); + factory _CpuScore.fromJson(Map json) => + _$CpuScoreFromJson(json); + + @override + final String? algorithmVersion; + @override + final double? overall; + @override + final ScoreMetric? single; + @override + final ScoreMetric? multi; + + /// Create a copy of CpuScore + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$CpuScoreCopyWith<_CpuScore> get copyWith => + __$CpuScoreCopyWithImpl<_CpuScore>(this, _$identity); + + @override + Map toJson() { + return _$CpuScoreToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _CpuScore && + (identical(other.algorithmVersion, algorithmVersion) || + other.algorithmVersion == algorithmVersion) && + (identical(other.overall, overall) || other.overall == overall) && + (identical(other.single, single) || other.single == single) && + (identical(other.multi, multi) || other.multi == multi)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, algorithmVersion, overall, single, multi); + + @override + String toString() { + return 'CpuScore(algorithmVersion: $algorithmVersion, overall: $overall, single: $single, multi: $multi)'; + } +} + +/// @nodoc +abstract mixin class _$CpuScoreCopyWith<$Res> + implements $CpuScoreCopyWith<$Res> { + factory _$CpuScoreCopyWith(_CpuScore value, $Res Function(_CpuScore) _then) = + __$CpuScoreCopyWithImpl; + @override + @useResult + $Res call( + {String? algorithmVersion, + double? overall, + ScoreMetric? single, + ScoreMetric? multi}); + + @override + $ScoreMetricCopyWith<$Res>? get single; + @override + $ScoreMetricCopyWith<$Res>? get multi; +} + +/// @nodoc +class __$CpuScoreCopyWithImpl<$Res> implements _$CpuScoreCopyWith<$Res> { + __$CpuScoreCopyWithImpl(this._self, this._then); + + final _CpuScore _self; + final $Res Function(_CpuScore) _then; + + /// Create a copy of CpuScore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? algorithmVersion = freezed, + Object? overall = freezed, + Object? single = freezed, + Object? multi = freezed, + }) { + return _then(_CpuScore( + algorithmVersion: freezed == algorithmVersion + ? _self.algorithmVersion + : algorithmVersion // ignore: cast_nullable_to_non_nullable + as String?, + overall: freezed == overall + ? _self.overall + : overall // ignore: cast_nullable_to_non_nullable + as double?, + single: freezed == single + ? _self.single + : single // ignore: cast_nullable_to_non_nullable + as ScoreMetric?, + multi: freezed == multi + ? _self.multi + : multi // ignore: cast_nullable_to_non_nullable + as ScoreMetric?, + )); + } + + /// Create a copy of CpuScore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ScoreMetricCopyWith<$Res>? get single { + if (_self.single == null) { + return null; + } + + return $ScoreMetricCopyWith<$Res>(_self.single!, (value) { + return _then(_self.copyWith(single: value)); + }); + } + + /// Create a copy of CpuScore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ScoreMetricCopyWith<$Res>? get multi { + if (_self.multi == null) { + return null; + } + + return $ScoreMetricCopyWith<$Res>(_self.multi!, (value) { + return _then(_self.copyWith(multi: value)); + }); + } +} + +/// @nodoc +mixin _$GpuScore { + String? get algorithmVersion; + double? get overall; + ScoreMetric? get graphics; + + /// Create a copy of GpuScore + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $GpuScoreCopyWith get copyWith => + _$GpuScoreCopyWithImpl(this as GpuScore, _$identity); + + /// Serializes this GpuScore to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is GpuScore && + (identical(other.algorithmVersion, algorithmVersion) || + other.algorithmVersion == algorithmVersion) && + (identical(other.overall, overall) || other.overall == overall) && + (identical(other.graphics, graphics) || + other.graphics == graphics)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, algorithmVersion, overall, graphics); + + @override + String toString() { + return 'GpuScore(algorithmVersion: $algorithmVersion, overall: $overall, graphics: $graphics)'; + } +} + +/// @nodoc +abstract mixin class $GpuScoreCopyWith<$Res> { + factory $GpuScoreCopyWith(GpuScore value, $Res Function(GpuScore) _then) = + _$GpuScoreCopyWithImpl; + @useResult + $Res call({String? algorithmVersion, double? overall, ScoreMetric? graphics}); + + $ScoreMetricCopyWith<$Res>? get graphics; +} + +/// @nodoc +class _$GpuScoreCopyWithImpl<$Res> implements $GpuScoreCopyWith<$Res> { + _$GpuScoreCopyWithImpl(this._self, this._then); + + final GpuScore _self; + final $Res Function(GpuScore) _then; + + /// Create a copy of GpuScore + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? algorithmVersion = freezed, + Object? overall = freezed, + Object? graphics = freezed, + }) { + return _then(_self.copyWith( + algorithmVersion: freezed == algorithmVersion + ? _self.algorithmVersion + : algorithmVersion // ignore: cast_nullable_to_non_nullable + as String?, + overall: freezed == overall + ? _self.overall + : overall // ignore: cast_nullable_to_non_nullable + as double?, + graphics: freezed == graphics + ? _self.graphics + : graphics // ignore: cast_nullable_to_non_nullable + as ScoreMetric?, + )); + } + + /// Create a copy of GpuScore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ScoreMetricCopyWith<$Res>? get graphics { + if (_self.graphics == null) { + return null; + } + + return $ScoreMetricCopyWith<$Res>(_self.graphics!, (value) { + return _then(_self.copyWith(graphics: value)); + }); + } +} + +/// Adds pattern-matching-related methods to [GpuScore]. +extension GpuScorePatterns on GpuScore { + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap( + TResult Function(_GpuScore value)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _GpuScore() when $default != null: + return $default(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map( + TResult Function(_GpuScore value) $default, + ) { + final _that = this; + switch (_that) { + case _GpuScore(): + return $default(_that); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_GpuScore value)? $default, + ) { + final _that = this; + switch (_that) { + case _GpuScore() when $default != null: + return $default(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen( + TResult Function( + String? algorithmVersion, double? overall, ScoreMetric? graphics)? + $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _GpuScore() when $default != null: + return $default(_that.algorithmVersion, _that.overall, _that.graphics); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when( + TResult Function( + String? algorithmVersion, double? overall, ScoreMetric? graphics) + $default, + ) { + final _that = this; + switch (_that) { + case _GpuScore(): + return $default(_that.algorithmVersion, _that.overall, _that.graphics); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function( + String? algorithmVersion, double? overall, ScoreMetric? graphics)? + $default, + ) { + final _that = this; + switch (_that) { + case _GpuScore() when $default != null: + return $default(_that.algorithmVersion, _that.overall, _that.graphics); + case _: + return null; + } + } +} + +/// @nodoc +@JsonSerializable() +class _GpuScore implements GpuScore { + const _GpuScore({this.algorithmVersion, this.overall, this.graphics}); + factory _GpuScore.fromJson(Map json) => + _$GpuScoreFromJson(json); + + @override + final String? algorithmVersion; + @override + final double? overall; + @override + final ScoreMetric? graphics; + + /// Create a copy of GpuScore + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$GpuScoreCopyWith<_GpuScore> get copyWith => + __$GpuScoreCopyWithImpl<_GpuScore>(this, _$identity); + + @override + Map toJson() { + return _$GpuScoreToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _GpuScore && + (identical(other.algorithmVersion, algorithmVersion) || + other.algorithmVersion == algorithmVersion) && + (identical(other.overall, overall) || other.overall == overall) && + (identical(other.graphics, graphics) || + other.graphics == graphics)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, algorithmVersion, overall, graphics); + + @override + String toString() { + return 'GpuScore(algorithmVersion: $algorithmVersion, overall: $overall, graphics: $graphics)'; + } +} + +/// @nodoc +abstract mixin class _$GpuScoreCopyWith<$Res> + implements $GpuScoreCopyWith<$Res> { + factory _$GpuScoreCopyWith(_GpuScore value, $Res Function(_GpuScore) _then) = + __$GpuScoreCopyWithImpl; + @override + @useResult + $Res call({String? algorithmVersion, double? overall, ScoreMetric? graphics}); + + @override + $ScoreMetricCopyWith<$Res>? get graphics; +} + +/// @nodoc +class __$GpuScoreCopyWithImpl<$Res> implements _$GpuScoreCopyWith<$Res> { + __$GpuScoreCopyWithImpl(this._self, this._then); + + final _GpuScore _self; + final $Res Function(_GpuScore) _then; + + /// Create a copy of GpuScore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? algorithmVersion = freezed, + Object? overall = freezed, + Object? graphics = freezed, + }) { + return _then(_GpuScore( + algorithmVersion: freezed == algorithmVersion + ? _self.algorithmVersion + : algorithmVersion // ignore: cast_nullable_to_non_nullable + as String?, + overall: freezed == overall + ? _self.overall + : overall // ignore: cast_nullable_to_non_nullable + as double?, + graphics: freezed == graphics + ? _self.graphics + : graphics // ignore: cast_nullable_to_non_nullable + as ScoreMetric?, + )); + } + + /// Create a copy of GpuScore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ScoreMetricCopyWith<$Res>? get graphics { + if (_self.graphics == null) { + return null; + } + + return $ScoreMetricCopyWith<$Res>(_self.graphics!, (value) { + return _then(_self.copyWith(graphics: value)); + }); + } +} + +/// @nodoc +mixin _$SocScore { + String? get algorithmVersion; + double? get overall; + ScoreMetric? get cpu; + ScoreMetric? get system; + + /// Create a copy of SocScore + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $SocScoreCopyWith get copyWith => + _$SocScoreCopyWithImpl(this as SocScore, _$identity); + + /// Serializes this SocScore to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is SocScore && + (identical(other.algorithmVersion, algorithmVersion) || + other.algorithmVersion == algorithmVersion) && + (identical(other.overall, overall) || other.overall == overall) && + (identical(other.cpu, cpu) || other.cpu == cpu) && + (identical(other.system, system) || other.system == system)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, algorithmVersion, overall, cpu, system); + + @override + String toString() { + return 'SocScore(algorithmVersion: $algorithmVersion, overall: $overall, cpu: $cpu, system: $system)'; + } +} + +/// @nodoc +abstract mixin class $SocScoreCopyWith<$Res> { + factory $SocScoreCopyWith(SocScore value, $Res Function(SocScore) _then) = + _$SocScoreCopyWithImpl; + @useResult + $Res call( + {String? algorithmVersion, + double? overall, + ScoreMetric? cpu, + ScoreMetric? system}); + + $ScoreMetricCopyWith<$Res>? get cpu; + $ScoreMetricCopyWith<$Res>? get system; +} + +/// @nodoc +class _$SocScoreCopyWithImpl<$Res> implements $SocScoreCopyWith<$Res> { + _$SocScoreCopyWithImpl(this._self, this._then); + + final SocScore _self; + final $Res Function(SocScore) _then; + + /// Create a copy of SocScore + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? algorithmVersion = freezed, + Object? overall = freezed, + Object? cpu = freezed, + Object? system = freezed, + }) { + return _then(_self.copyWith( + algorithmVersion: freezed == algorithmVersion + ? _self.algorithmVersion + : algorithmVersion // ignore: cast_nullable_to_non_nullable + as String?, + overall: freezed == overall + ? _self.overall + : overall // ignore: cast_nullable_to_non_nullable + as double?, + cpu: freezed == cpu + ? _self.cpu + : cpu // ignore: cast_nullable_to_non_nullable + as ScoreMetric?, + system: freezed == system + ? _self.system + : system // ignore: cast_nullable_to_non_nullable + as ScoreMetric?, + )); + } + + /// Create a copy of SocScore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ScoreMetricCopyWith<$Res>? get cpu { + if (_self.cpu == null) { + return null; + } + + return $ScoreMetricCopyWith<$Res>(_self.cpu!, (value) { + return _then(_self.copyWith(cpu: value)); + }); + } + + /// Create a copy of SocScore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ScoreMetricCopyWith<$Res>? get system { + if (_self.system == null) { + return null; + } + + return $ScoreMetricCopyWith<$Res>(_self.system!, (value) { + return _then(_self.copyWith(system: value)); + }); + } +} + +/// Adds pattern-matching-related methods to [SocScore]. +extension SocScorePatterns on SocScore { + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap( + TResult Function(_SocScore value)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _SocScore() when $default != null: + return $default(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map( + TResult Function(_SocScore value) $default, + ) { + final _that = this; + switch (_that) { + case _SocScore(): + return $default(_that); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_SocScore value)? $default, + ) { + final _that = this; + switch (_that) { + case _SocScore() when $default != null: + return $default(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen( + TResult Function(String? algorithmVersion, double? overall, + ScoreMetric? cpu, ScoreMetric? system)? + $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _SocScore() when $default != null: + return $default( + _that.algorithmVersion, _that.overall, _that.cpu, _that.system); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when( + TResult Function(String? algorithmVersion, double? overall, + ScoreMetric? cpu, ScoreMetric? system) + $default, + ) { + final _that = this; + switch (_that) { + case _SocScore(): + return $default( + _that.algorithmVersion, _that.overall, _that.cpu, _that.system); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function(String? algorithmVersion, double? overall, + ScoreMetric? cpu, ScoreMetric? system)? + $default, + ) { + final _that = this; + switch (_that) { + case _SocScore() when $default != null: + return $default( + _that.algorithmVersion, _that.overall, _that.cpu, _that.system); + case _: + return null; + } + } +} + +/// @nodoc +@JsonSerializable() +class _SocScore implements SocScore { + const _SocScore({this.algorithmVersion, this.overall, this.cpu, this.system}); + factory _SocScore.fromJson(Map json) => + _$SocScoreFromJson(json); + + @override + final String? algorithmVersion; + @override + final double? overall; + @override + final ScoreMetric? cpu; + @override + final ScoreMetric? system; + + /// Create a copy of SocScore + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$SocScoreCopyWith<_SocScore> get copyWith => + __$SocScoreCopyWithImpl<_SocScore>(this, _$identity); + + @override + Map toJson() { + return _$SocScoreToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _SocScore && + (identical(other.algorithmVersion, algorithmVersion) || + other.algorithmVersion == algorithmVersion) && + (identical(other.overall, overall) || other.overall == overall) && + (identical(other.cpu, cpu) || other.cpu == cpu) && + (identical(other.system, system) || other.system == system)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, algorithmVersion, overall, cpu, system); + + @override + String toString() { + return 'SocScore(algorithmVersion: $algorithmVersion, overall: $overall, cpu: $cpu, system: $system)'; + } +} + +/// @nodoc +abstract mixin class _$SocScoreCopyWith<$Res> + implements $SocScoreCopyWith<$Res> { + factory _$SocScoreCopyWith(_SocScore value, $Res Function(_SocScore) _then) = + __$SocScoreCopyWithImpl; + @override + @useResult + $Res call( + {String? algorithmVersion, + double? overall, + ScoreMetric? cpu, + ScoreMetric? system}); + + @override + $ScoreMetricCopyWith<$Res>? get cpu; + @override + $ScoreMetricCopyWith<$Res>? get system; +} + +/// @nodoc +class __$SocScoreCopyWithImpl<$Res> implements _$SocScoreCopyWith<$Res> { + __$SocScoreCopyWithImpl(this._self, this._then); + + final _SocScore _self; + final $Res Function(_SocScore) _then; + + /// Create a copy of SocScore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? algorithmVersion = freezed, + Object? overall = freezed, + Object? cpu = freezed, + Object? system = freezed, + }) { + return _then(_SocScore( + algorithmVersion: freezed == algorithmVersion + ? _self.algorithmVersion + : algorithmVersion // ignore: cast_nullable_to_non_nullable + as String?, + overall: freezed == overall + ? _self.overall + : overall // ignore: cast_nullable_to_non_nullable + as double?, + cpu: freezed == cpu + ? _self.cpu + : cpu // ignore: cast_nullable_to_non_nullable + as ScoreMetric?, + system: freezed == system + ? _self.system + : system // ignore: cast_nullable_to_non_nullable + as ScoreMetric?, + )); + } + + /// Create a copy of SocScore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ScoreMetricCopyWith<$Res>? get cpu { + if (_self.cpu == null) { + return null; + } + + return $ScoreMetricCopyWith<$Res>(_self.cpu!, (value) { + return _then(_self.copyWith(cpu: value)); + }); + } + + /// Create a copy of SocScore + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ScoreMetricCopyWith<$Res>? get system { + if (_self.system == null) { + return null; + } + + return $ScoreMetricCopyWith<$Res>(_self.system!, (value) { + return _then(_self.copyWith(system: value)); + }); + } +} + +// dart format on diff --git a/lib/data/dto/score.g.dart b/lib/data/dto/score.g.dart new file mode 100644 index 0000000..5aa5220 --- /dev/null +++ b/lib/data/dto/score.g.dart @@ -0,0 +1,100 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'score.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_ScoreMetric _$ScoreMetricFromJson(Map json) => _ScoreMetric( + index: (json['index'] as num?)?.toDouble(), + percentile: (json['percentile'] as num?)?.toDouble(), + tier: json['tier'] as String?, + era: json['era'] as String?, + source: json['source'] as String?, + ); + +Map _$ScoreMetricToJson(_ScoreMetric instance) => + { + 'index': instance.index, + 'percentile': instance.percentile, + 'tier': instance.tier, + 'era': instance.era, + 'source': instance.source, + }; + +_SmartphoneScore _$SmartphoneScoreFromJson(Map json) => + _SmartphoneScore( + algorithmVersion: json['algorithm_version'] as String?, + overall: (json['overall'] as num?)?.toDouble(), + performance: (json['performance'] as num?)?.toDouble(), + camera: (json['camera'] as num?)?.toDouble(), + battery: (json['battery'] as num?)?.toDouble(), + display: (json['display'] as num?)?.toDouble(), + value: (json['value'] as num?)?.toDouble(), + perf: json['perf'] == null + ? null + : ScoreMetric.fromJson(json['perf'] as Map), + ); + +Map _$SmartphoneScoreToJson(_SmartphoneScore instance) => + { + 'algorithm_version': instance.algorithmVersion, + 'overall': instance.overall, + 'performance': instance.performance, + 'camera': instance.camera, + 'battery': instance.battery, + 'display': instance.display, + 'value': instance.value, + 'perf': instance.perf?.toJson(), + }; + +_CpuScore _$CpuScoreFromJson(Map json) => _CpuScore( + algorithmVersion: json['algorithm_version'] as String?, + overall: (json['overall'] as num?)?.toDouble(), + single: json['single'] == null + ? null + : ScoreMetric.fromJson(json['single'] as Map), + multi: json['multi'] == null + ? null + : ScoreMetric.fromJson(json['multi'] as Map), + ); + +Map _$CpuScoreToJson(_CpuScore instance) => { + 'algorithm_version': instance.algorithmVersion, + 'overall': instance.overall, + 'single': instance.single?.toJson(), + 'multi': instance.multi?.toJson(), + }; + +_GpuScore _$GpuScoreFromJson(Map json) => _GpuScore( + algorithmVersion: json['algorithm_version'] as String?, + overall: (json['overall'] as num?)?.toDouble(), + graphics: json['graphics'] == null + ? null + : ScoreMetric.fromJson(json['graphics'] as Map), + ); + +Map _$GpuScoreToJson(_GpuScore instance) => { + 'algorithm_version': instance.algorithmVersion, + 'overall': instance.overall, + 'graphics': instance.graphics?.toJson(), + }; + +_SocScore _$SocScoreFromJson(Map json) => _SocScore( + algorithmVersion: json['algorithm_version'] as String?, + overall: (json['overall'] as num?)?.toDouble(), + cpu: json['cpu'] == null + ? null + : ScoreMetric.fromJson(json['cpu'] as Map), + system: json['system'] == null + ? null + : ScoreMetric.fromJson(json['system'] as Map), + ); + +Map _$SocScoreToJson(_SocScore instance) => { + 'algorithm_version': instance.algorithmVersion, + 'overall': instance.overall, + 'cpu': instance.cpu?.toJson(), + 'system': instance.system?.toJson(), + }; diff --git a/lib/data/dto/smartphone.dart b/lib/data/dto/smartphone.dart new file mode 100644 index 0000000..ef0c08d --- /dev/null +++ b/lib/data/dto/smartphone.dart @@ -0,0 +1,126 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +import 'brand.dart'; +import 'score.dart'; +import 'soc.dart'; + +part 'smartphone.freezed.dart'; +part 'smartphone.g.dart'; + +@freezed +abstract class Display with _$Display { + const factory Display({ + double? sizeInch, + + /// `2340x1080` 형태의 문자열. 숫자로 파싱하지 않는다. + String? resolution, + int? refreshHz, + + /// 패널 종류 (예: `Dynamic AMOLED 2X`). + String? type, + int? ppi, + int? brightnessNits, + }) = _Display; + + factory Display.fromJson(Map json) => + _$DisplayFromJson(json); +} + +/// 카메라 하나. 기기당 여러 개가 배열로 온다. +/// +/// `type`은 `main` / `ultrawide` / `telephoto` / `selfie` 등이며, +/// 나머지 필드는 카메라 종류에 따라 있기도 없기도 하다. +@freezed +abstract class Camera with _$Camera { + const factory Camera({ + String? type, + + /// 화소 (메가픽셀). + double? mp, + double? aperture, + + /// 광학식 손떨림 보정. + bool? ois, + String? sensor, + double? opticalZoom, + }) = _Camera; + + factory Camera.fromJson(Map json) => _$CameraFromJson(json); +} + +@freezed +abstract class Dimensions with _$Dimensions { + const factory Dimensions({ + double? heightMm, + double? widthMm, + double? depthMm, + }) = _Dimensions; + + factory Dimensions.fromJson(Map json) => + _$DimensionsFromJson(json); +} + +@freezed +abstract class Connectivity with _$Connectivity { + const factory Connectivity({ + String? wifi, + String? bluetooth, + bool? nfc, + String? usb, + }) = _Connectivity; + + factory Connectivity.fromJson(Map json) => + _$ConnectivityFromJson(json); +} + +/// 스마트폰. 데이터셋에서 가장 큰 컬렉션(93,000건 이상)이다. +/// +/// `brand`와 `soc`가 이미 조인되어 내려오므로 상세 화면을 그리는 데 +/// 추가 요청이 필요 없다. +@freezed +abstract class Smartphone with _$Smartphone { + const factory Smartphone({ + required String slug, + required String name, + int? id, + + /// 파생 모델일 때 원본 모델의 slug (예: Plus/Ultra 변형). + String? baseModelSlug, + Brand? brand, + Soc? soc, + + /// `YYYY-MM-DD`. 일자가 불확실하면 월초로 채워져 있다. + String? releaseDate, + int? msrpUsd, + int? ramGb, + @Default([]) List storageOptionsGb, + + /// 지역·구성별 변형 정보. 스키마가 고정되어 있지 않아 원본 그대로 둔다. + @Default({}) Map variant, + Display? display, + @Default([]) List cameras, + int? batteryMah, + int? chargingWiredW, + int? chargingWirelessW, + double? weightG, + Dimensions? dimensions, + + /// 방수·방진 등급 (예: `IP68`). + String? ipRating, + String? os, + String? osVersion, + Connectivity? connectivity, + String? imageUrl, + @Default([]) List images, + SmartphoneScore? score, + @Default(false) bool verified, + + /// CC-BY-SA 4.0 조건상 UI에 반드시 노출해야 한다. + @Default([]) List sourceUrls, + String? createdAt, + String? updatedAt, + }) = _Smartphone; + + factory Smartphone.fromJson(Map json) => + _$SmartphoneFromJson(json); +} diff --git a/lib/data/dto/smartphone.freezed.dart b/lib/data/dto/smartphone.freezed.dart new file mode 100644 index 0000000..0194850 --- /dev/null +++ b/lib/data/dto/smartphone.freezed.dart @@ -0,0 +1,2850 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'smartphone.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$Display { + double? get sizeInch; + + /// `2340x1080` 형태의 문자열. 숫자로 파싱하지 않는다. + String? get resolution; + int? get refreshHz; + + /// 패널 종류 (예: `Dynamic AMOLED 2X`). + String? get type; + int? get ppi; + int? get brightnessNits; + + /// Create a copy of Display + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $DisplayCopyWith get copyWith => + _$DisplayCopyWithImpl(this as Display, _$identity); + + /// Serializes this Display to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is Display && + (identical(other.sizeInch, sizeInch) || + other.sizeInch == sizeInch) && + (identical(other.resolution, resolution) || + other.resolution == resolution) && + (identical(other.refreshHz, refreshHz) || + other.refreshHz == refreshHz) && + (identical(other.type, type) || other.type == type) && + (identical(other.ppi, ppi) || other.ppi == ppi) && + (identical(other.brightnessNits, brightnessNits) || + other.brightnessNits == brightnessNits)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, sizeInch, resolution, refreshHz, type, ppi, brightnessNits); + + @override + String toString() { + return 'Display(sizeInch: $sizeInch, resolution: $resolution, refreshHz: $refreshHz, type: $type, ppi: $ppi, brightnessNits: $brightnessNits)'; + } +} + +/// @nodoc +abstract mixin class $DisplayCopyWith<$Res> { + factory $DisplayCopyWith(Display value, $Res Function(Display) _then) = + _$DisplayCopyWithImpl; + @useResult + $Res call( + {double? sizeInch, + String? resolution, + int? refreshHz, + String? type, + int? ppi, + int? brightnessNits}); +} + +/// @nodoc +class _$DisplayCopyWithImpl<$Res> implements $DisplayCopyWith<$Res> { + _$DisplayCopyWithImpl(this._self, this._then); + + final Display _self; + final $Res Function(Display) _then; + + /// Create a copy of Display + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? sizeInch = freezed, + Object? resolution = freezed, + Object? refreshHz = freezed, + Object? type = freezed, + Object? ppi = freezed, + Object? brightnessNits = freezed, + }) { + return _then(_self.copyWith( + sizeInch: freezed == sizeInch + ? _self.sizeInch + : sizeInch // ignore: cast_nullable_to_non_nullable + as double?, + resolution: freezed == resolution + ? _self.resolution + : resolution // ignore: cast_nullable_to_non_nullable + as String?, + refreshHz: freezed == refreshHz + ? _self.refreshHz + : refreshHz // ignore: cast_nullable_to_non_nullable + as int?, + type: freezed == type + ? _self.type + : type // ignore: cast_nullable_to_non_nullable + as String?, + ppi: freezed == ppi + ? _self.ppi + : ppi // ignore: cast_nullable_to_non_nullable + as int?, + brightnessNits: freezed == brightnessNits + ? _self.brightnessNits + : brightnessNits // ignore: cast_nullable_to_non_nullable + as int?, + )); + } +} + +/// Adds pattern-matching-related methods to [Display]. +extension DisplayPatterns on Display { + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap( + TResult Function(_Display value)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Display() when $default != null: + return $default(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map( + TResult Function(_Display value) $default, + ) { + final _that = this; + switch (_that) { + case _Display(): + return $default(_that); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_Display value)? $default, + ) { + final _that = this; + switch (_that) { + case _Display() when $default != null: + return $default(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen( + TResult Function(double? sizeInch, String? resolution, int? refreshHz, + String? type, int? ppi, int? brightnessNits)? + $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Display() when $default != null: + return $default(_that.sizeInch, _that.resolution, _that.refreshHz, + _that.type, _that.ppi, _that.brightnessNits); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when( + TResult Function(double? sizeInch, String? resolution, int? refreshHz, + String? type, int? ppi, int? brightnessNits) + $default, + ) { + final _that = this; + switch (_that) { + case _Display(): + return $default(_that.sizeInch, _that.resolution, _that.refreshHz, + _that.type, _that.ppi, _that.brightnessNits); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function(double? sizeInch, String? resolution, int? refreshHz, + String? type, int? ppi, int? brightnessNits)? + $default, + ) { + final _that = this; + switch (_that) { + case _Display() when $default != null: + return $default(_that.sizeInch, _that.resolution, _that.refreshHz, + _that.type, _that.ppi, _that.brightnessNits); + case _: + return null; + } + } +} + +/// @nodoc +@JsonSerializable() +class _Display implements Display { + const _Display( + {this.sizeInch, + this.resolution, + this.refreshHz, + this.type, + this.ppi, + this.brightnessNits}); + factory _Display.fromJson(Map json) => + _$DisplayFromJson(json); + + @override + final double? sizeInch; + + /// `2340x1080` 형태의 문자열. 숫자로 파싱하지 않는다. + @override + final String? resolution; + @override + final int? refreshHz; + + /// 패널 종류 (예: `Dynamic AMOLED 2X`). + @override + final String? type; + @override + final int? ppi; + @override + final int? brightnessNits; + + /// Create a copy of Display + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$DisplayCopyWith<_Display> get copyWith => + __$DisplayCopyWithImpl<_Display>(this, _$identity); + + @override + Map toJson() { + return _$DisplayToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _Display && + (identical(other.sizeInch, sizeInch) || + other.sizeInch == sizeInch) && + (identical(other.resolution, resolution) || + other.resolution == resolution) && + (identical(other.refreshHz, refreshHz) || + other.refreshHz == refreshHz) && + (identical(other.type, type) || other.type == type) && + (identical(other.ppi, ppi) || other.ppi == ppi) && + (identical(other.brightnessNits, brightnessNits) || + other.brightnessNits == brightnessNits)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, sizeInch, resolution, refreshHz, type, ppi, brightnessNits); + + @override + String toString() { + return 'Display(sizeInch: $sizeInch, resolution: $resolution, refreshHz: $refreshHz, type: $type, ppi: $ppi, brightnessNits: $brightnessNits)'; + } +} + +/// @nodoc +abstract mixin class _$DisplayCopyWith<$Res> implements $DisplayCopyWith<$Res> { + factory _$DisplayCopyWith(_Display value, $Res Function(_Display) _then) = + __$DisplayCopyWithImpl; + @override + @useResult + $Res call( + {double? sizeInch, + String? resolution, + int? refreshHz, + String? type, + int? ppi, + int? brightnessNits}); +} + +/// @nodoc +class __$DisplayCopyWithImpl<$Res> implements _$DisplayCopyWith<$Res> { + __$DisplayCopyWithImpl(this._self, this._then); + + final _Display _self; + final $Res Function(_Display) _then; + + /// Create a copy of Display + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? sizeInch = freezed, + Object? resolution = freezed, + Object? refreshHz = freezed, + Object? type = freezed, + Object? ppi = freezed, + Object? brightnessNits = freezed, + }) { + return _then(_Display( + sizeInch: freezed == sizeInch + ? _self.sizeInch + : sizeInch // ignore: cast_nullable_to_non_nullable + as double?, + resolution: freezed == resolution + ? _self.resolution + : resolution // ignore: cast_nullable_to_non_nullable + as String?, + refreshHz: freezed == refreshHz + ? _self.refreshHz + : refreshHz // ignore: cast_nullable_to_non_nullable + as int?, + type: freezed == type + ? _self.type + : type // ignore: cast_nullable_to_non_nullable + as String?, + ppi: freezed == ppi + ? _self.ppi + : ppi // ignore: cast_nullable_to_non_nullable + as int?, + brightnessNits: freezed == brightnessNits + ? _self.brightnessNits + : brightnessNits // ignore: cast_nullable_to_non_nullable + as int?, + )); + } +} + +/// @nodoc +mixin _$Camera { + String? get type; + + /// 화소 (메가픽셀). + double? get mp; + double? get aperture; + + /// 광학식 손떨림 보정. + bool? get ois; + String? get sensor; + double? get opticalZoom; + + /// Create a copy of Camera + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $CameraCopyWith get copyWith => + _$CameraCopyWithImpl(this as Camera, _$identity); + + /// Serializes this Camera to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is Camera && + (identical(other.type, type) || other.type == type) && + (identical(other.mp, mp) || other.mp == mp) && + (identical(other.aperture, aperture) || + other.aperture == aperture) && + (identical(other.ois, ois) || other.ois == ois) && + (identical(other.sensor, sensor) || other.sensor == sensor) && + (identical(other.opticalZoom, opticalZoom) || + other.opticalZoom == opticalZoom)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, type, mp, aperture, ois, sensor, opticalZoom); + + @override + String toString() { + return 'Camera(type: $type, mp: $mp, aperture: $aperture, ois: $ois, sensor: $sensor, opticalZoom: $opticalZoom)'; + } +} + +/// @nodoc +abstract mixin class $CameraCopyWith<$Res> { + factory $CameraCopyWith(Camera value, $Res Function(Camera) _then) = + _$CameraCopyWithImpl; + @useResult + $Res call( + {String? type, + double? mp, + double? aperture, + bool? ois, + String? sensor, + double? opticalZoom}); +} + +/// @nodoc +class _$CameraCopyWithImpl<$Res> implements $CameraCopyWith<$Res> { + _$CameraCopyWithImpl(this._self, this._then); + + final Camera _self; + final $Res Function(Camera) _then; + + /// Create a copy of Camera + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? type = freezed, + Object? mp = freezed, + Object? aperture = freezed, + Object? ois = freezed, + Object? sensor = freezed, + Object? opticalZoom = freezed, + }) { + return _then(_self.copyWith( + type: freezed == type + ? _self.type + : type // ignore: cast_nullable_to_non_nullable + as String?, + mp: freezed == mp + ? _self.mp + : mp // ignore: cast_nullable_to_non_nullable + as double?, + aperture: freezed == aperture + ? _self.aperture + : aperture // ignore: cast_nullable_to_non_nullable + as double?, + ois: freezed == ois + ? _self.ois + : ois // ignore: cast_nullable_to_non_nullable + as bool?, + sensor: freezed == sensor + ? _self.sensor + : sensor // ignore: cast_nullable_to_non_nullable + as String?, + opticalZoom: freezed == opticalZoom + ? _self.opticalZoom + : opticalZoom // ignore: cast_nullable_to_non_nullable + as double?, + )); + } +} + +/// Adds pattern-matching-related methods to [Camera]. +extension CameraPatterns on Camera { + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap( + TResult Function(_Camera value)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Camera() when $default != null: + return $default(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map( + TResult Function(_Camera value) $default, + ) { + final _that = this; + switch (_that) { + case _Camera(): + return $default(_that); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_Camera value)? $default, + ) { + final _that = this; + switch (_that) { + case _Camera() when $default != null: + return $default(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen( + TResult Function(String? type, double? mp, double? aperture, bool? ois, + String? sensor, double? opticalZoom)? + $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Camera() when $default != null: + return $default(_that.type, _that.mp, _that.aperture, _that.ois, + _that.sensor, _that.opticalZoom); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when( + TResult Function(String? type, double? mp, double? aperture, bool? ois, + String? sensor, double? opticalZoom) + $default, + ) { + final _that = this; + switch (_that) { + case _Camera(): + return $default(_that.type, _that.mp, _that.aperture, _that.ois, + _that.sensor, _that.opticalZoom); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function(String? type, double? mp, double? aperture, bool? ois, + String? sensor, double? opticalZoom)? + $default, + ) { + final _that = this; + switch (_that) { + case _Camera() when $default != null: + return $default(_that.type, _that.mp, _that.aperture, _that.ois, + _that.sensor, _that.opticalZoom); + case _: + return null; + } + } +} + +/// @nodoc +@JsonSerializable() +class _Camera implements Camera { + const _Camera( + {this.type, + this.mp, + this.aperture, + this.ois, + this.sensor, + this.opticalZoom}); + factory _Camera.fromJson(Map json) => _$CameraFromJson(json); + + @override + final String? type; + + /// 화소 (메가픽셀). + @override + final double? mp; + @override + final double? aperture; + + /// 광학식 손떨림 보정. + @override + final bool? ois; + @override + final String? sensor; + @override + final double? opticalZoom; + + /// Create a copy of Camera + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$CameraCopyWith<_Camera> get copyWith => + __$CameraCopyWithImpl<_Camera>(this, _$identity); + + @override + Map toJson() { + return _$CameraToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _Camera && + (identical(other.type, type) || other.type == type) && + (identical(other.mp, mp) || other.mp == mp) && + (identical(other.aperture, aperture) || + other.aperture == aperture) && + (identical(other.ois, ois) || other.ois == ois) && + (identical(other.sensor, sensor) || other.sensor == sensor) && + (identical(other.opticalZoom, opticalZoom) || + other.opticalZoom == opticalZoom)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, type, mp, aperture, ois, sensor, opticalZoom); + + @override + String toString() { + return 'Camera(type: $type, mp: $mp, aperture: $aperture, ois: $ois, sensor: $sensor, opticalZoom: $opticalZoom)'; + } +} + +/// @nodoc +abstract mixin class _$CameraCopyWith<$Res> implements $CameraCopyWith<$Res> { + factory _$CameraCopyWith(_Camera value, $Res Function(_Camera) _then) = + __$CameraCopyWithImpl; + @override + @useResult + $Res call( + {String? type, + double? mp, + double? aperture, + bool? ois, + String? sensor, + double? opticalZoom}); +} + +/// @nodoc +class __$CameraCopyWithImpl<$Res> implements _$CameraCopyWith<$Res> { + __$CameraCopyWithImpl(this._self, this._then); + + final _Camera _self; + final $Res Function(_Camera) _then; + + /// Create a copy of Camera + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? type = freezed, + Object? mp = freezed, + Object? aperture = freezed, + Object? ois = freezed, + Object? sensor = freezed, + Object? opticalZoom = freezed, + }) { + return _then(_Camera( + type: freezed == type + ? _self.type + : type // ignore: cast_nullable_to_non_nullable + as String?, + mp: freezed == mp + ? _self.mp + : mp // ignore: cast_nullable_to_non_nullable + as double?, + aperture: freezed == aperture + ? _self.aperture + : aperture // ignore: cast_nullable_to_non_nullable + as double?, + ois: freezed == ois + ? _self.ois + : ois // ignore: cast_nullable_to_non_nullable + as bool?, + sensor: freezed == sensor + ? _self.sensor + : sensor // ignore: cast_nullable_to_non_nullable + as String?, + opticalZoom: freezed == opticalZoom + ? _self.opticalZoom + : opticalZoom // ignore: cast_nullable_to_non_nullable + as double?, + )); + } +} + +/// @nodoc +mixin _$Dimensions { + double? get heightMm; + double? get widthMm; + double? get depthMm; + + /// Create a copy of Dimensions + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $DimensionsCopyWith get copyWith => + _$DimensionsCopyWithImpl(this as Dimensions, _$identity); + + /// Serializes this Dimensions to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is Dimensions && + (identical(other.heightMm, heightMm) || + other.heightMm == heightMm) && + (identical(other.widthMm, widthMm) || other.widthMm == widthMm) && + (identical(other.depthMm, depthMm) || other.depthMm == depthMm)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, heightMm, widthMm, depthMm); + + @override + String toString() { + return 'Dimensions(heightMm: $heightMm, widthMm: $widthMm, depthMm: $depthMm)'; + } +} + +/// @nodoc +abstract mixin class $DimensionsCopyWith<$Res> { + factory $DimensionsCopyWith( + Dimensions value, $Res Function(Dimensions) _then) = + _$DimensionsCopyWithImpl; + @useResult + $Res call({double? heightMm, double? widthMm, double? depthMm}); +} + +/// @nodoc +class _$DimensionsCopyWithImpl<$Res> implements $DimensionsCopyWith<$Res> { + _$DimensionsCopyWithImpl(this._self, this._then); + + final Dimensions _self; + final $Res Function(Dimensions) _then; + + /// Create a copy of Dimensions + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? heightMm = freezed, + Object? widthMm = freezed, + Object? depthMm = freezed, + }) { + return _then(_self.copyWith( + heightMm: freezed == heightMm + ? _self.heightMm + : heightMm // ignore: cast_nullable_to_non_nullable + as double?, + widthMm: freezed == widthMm + ? _self.widthMm + : widthMm // ignore: cast_nullable_to_non_nullable + as double?, + depthMm: freezed == depthMm + ? _self.depthMm + : depthMm // ignore: cast_nullable_to_non_nullable + as double?, + )); + } +} + +/// Adds pattern-matching-related methods to [Dimensions]. +extension DimensionsPatterns on Dimensions { + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap( + TResult Function(_Dimensions value)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Dimensions() when $default != null: + return $default(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map( + TResult Function(_Dimensions value) $default, + ) { + final _that = this; + switch (_that) { + case _Dimensions(): + return $default(_that); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_Dimensions value)? $default, + ) { + final _that = this; + switch (_that) { + case _Dimensions() when $default != null: + return $default(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen( + TResult Function(double? heightMm, double? widthMm, double? depthMm)? + $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Dimensions() when $default != null: + return $default(_that.heightMm, _that.widthMm, _that.depthMm); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when( + TResult Function(double? heightMm, double? widthMm, double? depthMm) + $default, + ) { + final _that = this; + switch (_that) { + case _Dimensions(): + return $default(_that.heightMm, _that.widthMm, _that.depthMm); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function(double? heightMm, double? widthMm, double? depthMm)? + $default, + ) { + final _that = this; + switch (_that) { + case _Dimensions() when $default != null: + return $default(_that.heightMm, _that.widthMm, _that.depthMm); + case _: + return null; + } + } +} + +/// @nodoc +@JsonSerializable() +class _Dimensions implements Dimensions { + const _Dimensions({this.heightMm, this.widthMm, this.depthMm}); + factory _Dimensions.fromJson(Map json) => + _$DimensionsFromJson(json); + + @override + final double? heightMm; + @override + final double? widthMm; + @override + final double? depthMm; + + /// Create a copy of Dimensions + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$DimensionsCopyWith<_Dimensions> get copyWith => + __$DimensionsCopyWithImpl<_Dimensions>(this, _$identity); + + @override + Map toJson() { + return _$DimensionsToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _Dimensions && + (identical(other.heightMm, heightMm) || + other.heightMm == heightMm) && + (identical(other.widthMm, widthMm) || other.widthMm == widthMm) && + (identical(other.depthMm, depthMm) || other.depthMm == depthMm)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, heightMm, widthMm, depthMm); + + @override + String toString() { + return 'Dimensions(heightMm: $heightMm, widthMm: $widthMm, depthMm: $depthMm)'; + } +} + +/// @nodoc +abstract mixin class _$DimensionsCopyWith<$Res> + implements $DimensionsCopyWith<$Res> { + factory _$DimensionsCopyWith( + _Dimensions value, $Res Function(_Dimensions) _then) = + __$DimensionsCopyWithImpl; + @override + @useResult + $Res call({double? heightMm, double? widthMm, double? depthMm}); +} + +/// @nodoc +class __$DimensionsCopyWithImpl<$Res> implements _$DimensionsCopyWith<$Res> { + __$DimensionsCopyWithImpl(this._self, this._then); + + final _Dimensions _self; + final $Res Function(_Dimensions) _then; + + /// Create a copy of Dimensions + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? heightMm = freezed, + Object? widthMm = freezed, + Object? depthMm = freezed, + }) { + return _then(_Dimensions( + heightMm: freezed == heightMm + ? _self.heightMm + : heightMm // ignore: cast_nullable_to_non_nullable + as double?, + widthMm: freezed == widthMm + ? _self.widthMm + : widthMm // ignore: cast_nullable_to_non_nullable + as double?, + depthMm: freezed == depthMm + ? _self.depthMm + : depthMm // ignore: cast_nullable_to_non_nullable + as double?, + )); + } +} + +/// @nodoc +mixin _$Connectivity { + String? get wifi; + String? get bluetooth; + bool? get nfc; + String? get usb; + + /// Create a copy of Connectivity + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $ConnectivityCopyWith get copyWith => + _$ConnectivityCopyWithImpl( + this as Connectivity, _$identity); + + /// Serializes this Connectivity to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is Connectivity && + (identical(other.wifi, wifi) || other.wifi == wifi) && + (identical(other.bluetooth, bluetooth) || + other.bluetooth == bluetooth) && + (identical(other.nfc, nfc) || other.nfc == nfc) && + (identical(other.usb, usb) || other.usb == usb)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, wifi, bluetooth, nfc, usb); + + @override + String toString() { + return 'Connectivity(wifi: $wifi, bluetooth: $bluetooth, nfc: $nfc, usb: $usb)'; + } +} + +/// @nodoc +abstract mixin class $ConnectivityCopyWith<$Res> { + factory $ConnectivityCopyWith( + Connectivity value, $Res Function(Connectivity) _then) = + _$ConnectivityCopyWithImpl; + @useResult + $Res call({String? wifi, String? bluetooth, bool? nfc, String? usb}); +} + +/// @nodoc +class _$ConnectivityCopyWithImpl<$Res> implements $ConnectivityCopyWith<$Res> { + _$ConnectivityCopyWithImpl(this._self, this._then); + + final Connectivity _self; + final $Res Function(Connectivity) _then; + + /// Create a copy of Connectivity + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? wifi = freezed, + Object? bluetooth = freezed, + Object? nfc = freezed, + Object? usb = freezed, + }) { + return _then(_self.copyWith( + wifi: freezed == wifi + ? _self.wifi + : wifi // ignore: cast_nullable_to_non_nullable + as String?, + bluetooth: freezed == bluetooth + ? _self.bluetooth + : bluetooth // ignore: cast_nullable_to_non_nullable + as String?, + nfc: freezed == nfc + ? _self.nfc + : nfc // ignore: cast_nullable_to_non_nullable + as bool?, + usb: freezed == usb + ? _self.usb + : usb // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// Adds pattern-matching-related methods to [Connectivity]. +extension ConnectivityPatterns on Connectivity { + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap( + TResult Function(_Connectivity value)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Connectivity() when $default != null: + return $default(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map( + TResult Function(_Connectivity value) $default, + ) { + final _that = this; + switch (_that) { + case _Connectivity(): + return $default(_that); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_Connectivity value)? $default, + ) { + final _that = this; + switch (_that) { + case _Connectivity() when $default != null: + return $default(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen( + TResult Function(String? wifi, String? bluetooth, bool? nfc, String? usb)? + $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Connectivity() when $default != null: + return $default(_that.wifi, _that.bluetooth, _that.nfc, _that.usb); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when( + TResult Function(String? wifi, String? bluetooth, bool? nfc, String? usb) + $default, + ) { + final _that = this; + switch (_that) { + case _Connectivity(): + return $default(_that.wifi, _that.bluetooth, _that.nfc, _that.usb); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function(String? wifi, String? bluetooth, bool? nfc, String? usb)? + $default, + ) { + final _that = this; + switch (_that) { + case _Connectivity() when $default != null: + return $default(_that.wifi, _that.bluetooth, _that.nfc, _that.usb); + case _: + return null; + } + } +} + +/// @nodoc +@JsonSerializable() +class _Connectivity implements Connectivity { + const _Connectivity({this.wifi, this.bluetooth, this.nfc, this.usb}); + factory _Connectivity.fromJson(Map json) => + _$ConnectivityFromJson(json); + + @override + final String? wifi; + @override + final String? bluetooth; + @override + final bool? nfc; + @override + final String? usb; + + /// Create a copy of Connectivity + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$ConnectivityCopyWith<_Connectivity> get copyWith => + __$ConnectivityCopyWithImpl<_Connectivity>(this, _$identity); + + @override + Map toJson() { + return _$ConnectivityToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _Connectivity && + (identical(other.wifi, wifi) || other.wifi == wifi) && + (identical(other.bluetooth, bluetooth) || + other.bluetooth == bluetooth) && + (identical(other.nfc, nfc) || other.nfc == nfc) && + (identical(other.usb, usb) || other.usb == usb)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, wifi, bluetooth, nfc, usb); + + @override + String toString() { + return 'Connectivity(wifi: $wifi, bluetooth: $bluetooth, nfc: $nfc, usb: $usb)'; + } +} + +/// @nodoc +abstract mixin class _$ConnectivityCopyWith<$Res> + implements $ConnectivityCopyWith<$Res> { + factory _$ConnectivityCopyWith( + _Connectivity value, $Res Function(_Connectivity) _then) = + __$ConnectivityCopyWithImpl; + @override + @useResult + $Res call({String? wifi, String? bluetooth, bool? nfc, String? usb}); +} + +/// @nodoc +class __$ConnectivityCopyWithImpl<$Res> + implements _$ConnectivityCopyWith<$Res> { + __$ConnectivityCopyWithImpl(this._self, this._then); + + final _Connectivity _self; + final $Res Function(_Connectivity) _then; + + /// Create a copy of Connectivity + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? wifi = freezed, + Object? bluetooth = freezed, + Object? nfc = freezed, + Object? usb = freezed, + }) { + return _then(_Connectivity( + wifi: freezed == wifi + ? _self.wifi + : wifi // ignore: cast_nullable_to_non_nullable + as String?, + bluetooth: freezed == bluetooth + ? _self.bluetooth + : bluetooth // ignore: cast_nullable_to_non_nullable + as String?, + nfc: freezed == nfc + ? _self.nfc + : nfc // ignore: cast_nullable_to_non_nullable + as bool?, + usb: freezed == usb + ? _self.usb + : usb // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +mixin _$Smartphone { + String get slug; + String get name; + int? get id; + + /// 파생 모델일 때 원본 모델의 slug (예: Plus/Ultra 변형). + String? get baseModelSlug; + Brand? get brand; + Soc? get soc; + + /// `YYYY-MM-DD`. 일자가 불확실하면 월초로 채워져 있다. + String? get releaseDate; + int? get msrpUsd; + int? get ramGb; + List get storageOptionsGb; + + /// 지역·구성별 변형 정보. 스키마가 고정되어 있지 않아 원본 그대로 둔다. + Map get variant; + Display? get display; + List get cameras; + int? get batteryMah; + int? get chargingWiredW; + int? get chargingWirelessW; + double? get weightG; + Dimensions? get dimensions; + + /// 방수·방진 등급 (예: `IP68`). + String? get ipRating; + String? get os; + String? get osVersion; + Connectivity? get connectivity; + String? get imageUrl; + List get images; + SmartphoneScore? get score; + bool get verified; + + /// CC-BY-SA 4.0 조건상 UI에 반드시 노출해야 한다. + List get sourceUrls; + String? get createdAt; + String? get updatedAt; + + /// Create a copy of Smartphone + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $SmartphoneCopyWith get copyWith => + _$SmartphoneCopyWithImpl(this as Smartphone, _$identity); + + /// Serializes this Smartphone to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is Smartphone && + (identical(other.slug, slug) || other.slug == slug) && + (identical(other.name, name) || other.name == name) && + (identical(other.id, id) || other.id == id) && + (identical(other.baseModelSlug, baseModelSlug) || + other.baseModelSlug == baseModelSlug) && + (identical(other.brand, brand) || other.brand == brand) && + (identical(other.soc, soc) || other.soc == soc) && + (identical(other.releaseDate, releaseDate) || + other.releaseDate == releaseDate) && + (identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd) && + (identical(other.ramGb, ramGb) || other.ramGb == ramGb) && + const DeepCollectionEquality() + .equals(other.storageOptionsGb, storageOptionsGb) && + const DeepCollectionEquality().equals(other.variant, variant) && + (identical(other.display, display) || other.display == display) && + const DeepCollectionEquality().equals(other.cameras, cameras) && + (identical(other.batteryMah, batteryMah) || + other.batteryMah == batteryMah) && + (identical(other.chargingWiredW, chargingWiredW) || + other.chargingWiredW == chargingWiredW) && + (identical(other.chargingWirelessW, chargingWirelessW) || + other.chargingWirelessW == chargingWirelessW) && + (identical(other.weightG, weightG) || other.weightG == weightG) && + (identical(other.dimensions, dimensions) || + other.dimensions == dimensions) && + (identical(other.ipRating, ipRating) || + other.ipRating == ipRating) && + (identical(other.os, os) || other.os == os) && + (identical(other.osVersion, osVersion) || + other.osVersion == osVersion) && + (identical(other.connectivity, connectivity) || + other.connectivity == connectivity) && + (identical(other.imageUrl, imageUrl) || + other.imageUrl == imageUrl) && + const DeepCollectionEquality().equals(other.images, images) && + (identical(other.score, score) || other.score == score) && + (identical(other.verified, verified) || + other.verified == verified) && + const DeepCollectionEquality() + .equals(other.sourceUrls, sourceUrls) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hashAll([ + runtimeType, + slug, + name, + id, + baseModelSlug, + brand, + soc, + releaseDate, + msrpUsd, + ramGb, + const DeepCollectionEquality().hash(storageOptionsGb), + const DeepCollectionEquality().hash(variant), + display, + const DeepCollectionEquality().hash(cameras), + batteryMah, + chargingWiredW, + chargingWirelessW, + weightG, + dimensions, + ipRating, + os, + osVersion, + connectivity, + imageUrl, + const DeepCollectionEquality().hash(images), + score, + verified, + const DeepCollectionEquality().hash(sourceUrls), + createdAt, + updatedAt + ]); + + @override + String toString() { + return 'Smartphone(slug: $slug, name: $name, id: $id, baseModelSlug: $baseModelSlug, brand: $brand, soc: $soc, releaseDate: $releaseDate, msrpUsd: $msrpUsd, ramGb: $ramGb, storageOptionsGb: $storageOptionsGb, variant: $variant, display: $display, cameras: $cameras, batteryMah: $batteryMah, chargingWiredW: $chargingWiredW, chargingWirelessW: $chargingWirelessW, weightG: $weightG, dimensions: $dimensions, ipRating: $ipRating, os: $os, osVersion: $osVersion, connectivity: $connectivity, imageUrl: $imageUrl, images: $images, score: $score, verified: $verified, sourceUrls: $sourceUrls, createdAt: $createdAt, updatedAt: $updatedAt)'; + } +} + +/// @nodoc +abstract mixin class $SmartphoneCopyWith<$Res> { + factory $SmartphoneCopyWith( + Smartphone value, $Res Function(Smartphone) _then) = + _$SmartphoneCopyWithImpl; + @useResult + $Res call( + {String slug, + String name, + int? id, + String? baseModelSlug, + Brand? brand, + Soc? soc, + String? releaseDate, + int? msrpUsd, + int? ramGb, + List storageOptionsGb, + Map variant, + Display? display, + List cameras, + int? batteryMah, + int? chargingWiredW, + int? chargingWirelessW, + double? weightG, + Dimensions? dimensions, + String? ipRating, + String? os, + String? osVersion, + Connectivity? connectivity, + String? imageUrl, + List images, + SmartphoneScore? score, + bool verified, + List sourceUrls, + String? createdAt, + String? updatedAt}); + + $BrandCopyWith<$Res>? get brand; + $SocCopyWith<$Res>? get soc; + $DisplayCopyWith<$Res>? get display; + $DimensionsCopyWith<$Res>? get dimensions; + $ConnectivityCopyWith<$Res>? get connectivity; + $SmartphoneScoreCopyWith<$Res>? get score; +} + +/// @nodoc +class _$SmartphoneCopyWithImpl<$Res> implements $SmartphoneCopyWith<$Res> { + _$SmartphoneCopyWithImpl(this._self, this._then); + + final Smartphone _self; + final $Res Function(Smartphone) _then; + + /// Create a copy of Smartphone + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? slug = null, + Object? name = null, + Object? id = freezed, + Object? baseModelSlug = freezed, + Object? brand = freezed, + Object? soc = freezed, + Object? releaseDate = freezed, + Object? msrpUsd = freezed, + Object? ramGb = freezed, + Object? storageOptionsGb = null, + Object? variant = null, + Object? display = freezed, + Object? cameras = null, + Object? batteryMah = freezed, + Object? chargingWiredW = freezed, + Object? chargingWirelessW = freezed, + Object? weightG = freezed, + Object? dimensions = freezed, + Object? ipRating = freezed, + Object? os = freezed, + Object? osVersion = freezed, + Object? connectivity = freezed, + Object? imageUrl = freezed, + Object? images = null, + Object? score = freezed, + Object? verified = null, + Object? sourceUrls = null, + Object? createdAt = freezed, + Object? updatedAt = freezed, + }) { + return _then(_self.copyWith( + slug: null == slug + ? _self.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _self.name + : name // ignore: cast_nullable_to_non_nullable + as String, + id: freezed == id + ? _self.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + baseModelSlug: freezed == baseModelSlug + ? _self.baseModelSlug + : baseModelSlug // ignore: cast_nullable_to_non_nullable + as String?, + brand: freezed == brand + ? _self.brand + : brand // ignore: cast_nullable_to_non_nullable + as Brand?, + soc: freezed == soc + ? _self.soc + : soc // ignore: cast_nullable_to_non_nullable + as Soc?, + releaseDate: freezed == releaseDate + ? _self.releaseDate + : releaseDate // ignore: cast_nullable_to_non_nullable + as String?, + msrpUsd: freezed == msrpUsd + ? _self.msrpUsd + : msrpUsd // ignore: cast_nullable_to_non_nullable + as int?, + ramGb: freezed == ramGb + ? _self.ramGb + : ramGb // ignore: cast_nullable_to_non_nullable + as int?, + storageOptionsGb: null == storageOptionsGb + ? _self.storageOptionsGb + : storageOptionsGb // ignore: cast_nullable_to_non_nullable + as List, + variant: null == variant + ? _self.variant + : variant // ignore: cast_nullable_to_non_nullable + as Map, + display: freezed == display + ? _self.display + : display // ignore: cast_nullable_to_non_nullable + as Display?, + cameras: null == cameras + ? _self.cameras + : cameras // ignore: cast_nullable_to_non_nullable + as List, + batteryMah: freezed == batteryMah + ? _self.batteryMah + : batteryMah // ignore: cast_nullable_to_non_nullable + as int?, + chargingWiredW: freezed == chargingWiredW + ? _self.chargingWiredW + : chargingWiredW // ignore: cast_nullable_to_non_nullable + as int?, + chargingWirelessW: freezed == chargingWirelessW + ? _self.chargingWirelessW + : chargingWirelessW // ignore: cast_nullable_to_non_nullable + as int?, + weightG: freezed == weightG + ? _self.weightG + : weightG // ignore: cast_nullable_to_non_nullable + as double?, + dimensions: freezed == dimensions + ? _self.dimensions + : dimensions // ignore: cast_nullable_to_non_nullable + as Dimensions?, + ipRating: freezed == ipRating + ? _self.ipRating + : ipRating // ignore: cast_nullable_to_non_nullable + as String?, + os: freezed == os + ? _self.os + : os // ignore: cast_nullable_to_non_nullable + as String?, + osVersion: freezed == osVersion + ? _self.osVersion + : osVersion // ignore: cast_nullable_to_non_nullable + as String?, + connectivity: freezed == connectivity + ? _self.connectivity + : connectivity // ignore: cast_nullable_to_non_nullable + as Connectivity?, + imageUrl: freezed == imageUrl + ? _self.imageUrl + : imageUrl // ignore: cast_nullable_to_non_nullable + as String?, + images: null == images + ? _self.images + : images // ignore: cast_nullable_to_non_nullable + as List, + score: freezed == score + ? _self.score + : score // ignore: cast_nullable_to_non_nullable + as SmartphoneScore?, + verified: null == verified + ? _self.verified + : verified // ignore: cast_nullable_to_non_nullable + as bool, + sourceUrls: null == sourceUrls + ? _self.sourceUrls + : sourceUrls // ignore: cast_nullable_to_non_nullable + as List, + createdAt: freezed == createdAt + ? _self.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as String?, + updatedAt: freezed == updatedAt + ? _self.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as String?, + )); + } + + /// Create a copy of Smartphone + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $BrandCopyWith<$Res>? get brand { + if (_self.brand == null) { + return null; + } + + return $BrandCopyWith<$Res>(_self.brand!, (value) { + return _then(_self.copyWith(brand: value)); + }); + } + + /// Create a copy of Smartphone + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $SocCopyWith<$Res>? get soc { + if (_self.soc == null) { + return null; + } + + return $SocCopyWith<$Res>(_self.soc!, (value) { + return _then(_self.copyWith(soc: value)); + }); + } + + /// Create a copy of Smartphone + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $DisplayCopyWith<$Res>? get display { + if (_self.display == null) { + return null; + } + + return $DisplayCopyWith<$Res>(_self.display!, (value) { + return _then(_self.copyWith(display: value)); + }); + } + + /// Create a copy of Smartphone + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $DimensionsCopyWith<$Res>? get dimensions { + if (_self.dimensions == null) { + return null; + } + + return $DimensionsCopyWith<$Res>(_self.dimensions!, (value) { + return _then(_self.copyWith(dimensions: value)); + }); + } + + /// Create a copy of Smartphone + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ConnectivityCopyWith<$Res>? get connectivity { + if (_self.connectivity == null) { + return null; + } + + return $ConnectivityCopyWith<$Res>(_self.connectivity!, (value) { + return _then(_self.copyWith(connectivity: value)); + }); + } + + /// Create a copy of Smartphone + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $SmartphoneScoreCopyWith<$Res>? get score { + if (_self.score == null) { + return null; + } + + return $SmartphoneScoreCopyWith<$Res>(_self.score!, (value) { + return _then(_self.copyWith(score: value)); + }); + } +} + +/// Adds pattern-matching-related methods to [Smartphone]. +extension SmartphonePatterns on Smartphone { + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap( + TResult Function(_Smartphone value)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Smartphone() when $default != null: + return $default(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map( + TResult Function(_Smartphone value) $default, + ) { + final _that = this; + switch (_that) { + case _Smartphone(): + return $default(_that); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_Smartphone value)? $default, + ) { + final _that = this; + switch (_that) { + case _Smartphone() when $default != null: + return $default(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen( + TResult Function( + String slug, + String name, + int? id, + String? baseModelSlug, + Brand? brand, + Soc? soc, + String? releaseDate, + int? msrpUsd, + int? ramGb, + List storageOptionsGb, + Map variant, + Display? display, + List cameras, + int? batteryMah, + int? chargingWiredW, + int? chargingWirelessW, + double? weightG, + Dimensions? dimensions, + String? ipRating, + String? os, + String? osVersion, + Connectivity? connectivity, + String? imageUrl, + List images, + SmartphoneScore? score, + bool verified, + List sourceUrls, + String? createdAt, + String? updatedAt)? + $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Smartphone() when $default != null: + return $default( + _that.slug, + _that.name, + _that.id, + _that.baseModelSlug, + _that.brand, + _that.soc, + _that.releaseDate, + _that.msrpUsd, + _that.ramGb, + _that.storageOptionsGb, + _that.variant, + _that.display, + _that.cameras, + _that.batteryMah, + _that.chargingWiredW, + _that.chargingWirelessW, + _that.weightG, + _that.dimensions, + _that.ipRating, + _that.os, + _that.osVersion, + _that.connectivity, + _that.imageUrl, + _that.images, + _that.score, + _that.verified, + _that.sourceUrls, + _that.createdAt, + _that.updatedAt); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when( + TResult Function( + String slug, + String name, + int? id, + String? baseModelSlug, + Brand? brand, + Soc? soc, + String? releaseDate, + int? msrpUsd, + int? ramGb, + List storageOptionsGb, + Map variant, + Display? display, + List cameras, + int? batteryMah, + int? chargingWiredW, + int? chargingWirelessW, + double? weightG, + Dimensions? dimensions, + String? ipRating, + String? os, + String? osVersion, + Connectivity? connectivity, + String? imageUrl, + List images, + SmartphoneScore? score, + bool verified, + List sourceUrls, + String? createdAt, + String? updatedAt) + $default, + ) { + final _that = this; + switch (_that) { + case _Smartphone(): + return $default( + _that.slug, + _that.name, + _that.id, + _that.baseModelSlug, + _that.brand, + _that.soc, + _that.releaseDate, + _that.msrpUsd, + _that.ramGb, + _that.storageOptionsGb, + _that.variant, + _that.display, + _that.cameras, + _that.batteryMah, + _that.chargingWiredW, + _that.chargingWirelessW, + _that.weightG, + _that.dimensions, + _that.ipRating, + _that.os, + _that.osVersion, + _that.connectivity, + _that.imageUrl, + _that.images, + _that.score, + _that.verified, + _that.sourceUrls, + _that.createdAt, + _that.updatedAt); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function( + String slug, + String name, + int? id, + String? baseModelSlug, + Brand? brand, + Soc? soc, + String? releaseDate, + int? msrpUsd, + int? ramGb, + List storageOptionsGb, + Map variant, + Display? display, + List cameras, + int? batteryMah, + int? chargingWiredW, + int? chargingWirelessW, + double? weightG, + Dimensions? dimensions, + String? ipRating, + String? os, + String? osVersion, + Connectivity? connectivity, + String? imageUrl, + List images, + SmartphoneScore? score, + bool verified, + List sourceUrls, + String? createdAt, + String? updatedAt)? + $default, + ) { + final _that = this; + switch (_that) { + case _Smartphone() when $default != null: + return $default( + _that.slug, + _that.name, + _that.id, + _that.baseModelSlug, + _that.brand, + _that.soc, + _that.releaseDate, + _that.msrpUsd, + _that.ramGb, + _that.storageOptionsGb, + _that.variant, + _that.display, + _that.cameras, + _that.batteryMah, + _that.chargingWiredW, + _that.chargingWirelessW, + _that.weightG, + _that.dimensions, + _that.ipRating, + _that.os, + _that.osVersion, + _that.connectivity, + _that.imageUrl, + _that.images, + _that.score, + _that.verified, + _that.sourceUrls, + _that.createdAt, + _that.updatedAt); + case _: + return null; + } + } +} + +/// @nodoc +@JsonSerializable() +class _Smartphone implements Smartphone { + const _Smartphone( + {required this.slug, + required this.name, + this.id, + this.baseModelSlug, + this.brand, + this.soc, + this.releaseDate, + this.msrpUsd, + this.ramGb, + final List storageOptionsGb = const [], + final Map variant = const {}, + this.display, + final List cameras = const [], + this.batteryMah, + this.chargingWiredW, + this.chargingWirelessW, + this.weightG, + this.dimensions, + this.ipRating, + this.os, + this.osVersion, + this.connectivity, + this.imageUrl, + final List images = const [], + this.score, + this.verified = false, + final List sourceUrls = const [], + this.createdAt, + this.updatedAt}) + : _storageOptionsGb = storageOptionsGb, + _variant = variant, + _cameras = cameras, + _images = images, + _sourceUrls = sourceUrls; + factory _Smartphone.fromJson(Map json) => + _$SmartphoneFromJson(json); + + @override + final String slug; + @override + final String name; + @override + final int? id; + + /// 파생 모델일 때 원본 모델의 slug (예: Plus/Ultra 변형). + @override + final String? baseModelSlug; + @override + final Brand? brand; + @override + final Soc? soc; + + /// `YYYY-MM-DD`. 일자가 불확실하면 월초로 채워져 있다. + @override + final String? releaseDate; + @override + final int? msrpUsd; + @override + final int? ramGb; + final List _storageOptionsGb; + @override + @JsonKey() + List get storageOptionsGb { + if (_storageOptionsGb is EqualUnmodifiableListView) + return _storageOptionsGb; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_storageOptionsGb); + } + + /// 지역·구성별 변형 정보. 스키마가 고정되어 있지 않아 원본 그대로 둔다. + final Map _variant; + + /// 지역·구성별 변형 정보. 스키마가 고정되어 있지 않아 원본 그대로 둔다. + @override + @JsonKey() + Map get variant { + if (_variant is EqualUnmodifiableMapView) return _variant; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_variant); + } + + @override + final Display? display; + final List _cameras; + @override + @JsonKey() + List get cameras { + if (_cameras is EqualUnmodifiableListView) return _cameras; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_cameras); + } + + @override + final int? batteryMah; + @override + final int? chargingWiredW; + @override + final int? chargingWirelessW; + @override + final double? weightG; + @override + final Dimensions? dimensions; + + /// 방수·방진 등급 (예: `IP68`). + @override + final String? ipRating; + @override + final String? os; + @override + final String? osVersion; + @override + final Connectivity? connectivity; + @override + final String? imageUrl; + final List _images; + @override + @JsonKey() + List get images { + if (_images is EqualUnmodifiableListView) return _images; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_images); + } + + @override + final SmartphoneScore? score; + @override + @JsonKey() + final bool verified; + + /// CC-BY-SA 4.0 조건상 UI에 반드시 노출해야 한다. + final List _sourceUrls; + + /// CC-BY-SA 4.0 조건상 UI에 반드시 노출해야 한다. + @override + @JsonKey() + List get sourceUrls { + if (_sourceUrls is EqualUnmodifiableListView) return _sourceUrls; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_sourceUrls); + } + + @override + final String? createdAt; + @override + final String? updatedAt; + + /// Create a copy of Smartphone + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$SmartphoneCopyWith<_Smartphone> get copyWith => + __$SmartphoneCopyWithImpl<_Smartphone>(this, _$identity); + + @override + Map toJson() { + return _$SmartphoneToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _Smartphone && + (identical(other.slug, slug) || other.slug == slug) && + (identical(other.name, name) || other.name == name) && + (identical(other.id, id) || other.id == id) && + (identical(other.baseModelSlug, baseModelSlug) || + other.baseModelSlug == baseModelSlug) && + (identical(other.brand, brand) || other.brand == brand) && + (identical(other.soc, soc) || other.soc == soc) && + (identical(other.releaseDate, releaseDate) || + other.releaseDate == releaseDate) && + (identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd) && + (identical(other.ramGb, ramGb) || other.ramGb == ramGb) && + const DeepCollectionEquality() + .equals(other._storageOptionsGb, _storageOptionsGb) && + const DeepCollectionEquality().equals(other._variant, _variant) && + (identical(other.display, display) || other.display == display) && + const DeepCollectionEquality().equals(other._cameras, _cameras) && + (identical(other.batteryMah, batteryMah) || + other.batteryMah == batteryMah) && + (identical(other.chargingWiredW, chargingWiredW) || + other.chargingWiredW == chargingWiredW) && + (identical(other.chargingWirelessW, chargingWirelessW) || + other.chargingWirelessW == chargingWirelessW) && + (identical(other.weightG, weightG) || other.weightG == weightG) && + (identical(other.dimensions, dimensions) || + other.dimensions == dimensions) && + (identical(other.ipRating, ipRating) || + other.ipRating == ipRating) && + (identical(other.os, os) || other.os == os) && + (identical(other.osVersion, osVersion) || + other.osVersion == osVersion) && + (identical(other.connectivity, connectivity) || + other.connectivity == connectivity) && + (identical(other.imageUrl, imageUrl) || + other.imageUrl == imageUrl) && + const DeepCollectionEquality().equals(other._images, _images) && + (identical(other.score, score) || other.score == score) && + (identical(other.verified, verified) || + other.verified == verified) && + const DeepCollectionEquality() + .equals(other._sourceUrls, _sourceUrls) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hashAll([ + runtimeType, + slug, + name, + id, + baseModelSlug, + brand, + soc, + releaseDate, + msrpUsd, + ramGb, + const DeepCollectionEquality().hash(_storageOptionsGb), + const DeepCollectionEquality().hash(_variant), + display, + const DeepCollectionEquality().hash(_cameras), + batteryMah, + chargingWiredW, + chargingWirelessW, + weightG, + dimensions, + ipRating, + os, + osVersion, + connectivity, + imageUrl, + const DeepCollectionEquality().hash(_images), + score, + verified, + const DeepCollectionEquality().hash(_sourceUrls), + createdAt, + updatedAt + ]); + + @override + String toString() { + return 'Smartphone(slug: $slug, name: $name, id: $id, baseModelSlug: $baseModelSlug, brand: $brand, soc: $soc, releaseDate: $releaseDate, msrpUsd: $msrpUsd, ramGb: $ramGb, storageOptionsGb: $storageOptionsGb, variant: $variant, display: $display, cameras: $cameras, batteryMah: $batteryMah, chargingWiredW: $chargingWiredW, chargingWirelessW: $chargingWirelessW, weightG: $weightG, dimensions: $dimensions, ipRating: $ipRating, os: $os, osVersion: $osVersion, connectivity: $connectivity, imageUrl: $imageUrl, images: $images, score: $score, verified: $verified, sourceUrls: $sourceUrls, createdAt: $createdAt, updatedAt: $updatedAt)'; + } +} + +/// @nodoc +abstract mixin class _$SmartphoneCopyWith<$Res> + implements $SmartphoneCopyWith<$Res> { + factory _$SmartphoneCopyWith( + _Smartphone value, $Res Function(_Smartphone) _then) = + __$SmartphoneCopyWithImpl; + @override + @useResult + $Res call( + {String slug, + String name, + int? id, + String? baseModelSlug, + Brand? brand, + Soc? soc, + String? releaseDate, + int? msrpUsd, + int? ramGb, + List storageOptionsGb, + Map variant, + Display? display, + List cameras, + int? batteryMah, + int? chargingWiredW, + int? chargingWirelessW, + double? weightG, + Dimensions? dimensions, + String? ipRating, + String? os, + String? osVersion, + Connectivity? connectivity, + String? imageUrl, + List images, + SmartphoneScore? score, + bool verified, + List sourceUrls, + String? createdAt, + String? updatedAt}); + + @override + $BrandCopyWith<$Res>? get brand; + @override + $SocCopyWith<$Res>? get soc; + @override + $DisplayCopyWith<$Res>? get display; + @override + $DimensionsCopyWith<$Res>? get dimensions; + @override + $ConnectivityCopyWith<$Res>? get connectivity; + @override + $SmartphoneScoreCopyWith<$Res>? get score; +} + +/// @nodoc +class __$SmartphoneCopyWithImpl<$Res> implements _$SmartphoneCopyWith<$Res> { + __$SmartphoneCopyWithImpl(this._self, this._then); + + final _Smartphone _self; + final $Res Function(_Smartphone) _then; + + /// Create a copy of Smartphone + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? slug = null, + Object? name = null, + Object? id = freezed, + Object? baseModelSlug = freezed, + Object? brand = freezed, + Object? soc = freezed, + Object? releaseDate = freezed, + Object? msrpUsd = freezed, + Object? ramGb = freezed, + Object? storageOptionsGb = null, + Object? variant = null, + Object? display = freezed, + Object? cameras = null, + Object? batteryMah = freezed, + Object? chargingWiredW = freezed, + Object? chargingWirelessW = freezed, + Object? weightG = freezed, + Object? dimensions = freezed, + Object? ipRating = freezed, + Object? os = freezed, + Object? osVersion = freezed, + Object? connectivity = freezed, + Object? imageUrl = freezed, + Object? images = null, + Object? score = freezed, + Object? verified = null, + Object? sourceUrls = null, + Object? createdAt = freezed, + Object? updatedAt = freezed, + }) { + return _then(_Smartphone( + slug: null == slug + ? _self.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _self.name + : name // ignore: cast_nullable_to_non_nullable + as String, + id: freezed == id + ? _self.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + baseModelSlug: freezed == baseModelSlug + ? _self.baseModelSlug + : baseModelSlug // ignore: cast_nullable_to_non_nullable + as String?, + brand: freezed == brand + ? _self.brand + : brand // ignore: cast_nullable_to_non_nullable + as Brand?, + soc: freezed == soc + ? _self.soc + : soc // ignore: cast_nullable_to_non_nullable + as Soc?, + releaseDate: freezed == releaseDate + ? _self.releaseDate + : releaseDate // ignore: cast_nullable_to_non_nullable + as String?, + msrpUsd: freezed == msrpUsd + ? _self.msrpUsd + : msrpUsd // ignore: cast_nullable_to_non_nullable + as int?, + ramGb: freezed == ramGb + ? _self.ramGb + : ramGb // ignore: cast_nullable_to_non_nullable + as int?, + storageOptionsGb: null == storageOptionsGb + ? _self._storageOptionsGb + : storageOptionsGb // ignore: cast_nullable_to_non_nullable + as List, + variant: null == variant + ? _self._variant + : variant // ignore: cast_nullable_to_non_nullable + as Map, + display: freezed == display + ? _self.display + : display // ignore: cast_nullable_to_non_nullable + as Display?, + cameras: null == cameras + ? _self._cameras + : cameras // ignore: cast_nullable_to_non_nullable + as List, + batteryMah: freezed == batteryMah + ? _self.batteryMah + : batteryMah // ignore: cast_nullable_to_non_nullable + as int?, + chargingWiredW: freezed == chargingWiredW + ? _self.chargingWiredW + : chargingWiredW // ignore: cast_nullable_to_non_nullable + as int?, + chargingWirelessW: freezed == chargingWirelessW + ? _self.chargingWirelessW + : chargingWirelessW // ignore: cast_nullable_to_non_nullable + as int?, + weightG: freezed == weightG + ? _self.weightG + : weightG // ignore: cast_nullable_to_non_nullable + as double?, + dimensions: freezed == dimensions + ? _self.dimensions + : dimensions // ignore: cast_nullable_to_non_nullable + as Dimensions?, + ipRating: freezed == ipRating + ? _self.ipRating + : ipRating // ignore: cast_nullable_to_non_nullable + as String?, + os: freezed == os + ? _self.os + : os // ignore: cast_nullable_to_non_nullable + as String?, + osVersion: freezed == osVersion + ? _self.osVersion + : osVersion // ignore: cast_nullable_to_non_nullable + as String?, + connectivity: freezed == connectivity + ? _self.connectivity + : connectivity // ignore: cast_nullable_to_non_nullable + as Connectivity?, + imageUrl: freezed == imageUrl + ? _self.imageUrl + : imageUrl // ignore: cast_nullable_to_non_nullable + as String?, + images: null == images + ? _self._images + : images // ignore: cast_nullable_to_non_nullable + as List, + score: freezed == score + ? _self.score + : score // ignore: cast_nullable_to_non_nullable + as SmartphoneScore?, + verified: null == verified + ? _self.verified + : verified // ignore: cast_nullable_to_non_nullable + as bool, + sourceUrls: null == sourceUrls + ? _self._sourceUrls + : sourceUrls // ignore: cast_nullable_to_non_nullable + as List, + createdAt: freezed == createdAt + ? _self.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as String?, + updatedAt: freezed == updatedAt + ? _self.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as String?, + )); + } + + /// Create a copy of Smartphone + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $BrandCopyWith<$Res>? get brand { + if (_self.brand == null) { + return null; + } + + return $BrandCopyWith<$Res>(_self.brand!, (value) { + return _then(_self.copyWith(brand: value)); + }); + } + + /// Create a copy of Smartphone + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $SocCopyWith<$Res>? get soc { + if (_self.soc == null) { + return null; + } + + return $SocCopyWith<$Res>(_self.soc!, (value) { + return _then(_self.copyWith(soc: value)); + }); + } + + /// Create a copy of Smartphone + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $DisplayCopyWith<$Res>? get display { + if (_self.display == null) { + return null; + } + + return $DisplayCopyWith<$Res>(_self.display!, (value) { + return _then(_self.copyWith(display: value)); + }); + } + + /// Create a copy of Smartphone + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $DimensionsCopyWith<$Res>? get dimensions { + if (_self.dimensions == null) { + return null; + } + + return $DimensionsCopyWith<$Res>(_self.dimensions!, (value) { + return _then(_self.copyWith(dimensions: value)); + }); + } + + /// Create a copy of Smartphone + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ConnectivityCopyWith<$Res>? get connectivity { + if (_self.connectivity == null) { + return null; + } + + return $ConnectivityCopyWith<$Res>(_self.connectivity!, (value) { + return _then(_self.copyWith(connectivity: value)); + }); + } + + /// Create a copy of Smartphone + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $SmartphoneScoreCopyWith<$Res>? get score { + if (_self.score == null) { + return null; + } + + return $SmartphoneScoreCopyWith<$Res>(_self.score!, (value) { + return _then(_self.copyWith(score: value)); + }); + } +} + +// dart format on diff --git a/lib/data/dto/smartphone.g.dart b/lib/data/dto/smartphone.g.dart new file mode 100644 index 0000000..ecddd90 --- /dev/null +++ b/lib/data/dto/smartphone.g.dart @@ -0,0 +1,162 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'smartphone.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_Display _$DisplayFromJson(Map json) => _Display( + sizeInch: (json['size_inch'] as num?)?.toDouble(), + resolution: json['resolution'] as String?, + refreshHz: (json['refresh_hz'] as num?)?.toInt(), + type: json['type'] as String?, + ppi: (json['ppi'] as num?)?.toInt(), + brightnessNits: (json['brightness_nits'] as num?)?.toInt(), + ); + +Map _$DisplayToJson(_Display instance) => { + 'size_inch': instance.sizeInch, + 'resolution': instance.resolution, + 'refresh_hz': instance.refreshHz, + 'type': instance.type, + 'ppi': instance.ppi, + 'brightness_nits': instance.brightnessNits, + }; + +_Camera _$CameraFromJson(Map json) => _Camera( + type: json['type'] as String?, + mp: (json['mp'] as num?)?.toDouble(), + aperture: (json['aperture'] as num?)?.toDouble(), + ois: json['ois'] as bool?, + sensor: json['sensor'] as String?, + opticalZoom: (json['optical_zoom'] as num?)?.toDouble(), + ); + +Map _$CameraToJson(_Camera instance) => { + 'type': instance.type, + 'mp': instance.mp, + 'aperture': instance.aperture, + 'ois': instance.ois, + 'sensor': instance.sensor, + 'optical_zoom': instance.opticalZoom, + }; + +_Dimensions _$DimensionsFromJson(Map json) => _Dimensions( + heightMm: (json['height_mm'] as num?)?.toDouble(), + widthMm: (json['width_mm'] as num?)?.toDouble(), + depthMm: (json['depth_mm'] as num?)?.toDouble(), + ); + +Map _$DimensionsToJson(_Dimensions instance) => + { + 'height_mm': instance.heightMm, + 'width_mm': instance.widthMm, + 'depth_mm': instance.depthMm, + }; + +_Connectivity _$ConnectivityFromJson(Map json) => + _Connectivity( + wifi: json['wifi'] as String?, + bluetooth: json['bluetooth'] as String?, + nfc: json['nfc'] as bool?, + usb: json['usb'] as String?, + ); + +Map _$ConnectivityToJson(_Connectivity instance) => + { + 'wifi': instance.wifi, + 'bluetooth': instance.bluetooth, + 'nfc': instance.nfc, + 'usb': instance.usb, + }; + +_Smartphone _$SmartphoneFromJson(Map json) => _Smartphone( + slug: json['slug'] as String, + name: json['name'] as String, + id: (json['id'] as num?)?.toInt(), + baseModelSlug: json['base_model_slug'] as String?, + brand: json['brand'] == null + ? null + : Brand.fromJson(json['brand'] as Map), + soc: json['soc'] == null + ? null + : Soc.fromJson(json['soc'] as Map), + releaseDate: json['release_date'] as String?, + msrpUsd: (json['msrp_usd'] as num?)?.toInt(), + ramGb: (json['ram_gb'] as num?)?.toInt(), + storageOptionsGb: (json['storage_options_gb'] as List?) + ?.map((e) => (e as num).toInt()) + .toList() ?? + const [], + variant: + json['variant'] as Map? ?? const {}, + display: json['display'] == null + ? null + : Display.fromJson(json['display'] as Map), + cameras: (json['cameras'] as List?) + ?.map((e) => Camera.fromJson(e as Map)) + .toList() ?? + const [], + batteryMah: (json['battery_mah'] as num?)?.toInt(), + chargingWiredW: (json['charging_wired_w'] as num?)?.toInt(), + chargingWirelessW: (json['charging_wireless_w'] as num?)?.toInt(), + weightG: (json['weight_g'] as num?)?.toDouble(), + dimensions: json['dimensions'] == null + ? null + : Dimensions.fromJson(json['dimensions'] as Map), + ipRating: json['ip_rating'] as String?, + os: json['os'] as String?, + osVersion: json['os_version'] as String?, + connectivity: json['connectivity'] == null + ? null + : Connectivity.fromJson(json['connectivity'] as Map), + imageUrl: json['image_url'] as String?, + images: (json['images'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], + score: json['score'] == null + ? null + : SmartphoneScore.fromJson(json['score'] as Map), + verified: json['verified'] as bool? ?? false, + sourceUrls: (json['source_urls'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], + createdAt: json['created_at'] as String?, + updatedAt: json['updated_at'] as String?, + ); + +Map _$SmartphoneToJson(_Smartphone instance) => + { + 'slug': instance.slug, + 'name': instance.name, + 'id': instance.id, + 'base_model_slug': instance.baseModelSlug, + 'brand': instance.brand?.toJson(), + 'soc': instance.soc?.toJson(), + 'release_date': instance.releaseDate, + 'msrp_usd': instance.msrpUsd, + 'ram_gb': instance.ramGb, + 'storage_options_gb': instance.storageOptionsGb, + 'variant': instance.variant, + 'display': instance.display?.toJson(), + 'cameras': instance.cameras.map((e) => e.toJson()).toList(), + 'battery_mah': instance.batteryMah, + 'charging_wired_w': instance.chargingWiredW, + 'charging_wireless_w': instance.chargingWirelessW, + 'weight_g': instance.weightG, + 'dimensions': instance.dimensions?.toJson(), + 'ip_rating': instance.ipRating, + 'os': instance.os, + 'os_version': instance.osVersion, + 'connectivity': instance.connectivity?.toJson(), + 'image_url': instance.imageUrl, + 'images': instance.images, + 'score': instance.score?.toJson(), + 'verified': instance.verified, + 'source_urls': instance.sourceUrls, + 'created_at': instance.createdAt, + 'updated_at': instance.updatedAt, + }; diff --git a/lib/data/dto/soc.dart b/lib/data/dto/soc.dart new file mode 100644 index 0000000..98ee0df --- /dev/null +++ b/lib/data/dto/soc.dart @@ -0,0 +1,61 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +import 'brand.dart'; +import 'score.dart'; + +part 'soc.freezed.dart'; +part 'soc.g.dart'; + +/// SoC의 CPU 클러스터 구성. +@freezed +abstract class CpuConfig with _$CpuConfig { + const factory CpuConfig({ + /// 고성능 코어 수. + int? performance, + + /// 효율 코어 수. + int? efficiency, + String? architecture, + + /// 클러스터별 최대 클럭. 길이는 고정이 아니다. + @Default([]) List clocksGhz, + }) = _CpuConfig; + + factory CpuConfig.fromJson(Map json) => + _$CpuConfigFromJson(json); +} + +/// 모바일 SoC. +/// +/// 스마트폰 레코드에 임베드될 때는 `manufacturer`/`process_nm`/`gpu_name` +/// 정도만 채워져 온다. +@freezed +abstract class Soc with _$Soc { + const factory Soc({ + required String slug, + required String name, + int? id, + Brand? manufacturer, + String? releaseDate, + + /// 공정 (나노미터). + double? processNm, + double? transistorsBillion, + CpuConfig? cpuConfig, + String? gpuName, + int? gpuCores, + int? gpuClockMhz, + + /// NPU 연산 성능 (TOPS). + double? npuTops, + String? modem, + SocScore? score, + + /// 큐레이터가 출처를 검증했는지. 데이터셋 상당수가 false다. + @Default(false) bool verified, + @Default([]) List sourceUrls, + String? url, + }) = _Soc; + + factory Soc.fromJson(Map json) => _$SocFromJson(json); +} diff --git a/lib/data/dto/soc.freezed.dart b/lib/data/dto/soc.freezed.dart new file mode 100644 index 0000000..1ebd0f9 --- /dev/null +++ b/lib/data/dto/soc.freezed.dart @@ -0,0 +1,1265 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'soc.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$CpuConfig { + /// 고성능 코어 수. + int? get performance; + + /// 효율 코어 수. + int? get efficiency; + String? get architecture; + + /// 클러스터별 최대 클럭. 길이는 고정이 아니다. + List get clocksGhz; + + /// Create a copy of CpuConfig + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $CpuConfigCopyWith get copyWith => + _$CpuConfigCopyWithImpl(this as CpuConfig, _$identity); + + /// Serializes this CpuConfig to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is CpuConfig && + (identical(other.performance, performance) || + other.performance == performance) && + (identical(other.efficiency, efficiency) || + other.efficiency == efficiency) && + (identical(other.architecture, architecture) || + other.architecture == architecture) && + const DeepCollectionEquality().equals(other.clocksGhz, clocksGhz)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, performance, efficiency, + architecture, const DeepCollectionEquality().hash(clocksGhz)); + + @override + String toString() { + return 'CpuConfig(performance: $performance, efficiency: $efficiency, architecture: $architecture, clocksGhz: $clocksGhz)'; + } +} + +/// @nodoc +abstract mixin class $CpuConfigCopyWith<$Res> { + factory $CpuConfigCopyWith(CpuConfig value, $Res Function(CpuConfig) _then) = + _$CpuConfigCopyWithImpl; + @useResult + $Res call( + {int? performance, + int? efficiency, + String? architecture, + List clocksGhz}); +} + +/// @nodoc +class _$CpuConfigCopyWithImpl<$Res> implements $CpuConfigCopyWith<$Res> { + _$CpuConfigCopyWithImpl(this._self, this._then); + + final CpuConfig _self; + final $Res Function(CpuConfig) _then; + + /// Create a copy of CpuConfig + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? performance = freezed, + Object? efficiency = freezed, + Object? architecture = freezed, + Object? clocksGhz = null, + }) { + return _then(_self.copyWith( + performance: freezed == performance + ? _self.performance + : performance // ignore: cast_nullable_to_non_nullable + as int?, + efficiency: freezed == efficiency + ? _self.efficiency + : efficiency // ignore: cast_nullable_to_non_nullable + as int?, + architecture: freezed == architecture + ? _self.architecture + : architecture // ignore: cast_nullable_to_non_nullable + as String?, + clocksGhz: null == clocksGhz + ? _self.clocksGhz + : clocksGhz // ignore: cast_nullable_to_non_nullable + as List, + )); + } +} + +/// Adds pattern-matching-related methods to [CpuConfig]. +extension CpuConfigPatterns on CpuConfig { + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap( + TResult Function(_CpuConfig value)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _CpuConfig() when $default != null: + return $default(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map( + TResult Function(_CpuConfig value) $default, + ) { + final _that = this; + switch (_that) { + case _CpuConfig(): + return $default(_that); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_CpuConfig value)? $default, + ) { + final _that = this; + switch (_that) { + case _CpuConfig() when $default != null: + return $default(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen( + TResult Function(int? performance, int? efficiency, String? architecture, + List clocksGhz)? + $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _CpuConfig() when $default != null: + return $default(_that.performance, _that.efficiency, _that.architecture, + _that.clocksGhz); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when( + TResult Function(int? performance, int? efficiency, String? architecture, + List clocksGhz) + $default, + ) { + final _that = this; + switch (_that) { + case _CpuConfig(): + return $default(_that.performance, _that.efficiency, _that.architecture, + _that.clocksGhz); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function(int? performance, int? efficiency, String? architecture, + List clocksGhz)? + $default, + ) { + final _that = this; + switch (_that) { + case _CpuConfig() when $default != null: + return $default(_that.performance, _that.efficiency, _that.architecture, + _that.clocksGhz); + case _: + return null; + } + } +} + +/// @nodoc +@JsonSerializable() +class _CpuConfig implements CpuConfig { + const _CpuConfig( + {this.performance, + this.efficiency, + this.architecture, + final List clocksGhz = const []}) + : _clocksGhz = clocksGhz; + factory _CpuConfig.fromJson(Map json) => + _$CpuConfigFromJson(json); + + /// 고성능 코어 수. + @override + final int? performance; + + /// 효율 코어 수. + @override + final int? efficiency; + @override + final String? architecture; + + /// 클러스터별 최대 클럭. 길이는 고정이 아니다. + final List _clocksGhz; + + /// 클러스터별 최대 클럭. 길이는 고정이 아니다. + @override + @JsonKey() + List get clocksGhz { + if (_clocksGhz is EqualUnmodifiableListView) return _clocksGhz; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_clocksGhz); + } + + /// Create a copy of CpuConfig + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$CpuConfigCopyWith<_CpuConfig> get copyWith => + __$CpuConfigCopyWithImpl<_CpuConfig>(this, _$identity); + + @override + Map toJson() { + return _$CpuConfigToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _CpuConfig && + (identical(other.performance, performance) || + other.performance == performance) && + (identical(other.efficiency, efficiency) || + other.efficiency == efficiency) && + (identical(other.architecture, architecture) || + other.architecture == architecture) && + const DeepCollectionEquality() + .equals(other._clocksGhz, _clocksGhz)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, performance, efficiency, + architecture, const DeepCollectionEquality().hash(_clocksGhz)); + + @override + String toString() { + return 'CpuConfig(performance: $performance, efficiency: $efficiency, architecture: $architecture, clocksGhz: $clocksGhz)'; + } +} + +/// @nodoc +abstract mixin class _$CpuConfigCopyWith<$Res> + implements $CpuConfigCopyWith<$Res> { + factory _$CpuConfigCopyWith( + _CpuConfig value, $Res Function(_CpuConfig) _then) = + __$CpuConfigCopyWithImpl; + @override + @useResult + $Res call( + {int? performance, + int? efficiency, + String? architecture, + List clocksGhz}); +} + +/// @nodoc +class __$CpuConfigCopyWithImpl<$Res> implements _$CpuConfigCopyWith<$Res> { + __$CpuConfigCopyWithImpl(this._self, this._then); + + final _CpuConfig _self; + final $Res Function(_CpuConfig) _then; + + /// Create a copy of CpuConfig + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? performance = freezed, + Object? efficiency = freezed, + Object? architecture = freezed, + Object? clocksGhz = null, + }) { + return _then(_CpuConfig( + performance: freezed == performance + ? _self.performance + : performance // ignore: cast_nullable_to_non_nullable + as int?, + efficiency: freezed == efficiency + ? _self.efficiency + : efficiency // ignore: cast_nullable_to_non_nullable + as int?, + architecture: freezed == architecture + ? _self.architecture + : architecture // ignore: cast_nullable_to_non_nullable + as String?, + clocksGhz: null == clocksGhz + ? _self._clocksGhz + : clocksGhz // ignore: cast_nullable_to_non_nullable + as List, + )); + } +} + +/// @nodoc +mixin _$Soc { + String get slug; + String get name; + int? get id; + Brand? get manufacturer; + String? get releaseDate; + + /// 공정 (나노미터). + double? get processNm; + double? get transistorsBillion; + CpuConfig? get cpuConfig; + String? get gpuName; + int? get gpuCores; + int? get gpuClockMhz; + + /// NPU 연산 성능 (TOPS). + double? get npuTops; + String? get modem; + SocScore? get score; + + /// 큐레이터가 출처를 검증했는지. 데이터셋 상당수가 false다. + bool get verified; + List get sourceUrls; + String? get url; + + /// Create a copy of Soc + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + $SocCopyWith get copyWith => + _$SocCopyWithImpl(this as Soc, _$identity); + + /// Serializes this Soc to a JSON map. + Map toJson(); + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is Soc && + (identical(other.slug, slug) || other.slug == slug) && + (identical(other.name, name) || other.name == name) && + (identical(other.id, id) || other.id == id) && + (identical(other.manufacturer, manufacturer) || + other.manufacturer == manufacturer) && + (identical(other.releaseDate, releaseDate) || + other.releaseDate == releaseDate) && + (identical(other.processNm, processNm) || + other.processNm == processNm) && + (identical(other.transistorsBillion, transistorsBillion) || + other.transistorsBillion == transistorsBillion) && + (identical(other.cpuConfig, cpuConfig) || + other.cpuConfig == cpuConfig) && + (identical(other.gpuName, gpuName) || other.gpuName == gpuName) && + (identical(other.gpuCores, gpuCores) || + other.gpuCores == gpuCores) && + (identical(other.gpuClockMhz, gpuClockMhz) || + other.gpuClockMhz == gpuClockMhz) && + (identical(other.npuTops, npuTops) || other.npuTops == npuTops) && + (identical(other.modem, modem) || other.modem == modem) && + (identical(other.score, score) || other.score == score) && + (identical(other.verified, verified) || + other.verified == verified) && + const DeepCollectionEquality() + .equals(other.sourceUrls, sourceUrls) && + (identical(other.url, url) || other.url == url)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + slug, + name, + id, + manufacturer, + releaseDate, + processNm, + transistorsBillion, + cpuConfig, + gpuName, + gpuCores, + gpuClockMhz, + npuTops, + modem, + score, + verified, + const DeepCollectionEquality().hash(sourceUrls), + url); + + @override + String toString() { + return 'Soc(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, releaseDate: $releaseDate, processNm: $processNm, transistorsBillion: $transistorsBillion, cpuConfig: $cpuConfig, gpuName: $gpuName, gpuCores: $gpuCores, gpuClockMhz: $gpuClockMhz, npuTops: $npuTops, modem: $modem, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; + } +} + +/// @nodoc +abstract mixin class $SocCopyWith<$Res> { + factory $SocCopyWith(Soc value, $Res Function(Soc) _then) = _$SocCopyWithImpl; + @useResult + $Res call( + {String slug, + String name, + int? id, + Brand? manufacturer, + String? releaseDate, + double? processNm, + double? transistorsBillion, + CpuConfig? cpuConfig, + String? gpuName, + int? gpuCores, + int? gpuClockMhz, + double? npuTops, + String? modem, + SocScore? score, + bool verified, + List sourceUrls, + String? url}); + + $BrandCopyWith<$Res>? get manufacturer; + $CpuConfigCopyWith<$Res>? get cpuConfig; + $SocScoreCopyWith<$Res>? get score; +} + +/// @nodoc +class _$SocCopyWithImpl<$Res> implements $SocCopyWith<$Res> { + _$SocCopyWithImpl(this._self, this._then); + + final Soc _self; + final $Res Function(Soc) _then; + + /// Create a copy of Soc + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? slug = null, + Object? name = null, + Object? id = freezed, + Object? manufacturer = freezed, + Object? releaseDate = freezed, + Object? processNm = freezed, + Object? transistorsBillion = freezed, + Object? cpuConfig = freezed, + Object? gpuName = freezed, + Object? gpuCores = freezed, + Object? gpuClockMhz = freezed, + Object? npuTops = freezed, + Object? modem = freezed, + Object? score = freezed, + Object? verified = null, + Object? sourceUrls = null, + Object? url = freezed, + }) { + return _then(_self.copyWith( + slug: null == slug + ? _self.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _self.name + : name // ignore: cast_nullable_to_non_nullable + as String, + id: freezed == id + ? _self.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + manufacturer: freezed == manufacturer + ? _self.manufacturer + : manufacturer // ignore: cast_nullable_to_non_nullable + as Brand?, + releaseDate: freezed == releaseDate + ? _self.releaseDate + : releaseDate // ignore: cast_nullable_to_non_nullable + as String?, + processNm: freezed == processNm + ? _self.processNm + : processNm // ignore: cast_nullable_to_non_nullable + as double?, + transistorsBillion: freezed == transistorsBillion + ? _self.transistorsBillion + : transistorsBillion // ignore: cast_nullable_to_non_nullable + as double?, + cpuConfig: freezed == cpuConfig + ? _self.cpuConfig + : cpuConfig // ignore: cast_nullable_to_non_nullable + as CpuConfig?, + gpuName: freezed == gpuName + ? _self.gpuName + : gpuName // ignore: cast_nullable_to_non_nullable + as String?, + gpuCores: freezed == gpuCores + ? _self.gpuCores + : gpuCores // ignore: cast_nullable_to_non_nullable + as int?, + gpuClockMhz: freezed == gpuClockMhz + ? _self.gpuClockMhz + : gpuClockMhz // ignore: cast_nullable_to_non_nullable + as int?, + npuTops: freezed == npuTops + ? _self.npuTops + : npuTops // ignore: cast_nullable_to_non_nullable + as double?, + modem: freezed == modem + ? _self.modem + : modem // ignore: cast_nullable_to_non_nullable + as String?, + score: freezed == score + ? _self.score + : score // ignore: cast_nullable_to_non_nullable + as SocScore?, + verified: null == verified + ? _self.verified + : verified // ignore: cast_nullable_to_non_nullable + as bool, + sourceUrls: null == sourceUrls + ? _self.sourceUrls + : sourceUrls // ignore: cast_nullable_to_non_nullable + as List, + url: freezed == url + ? _self.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + )); + } + + /// Create a copy of Soc + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $BrandCopyWith<$Res>? get manufacturer { + if (_self.manufacturer == null) { + return null; + } + + return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { + return _then(_self.copyWith(manufacturer: value)); + }); + } + + /// Create a copy of Soc + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $CpuConfigCopyWith<$Res>? get cpuConfig { + if (_self.cpuConfig == null) { + return null; + } + + return $CpuConfigCopyWith<$Res>(_self.cpuConfig!, (value) { + return _then(_self.copyWith(cpuConfig: value)); + }); + } + + /// Create a copy of Soc + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $SocScoreCopyWith<$Res>? get score { + if (_self.score == null) { + return null; + } + + return $SocScoreCopyWith<$Res>(_self.score!, (value) { + return _then(_self.copyWith(score: value)); + }); + } +} + +/// Adds pattern-matching-related methods to [Soc]. +extension SocPatterns on Soc { + /// A variant of `map` that fallback to returning `orElse`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeMap( + TResult Function(_Soc value)? $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Soc() when $default != null: + return $default(_that); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// Callbacks receives the raw object, upcasted. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case final Subclass2 value: + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult map( + TResult Function(_Soc value) $default, + ) { + final _that = this; + switch (_that) { + case _Soc(): + return $default(_that); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `map` that fallback to returning `null`. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case final Subclass value: + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_Soc value)? $default, + ) { + final _that = this; + switch (_that) { + case _Soc() when $default != null: + return $default(_that); + case _: + return null; + } + } + + /// A variant of `when` that fallback to an `orElse` callback. + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return orElse(); + /// } + /// ``` + + @optionalTypeArgs + TResult maybeWhen( + TResult Function( + String slug, + String name, + int? id, + Brand? manufacturer, + String? releaseDate, + double? processNm, + double? transistorsBillion, + CpuConfig? cpuConfig, + String? gpuName, + int? gpuCores, + int? gpuClockMhz, + double? npuTops, + String? modem, + SocScore? score, + bool verified, + List sourceUrls, + String? url)? + $default, { + required TResult orElse(), + }) { + final _that = this; + switch (_that) { + case _Soc() when $default != null: + return $default( + _that.slug, + _that.name, + _that.id, + _that.manufacturer, + _that.releaseDate, + _that.processNm, + _that.transistorsBillion, + _that.cpuConfig, + _that.gpuName, + _that.gpuCores, + _that.gpuClockMhz, + _that.npuTops, + _that.modem, + _that.score, + _that.verified, + _that.sourceUrls, + _that.url); + case _: + return orElse(); + } + } + + /// A `switch`-like method, using callbacks. + /// + /// As opposed to `map`, this offers destructuring. + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case Subclass2(:final field2): + /// return ...; + /// } + /// ``` + + @optionalTypeArgs + TResult when( + TResult Function( + String slug, + String name, + int? id, + Brand? manufacturer, + String? releaseDate, + double? processNm, + double? transistorsBillion, + CpuConfig? cpuConfig, + String? gpuName, + int? gpuCores, + int? gpuClockMhz, + double? npuTops, + String? modem, + SocScore? score, + bool verified, + List sourceUrls, + String? url) + $default, + ) { + final _that = this; + switch (_that) { + case _Soc(): + return $default( + _that.slug, + _that.name, + _that.id, + _that.manufacturer, + _that.releaseDate, + _that.processNm, + _that.transistorsBillion, + _that.cpuConfig, + _that.gpuName, + _that.gpuCores, + _that.gpuClockMhz, + _that.npuTops, + _that.modem, + _that.score, + _that.verified, + _that.sourceUrls, + _that.url); + case _: + throw StateError('Unexpected subclass'); + } + } + + /// A variant of `when` that fallback to returning `null` + /// + /// It is equivalent to doing: + /// ```dart + /// switch (sealedClass) { + /// case Subclass(:final field): + /// return ...; + /// case _: + /// return null; + /// } + /// ``` + + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function( + String slug, + String name, + int? id, + Brand? manufacturer, + String? releaseDate, + double? processNm, + double? transistorsBillion, + CpuConfig? cpuConfig, + String? gpuName, + int? gpuCores, + int? gpuClockMhz, + double? npuTops, + String? modem, + SocScore? score, + bool verified, + List sourceUrls, + String? url)? + $default, + ) { + final _that = this; + switch (_that) { + case _Soc() when $default != null: + return $default( + _that.slug, + _that.name, + _that.id, + _that.manufacturer, + _that.releaseDate, + _that.processNm, + _that.transistorsBillion, + _that.cpuConfig, + _that.gpuName, + _that.gpuCores, + _that.gpuClockMhz, + _that.npuTops, + _that.modem, + _that.score, + _that.verified, + _that.sourceUrls, + _that.url); + case _: + return null; + } + } +} + +/// @nodoc +@JsonSerializable() +class _Soc implements Soc { + const _Soc( + {required this.slug, + required this.name, + this.id, + this.manufacturer, + this.releaseDate, + this.processNm, + this.transistorsBillion, + this.cpuConfig, + this.gpuName, + this.gpuCores, + this.gpuClockMhz, + this.npuTops, + this.modem, + this.score, + this.verified = false, + final List sourceUrls = const [], + this.url}) + : _sourceUrls = sourceUrls; + factory _Soc.fromJson(Map json) => _$SocFromJson(json); + + @override + final String slug; + @override + final String name; + @override + final int? id; + @override + final Brand? manufacturer; + @override + final String? releaseDate; + + /// 공정 (나노미터). + @override + final double? processNm; + @override + final double? transistorsBillion; + @override + final CpuConfig? cpuConfig; + @override + final String? gpuName; + @override + final int? gpuCores; + @override + final int? gpuClockMhz; + + /// NPU 연산 성능 (TOPS). + @override + final double? npuTops; + @override + final String? modem; + @override + final SocScore? score; + + /// 큐레이터가 출처를 검증했는지. 데이터셋 상당수가 false다. + @override + @JsonKey() + final bool verified; + final List _sourceUrls; + @override + @JsonKey() + List get sourceUrls { + if (_sourceUrls is EqualUnmodifiableListView) return _sourceUrls; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_sourceUrls); + } + + @override + final String? url; + + /// Create a copy of Soc + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + @pragma('vm:prefer-inline') + _$SocCopyWith<_Soc> get copyWith => + __$SocCopyWithImpl<_Soc>(this, _$identity); + + @override + Map toJson() { + return _$SocToJson( + this, + ); + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _Soc && + (identical(other.slug, slug) || other.slug == slug) && + (identical(other.name, name) || other.name == name) && + (identical(other.id, id) || other.id == id) && + (identical(other.manufacturer, manufacturer) || + other.manufacturer == manufacturer) && + (identical(other.releaseDate, releaseDate) || + other.releaseDate == releaseDate) && + (identical(other.processNm, processNm) || + other.processNm == processNm) && + (identical(other.transistorsBillion, transistorsBillion) || + other.transistorsBillion == transistorsBillion) && + (identical(other.cpuConfig, cpuConfig) || + other.cpuConfig == cpuConfig) && + (identical(other.gpuName, gpuName) || other.gpuName == gpuName) && + (identical(other.gpuCores, gpuCores) || + other.gpuCores == gpuCores) && + (identical(other.gpuClockMhz, gpuClockMhz) || + other.gpuClockMhz == gpuClockMhz) && + (identical(other.npuTops, npuTops) || other.npuTops == npuTops) && + (identical(other.modem, modem) || other.modem == modem) && + (identical(other.score, score) || other.score == score) && + (identical(other.verified, verified) || + other.verified == verified) && + const DeepCollectionEquality() + .equals(other._sourceUrls, _sourceUrls) && + (identical(other.url, url) || other.url == url)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + slug, + name, + id, + manufacturer, + releaseDate, + processNm, + transistorsBillion, + cpuConfig, + gpuName, + gpuCores, + gpuClockMhz, + npuTops, + modem, + score, + verified, + const DeepCollectionEquality().hash(_sourceUrls), + url); + + @override + String toString() { + return 'Soc(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, releaseDate: $releaseDate, processNm: $processNm, transistorsBillion: $transistorsBillion, cpuConfig: $cpuConfig, gpuName: $gpuName, gpuCores: $gpuCores, gpuClockMhz: $gpuClockMhz, npuTops: $npuTops, modem: $modem, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; + } +} + +/// @nodoc +abstract mixin class _$SocCopyWith<$Res> implements $SocCopyWith<$Res> { + factory _$SocCopyWith(_Soc value, $Res Function(_Soc) _then) = + __$SocCopyWithImpl; + @override + @useResult + $Res call( + {String slug, + String name, + int? id, + Brand? manufacturer, + String? releaseDate, + double? processNm, + double? transistorsBillion, + CpuConfig? cpuConfig, + String? gpuName, + int? gpuCores, + int? gpuClockMhz, + double? npuTops, + String? modem, + SocScore? score, + bool verified, + List sourceUrls, + String? url}); + + @override + $BrandCopyWith<$Res>? get manufacturer; + @override + $CpuConfigCopyWith<$Res>? get cpuConfig; + @override + $SocScoreCopyWith<$Res>? get score; +} + +/// @nodoc +class __$SocCopyWithImpl<$Res> implements _$SocCopyWith<$Res> { + __$SocCopyWithImpl(this._self, this._then); + + final _Soc _self; + final $Res Function(_Soc) _then; + + /// Create a copy of Soc + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $Res call({ + Object? slug = null, + Object? name = null, + Object? id = freezed, + Object? manufacturer = freezed, + Object? releaseDate = freezed, + Object? processNm = freezed, + Object? transistorsBillion = freezed, + Object? cpuConfig = freezed, + Object? gpuName = freezed, + Object? gpuCores = freezed, + Object? gpuClockMhz = freezed, + Object? npuTops = freezed, + Object? modem = freezed, + Object? score = freezed, + Object? verified = null, + Object? sourceUrls = null, + Object? url = freezed, + }) { + return _then(_Soc( + slug: null == slug + ? _self.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _self.name + : name // ignore: cast_nullable_to_non_nullable + as String, + id: freezed == id + ? _self.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + manufacturer: freezed == manufacturer + ? _self.manufacturer + : manufacturer // ignore: cast_nullable_to_non_nullable + as Brand?, + releaseDate: freezed == releaseDate + ? _self.releaseDate + : releaseDate // ignore: cast_nullable_to_non_nullable + as String?, + processNm: freezed == processNm + ? _self.processNm + : processNm // ignore: cast_nullable_to_non_nullable + as double?, + transistorsBillion: freezed == transistorsBillion + ? _self.transistorsBillion + : transistorsBillion // ignore: cast_nullable_to_non_nullable + as double?, + cpuConfig: freezed == cpuConfig + ? _self.cpuConfig + : cpuConfig // ignore: cast_nullable_to_non_nullable + as CpuConfig?, + gpuName: freezed == gpuName + ? _self.gpuName + : gpuName // ignore: cast_nullable_to_non_nullable + as String?, + gpuCores: freezed == gpuCores + ? _self.gpuCores + : gpuCores // ignore: cast_nullable_to_non_nullable + as int?, + gpuClockMhz: freezed == gpuClockMhz + ? _self.gpuClockMhz + : gpuClockMhz // ignore: cast_nullable_to_non_nullable + as int?, + npuTops: freezed == npuTops + ? _self.npuTops + : npuTops // ignore: cast_nullable_to_non_nullable + as double?, + modem: freezed == modem + ? _self.modem + : modem // ignore: cast_nullable_to_non_nullable + as String?, + score: freezed == score + ? _self.score + : score // ignore: cast_nullable_to_non_nullable + as SocScore?, + verified: null == verified + ? _self.verified + : verified // ignore: cast_nullable_to_non_nullable + as bool, + sourceUrls: null == sourceUrls + ? _self._sourceUrls + : sourceUrls // ignore: cast_nullable_to_non_nullable + as List, + url: freezed == url + ? _self.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + )); + } + + /// Create a copy of Soc + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $BrandCopyWith<$Res>? get manufacturer { + if (_self.manufacturer == null) { + return null; + } + + return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { + return _then(_self.copyWith(manufacturer: value)); + }); + } + + /// Create a copy of Soc + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $CpuConfigCopyWith<$Res>? get cpuConfig { + if (_self.cpuConfig == null) { + return null; + } + + return $CpuConfigCopyWith<$Res>(_self.cpuConfig!, (value) { + return _then(_self.copyWith(cpuConfig: value)); + }); + } + + /// Create a copy of Soc + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $SocScoreCopyWith<$Res>? get score { + if (_self.score == null) { + return null; + } + + return $SocScoreCopyWith<$Res>(_self.score!, (value) { + return _then(_self.copyWith(score: value)); + }); + } +} + +// dart format on diff --git a/lib/data/dto/soc.g.dart b/lib/data/dto/soc.g.dart new file mode 100644 index 0000000..f8ab3dd --- /dev/null +++ b/lib/data/dto/soc.g.dart @@ -0,0 +1,74 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'soc.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_CpuConfig _$CpuConfigFromJson(Map json) => _CpuConfig( + performance: (json['performance'] as num?)?.toInt(), + efficiency: (json['efficiency'] as num?)?.toInt(), + architecture: json['architecture'] as String?, + clocksGhz: (json['clocks_ghz'] as List?) + ?.map((e) => (e as num).toDouble()) + .toList() ?? + const [], + ); + +Map _$CpuConfigToJson(_CpuConfig instance) => + { + 'performance': instance.performance, + 'efficiency': instance.efficiency, + 'architecture': instance.architecture, + 'clocks_ghz': instance.clocksGhz, + }; + +_Soc _$SocFromJson(Map json) => _Soc( + slug: json['slug'] as String, + name: json['name'] as String, + id: (json['id'] as num?)?.toInt(), + manufacturer: json['manufacturer'] == null + ? null + : Brand.fromJson(json['manufacturer'] as Map), + releaseDate: json['release_date'] as String?, + processNm: (json['process_nm'] as num?)?.toDouble(), + transistorsBillion: (json['transistors_billion'] as num?)?.toDouble(), + cpuConfig: json['cpu_config'] == null + ? null + : CpuConfig.fromJson(json['cpu_config'] as Map), + gpuName: json['gpu_name'] as String?, + gpuCores: (json['gpu_cores'] as num?)?.toInt(), + gpuClockMhz: (json['gpu_clock_mhz'] as num?)?.toInt(), + npuTops: (json['npu_tops'] as num?)?.toDouble(), + modem: json['modem'] as String?, + score: json['score'] == null + ? null + : SocScore.fromJson(json['score'] as Map), + verified: json['verified'] as bool? ?? false, + sourceUrls: (json['source_urls'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], + url: json['url'] as String?, + ); + +Map _$SocToJson(_Soc instance) => { + 'slug': instance.slug, + 'name': instance.name, + 'id': instance.id, + 'manufacturer': instance.manufacturer?.toJson(), + 'release_date': instance.releaseDate, + 'process_nm': instance.processNm, + 'transistors_billion': instance.transistorsBillion, + 'cpu_config': instance.cpuConfig?.toJson(), + 'gpu_name': instance.gpuName, + 'gpu_cores': instance.gpuCores, + 'gpu_clock_mhz': instance.gpuClockMhz, + 'npu_tops': instance.npuTops, + 'modem': instance.modem, + 'score': instance.score?.toJson(), + 'verified': instance.verified, + 'source_urls': instance.sourceUrls, + 'url': instance.url, + }; diff --git a/lib/data/repository/tech_api_repository.dart b/lib/data/repository/tech_api_repository.dart new file mode 100644 index 0000000..4098ccf --- /dev/null +++ b/lib/data/repository/tech_api_repository.dart @@ -0,0 +1,78 @@ +import '../../core/failure.dart'; +import '../../core/network/tech_api_client.dart'; +import '../../core/result.dart'; +import '../../domain/repository/device_repository.dart'; +import '../dto/brand.dart'; +import '../dto/collection_page.dart'; +import '../dto/cpu.dart'; +import '../dto/gpu.dart'; +import '../dto/smartphone.dart'; +import '../dto/soc.dart'; + +/// [TechApiClient] 위에 얹은 [DeviceRepository] 구현. +/// +/// 클라이언트가 던지는 [Failure]를 [Result]로 접고, JSON을 DTO로 바꾼다. +/// 파싱 도중 터지는 예외도 [ParseFailure]로 감싸 밖으로 새지 않게 한다. +class TechApiRepository implements DeviceRepository { + TechApiRepository({TechApiClient? client}) + : _client = client ?? TechApiClient(); + + final TechApiClient _client; + + @override + Future> smartphone(String slug) => + _detail('smartphones', slug, Smartphone.fromJson); + + @override + Future> cpu(String slug) => _detail('cpus', slug, Cpu.fromJson); + + @override + Future> gpu(String slug) => _detail('gpus', slug, Gpu.fromJson); + + @override + Future> soc(String slug) => _detail('socs', slug, Soc.fromJson); + + @override + Future> brand(String slug) => + _detail('brands', slug, Brand.fromJson); + + @override + Future> list(TechApiCollection collection) => + _guard(() async { + final json = await _client.getJson( + _client.source.list(collection.path), + collection: collection.path, + ); + return CollectionPage.fromJson(json); + }); + + @override + Future>> index() => _guard(() async { + return _client.getJson(_client.source.index()); + }); + + Future> _detail( + String collection, + String slug, + T Function(Map) parse, + ) => + _guard(() async { + final json = await _client.getJson( + _client.source.detail(collection, slug), + collection: collection, + slug: slug, + ); + return parse(json); + }); + + Future> _guard(Future Function() body) async { + try { + return Ok(await body()); + } on Failure catch (f) { + return Err(f); + } catch (e) { + // TypeError 등 DTO 파싱 실패. 스키마가 바뀌면 여기로 떨어진다. + return Err(ParseFailure('응답을 모델로 변환하지 못했다', cause: e)); + } + } +} diff --git a/lib/domain/repository/device_repository.dart b/lib/domain/repository/device_repository.dart new file mode 100644 index 0000000..914ae8c --- /dev/null +++ b/lib/domain/repository/device_repository.dart @@ -0,0 +1,47 @@ +import '../../core/result.dart'; +import '../../data/dto/brand.dart'; +import '../../data/dto/collection_page.dart'; +import '../../data/dto/cpu.dart'; +import '../../data/dto/gpu.dart'; +import '../../data/dto/smartphone.dart'; +import '../../data/dto/soc.dart'; + +/// 기기 데이터 조회. +/// +/// 구현은 데이터를 어디서 가져오는지(정적 덤프 / REST / 로컬 캐시)를 +/// 감춘다. 호출부는 [Result]만 다룬다. +abstract class DeviceRepository { + Future> smartphone(String slug); + Future> cpu(String slug); + Future> gpu(String slug); + Future> soc(String slug); + Future> brand(String slug); + + /// 컬렉션 전체 목록. + /// + /// 정적 덤프에서는 한 요청에 전부 돌아온다. 스마트폰은 93,000건이 + /// 넘으므로 호출 전에 크기를 고려할 것. + Future> list(TechApiCollection collection); + + /// 컬렉션별 레코드 수 등 API 메타 정보. + Future>> index(); +} + +/// API가 노출하는 컬렉션. +/// +/// 경로에 그대로 쓰이는 값이므로 오타를 컴파일 단계에서 막는다. +enum TechApiCollection { + smartphones('smartphones'), + cpus('cpus'), + gpus('gpus'), + socs('socs'), + brands('brands'), + laptops('laptops'), + monitors('monitors'), + tablets('tablets'), + watches('watches'); + + const TechApiCollection(this.path); + + final String path; +} diff --git a/pubspec.lock b/pubspec.lock index 8ccef44..540f213 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,14 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: "3b19a47f6ea7c2632760777c78174f47f6aec1e05f0cd611380d4593b8af1dbc" + url: "https://pub.dev" + source: hosted + version: "96.0.0" _flutterfire_internals: dependency: transitive description: @@ -9,6 +17,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.44" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "0c516bc4ad36a1a75759e54d5047cb9d15cded4459df01aa35a0b5ec7db2c2a0" + url: "https://pub.dev" + source: hosted + version: "10.2.0" animated_text_kit: dependency: "direct main" description: @@ -57,6 +73,54 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + build: + dependency: transitive + description: + name: build + sha256: "45d14a0fb23e018d8287c32fc98d726ce466b231928ed9b9200f29bd3ccd39ae" + url: "https://pub.dev" + source: hosted + version: "4.0.7" + build_config: + dependency: transitive + description: + name: build_config + sha256: "94eaf6708fe64408c632ef2689ca3777b112f9421306ccf4f8c84d7c5c9f83f8" + url: "https://pub.dev" + source: hosted + version: "1.3.2" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "79e05eaf15a48d7230b053a4363b8eaac0cc234bbd0134c3229455481f55cbc6" + url: "https://pub.dev" + source: hosted + version: "4.1.5" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "5367e521935b102bdf1e735d2aab461e36b2edca6517662d088dd04cc39f8d16" + url: "https://pub.dev" + source: hosted + version: "2.15.1" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: "31b24be6615ec7fcf70b3aa5a7469fe35826485e639a16dd7eb83ba30e4cc6a8" + url: "https://pub.dev" + source: hosted + version: "8.12.7" camera: dependency: "direct main" description: @@ -161,6 +225,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.19.1" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" cross_file: dependency: transitive description: @@ -193,6 +265,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.8" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "29f7ecc274a86d32920b1d9cfc7502fa87220da41ec60b55f329559d5732e2b2" + url: "https://pub.dev" + source: hosted + version: "3.1.7" device_info_plus: dependency: "direct main" description: @@ -209,6 +289,22 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.1" + dio: + dependency: "direct main" + description: + name: dio + sha256: "0df44ebba85e503958eb75d07eedd3c86275a58c1d3eda2f2ce8f0a2c3abbb3c" + url: "https://pub.dev" + source: hosted + version: "5.11.0" + dio_web_adapter: + dependency: transitive + description: + name: dio_web_adapter + sha256: "0786d0b7295a373de356fc0af4f6f1d0ab2844ed31b19dfc5e7556b70e24212c" + url: "https://pub.dev" + source: hosted + version: "2.2.1" easy_localization: dependency: "direct main" description: @@ -409,6 +505,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.2.3+4" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" fl_chart: dependency: "direct main" description: @@ -469,6 +573,30 @@ packages: description: flutter source: sdk version: "0.0.0" + freezed: + dependency: "direct dev" + description: + name: freezed + sha256: f23ea33b3863f119b58ed1b586e881a46bd28715ddcc4dbc33104524e3434131 + url: "https://pub.dev" + source: hosted + version: "3.2.5" + freezed_annotation: + dependency: "direct main" + description: + name: freezed_annotation + sha256: "7294967ff0a6d98638e7acb774aac3af2550777accd8149c90af5b014e6d44d8" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" google_generative_ai: dependency: transitive description: @@ -669,6 +797,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.2" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.dev" + source: hosted + version: "3.2.2" http_parser: dependency: transitive description: @@ -757,14 +893,30 @@ packages: url: "https://pub.dev" source: hosted version: "0.20.2" - json_annotation: + io: dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.dev" + source: hosted + version: "1.0.5" + json_annotation: + dependency: "direct main" description: name: json_annotation - sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + sha256: "2a743920d81b7910627f68ee2c9ac1fc0bfee32b9fc3403587d7c6791ca12f80" url: "https://pub.dev" source: hosted - version: "4.9.0" + version: "4.12.0" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + sha256: e45aefa0324f08c683caafbb94b72837aa6193c61822799c916e45f4a263113d + url: "https://pub.dev" + source: hosted + version: "6.14.1" leak_tracker: dependency: transitive description: @@ -797,6 +949,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.0" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" matcher: dependency: transitive description: @@ -829,6 +989,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.6" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" path: dependency: transitive description: @@ -933,6 +1101,30 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.8" + pool: + dependency: transitive + description: + name: pool + sha256: "978783255c543aa3586a1b3c21f6e9d720eb315376a915872c61ef8b5c20177d" + url: "https://pub.dev" + source: hosted + version: "1.5.2" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" + url: "https://pub.dev" + source: hosted + version: "1.5.0" quiver: dependency: transitive description: @@ -1029,11 +1221,43 @@ packages: url: "https://pub.dev" source: hosted version: "2.4.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" + source: hosted + version: "1.4.1" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" + url: "https://pub.dev" + source: hosted + version: "3.0.0" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.0" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: a603f1fb984a7391ae5978d1b92bfaaa08b350dca5c825256f925818f7943bf5 + url: "https://pub.dev" + source: hosted + version: "4.2.4" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: "5e6f216fdf6376c9f3852381ae037499797a3385377d388b011dac98d303c67c" + url: "https://pub.dev" + source: hosted + version: "1.3.13" source_span: dependency: transitive description: @@ -1186,6 +1410,14 @@ packages: url: "https://pub.dev" source: hosted version: "14.2.5" + watcher: + dependency: transitive + description: + name: watcher + sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635" + url: "https://pub.dev" + source: hosted + version: "1.2.1" web: dependency: transitive description: @@ -1194,6 +1426,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + url: "https://pub.dev" + source: hosted + version: "3.0.3" webview_flutter: dependency: "direct main" description: @@ -1267,5 +1515,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.10.0-0 <4.0.0" + dart: ">=3.11.0 <4.0.0" flutter: ">=3.35.1" diff --git a/pubspec.yaml b/pubspec.yaml index 695bd25..87a2f5a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ^3.5.0 + # json_serializable 6.14+ 가 ^3.8.0 이상을 요구한다. + sdk: ^3.8.0 dependencies: flutter: @@ -38,6 +39,9 @@ dependencies: camera: ^0.11.0+2 google_ml_kit: ^0.19.0 tflite_flutter: ^0.11.0 + dio: ^5.11.0 + freezed_annotation: ^3.1.0 + json_annotation: ^4.12.0 @@ -47,6 +51,9 @@ dev_dependencies: flutter_lints: ^4.0.0 flutter_native_splash: ^2.4.1 + build_runner: ^2.15.1 + freezed: ^3.0.0 + json_serializable: ^6.14.1 flutter: diff --git a/test/fixtures/brand_samsung.json b/test/fixtures/brand_samsung.json new file mode 100644 index 0000000..833369b --- /dev/null +++ b/test/fixtures/brand_samsung.json @@ -0,0 +1,15 @@ +{ + "id": 113, + "slug": "samsung", + "name": "Samsung", + "country": "KR", + "founded_year": 1969, + "logo_url": "https://commons.wikimedia.org/wiki/Special:FilePath/Samsung_wordmark.svg", + "website": "https://www.samsung.com", + "source_urls": [ + "https://www.samsung.com" + ], + "description_en": "South Korean multinational electronics manufacturer; makes Galaxy smartphones and Exynos SoCs.", + "description_ko": "대한민국의 다국적 전자기기 제조사. 갤럭시 스마트폰과 엑시노스 SoC를 생산.", + "url": "/v1/brands/samsung" +} diff --git a/test/fixtures/brands_list.json b/test/fixtures/brands_list.json new file mode 100644 index 0000000..a30214a --- /dev/null +++ b/test/fixtures/brands_list.json @@ -0,0 +1,30 @@ +{ + "count": 207, + "results": [ + { + "slug": "3dfx", + "name": "3dfx Interactive", + "url": "/v1/brands/3dfx" + }, + { + "slug": "amd", + "name": "AMD", + "url": "/v1/brands/amd" + }, + { + "slug": "aoc", + "name": "AOC", + "url": "/v1/brands/aoc" + }, + { + "slug": "aopen", + "name": "AOpen", + "url": "/v1/brands/aopen" + }, + { + "slug": "asrock", + "name": "ASRock", + "url": "/v1/brands/asrock" + } + ] +} \ No newline at end of file diff --git a/test/fixtures/cpu_ryzen_9950x3d.json b/test/fixtures/cpu_ryzen_9950x3d.json new file mode 100644 index 0000000..56f7f51 --- /dev/null +++ b/test/fixtures/cpu_ryzen_9950x3d.json @@ -0,0 +1,57 @@ +{ + "id": 1281, + "slug": "ryzen-9-9950x3d", + "name": "AMD Ryzen 9 9950X3D", + "manufacturer": { + "slug": "amd", + "name": "AMD", + "url": "/v1/brands/amd" + }, + "release_date": "2025-03-31", + "segment": "desktop", + "architecture": "Zen 5", + "socket": "AM5", + "process_node": "TSMC N4", + "cores": 16, + "threads": 32, + "p_cores": null, + "e_cores": null, + "base_clock_ghz": 4.3, + "boost_clock_ghz": 5.7, + "l3_cache_mb": 144.0, + "tdp_w": 170, + "max_tdp_w": 230, + "integrated_graphics": null, + "memory_support": "DDR5-5600", + "msrp_usd": 699, + "score": { + "algorithm_version": "2.0.0", + "overall": 82.9, + "single": { + "index": 99.2, + "percentile": 93.1, + "tier": "A", + "era": "2024-2026", + "source": "cinebench_r23_single" + }, + "multi": { + "index": 69.5, + "percentile": 70.0, + "tier": "B", + "era": "2024-2026", + "source": "cinebench_r23_multi" + } + }, + "verified": true, + "source_urls": [ + "https://www.amd.com/en/products/processors/desktops/ryzen/9000-series/amd-ryzen-9-9950x3d.html", + "https://en.wikipedia.org/wiki/Ryzen_9000_series", + "https://www.cpubenchmark.net/cpu.php?id=6549&cpu=AMD+Ryzen+9+9950X3D", + "https://technical.city/en/cpu/Ryzen-9-9950X3D", + "https://www.notebookcheck.net/Mobile-Processors-Benchmark-List.2436.0.html", + "https://www.topcpu.net/en/cpu-r/" + ], + "created_at": "2026-06-24T08:54:40.924573", + "updated_at": "2026-06-24T08:54:40.924584", + "url": "/v1/cpus/ryzen-9-9950x3d" +} diff --git a/test/fixtures/fixtures.dart b/test/fixtures/fixtures.dart new file mode 100644 index 0000000..a8a7bea --- /dev/null +++ b/test/fixtures/fixtures.dart @@ -0,0 +1,14 @@ +import 'dart:convert'; +import 'dart:io'; + +/// 픽스처는 실제 TechAPI 정적 덤프에서 그대로 내려받은 응답이다. +/// 손으로 만든 가짜가 아니므로 스키마가 바뀌면 테스트가 깨지고, 그게 의도다. +/// +/// 갱신: `dart run tool/refresh_fixtures.dart` +Map loadFixture(String name) { + final file = File('test/fixtures/$name.json'); + if (!file.existsSync()) { + throw StateError('픽스처가 없다: ${file.path}'); + } + return jsonDecode(file.readAsStringSync()) as Map; +} diff --git a/test/fixtures/gpu_rtx_5090.json b/test/fixtures/gpu_rtx_5090.json new file mode 100644 index 0000000..2166cab --- /dev/null +++ b/test/fixtures/gpu_rtx_5090.json @@ -0,0 +1,48 @@ +{ + "id": 1996, + "slug": "geforce-rtx-5090", + "name": "GeForce RTX 5090", + "manufacturer": { + "slug": "nvidia", + "name": "NVIDIA", + "url": "/v1/brands/nvidia" + }, + "architecture": "Blackwell", + "release_date": "2025-01-30", + "msrp_usd": 1999, + "cuda_cores": 21760, + "stream_processors": null, + "rt_cores": 170, + "tensor_cores": 680, + "memory_gb": 32.0, + "memory_type": "GDDR7", + "memory_bus_bit": 512, + "memory_bandwidth_gbps": 1792.0, + "base_clock_mhz": 2017, + "boost_clock_mhz": 2407, + "tdp_w": 575, + "pcie_version": "PCIe 5.0", + "fp32_tflops": 104.8, + "blender_score": 14972.12, + "score": { + "algorithm_version": "2.0.0", + "overall": 100.0, + "graphics": { + "index": 100.0, + "percentile": 100.0, + "tier": "S", + "era": "2024-2026", + "source": "timespy_score" + } + }, + "verified": true, + "source_urls": [ + "https://www.nvidia.com/en-us/geforce/graphics-cards/50-series/rtx-5090/", + "https://www.techpowerup.com/gpu-specs/geforce-rtx-5090.c4216", + "https://opendata.blender.org/snapshots/opendata-latest.zip", + "https://www.topcpu.net/en/gpu-r/3dmark-time-spy", + "https://www.videocardbenchmark.net/gpu_list.php", + "https://www.topcpu.net/en/gpu-r/" + ], + "url": "/v1/gpus/geforce-rtx-5090" +} diff --git a/test/fixtures/smartphone_galaxy_s25.json b/test/fixtures/smartphone_galaxy_s25.json new file mode 100644 index 0000000..7bcb11a --- /dev/null +++ b/test/fixtures/smartphone_galaxy_s25.json @@ -0,0 +1,113 @@ +{ + "id": 67244, + "slug": "galaxy-s25", + "base_model_slug": null, + "name": "Galaxy S25", + "brand": { + "id": 113, + "slug": "samsung", + "name": "Samsung", + "country": "KR", + "url": "/v1/brands/samsung" + }, + "soc": { + "id": 1780, + "slug": "snapdragon-8-elite", + "name": "Snapdragon 8 Elite", + "manufacturer": { + "slug": "qualcomm", + "name": "Qualcomm", + "url": "/v1/brands/qualcomm" + }, + "process_nm": 3.0, + "gpu_name": "Adreno 830", + "url": "/v1/socs/snapdragon-8-elite" + }, + "release_date": "2025-02-07", + "msrp_usd": 799, + "ram_gb": 12, + "storage_options_gb": [ + 128, + 256, + 512 + ], + "variant": {}, + "display": { + "size_inch": 6.2, + "resolution": "2340x1080", + "refresh_hz": 120, + "type": "Dynamic AMOLED 2X", + "brightness_nits": 2600, + "ppi": 416 + }, + "cameras": [ + { + "type": "main", + "mp": 50, + "aperture": 1.8, + "ois": true, + "sensor": "Samsung GN3" + }, + { + "type": "ultrawide", + "mp": 12, + "aperture": 2.2, + "ois": false + }, + { + "type": "telephoto", + "mp": 10, + "aperture": 2.4, + "ois": true, + "optical_zoom": 3 + }, + { + "type": "selfie", + "mp": 12, + "aperture": 2.2 + } + ], + "battery_mah": 4000, + "charging_wired_w": 25.0, + "charging_wireless_w": 15.0, + "weight_g": 162.0, + "dimensions": { + "height_mm": 146.9, + "width_mm": 70.5, + "depth_mm": 7.2 + }, + "ip_rating": "IP68", + "os": "Android", + "os_version": "15", + "connectivity": { + "wifi": "Wi-Fi 7", + "bluetooth": "5.4", + "nfc": true, + "usb": "USB-C 3.2" + }, + "image_url": "https://cdn.jsdelivr.net/gh/GetTechAPI/images/smartphones/galaxy-s25.webp", + "images": [], + "score": { + "algorithm_version": "2.0.0", + "overall": 60.8, + "performance": 88.9, + "camera": 36.1, + "battery": 54.4, + "display": 63.8, + "value": 59.0, + "perf": { + "index": 88.9, + "percentile": 92.0, + "tier": "A", + "era": "2024-2026", + "source": "geekbench" + } + }, + "verified": true, + "source_urls": [ + "https://www.samsung.com/global/galaxy/galaxy-s25/specs/", + "https://en.wikipedia.org/wiki/Samsung_Galaxy_S25" + ], + "created_at": "2026-06-24T08:54:18.111973", + "updated_at": "2026-06-24T08:54:18.111985" +} diff --git a/test/fixtures/smartphone_unscored.json b/test/fixtures/smartphone_unscored.json new file mode 100644 index 0000000..b9a1314 --- /dev/null +++ b/test/fixtures/smartphone_unscored.json @@ -0,0 +1,79 @@ +{ + "id": 11832, + "slug": "energy-200", + "base_model_slug": null, + "name": "Energy 200", + "brand": { + "id": 169, + "slug": "energizer", + "name": "Energizer", + "country": "US", + "url": "/v1/brands/energizer" + }, + "soc": { + "id": 666, + "slug": "energizer-mobile-platform-2015", + "name": "Energizer mobile platform 2015", + "manufacturer": { + "slug": "arm", + "name": "Arm", + "url": "/v1/brands/arm" + }, + "process_nm": 28.0, + "gpu_name": "Unknown mobile GPU", + "url": "/v1/socs/energizer-mobile-platform-2015" + }, + "release_date": "2015-01-01", + "msrp_usd": null, + "ram_gb": 1, + "storage_options_gb": [], + "variant": {}, + "display": { + "size_inch": 2.0, + "resolution": "240x320", + "type": "TFT, 256K colors", + "ppi": 200 + }, + "cameras": [ + { + "type": "main", + "mp": 1.3 + } + ], + "battery_mah": 1450, + "charging_wired_w": null, + "charging_wireless_w": null, + "weight_g": 122.0, + "dimensions": {}, + "ip_rating": null, + "os": "Feature phone", + "os_version": null, + "connectivity": { + "bluetooth": "2.1, A2DP, EDR", + "usb": "microUSB 2.0" + }, + "image_url": null, + "images": [], + "score": { + "algorithm_version": "2.0.0", + "overall": 13.3, + "performance": null, + "camera": 5.0, + "battery": 0.0, + "display": 35.0, + "value": null, + "perf": { + "index": null, + "percentile": null, + "tier": null, + "era": "2014-2016", + "source": null + } + }, + "verified": false, + "source_urls": [ + "https://www.kaggle.com/datasets/msainani/gsmarena-mobile-devices" + ], + "created_at": "2026-07-09T02:45:32.211691", + "updated_at": "2026-07-09T02:45:32.211691" +} diff --git a/test/fixtures/soc_snapdragon_8_elite.json b/test/fixtures/soc_snapdragon_8_elite.json new file mode 100644 index 0000000..83ff23e --- /dev/null +++ b/test/fixtures/soc_snapdragon_8_elite.json @@ -0,0 +1,53 @@ +{ + "id": 1780, + "slug": "snapdragon-8-elite", + "name": "Snapdragon 8 Elite", + "manufacturer": { + "slug": "qualcomm", + "name": "Qualcomm", + "url": "/v1/brands/qualcomm" + }, + "release_date": "2024-10-21", + "process_nm": 3.0, + "transistors_billion": null, + "cpu_config": { + "performance": 2, + "efficiency": 6, + "architecture": "Oryon (2nd gen)", + "clocks_ghz": [ + 4.32, + 3.53 + ] + }, + "gpu_name": "Adreno 830", + "gpu_cores": null, + "gpu_clock_mhz": 1100, + "npu_tops": 45.0, + "modem": "Snapdragon X80 5G", + "score": { + "algorithm_version": "2.0.0", + "overall": 96.7, + "cpu": { + "index": 97.3, + "percentile": 87.5, + "tier": "A", + "era": "2024-2026", + "source": "geekbench" + }, + "system": { + "index": 95.4, + "percentile": 84.4, + "tier": "A", + "era": "2024-2026", + "source": "antutu_score" + } + }, + "verified": true, + "source_urls": [ + "https://www.qualcomm.com/products/mobile/snapdragon/smartphones/snapdragon-8-series-mobile-platforms/snapdragon-8-elite-mobile-platform", + "https://en.wikipedia.org/wiki/Snapdragon_8_Elite" + ], + "created_at": "2026-06-24T08:53:43.920966", + "updated_at": "2026-06-24T08:53:43.920977", + "url": "/v1/socs/snapdragon-8-elite" +} diff --git a/test/fixtures/v1_index.json b/test/fixtures/v1_index.json new file mode 100644 index 0000000..d995a0f --- /dev/null +++ b/test/fixtures/v1_index.json @@ -0,0 +1,57 @@ +{ + "version": "v1", + "collections": { + "brands": { + "count": 207, + "url": "/v1/brands/index.json" + }, + "socs": { + "count": 2104, + "url": "/v1/socs/index.json", + "scored": 195 + }, + "smartphones": { + "count": 93396, + "url": "/v1/smartphones/index.json", + "scored": 93396 + }, + "tablets": { + "count": 3455, + "url": "/v1/tablets/index.json" + }, + "watches": { + "count": 433, + "url": "/v1/watches/index.json" + }, + "pdas": { + "count": 140, + "url": "/v1/pdas/index.json" + }, + "gpus": { + "count": 2030, + "url": "/v1/gpus/index.json", + "scored": 1768 + }, + "cpus": { + "count": 3977, + "url": "/v1/cpus/index.json", + "scored": 841 + }, + "laptops": { + "count": 1951, + "url": "/v1/laptops/index.json" + }, + "monitors": { + "count": 882, + "url": "/v1/monitors/index.json" + }, + "software": { + "count": 42493, + "url": "/v1/software/index.json" + }, + "websites": { + "count": 40084, + "url": "/v1/websites/index.json" + } + } +} diff --git a/test/unit/dto_parsing_test.dart b/test/unit/dto_parsing_test.dart new file mode 100644 index 0000000..d4e9110 --- /dev/null +++ b/test/unit/dto_parsing_test.dart @@ -0,0 +1,182 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:techpicks/data/dto/brand.dart'; +import 'package:techpicks/data/dto/collection_page.dart'; +import 'package:techpicks/data/dto/cpu.dart'; +import 'package:techpicks/data/dto/gpu.dart'; +import 'package:techpicks/data/dto/smartphone.dart'; +import 'package:techpicks/data/dto/soc.dart'; + +import '../fixtures/fixtures.dart'; + +void main() { + group('Smartphone', () { + test('galaxy-s25의 점수 5축과 종합을 뽑아낸다 (issue #4 완료 기준)', () { + final phone = + Smartphone.fromJson(loadFixture('smartphone_galaxy_s25')); + + expect(phone.slug, 'galaxy-s25'); + expect(phone.name, 'Galaxy S25'); + + final score = phone.score; + expect(score, isNotNull, reason: '갤럭시 S25는 점수가 산출된 기기다'); + expect(score!.overall, closeTo(60.8, 0.01)); + expect(score.performance, closeTo(88.9, 0.01)); + expect(score.camera, closeTo(36.1, 0.01)); + expect(score.battery, closeTo(54.4, 0.01)); + expect(score.display, closeTo(63.8, 0.01)); + expect(score.value, closeTo(59.0, 0.01)); + expect(score.algorithmVersion, '2.0.0'); + + // 성능 축의 근거 + expect(score.perf?.tier, 'A'); + expect(score.perf?.source, 'geekbench'); + expect(score.perf?.percentile, closeTo(92.0, 0.01)); + }); + + test('brand와 soc가 조인되어 있어 추가 요청이 필요 없다', () { + final phone = + Smartphone.fromJson(loadFixture('smartphone_galaxy_s25')); + + expect(phone.brand?.slug, 'samsung'); + expect(phone.brand?.country, 'KR'); + expect(phone.soc?.slug, 'snapdragon-8-elite'); + expect(phone.soc?.gpuName, 'Adreno 830'); + expect(phone.soc?.processNm, 3.0); + // SoC의 manufacturer는 id 없이 온다 — Brand.id가 nullable이어야 하는 이유 + expect(phone.soc?.manufacturer?.slug, 'qualcomm'); + expect(phone.soc?.manufacturer?.id, isNull); + }); + + test('중첩 스펙을 구조화해 읽는다', () { + final phone = + Smartphone.fromJson(loadFixture('smartphone_galaxy_s25')); + + expect(phone.display?.sizeInch, 6.2); + expect(phone.display?.refreshHz, 120); + expect(phone.display?.brightnessNits, 2600); + expect(phone.dimensions?.heightMm, closeTo(146.9, 0.01)); + expect(phone.connectivity?.nfc, isTrue); + expect(phone.connectivity?.wifi, 'Wi-Fi 7'); + expect(phone.storageOptionsGb, [128, 256, 512]); + + expect(phone.cameras, hasLength(4)); + final main = phone.cameras.firstWhere((c) => c.type == 'main'); + expect(main.mp, 50); + expect(main.ois, isTrue); + expect(main.sensor, 'Samsung GN3'); + // 셀피 카메라에는 ois/sensor가 없다 + final selfie = phone.cameras.firstWhere((c) => c.type == 'selfie'); + expect(selfie.ois, isNull); + expect(selfie.sensor, isNull); + }); + + test('점수 객체가 있어도 개별 축은 null일 수 있다', () { + // 저가·구형 기기. 데이터셋의 상당수가 이 형태다. + final phone = Smartphone.fromJson(loadFixture('smartphone_unscored')); + + expect(phone.score, isNotNull); + expect(phone.score!.overall, closeTo(13.3, 0.01)); + // 벤치마크 원본이 없어 비어 있는 축들 + expect(phone.score!.performance, isNull); + expect(phone.score!.value, isNull); + expect(phone.score!.perf?.index, isNull); + expect(phone.score!.perf?.tier, isNull); + // era만 채워져 온다 + expect(phone.score!.perf?.era, '2014-2016'); + }); + + test('빈 필드가 많은 레코드도 예외 없이 파싱된다', () { + final phone = Smartphone.fromJson(loadFixture('smartphone_unscored')); + + expect(phone.msrpUsd, isNull); + expect(phone.ipRating, isNull); + expect(phone.display?.refreshHz, isNull); + expect(phone.display?.brightnessNits, isNull); + expect(phone.verified, isFalse); + // 리스트형 필드는 null 대신 빈 리스트로 정규화된다 + expect(phone.images, isEmpty); + expect(phone.sourceUrls, isNotEmpty); + }); + }); + + group('Cpu', () { + test('싱글/멀티 축을 각각 읽는다', () { + final cpu = Cpu.fromJson(loadFixture('cpu_ryzen_9950x3d')); + + expect(cpu.slug, 'ryzen-9-9950x3d'); + expect(cpu.manufacturer?.slug, 'amd'); + expect(cpu.segment, 'desktop'); + expect(cpu.cores, 16); + expect(cpu.threads, 32); + expect(cpu.l3CacheMb, 144.0); + // 하이브리드 구조가 아니므로 비어 있다 + expect(cpu.pCores, isNull); + expect(cpu.eCores, isNull); + + expect(cpu.score?.overall, closeTo(82.9, 0.01)); + expect(cpu.score?.single?.tier, 'A'); + expect(cpu.score?.single?.source, 'cinebench_r23_single'); + expect(cpu.score?.multi?.tier, 'B'); + expect(cpu.verified, isTrue); + }); + }); + + group('Gpu', () { + test('그래픽 단일 축과 NVIDIA 전용 필드를 읽는다', () { + final gpu = Gpu.fromJson(loadFixture('gpu_rtx_5090')); + + expect(gpu.slug, 'geforce-rtx-5090'); + expect(gpu.cudaCores, 21760); + // AMD 전용 필드는 비어 있다 + expect(gpu.streamProcessors, isNull); + expect(gpu.memoryGb, 32.0); + expect(gpu.fp32Tflops, closeTo(104.8, 0.01)); + expect(gpu.pcieVersion, 'PCIe 5.0'); + + expect(gpu.score?.overall, 100.0); + expect(gpu.score?.graphics?.tier, 'S'); + }); + }); + + group('Soc', () { + test('cpu/system 두 축과 클러스터 구성을 읽는다', () { + final soc = Soc.fromJson(loadFixture('soc_snapdragon_8_elite')); + + expect(soc.slug, 'snapdragon-8-elite'); + expect(soc.processNm, 3.0); + expect(soc.npuTops, 45.0); + expect(soc.cpuConfig?.performance, 2); + expect(soc.cpuConfig?.efficiency, 6); + expect(soc.cpuConfig?.architecture, 'Oryon (2nd gen)'); + expect(soc.cpuConfig?.clocksGhz, [4.32, 3.53]); + + expect(soc.score?.cpu?.source, 'geekbench'); + expect(soc.score?.system?.source, 'antutu_score'); + }); + }); + + group('Brand', () { + test('상세는 한국어 설명까지 포함한다', () { + final brand = Brand.fromJson(loadFixture('brand_samsung')); + + expect(brand.slug, 'samsung'); + expect(brand.country, 'KR'); + expect(brand.foundedYear, 1969); + expect(brand.descriptionKo, contains('갤럭시')); + expect(brand.descriptionEn, isNotEmpty); + }); + }); + + group('CollectionPage', () { + test('목록은 slug/name/url만 담는다', () { + final page = CollectionPage.fromJson(loadFixture('brands_list')); + + expect(page.count, 207); + expect(page.results, isNotEmpty); + expect(page.results.first.slug, isNotEmpty); + // 정적 덤프에는 페이지네이션이 없다 + expect(page.next, isNull); + expect(page.previous, isNull); + }); + }); +} diff --git a/test/unit/tech_api_repository_test.dart b/test/unit/tech_api_repository_test.dart new file mode 100644 index 0000000..fdb8ab0 --- /dev/null +++ b/test/unit/tech_api_repository_test.dart @@ -0,0 +1,143 @@ +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:dio/dio.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:techpicks/core/failure.dart'; +import 'package:techpicks/core/network/tech_api_client.dart'; +import 'package:techpicks/core/network/tech_api_source.dart'; +import 'package:techpicks/core/result.dart'; +import 'package:techpicks/data/repository/tech_api_repository.dart'; +import 'package:techpicks/domain/repository/device_repository.dart'; + +import '../fixtures/fixtures.dart'; + +/// 네트워크를 타지 않고 정해진 응답을 돌려주는 어댑터. +class _StubAdapter implements HttpClientAdapter { + _StubAdapter(this.handler); + + final ResponseBody Function(RequestOptions options) handler; + final List requested = []; + + @override + Future fetch( + RequestOptions options, + Stream? requestStream, + Future? cancelFuture, + ) async { + requested.add(options.uri.toString()); + return handler(options); + } + + @override + void close({bool force = false}) {} +} + +ResponseBody _json(Object data, {int status = 200}) => ResponseBody.fromString( + jsonEncode(data), + status, + headers: { + Headers.contentTypeHeader: [Headers.jsonContentType], + }, + ); + +TechApiRepository _repoWith(_StubAdapter adapter) { + final dio = Dio()..httpClientAdapter = adapter; + return TechApiRepository( + client: TechApiClient(source: const DumpSource(), dio: dio), + ); +} + +void main() { + test('상세를 요청하면 덤프 URL을 치고 DTO로 돌려준다', () async { + final adapter = + _StubAdapter((_) => _json(loadFixture('smartphone_galaxy_s25'))); + final result = await _repoWith(adapter).smartphone('galaxy-s25'); + + expect(result.isOk, isTrue); + expect(result.valueOrNull?.name, 'Galaxy S25'); + expect( + adapter.requested.single, + 'https://gettechapi.github.io/TechAPI/v1/smartphones/galaxy-s25/index.json', + ); + }); + + test('404는 NotFoundFailure가 된다 — 큐레이션이 덜 된 slug', () async { + final adapter = _StubAdapter((_) => _json({}, status: 404)); + final result = await _repoWith(adapter).smartphone('없는-기기'); + + expect(result.isErr, isTrue); + final failure = result.failureOrNull; + expect(failure, isA()); + expect((failure! as NotFoundFailure).slug, '없는-기기'); + }); + + test('5xx는 ServerFailure로 상태 코드를 보존한다', () async { + final adapter = _StubAdapter((_) => _json({}, status: 503)); + final result = await _repoWith(adapter).cpu('ryzen-9-9950x3d'); + + expect(result.failureOrNull, isA()); + expect((result.failureOrNull! as ServerFailure).statusCode, 503); + }); + + test('연결 실패는 NetworkFailure가 된다', () async { + final adapter = _StubAdapter((options) { + throw DioException.connectionError( + requestOptions: options, + reason: '연결 거부', + ); + }); + final result = await _repoWith(adapter).gpu('geforce-rtx-5090'); + + expect(result.failureOrNull, isA()); + }); + + test('스키마가 어긋나면 예외 대신 ParseFailure로 접힌다', () async { + // slug가 없는 응답 — 필수 필드 위반 + final adapter = _StubAdapter((_) => _json({'name': '이름만 있음'})); + final result = await _repoWith(adapter).smartphone('galaxy-s25'); + + expect(result.isErr, isTrue); + expect(result.failureOrNull, isA()); + }); + + test('목록은 컬렉션 enum으로 경로를 만든다', () async { + final adapter = _StubAdapter((_) => _json(loadFixture('brands_list'))); + final result = + await _repoWith(adapter).list(TechApiCollection.brands); + + expect(result.valueOrNull?.count, 207); + expect( + adapter.requested.single, + 'https://gettechapi.github.io/TechAPI/v1/brands/index.json', + ); + }); + + test('인덱스는 컬렉션별 레코드 수를 담는다', () async { + final adapter = _StubAdapter((_) => _json(loadFixture('v1_index'))); + final result = await _repoWith(adapter).index(); + + final collections = + result.valueOrNull?['collections'] as Map?; + expect(collections, isNotNull); + expect(collections!['smartphones']['count'], greaterThan(90000)); + }); + + group('Result', () { + test('fold로 두 갈래를 하나로 접는다', () { + const ok = Ok(3); + const err = Err(NetworkFailure('끊김')); + + expect(ok.fold((v) => '값 $v', (f) => '실패'), '값 3'); + expect(err.fold((v) => '값 $v', (f) => '실패 ${f.message}'), '실패 끊김'); + }); + + test('map은 성공만 변환하고 실패는 통과시킨다', () { + const ok = Ok(3); + const err = Err(NetworkFailure('끊김')); + + expect(ok.map((v) => v * 2).valueOrNull, 6); + expect(err.map((v) => v * 2).failureOrNull, isA()); + }); + }); +} diff --git a/test/unit/tech_api_source_test.dart b/test/unit/tech_api_source_test.dart new file mode 100644 index 0000000..0207a61 --- /dev/null +++ b/test/unit/tech_api_source_test.dart @@ -0,0 +1,74 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:techpicks/core/network/tech_api_source.dart'; + +void main() { + group('DumpSource', () { + const source = DumpSource(); + + test('상세 경로 끝에 /index.json이 붙는다', () { + expect( + source.detail('smartphones', 'galaxy-s25').toString(), + 'https://gettechapi.github.io/TechAPI/v1/smartphones/galaxy-s25/index.json', + ); + }); + + test('목록과 인덱스도 디렉터리 형태다', () { + expect( + source.list('cpus').toString(), + 'https://gettechapi.github.io/TechAPI/v1/cpus/index.json', + ); + expect( + source.index().toString(), + 'https://gettechapi.github.io/TechAPI/v1/index.json', + ); + }); + + test('baseUrl을 바꾸면 로컬 덤프도 가리킬 수 있다', () { + const local = DumpSource(baseUrl: 'http://localhost:4321'); + expect( + local.detail('gpus', 'geforce-rtx-5090').toString(), + 'http://localhost:4321/v1/gpus/geforce-rtx-5090/index.json', + ); + }); + }); + + group('RestSource', () { + const source = RestSource(); + + test('덤프와 달리 /index.json이 없다', () { + expect( + source.detail('smartphones', 'galaxy-s25').toString(), + 'https://api.techapi.dev/v1/smartphones/galaxy-s25', + ); + expect(source.list('cpus').toString(), 'https://api.techapi.dev/v1/cpus'); + }); + }); + + test('두 소스의 차이는 /index.json 접미사뿐이다', () { + // 덤프가 실제 엔드포인트를 replay해 만들어지므로 응답 스키마는 동일하다. + // 전환 시 바뀌는 지점이 URL 조립 하나뿐임을 고정한다. + // + // 기본 DumpSource는 GitHub Pages 하위 경로(/TechAPI)를 갖기 때문에 + // 규칙만 비교하려고 같은 호스트 기준으로 맞춘다. + const dump = DumpSource(baseUrl: 'https://api.techapi.dev'); + const rest = RestSource(); + + for (final (collection, slug) in const [ + ('socs', 'snapdragon-8-elite'), + ('smartphones', 'galaxy-s25'), + ('cpus', 'ryzen-9-9950x3d'), + ]) { + expect( + dump.detail(collection, slug).toString(), + '${rest.detail(collection, slug)}/index.json', + ); + } + expect(dump.list('gpus').toString(), '${rest.list('gpus')}/index.json'); + }); + + test('기본 덤프 주소는 GitHub Pages 하위 경로를 포함한다', () { + // 리포지토리가 이 경로를 그대로 쓰므로 회귀를 막는다. + expect(DumpSource.defaultBaseUrl, 'https://gettechapi.github.io/TechAPI'); + expect(const DumpSource().index().path, '/TechAPI/v1/index.json'); + }); +} diff --git a/tool/smoke_techapi.dart b/tool/smoke_techapi.dart new file mode 100644 index 0000000..ba1fdea --- /dev/null +++ b/tool/smoke_techapi.dart @@ -0,0 +1,45 @@ +// 실제 TechAPI 정적 덤프를 한 번 쳐 보는 수동 스모크 테스트. +// +// 단위 테스트는 픽스처로 고정돼 있어 원격이 죽어도 통과한다. +// 이 스크립트는 그 반대로, 원격이 살아 있는지 확인한다. +// +// dart run tool/smoke_techapi.dart +// +// ignore_for_file: avoid_print — 콘솔 스크립트라 print가 출력 수단이다. +import 'package:techpicks/data/repository/tech_api_repository.dart'; +import 'package:techpicks/domain/repository/device_repository.dart'; + +Future main() async { + final repo = TechApiRepository(); + + final index = await repo.index(); + index.fold( + (json) { + final collections = json['collections'] as Map; + print('컬렉션 ${collections.length}개'); + collections.forEach((name, meta) { + print(' $name: ${(meta as Map)['count']}'); + }); + }, + (f) => print('인덱스 실패: $f'), + ); + + final phone = await repo.smartphone('galaxy-s25'); + phone.fold( + (p) { + final s = p.score; + print('\n${p.name} (${p.brand?.name}) — ${p.soc?.name}'); + print(' 종합 ${s?.overall} 성능 ${s?.performance} 카메라 ${s?.camera}'); + print(' 배터리 ${s?.battery} 화면 ${s?.display} 가치 ${s?.value}'); + print(' 등급 ${s?.perf?.tier} · 상위 ${s?.perf?.percentile}%'); + print(' 출처 ${p.sourceUrls.length}건'); + }, + (f) => print('상세 실패: $f'), + ); + + final missing = await repo.smartphone('존재하지-않는-기기'); + print('\n없는 slug -> ${missing.failureOrNull?.runtimeType}'); + + final brands = await repo.list(TechApiCollection.brands); + print('브랜드 목록 -> ${brands.valueOrNull?.count}건'); +} From 741bc94cb1633fee48e60811c5a526ac6923de25 Mon Sep 17 00:00:00 2001 From: Seungpyo1007 Date: Fri, 7 Aug 2026 16:39:15 +0900 Subject: [PATCH 2/2] fix: regenerate DTOs against the bumped language version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI의 코드 생성 최신성 검사가 잡아냈다. 재생성 결과가 커밋된 것과 4,873줄 삽입 / 9,005줄 삭제만큼 달랐다. 원인은 생성 시점과 pubspec 수정 순서. build_runner를 돌릴 때 environment.sdk 가 아직 ^3.5.0 이었고, json_serializable 이 요구하는 ^3.8.0 으로 올린 건 그 뒤였다. freezed 와 json_serializable 은 패키지의 language version 에 따라 다른 코드를 뽑기 때문에 생성물이 낡은 채로 남았다. 생성 로그에 "language version (3.5.0) does not match required range ^3.8.0" 경고가 떠 있었는데 SDK 제약만 올리고 재생성하지 않았다. 재생성 후 테스트 25건 그대로 통과. --- lib/data/dto/brand.freezed.dart | 821 ++--- lib/data/dto/brand.g.dart | 55 +- lib/data/dto/collection_page.freezed.dart | 1081 +++--- lib/data/dto/collection_page.g.dart | 11 +- lib/data/dto/cpu.freezed.dart | 1290 ++----- lib/data/dto/cpu.g.dart | 119 +- lib/data/dto/gpu.freezed.dart | 1290 ++----- lib/data/dto/gpu.g.dart | 119 +- lib/data/dto/score.freezed.dart | 3121 +++++++--------- lib/data/dto/score.g.dart | 88 +- lib/data/dto/smartphone.freezed.dart | 3902 +++++++-------------- lib/data/dto/smartphone.g.dart | 176 +- lib/data/dto/soc.freezed.dart | 1697 +++------ lib/data/dto/soc.g.dart | 108 +- 14 files changed, 4873 insertions(+), 9005 deletions(-) diff --git a/lib/data/dto/brand.freezed.dart b/lib/data/dto/brand.freezed.dart index d4be904..5921097 100644 --- a/lib/data/dto/brand.freezed.dart +++ b/lib/data/dto/brand.freezed.dart @@ -14,599 +14,306 @@ T _$identity(T value) => value; /// @nodoc mixin _$Brand { - String get slug; - String get name; - int? get id; - - /// ISO 3166-1 alpha-2 (예: `KR`). - String? get country; - int? get foundedYear; - String? get logoUrl; - String? get website; - - /// 설명은 언어별로 따로 온다. `?lang=` 파라미터가 아니라 별도 필드다. - String? get descriptionEn; - String? get descriptionKo; - - /// API 내부 상대 경로 (예: `/v1/brands/samsung`). - String? get url; - List get sourceUrls; - - /// Create a copy of Brand - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $BrandCopyWith get copyWith => - _$BrandCopyWithImpl(this as Brand, _$identity); + + String get slug; String get name; int? get id;/// ISO 3166-1 alpha-2 (예: `KR`). + String? get country; int? get foundedYear; String? get logoUrl; String? get website;/// 설명은 언어별로 따로 온다. `?lang=` 파라미터가 아니라 별도 필드다. + String? get descriptionEn; String? get descriptionKo;/// API 내부 상대 경로 (예: `/v1/brands/samsung`). + String? get url; List get sourceUrls; +/// Create a copy of Brand +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BrandCopyWith get copyWith => _$BrandCopyWithImpl(this as Brand, _$identity); /// Serializes this Brand to a JSON map. Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is Brand && - (identical(other.slug, slug) || other.slug == slug) && - (identical(other.name, name) || other.name == name) && - (identical(other.id, id) || other.id == id) && - (identical(other.country, country) || other.country == country) && - (identical(other.foundedYear, foundedYear) || - other.foundedYear == foundedYear) && - (identical(other.logoUrl, logoUrl) || other.logoUrl == logoUrl) && - (identical(other.website, website) || other.website == website) && - (identical(other.descriptionEn, descriptionEn) || - other.descriptionEn == descriptionEn) && - (identical(other.descriptionKo, descriptionKo) || - other.descriptionKo == descriptionKo) && - (identical(other.url, url) || other.url == url) && - const DeepCollectionEquality() - .equals(other.sourceUrls, sourceUrls)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - slug, - name, - id, - country, - foundedYear, - logoUrl, - website, - descriptionEn, - descriptionKo, - url, - const DeepCollectionEquality().hash(sourceUrls)); - - @override - String toString() { - return 'Brand(slug: $slug, name: $name, id: $id, country: $country, foundedYear: $foundedYear, logoUrl: $logoUrl, website: $website, descriptionEn: $descriptionEn, descriptionKo: $descriptionKo, url: $url, sourceUrls: $sourceUrls)'; - } + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Brand&&(identical(other.slug, slug) || other.slug == slug)&&(identical(other.name, name) || other.name == name)&&(identical(other.id, id) || other.id == id)&&(identical(other.country, country) || other.country == country)&&(identical(other.foundedYear, foundedYear) || other.foundedYear == foundedYear)&&(identical(other.logoUrl, logoUrl) || other.logoUrl == logoUrl)&&(identical(other.website, website) || other.website == website)&&(identical(other.descriptionEn, descriptionEn) || other.descriptionEn == descriptionEn)&&(identical(other.descriptionKo, descriptionKo) || other.descriptionKo == descriptionKo)&&(identical(other.url, url) || other.url == url)&&const DeepCollectionEquality().equals(other.sourceUrls, sourceUrls)); } -/// @nodoc -abstract mixin class $BrandCopyWith<$Res> { - factory $BrandCopyWith(Brand value, $Res Function(Brand) _then) = - _$BrandCopyWithImpl; - @useResult - $Res call( - {String slug, - String name, - int? id, - String? country, - int? foundedYear, - String? logoUrl, - String? website, - String? descriptionEn, - String? descriptionKo, - String? url, - List sourceUrls}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,slug,name,id,country,foundedYear,logoUrl,website,descriptionEn,descriptionKo,url,const DeepCollectionEquality().hash(sourceUrls)); + +@override +String toString() { + return 'Brand(slug: $slug, name: $name, id: $id, country: $country, foundedYear: $foundedYear, logoUrl: $logoUrl, website: $website, descriptionEn: $descriptionEn, descriptionKo: $descriptionKo, url: $url, sourceUrls: $sourceUrls)'; +} + + } /// @nodoc -class _$BrandCopyWithImpl<$Res> implements $BrandCopyWith<$Res> { +abstract mixin class $BrandCopyWith<$Res> { + factory $BrandCopyWith(Brand value, $Res Function(Brand) _then) = _$BrandCopyWithImpl; +@useResult +$Res call({ + String slug, String name, int? id, String? country, int? foundedYear, String? logoUrl, String? website, String? descriptionEn, String? descriptionKo, String? url, List sourceUrls +}); + + + + +} +/// @nodoc +class _$BrandCopyWithImpl<$Res> + implements $BrandCopyWith<$Res> { _$BrandCopyWithImpl(this._self, this._then); final Brand _self; final $Res Function(Brand) _then; - /// Create a copy of Brand - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? slug = null, - Object? name = null, - Object? id = freezed, - Object? country = freezed, - Object? foundedYear = freezed, - Object? logoUrl = freezed, - Object? website = freezed, - Object? descriptionEn = freezed, - Object? descriptionKo = freezed, - Object? url = freezed, - Object? sourceUrls = null, - }) { - return _then(_self.copyWith( - slug: null == slug - ? _self.slug - : slug // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _self.name - : name // ignore: cast_nullable_to_non_nullable - as String, - id: freezed == id - ? _self.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - country: freezed == country - ? _self.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - foundedYear: freezed == foundedYear - ? _self.foundedYear - : foundedYear // ignore: cast_nullable_to_non_nullable - as int?, - logoUrl: freezed == logoUrl - ? _self.logoUrl - : logoUrl // ignore: cast_nullable_to_non_nullable - as String?, - website: freezed == website - ? _self.website - : website // ignore: cast_nullable_to_non_nullable - as String?, - descriptionEn: freezed == descriptionEn - ? _self.descriptionEn - : descriptionEn // ignore: cast_nullable_to_non_nullable - as String?, - descriptionKo: freezed == descriptionKo - ? _self.descriptionKo - : descriptionKo // ignore: cast_nullable_to_non_nullable - as String?, - url: freezed == url - ? _self.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - sourceUrls: null == sourceUrls - ? _self.sourceUrls - : sourceUrls // ignore: cast_nullable_to_non_nullable - as List, - )); - } +/// Create a copy of Brand +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? slug = null,Object? name = null,Object? id = freezed,Object? country = freezed,Object? foundedYear = freezed,Object? logoUrl = freezed,Object? website = freezed,Object? descriptionEn = freezed,Object? descriptionKo = freezed,Object? url = freezed,Object? sourceUrls = null,}) { + return _then(_self.copyWith( +slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable +as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,foundedYear: freezed == foundedYear ? _self.foundedYear : foundedYear // ignore: cast_nullable_to_non_nullable +as int?,logoUrl: freezed == logoUrl ? _self.logoUrl : logoUrl // ignore: cast_nullable_to_non_nullable +as String?,website: freezed == website ? _self.website : website // ignore: cast_nullable_to_non_nullable +as String?,descriptionEn: freezed == descriptionEn ? _self.descriptionEn : descriptionEn // ignore: cast_nullable_to_non_nullable +as String?,descriptionKo: freezed == descriptionKo ? _self.descriptionKo : descriptionKo // ignore: cast_nullable_to_non_nullable +as String?,url: freezed == url ? _self.url : url // ignore: cast_nullable_to_non_nullable +as String?,sourceUrls: null == sourceUrls ? _self.sourceUrls : sourceUrls // ignore: cast_nullable_to_non_nullable +as List, + )); +} + } + /// Adds pattern-matching-related methods to [Brand]. extension BrandPatterns on Brand { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_Brand value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Brand() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } - - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_Brand value) $default, - ) { - final _that = this; - switch (_that) { - case _Brand(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } - - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_Brand value)? $default, - ) { - final _that = this; - switch (_that) { - case _Brand() when $default != null: - return $default(_that); - case _: - return null; - } - } - - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function( - String slug, - String name, - int? id, - String? country, - int? foundedYear, - String? logoUrl, - String? website, - String? descriptionEn, - String? descriptionKo, - String? url, - List sourceUrls)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Brand() when $default != null: - return $default( - _that.slug, - _that.name, - _that.id, - _that.country, - _that.foundedYear, - _that.logoUrl, - _that.website, - _that.descriptionEn, - _that.descriptionKo, - _that.url, - _that.sourceUrls); - case _: - return orElse(); - } - } - - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function( - String slug, - String name, - int? id, - String? country, - int? foundedYear, - String? logoUrl, - String? website, - String? descriptionEn, - String? descriptionKo, - String? url, - List sourceUrls) - $default, - ) { - final _that = this; - switch (_that) { - case _Brand(): - return $default( - _that.slug, - _that.name, - _that.id, - _that.country, - _that.foundedYear, - _that.logoUrl, - _that.website, - _that.descriptionEn, - _that.descriptionKo, - _that.url, - _that.sourceUrls); - case _: - throw StateError('Unexpected subclass'); - } - } - - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function( - String slug, - String name, - int? id, - String? country, - int? foundedYear, - String? logoUrl, - String? website, - String? descriptionEn, - String? descriptionKo, - String? url, - List sourceUrls)? - $default, - ) { - final _that = this; - switch (_that) { - case _Brand() when $default != null: - return $default( - _that.slug, - _that.name, - _that.id, - _that.country, - _that.foundedYear, - _that.logoUrl, - _that.website, - _that.descriptionEn, - _that.descriptionKo, - _that.url, - _that.sourceUrls); - case _: - return null; - } - } +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Brand value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Brand() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Brand value) $default,){ +final _that = this; +switch (_that) { +case _Brand(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Brand value)? $default,){ +final _that = this; +switch (_that) { +case _Brand() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String slug, String name, int? id, String? country, int? foundedYear, String? logoUrl, String? website, String? descriptionEn, String? descriptionKo, String? url, List sourceUrls)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Brand() when $default != null: +return $default(_that.slug,_that.name,_that.id,_that.country,_that.foundedYear,_that.logoUrl,_that.website,_that.descriptionEn,_that.descriptionKo,_that.url,_that.sourceUrls);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String slug, String name, int? id, String? country, int? foundedYear, String? logoUrl, String? website, String? descriptionEn, String? descriptionKo, String? url, List sourceUrls) $default,) {final _that = this; +switch (_that) { +case _Brand(): +return $default(_that.slug,_that.name,_that.id,_that.country,_that.foundedYear,_that.logoUrl,_that.website,_that.descriptionEn,_that.descriptionKo,_that.url,_that.sourceUrls);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String slug, String name, int? id, String? country, int? foundedYear, String? logoUrl, String? website, String? descriptionEn, String? descriptionKo, String? url, List sourceUrls)? $default,) {final _that = this; +switch (_that) { +case _Brand() when $default != null: +return $default(_that.slug,_that.name,_that.id,_that.country,_that.foundedYear,_that.logoUrl,_that.website,_that.descriptionEn,_that.descriptionKo,_that.url,_that.sourceUrls);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable() + class _Brand implements Brand { - const _Brand( - {required this.slug, - required this.name, - this.id, - this.country, - this.foundedYear, - this.logoUrl, - this.website, - this.descriptionEn, - this.descriptionKo, - this.url, - final List sourceUrls = const []}) - : _sourceUrls = sourceUrls; + const _Brand({required this.slug, required this.name, this.id, this.country, this.foundedYear, this.logoUrl, this.website, this.descriptionEn, this.descriptionKo, this.url, final List sourceUrls = const []}): _sourceUrls = sourceUrls; factory _Brand.fromJson(Map json) => _$BrandFromJson(json); - @override - final String slug; - @override - final String name; - @override - final int? id; - - /// ISO 3166-1 alpha-2 (예: `KR`). - @override - final String? country; - @override - final int? foundedYear; - @override - final String? logoUrl; - @override - final String? website; - - /// 설명은 언어별로 따로 온다. `?lang=` 파라미터가 아니라 별도 필드다. - @override - final String? descriptionEn; - @override - final String? descriptionKo; - - /// API 내부 상대 경로 (예: `/v1/brands/samsung`). - @override - final String? url; - final List _sourceUrls; - @override - @JsonKey() - List get sourceUrls { - if (_sourceUrls is EqualUnmodifiableListView) return _sourceUrls; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_sourceUrls); - } - - /// Create a copy of Brand - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$BrandCopyWith<_Brand> get copyWith => - __$BrandCopyWithImpl<_Brand>(this, _$identity); - - @override - Map toJson() { - return _$BrandToJson( - this, - ); - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _Brand && - (identical(other.slug, slug) || other.slug == slug) && - (identical(other.name, name) || other.name == name) && - (identical(other.id, id) || other.id == id) && - (identical(other.country, country) || other.country == country) && - (identical(other.foundedYear, foundedYear) || - other.foundedYear == foundedYear) && - (identical(other.logoUrl, logoUrl) || other.logoUrl == logoUrl) && - (identical(other.website, website) || other.website == website) && - (identical(other.descriptionEn, descriptionEn) || - other.descriptionEn == descriptionEn) && - (identical(other.descriptionKo, descriptionKo) || - other.descriptionKo == descriptionKo) && - (identical(other.url, url) || other.url == url) && - const DeepCollectionEquality() - .equals(other._sourceUrls, _sourceUrls)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - slug, - name, - id, - country, - foundedYear, - logoUrl, - website, - descriptionEn, - descriptionKo, - url, - const DeepCollectionEquality().hash(_sourceUrls)); - - @override - String toString() { - return 'Brand(slug: $slug, name: $name, id: $id, country: $country, foundedYear: $foundedYear, logoUrl: $logoUrl, website: $website, descriptionEn: $descriptionEn, descriptionKo: $descriptionKo, url: $url, sourceUrls: $sourceUrls)'; - } +@override final String slug; +@override final String name; +@override final int? id; +/// ISO 3166-1 alpha-2 (예: `KR`). +@override final String? country; +@override final int? foundedYear; +@override final String? logoUrl; +@override final String? website; +/// 설명은 언어별로 따로 온다. `?lang=` 파라미터가 아니라 별도 필드다. +@override final String? descriptionEn; +@override final String? descriptionKo; +/// API 내부 상대 경로 (예: `/v1/brands/samsung`). +@override final String? url; + final List _sourceUrls; +@override@JsonKey() List get sourceUrls { + if (_sourceUrls is EqualUnmodifiableListView) return _sourceUrls; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_sourceUrls); +} + + +/// Create a copy of Brand +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BrandCopyWith<_Brand> get copyWith => __$BrandCopyWithImpl<_Brand>(this, _$identity); + +@override +Map toJson() { + return _$BrandToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Brand&&(identical(other.slug, slug) || other.slug == slug)&&(identical(other.name, name) || other.name == name)&&(identical(other.id, id) || other.id == id)&&(identical(other.country, country) || other.country == country)&&(identical(other.foundedYear, foundedYear) || other.foundedYear == foundedYear)&&(identical(other.logoUrl, logoUrl) || other.logoUrl == logoUrl)&&(identical(other.website, website) || other.website == website)&&(identical(other.descriptionEn, descriptionEn) || other.descriptionEn == descriptionEn)&&(identical(other.descriptionKo, descriptionKo) || other.descriptionKo == descriptionKo)&&(identical(other.url, url) || other.url == url)&&const DeepCollectionEquality().equals(other._sourceUrls, _sourceUrls)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,slug,name,id,country,foundedYear,logoUrl,website,descriptionEn,descriptionKo,url,const DeepCollectionEquality().hash(_sourceUrls)); + +@override +String toString() { + return 'Brand(slug: $slug, name: $name, id: $id, country: $country, foundedYear: $foundedYear, logoUrl: $logoUrl, website: $website, descriptionEn: $descriptionEn, descriptionKo: $descriptionKo, url: $url, sourceUrls: $sourceUrls)'; +} + + } /// @nodoc abstract mixin class _$BrandCopyWith<$Res> implements $BrandCopyWith<$Res> { - factory _$BrandCopyWith(_Brand value, $Res Function(_Brand) _then) = - __$BrandCopyWithImpl; - @override - @useResult - $Res call( - {String slug, - String name, - int? id, - String? country, - int? foundedYear, - String? logoUrl, - String? website, - String? descriptionEn, - String? descriptionKo, - String? url, - List sourceUrls}); -} + factory _$BrandCopyWith(_Brand value, $Res Function(_Brand) _then) = __$BrandCopyWithImpl; +@override @useResult +$Res call({ + String slug, String name, int? id, String? country, int? foundedYear, String? logoUrl, String? website, String? descriptionEn, String? descriptionKo, String? url, List sourceUrls +}); + + + +} /// @nodoc -class __$BrandCopyWithImpl<$Res> implements _$BrandCopyWith<$Res> { +class __$BrandCopyWithImpl<$Res> + implements _$BrandCopyWith<$Res> { __$BrandCopyWithImpl(this._self, this._then); final _Brand _self; final $Res Function(_Brand) _then; - /// Create a copy of Brand - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? slug = null, - Object? name = null, - Object? id = freezed, - Object? country = freezed, - Object? foundedYear = freezed, - Object? logoUrl = freezed, - Object? website = freezed, - Object? descriptionEn = freezed, - Object? descriptionKo = freezed, - Object? url = freezed, - Object? sourceUrls = null, - }) { - return _then(_Brand( - slug: null == slug - ? _self.slug - : slug // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _self.name - : name // ignore: cast_nullable_to_non_nullable - as String, - id: freezed == id - ? _self.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - country: freezed == country - ? _self.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - foundedYear: freezed == foundedYear - ? _self.foundedYear - : foundedYear // ignore: cast_nullable_to_non_nullable - as int?, - logoUrl: freezed == logoUrl - ? _self.logoUrl - : logoUrl // ignore: cast_nullable_to_non_nullable - as String?, - website: freezed == website - ? _self.website - : website // ignore: cast_nullable_to_non_nullable - as String?, - descriptionEn: freezed == descriptionEn - ? _self.descriptionEn - : descriptionEn // ignore: cast_nullable_to_non_nullable - as String?, - descriptionKo: freezed == descriptionKo - ? _self.descriptionKo - : descriptionKo // ignore: cast_nullable_to_non_nullable - as String?, - url: freezed == url - ? _self.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - sourceUrls: null == sourceUrls - ? _self._sourceUrls - : sourceUrls // ignore: cast_nullable_to_non_nullable - as List, - )); - } +/// Create a copy of Brand +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? slug = null,Object? name = null,Object? id = freezed,Object? country = freezed,Object? foundedYear = freezed,Object? logoUrl = freezed,Object? website = freezed,Object? descriptionEn = freezed,Object? descriptionKo = freezed,Object? url = freezed,Object? sourceUrls = null,}) { + return _then(_Brand( +slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable +as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,foundedYear: freezed == foundedYear ? _self.foundedYear : foundedYear // ignore: cast_nullable_to_non_nullable +as int?,logoUrl: freezed == logoUrl ? _self.logoUrl : logoUrl // ignore: cast_nullable_to_non_nullable +as String?,website: freezed == website ? _self.website : website // ignore: cast_nullable_to_non_nullable +as String?,descriptionEn: freezed == descriptionEn ? _self.descriptionEn : descriptionEn // ignore: cast_nullable_to_non_nullable +as String?,descriptionKo: freezed == descriptionKo ? _self.descriptionKo : descriptionKo // ignore: cast_nullable_to_non_nullable +as String?,url: freezed == url ? _self.url : url // ignore: cast_nullable_to_non_nullable +as String?,sourceUrls: null == sourceUrls ? _self._sourceUrls : sourceUrls // ignore: cast_nullable_to_non_nullable +as List, + )); +} + + } // dart format on diff --git a/lib/data/dto/brand.g.dart b/lib/data/dto/brand.g.dart index b3b5c86..9aa8f68 100644 --- a/lib/data/dto/brand.g.dart +++ b/lib/data/dto/brand.g.dart @@ -7,32 +7,33 @@ part of 'brand.dart'; // ************************************************************************** _Brand _$BrandFromJson(Map json) => _Brand( - slug: json['slug'] as String, - name: json['name'] as String, - id: (json['id'] as num?)?.toInt(), - country: json['country'] as String?, - foundedYear: (json['founded_year'] as num?)?.toInt(), - logoUrl: json['logo_url'] as String?, - website: json['website'] as String?, - descriptionEn: json['description_en'] as String?, - descriptionKo: json['description_ko'] as String?, - url: json['url'] as String?, - sourceUrls: (json['source_urls'] as List?) - ?.map((e) => e as String) - .toList() ?? - const [], - ); + slug: json['slug'] as String, + name: json['name'] as String, + id: (json['id'] as num?)?.toInt(), + country: json['country'] as String?, + foundedYear: (json['founded_year'] as num?)?.toInt(), + logoUrl: json['logo_url'] as String?, + website: json['website'] as String?, + descriptionEn: json['description_en'] as String?, + descriptionKo: json['description_ko'] as String?, + url: json['url'] as String?, + sourceUrls: + (json['source_urls'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], +); Map _$BrandToJson(_Brand instance) => { - 'slug': instance.slug, - 'name': instance.name, - 'id': instance.id, - 'country': instance.country, - 'founded_year': instance.foundedYear, - 'logo_url': instance.logoUrl, - 'website': instance.website, - 'description_en': instance.descriptionEn, - 'description_ko': instance.descriptionKo, - 'url': instance.url, - 'source_urls': instance.sourceUrls, - }; + 'slug': instance.slug, + 'name': instance.name, + 'id': instance.id, + 'country': instance.country, + 'founded_year': instance.foundedYear, + 'logo_url': instance.logoUrl, + 'website': instance.website, + 'description_en': instance.descriptionEn, + 'description_ko': instance.descriptionKo, + 'url': instance.url, + 'source_urls': instance.sourceUrls, +}; diff --git a/lib/data/dto/collection_page.freezed.dart b/lib/data/dto/collection_page.freezed.dart index 0e27a79..01dc486 100644 --- a/lib/data/dto/collection_page.freezed.dart +++ b/lib/data/dto/collection_page.freezed.dart @@ -14,383 +14,316 @@ T _$identity(T value) => value; /// @nodoc mixin _$ResourceRef { - String get slug; - String get name; - String? get url; - /// Create a copy of ResourceRef - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $ResourceRefCopyWith get copyWith => - _$ResourceRefCopyWithImpl(this as ResourceRef, _$identity); + String get slug; String get name; String? get url; +/// Create a copy of ResourceRef +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ResourceRefCopyWith get copyWith => _$ResourceRefCopyWithImpl(this as ResourceRef, _$identity); /// Serializes this ResourceRef to a JSON map. Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is ResourceRef && - (identical(other.slug, slug) || other.slug == slug) && - (identical(other.name, name) || other.name == name) && - (identical(other.url, url) || other.url == url)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, slug, name, url); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ResourceRef&&(identical(other.slug, slug) || other.slug == slug)&&(identical(other.name, name) || other.name == name)&&(identical(other.url, url) || other.url == url)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,slug,name,url); - @override - String toString() { - return 'ResourceRef(slug: $slug, name: $name, url: $url)'; - } +@override +String toString() { + return 'ResourceRef(slug: $slug, name: $name, url: $url)'; } -/// @nodoc -abstract mixin class $ResourceRefCopyWith<$Res> { - factory $ResourceRefCopyWith( - ResourceRef value, $Res Function(ResourceRef) _then) = - _$ResourceRefCopyWithImpl; - @useResult - $Res call({String slug, String name, String? url}); + } /// @nodoc -class _$ResourceRefCopyWithImpl<$Res> implements $ResourceRefCopyWith<$Res> { +abstract mixin class $ResourceRefCopyWith<$Res> { + factory $ResourceRefCopyWith(ResourceRef value, $Res Function(ResourceRef) _then) = _$ResourceRefCopyWithImpl; +@useResult +$Res call({ + String slug, String name, String? url +}); + + + + +} +/// @nodoc +class _$ResourceRefCopyWithImpl<$Res> + implements $ResourceRefCopyWith<$Res> { _$ResourceRefCopyWithImpl(this._self, this._then); final ResourceRef _self; final $Res Function(ResourceRef) _then; - /// Create a copy of ResourceRef - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? slug = null, - Object? name = null, - Object? url = freezed, - }) { - return _then(_self.copyWith( - slug: null == slug - ? _self.slug - : slug // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _self.name - : name // ignore: cast_nullable_to_non_nullable - as String, - url: freezed == url - ? _self.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +/// Create a copy of ResourceRef +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? slug = null,Object? name = null,Object? url = freezed,}) { + return _then(_self.copyWith( +slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable +as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,url: freezed == url ? _self.url : url // ignore: cast_nullable_to_non_nullable +as String?, + )); } +} + + /// Adds pattern-matching-related methods to [ResourceRef]. extension ResourceRefPatterns on ResourceRef { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_ResourceRef value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _ResourceRef() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } - - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_ResourceRef value) $default, - ) { - final _that = this; - switch (_that) { - case _ResourceRef(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } - - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_ResourceRef value)? $default, - ) { - final _that = this; - switch (_that) { - case _ResourceRef() when $default != null: - return $default(_that); - case _: - return null; - } - } - - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function(String slug, String name, String? url)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _ResourceRef() when $default != null: - return $default(_that.slug, _that.name, _that.url); - case _: - return orElse(); - } - } - - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function(String slug, String name, String? url) $default, - ) { - final _that = this; - switch (_that) { - case _ResourceRef(): - return $default(_that.slug, _that.name, _that.url); - case _: - throw StateError('Unexpected subclass'); - } - } - - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(String slug, String name, String? url)? $default, - ) { - final _that = this; - switch (_that) { - case _ResourceRef() when $default != null: - return $default(_that.slug, _that.name, _that.url); - case _: - return null; - } - } +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ResourceRef value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ResourceRef() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ResourceRef value) $default,){ +final _that = this; +switch (_that) { +case _ResourceRef(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ResourceRef value)? $default,){ +final _that = this; +switch (_that) { +case _ResourceRef() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String slug, String name, String? url)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ResourceRef() when $default != null: +return $default(_that.slug,_that.name,_that.url);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String slug, String name, String? url) $default,) {final _that = this; +switch (_that) { +case _ResourceRef(): +return $default(_that.slug,_that.name,_that.url);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String slug, String name, String? url)? $default,) {final _that = this; +switch (_that) { +case _ResourceRef() when $default != null: +return $default(_that.slug,_that.name,_that.url);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable() + class _ResourceRef implements ResourceRef { const _ResourceRef({required this.slug, required this.name, this.url}); - factory _ResourceRef.fromJson(Map json) => - _$ResourceRefFromJson(json); - - @override - final String slug; - @override - final String name; - @override - final String? url; - - /// Create a copy of ResourceRef - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$ResourceRefCopyWith<_ResourceRef> get copyWith => - __$ResourceRefCopyWithImpl<_ResourceRef>(this, _$identity); - - @override - Map toJson() { - return _$ResourceRefToJson( - this, - ); - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _ResourceRef && - (identical(other.slug, slug) || other.slug == slug) && - (identical(other.name, name) || other.name == name) && - (identical(other.url, url) || other.url == url)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, slug, name, url); - - @override - String toString() { - return 'ResourceRef(slug: $slug, name: $name, url: $url)'; - } + factory _ResourceRef.fromJson(Map json) => _$ResourceRefFromJson(json); + +@override final String slug; +@override final String name; +@override final String? url; + +/// Create a copy of ResourceRef +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ResourceRefCopyWith<_ResourceRef> get copyWith => __$ResourceRefCopyWithImpl<_ResourceRef>(this, _$identity); + +@override +Map toJson() { + return _$ResourceRefToJson(this, ); } -/// @nodoc -abstract mixin class _$ResourceRefCopyWith<$Res> - implements $ResourceRefCopyWith<$Res> { - factory _$ResourceRefCopyWith( - _ResourceRef value, $Res Function(_ResourceRef) _then) = - __$ResourceRefCopyWithImpl; - @override - @useResult - $Res call({String slug, String name, String? url}); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ResourceRef&&(identical(other.slug, slug) || other.slug == slug)&&(identical(other.name, name) || other.name == name)&&(identical(other.url, url) || other.url == url)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,slug,name,url); + +@override +String toString() { + return 'ResourceRef(slug: $slug, name: $name, url: $url)'; } + +} + +/// @nodoc +abstract mixin class _$ResourceRefCopyWith<$Res> implements $ResourceRefCopyWith<$Res> { + factory _$ResourceRefCopyWith(_ResourceRef value, $Res Function(_ResourceRef) _then) = __$ResourceRefCopyWithImpl; +@override @useResult +$Res call({ + String slug, String name, String? url +}); + + + + +} /// @nodoc -class __$ResourceRefCopyWithImpl<$Res> implements _$ResourceRefCopyWith<$Res> { +class __$ResourceRefCopyWithImpl<$Res> + implements _$ResourceRefCopyWith<$Res> { __$ResourceRefCopyWithImpl(this._self, this._then); final _ResourceRef _self; final $Res Function(_ResourceRef) _then; - /// Create a copy of ResourceRef - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? slug = null, - Object? name = null, - Object? url = freezed, - }) { - return _then(_ResourceRef( - slug: null == slug - ? _self.slug - : slug // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _self.name - : name // ignore: cast_nullable_to_non_nullable - as String, - url: freezed == url - ? _self.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +/// Create a copy of ResourceRef +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? slug = null,Object? name = null,Object? url = freezed,}) { + return _then(_ResourceRef( +slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable +as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,url: freezed == url ? _self.url : url // ignore: cast_nullable_to_non_nullable +as String?, + )); } + +} + + /// @nodoc mixin _$CollectionPage { - int get count; - List get results; - String? get next; - String? get previous; - - /// Create a copy of CollectionPage - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $CollectionPageCopyWith get copyWith => - _$CollectionPageCopyWithImpl( - this as CollectionPage, _$identity); + + int get count; List get results; String? get next; String? get previous; +/// Create a copy of CollectionPage +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CollectionPageCopyWith get copyWith => _$CollectionPageCopyWithImpl(this as CollectionPage, _$identity); /// Serializes this CollectionPage to a JSON map. Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is CollectionPage && - (identical(other.count, count) || other.count == count) && - const DeepCollectionEquality().equals(other.results, results) && - (identical(other.next, next) || other.next == next) && - (identical(other.previous, previous) || - other.previous == previous)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, count, - const DeepCollectionEquality().hash(results), next, previous); - - @override - String toString() { - return 'CollectionPage(count: $count, results: $results, next: $next, previous: $previous)'; - } + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CollectionPage&&(identical(other.count, count) || other.count == count)&&const DeepCollectionEquality().equals(other.results, results)&&(identical(other.next, next) || other.next == next)&&(identical(other.previous, previous) || other.previous == previous)); } -/// @nodoc -abstract mixin class $CollectionPageCopyWith<$Res> { - factory $CollectionPageCopyWith( - CollectionPage value, $Res Function(CollectionPage) _then) = - _$CollectionPageCopyWithImpl; - @useResult - $Res call( - {int count, List results, String? next, String? previous}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,count,const DeepCollectionEquality().hash(results),next,previous); + +@override +String toString() { + return 'CollectionPage(count: $count, results: $results, next: $next, previous: $previous)'; } + +} + +/// @nodoc +abstract mixin class $CollectionPageCopyWith<$Res> { + factory $CollectionPageCopyWith(CollectionPage value, $Res Function(CollectionPage) _then) = _$CollectionPageCopyWithImpl; +@useResult +$Res call({ + int count, List results, String? next, String? previous +}); + + + + +} /// @nodoc class _$CollectionPageCopyWithImpl<$Res> implements $CollectionPageCopyWith<$Res> { @@ -399,279 +332,209 @@ class _$CollectionPageCopyWithImpl<$Res> final CollectionPage _self; final $Res Function(CollectionPage) _then; - /// Create a copy of CollectionPage - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? count = null, - Object? results = null, - Object? next = freezed, - Object? previous = freezed, - }) { - return _then(_self.copyWith( - count: null == count - ? _self.count - : count // ignore: cast_nullable_to_non_nullable - as int, - results: null == results - ? _self.results - : results // ignore: cast_nullable_to_non_nullable - as List, - next: freezed == next - ? _self.next - : next // ignore: cast_nullable_to_non_nullable - as String?, - previous: freezed == previous - ? _self.previous - : previous // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +/// Create a copy of CollectionPage +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? count = null,Object? results = null,Object? next = freezed,Object? previous = freezed,}) { + return _then(_self.copyWith( +count: null == count ? _self.count : count // ignore: cast_nullable_to_non_nullable +as int,results: null == results ? _self.results : results // ignore: cast_nullable_to_non_nullable +as List,next: freezed == next ? _self.next : next // ignore: cast_nullable_to_non_nullable +as String?,previous: freezed == previous ? _self.previous : previous // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + } + /// Adds pattern-matching-related methods to [CollectionPage]. extension CollectionPagePatterns on CollectionPage { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_CollectionPage value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _CollectionPage() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } - - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_CollectionPage value) $default, - ) { - final _that = this; - switch (_that) { - case _CollectionPage(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } - - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_CollectionPage value)? $default, - ) { - final _that = this; - switch (_that) { - case _CollectionPage() when $default != null: - return $default(_that); - case _: - return null; - } - } - - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function(int count, List results, String? next, - String? previous)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _CollectionPage() when $default != null: - return $default(_that.count, _that.results, _that.next, _that.previous); - case _: - return orElse(); - } - } - - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function(int count, List results, String? next, - String? previous) - $default, - ) { - final _that = this; - switch (_that) { - case _CollectionPage(): - return $default(_that.count, _that.results, _that.next, _that.previous); - case _: - throw StateError('Unexpected subclass'); - } - } - - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(int count, List results, String? next, - String? previous)? - $default, - ) { - final _that = this; - switch (_that) { - case _CollectionPage() when $default != null: - return $default(_that.count, _that.results, _that.next, _that.previous); - case _: - return null; - } - } +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CollectionPage value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CollectionPage() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CollectionPage value) $default,){ +final _that = this; +switch (_that) { +case _CollectionPage(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CollectionPage value)? $default,){ +final _that = this; +switch (_that) { +case _CollectionPage() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int count, List results, String? next, String? previous)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CollectionPage() when $default != null: +return $default(_that.count,_that.results,_that.next,_that.previous);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int count, List results, String? next, String? previous) $default,) {final _that = this; +switch (_that) { +case _CollectionPage(): +return $default(_that.count,_that.results,_that.next,_that.previous);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int count, List results, String? next, String? previous)? $default,) {final _that = this; +switch (_that) { +case _CollectionPage() when $default != null: +return $default(_that.count,_that.results,_that.next,_that.previous);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable() + class _CollectionPage implements CollectionPage { - const _CollectionPage( - {this.count = 0, - final List results = const [], - this.next, - this.previous}) - : _results = results; - factory _CollectionPage.fromJson(Map json) => - _$CollectionPageFromJson(json); - - @override - @JsonKey() - final int count; - final List _results; - @override - @JsonKey() - List get results { - if (_results is EqualUnmodifiableListView) return _results; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_results); - } - - @override - final String? next; - @override - final String? previous; - - /// Create a copy of CollectionPage - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$CollectionPageCopyWith<_CollectionPage> get copyWith => - __$CollectionPageCopyWithImpl<_CollectionPage>(this, _$identity); - - @override - Map toJson() { - return _$CollectionPageToJson( - this, - ); - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _CollectionPage && - (identical(other.count, count) || other.count == count) && - const DeepCollectionEquality().equals(other._results, _results) && - (identical(other.next, next) || other.next == next) && - (identical(other.previous, previous) || - other.previous == previous)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, count, - const DeepCollectionEquality().hash(_results), next, previous); - - @override - String toString() { - return 'CollectionPage(count: $count, results: $results, next: $next, previous: $previous)'; - } + const _CollectionPage({this.count = 0, final List results = const [], this.next, this.previous}): _results = results; + factory _CollectionPage.fromJson(Map json) => _$CollectionPageFromJson(json); + +@override@JsonKey() final int count; + final List _results; +@override@JsonKey() List get results { + if (_results is EqualUnmodifiableListView) return _results; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_results); } -/// @nodoc -abstract mixin class _$CollectionPageCopyWith<$Res> - implements $CollectionPageCopyWith<$Res> { - factory _$CollectionPageCopyWith( - _CollectionPage value, $Res Function(_CollectionPage) _then) = - __$CollectionPageCopyWithImpl; - @override - @useResult - $Res call( - {int count, List results, String? next, String? previous}); +@override final String? next; +@override final String? previous; + +/// Create a copy of CollectionPage +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CollectionPageCopyWith<_CollectionPage> get copyWith => __$CollectionPageCopyWithImpl<_CollectionPage>(this, _$identity); + +@override +Map toJson() { + return _$CollectionPageToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CollectionPage&&(identical(other.count, count) || other.count == count)&&const DeepCollectionEquality().equals(other._results, _results)&&(identical(other.next, next) || other.next == next)&&(identical(other.previous, previous) || other.previous == previous)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,count,const DeepCollectionEquality().hash(_results),next,previous); + +@override +String toString() { + return 'CollectionPage(count: $count, results: $results, next: $next, previous: $previous)'; } + +} + +/// @nodoc +abstract mixin class _$CollectionPageCopyWith<$Res> implements $CollectionPageCopyWith<$Res> { + factory _$CollectionPageCopyWith(_CollectionPage value, $Res Function(_CollectionPage) _then) = __$CollectionPageCopyWithImpl; +@override @useResult +$Res call({ + int count, List results, String? next, String? previous +}); + + + + +} /// @nodoc class __$CollectionPageCopyWithImpl<$Res> implements _$CollectionPageCopyWith<$Res> { @@ -680,35 +543,19 @@ class __$CollectionPageCopyWithImpl<$Res> final _CollectionPage _self; final $Res Function(_CollectionPage) _then; - /// Create a copy of CollectionPage - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? count = null, - Object? results = null, - Object? next = freezed, - Object? previous = freezed, - }) { - return _then(_CollectionPage( - count: null == count - ? _self.count - : count // ignore: cast_nullable_to_non_nullable - as int, - results: null == results - ? _self._results - : results // ignore: cast_nullable_to_non_nullable - as List, - next: freezed == next - ? _self.next - : next // ignore: cast_nullable_to_non_nullable - as String?, - previous: freezed == previous - ? _self.previous - : previous // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +/// Create a copy of CollectionPage +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? count = null,Object? results = null,Object? next = freezed,Object? previous = freezed,}) { + return _then(_CollectionPage( +count: null == count ? _self.count : count // ignore: cast_nullable_to_non_nullable +as int,results: null == results ? _self._results : results // ignore: cast_nullable_to_non_nullable +as List,next: freezed == next ? _self.next : next // ignore: cast_nullable_to_non_nullable +as String?,previous: freezed == previous ? _self.previous : previous // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + } // dart format on diff --git a/lib/data/dto/collection_page.g.dart b/lib/data/dto/collection_page.g.dart index eefec78..8f25a08 100644 --- a/lib/data/dto/collection_page.g.dart +++ b/lib/data/dto/collection_page.g.dart @@ -7,10 +7,10 @@ part of 'collection_page.dart'; // ************************************************************************** _ResourceRef _$ResourceRefFromJson(Map json) => _ResourceRef( - slug: json['slug'] as String, - name: json['name'] as String, - url: json['url'] as String?, - ); + slug: json['slug'] as String, + name: json['name'] as String, + url: json['url'] as String?, +); Map _$ResourceRefToJson(_ResourceRef instance) => { @@ -22,7 +22,8 @@ Map _$ResourceRefToJson(_ResourceRef instance) => _CollectionPage _$CollectionPageFromJson(Map json) => _CollectionPage( count: (json['count'] as num?)?.toInt() ?? 0, - results: (json['results'] as List?) + results: + (json['results'] as List?) ?.map((e) => ResourceRef.fromJson(e as Map)) .toList() ?? const [], diff --git a/lib/data/dto/cpu.freezed.dart b/lib/data/dto/cpu.freezed.dart index bdf238a..7b6aeeb 100644 --- a/lib/data/dto/cpu.freezed.dart +++ b/lib/data/dto/cpu.freezed.dart @@ -14,1044 +14,396 @@ T _$identity(T value) => value; /// @nodoc mixin _$Cpu { - String get slug; - String get name; - int? get id; - Brand? get manufacturer; - String? get releaseDate; - /// `desktop` / `laptop` / `server` 등. - String? get segment; - String? get architecture; - String? get socket; + String get slug; String get name; int? get id; Brand? get manufacturer; String? get releaseDate;/// `desktop` / `laptop` / `server` 등. + String? get segment; String? get architecture; String? get socket;/// 공정. CPU는 `TSMC N4` 같은 문자열이라 SoC의 `processNm`과 타입이 다르다. + String? get processNode; int? get cores; int? get threads;/// 하이브리드 구조에서만 채워진다. + int? get pCores; int? get eCores; double? get baseClockGhz; double? get boostClockGhz; double? get l3CacheMb; int? get tdpW; int? get maxTdpW; String? get integratedGraphics; String? get memorySupport; int? get msrpUsd; CpuScore? get score; bool get verified; List get sourceUrls; String? get url; +/// Create a copy of Cpu +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CpuCopyWith get copyWith => _$CpuCopyWithImpl(this as Cpu, _$identity); - /// 공정. CPU는 `TSMC N4` 같은 문자열이라 SoC의 `processNm`과 타입이 다르다. - String? get processNode; - int? get cores; - int? get threads; + /// Serializes this Cpu to a JSON map. + Map toJson(); - /// 하이브리드 구조에서만 채워진다. - int? get pCores; - int? get eCores; - double? get baseClockGhz; - double? get boostClockGhz; - double? get l3CacheMb; - int? get tdpW; - int? get maxTdpW; - String? get integratedGraphics; - String? get memorySupport; - int? get msrpUsd; - CpuScore? get score; - bool get verified; - List get sourceUrls; - String? get url; - /// Create a copy of Cpu - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $CpuCopyWith get copyWith => - _$CpuCopyWithImpl(this as Cpu, _$identity); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Cpu&&(identical(other.slug, slug) || other.slug == slug)&&(identical(other.name, name) || other.name == name)&&(identical(other.id, id) || other.id == id)&&(identical(other.manufacturer, manufacturer) || other.manufacturer == manufacturer)&&(identical(other.releaseDate, releaseDate) || other.releaseDate == releaseDate)&&(identical(other.segment, segment) || other.segment == segment)&&(identical(other.architecture, architecture) || other.architecture == architecture)&&(identical(other.socket, socket) || other.socket == socket)&&(identical(other.processNode, processNode) || other.processNode == processNode)&&(identical(other.cores, cores) || other.cores == cores)&&(identical(other.threads, threads) || other.threads == threads)&&(identical(other.pCores, pCores) || other.pCores == pCores)&&(identical(other.eCores, eCores) || other.eCores == eCores)&&(identical(other.baseClockGhz, baseClockGhz) || other.baseClockGhz == baseClockGhz)&&(identical(other.boostClockGhz, boostClockGhz) || other.boostClockGhz == boostClockGhz)&&(identical(other.l3CacheMb, l3CacheMb) || other.l3CacheMb == l3CacheMb)&&(identical(other.tdpW, tdpW) || other.tdpW == tdpW)&&(identical(other.maxTdpW, maxTdpW) || other.maxTdpW == maxTdpW)&&(identical(other.integratedGraphics, integratedGraphics) || other.integratedGraphics == integratedGraphics)&&(identical(other.memorySupport, memorySupport) || other.memorySupport == memorySupport)&&(identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd)&&(identical(other.score, score) || other.score == score)&&(identical(other.verified, verified) || other.verified == verified)&&const DeepCollectionEquality().equals(other.sourceUrls, sourceUrls)&&(identical(other.url, url) || other.url == url)); +} - /// Serializes this Cpu to a JSON map. - Map toJson(); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,slug,name,id,manufacturer,releaseDate,segment,architecture,socket,processNode,cores,threads,pCores,eCores,baseClockGhz,boostClockGhz,l3CacheMb,tdpW,maxTdpW,integratedGraphics,memorySupport,msrpUsd,score,verified,const DeepCollectionEquality().hash(sourceUrls),url]); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is Cpu && - (identical(other.slug, slug) || other.slug == slug) && - (identical(other.name, name) || other.name == name) && - (identical(other.id, id) || other.id == id) && - (identical(other.manufacturer, manufacturer) || - other.manufacturer == manufacturer) && - (identical(other.releaseDate, releaseDate) || - other.releaseDate == releaseDate) && - (identical(other.segment, segment) || other.segment == segment) && - (identical(other.architecture, architecture) || - other.architecture == architecture) && - (identical(other.socket, socket) || other.socket == socket) && - (identical(other.processNode, processNode) || - other.processNode == processNode) && - (identical(other.cores, cores) || other.cores == cores) && - (identical(other.threads, threads) || other.threads == threads) && - (identical(other.pCores, pCores) || other.pCores == pCores) && - (identical(other.eCores, eCores) || other.eCores == eCores) && - (identical(other.baseClockGhz, baseClockGhz) || - other.baseClockGhz == baseClockGhz) && - (identical(other.boostClockGhz, boostClockGhz) || - other.boostClockGhz == boostClockGhz) && - (identical(other.l3CacheMb, l3CacheMb) || - other.l3CacheMb == l3CacheMb) && - (identical(other.tdpW, tdpW) || other.tdpW == tdpW) && - (identical(other.maxTdpW, maxTdpW) || other.maxTdpW == maxTdpW) && - (identical(other.integratedGraphics, integratedGraphics) || - other.integratedGraphics == integratedGraphics) && - (identical(other.memorySupport, memorySupport) || - other.memorySupport == memorySupport) && - (identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd) && - (identical(other.score, score) || other.score == score) && - (identical(other.verified, verified) || - other.verified == verified) && - const DeepCollectionEquality() - .equals(other.sourceUrls, sourceUrls) && - (identical(other.url, url) || other.url == url)); - } +@override +String toString() { + return 'Cpu(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, releaseDate: $releaseDate, segment: $segment, architecture: $architecture, socket: $socket, processNode: $processNode, cores: $cores, threads: $threads, pCores: $pCores, eCores: $eCores, baseClockGhz: $baseClockGhz, boostClockGhz: $boostClockGhz, l3CacheMb: $l3CacheMb, tdpW: $tdpW, maxTdpW: $maxTdpW, integratedGraphics: $integratedGraphics, memorySupport: $memorySupport, msrpUsd: $msrpUsd, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hashAll([ - runtimeType, - slug, - name, - id, - manufacturer, - releaseDate, - segment, - architecture, - socket, - processNode, - cores, - threads, - pCores, - eCores, - baseClockGhz, - boostClockGhz, - l3CacheMb, - tdpW, - maxTdpW, - integratedGraphics, - memorySupport, - msrpUsd, - score, - verified, - const DeepCollectionEquality().hash(sourceUrls), - url - ]); - @override - String toString() { - return 'Cpu(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, releaseDate: $releaseDate, segment: $segment, architecture: $architecture, socket: $socket, processNode: $processNode, cores: $cores, threads: $threads, pCores: $pCores, eCores: $eCores, baseClockGhz: $baseClockGhz, boostClockGhz: $boostClockGhz, l3CacheMb: $l3CacheMb, tdpW: $tdpW, maxTdpW: $maxTdpW, integratedGraphics: $integratedGraphics, memorySupport: $memorySupport, msrpUsd: $msrpUsd, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; - } } /// @nodoc -abstract mixin class $CpuCopyWith<$Res> { +abstract mixin class $CpuCopyWith<$Res> { factory $CpuCopyWith(Cpu value, $Res Function(Cpu) _then) = _$CpuCopyWithImpl; - @useResult - $Res call( - {String slug, - String name, - int? id, - Brand? manufacturer, - String? releaseDate, - String? segment, - String? architecture, - String? socket, - String? processNode, - int? cores, - int? threads, - int? pCores, - int? eCores, - double? baseClockGhz, - double? boostClockGhz, - double? l3CacheMb, - int? tdpW, - int? maxTdpW, - String? integratedGraphics, - String? memorySupport, - int? msrpUsd, - CpuScore? score, - bool verified, - List sourceUrls, - String? url}); +@useResult +$Res call({ + String slug, String name, int? id, Brand? manufacturer, String? releaseDate, String? segment, String? architecture, String? socket, String? processNode, int? cores, int? threads, int? pCores, int? eCores, double? baseClockGhz, double? boostClockGhz, double? l3CacheMb, int? tdpW, int? maxTdpW, String? integratedGraphics, String? memorySupport, int? msrpUsd, CpuScore? score, bool verified, List sourceUrls, String? url +}); - $BrandCopyWith<$Res>? get manufacturer; - $CpuScoreCopyWith<$Res>? get score; -} +$BrandCopyWith<$Res>? get manufacturer;$CpuScoreCopyWith<$Res>? get score; + +} /// @nodoc -class _$CpuCopyWithImpl<$Res> implements $CpuCopyWith<$Res> { +class _$CpuCopyWithImpl<$Res> + implements $CpuCopyWith<$Res> { _$CpuCopyWithImpl(this._self, this._then); final Cpu _self; final $Res Function(Cpu) _then; - /// Create a copy of Cpu - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? slug = null, - Object? name = null, - Object? id = freezed, - Object? manufacturer = freezed, - Object? releaseDate = freezed, - Object? segment = freezed, - Object? architecture = freezed, - Object? socket = freezed, - Object? processNode = freezed, - Object? cores = freezed, - Object? threads = freezed, - Object? pCores = freezed, - Object? eCores = freezed, - Object? baseClockGhz = freezed, - Object? boostClockGhz = freezed, - Object? l3CacheMb = freezed, - Object? tdpW = freezed, - Object? maxTdpW = freezed, - Object? integratedGraphics = freezed, - Object? memorySupport = freezed, - Object? msrpUsd = freezed, - Object? score = freezed, - Object? verified = null, - Object? sourceUrls = null, - Object? url = freezed, - }) { - return _then(_self.copyWith( - slug: null == slug - ? _self.slug - : slug // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _self.name - : name // ignore: cast_nullable_to_non_nullable - as String, - id: freezed == id - ? _self.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - manufacturer: freezed == manufacturer - ? _self.manufacturer - : manufacturer // ignore: cast_nullable_to_non_nullable - as Brand?, - releaseDate: freezed == releaseDate - ? _self.releaseDate - : releaseDate // ignore: cast_nullable_to_non_nullable - as String?, - segment: freezed == segment - ? _self.segment - : segment // ignore: cast_nullable_to_non_nullable - as String?, - architecture: freezed == architecture - ? _self.architecture - : architecture // ignore: cast_nullable_to_non_nullable - as String?, - socket: freezed == socket - ? _self.socket - : socket // ignore: cast_nullable_to_non_nullable - as String?, - processNode: freezed == processNode - ? _self.processNode - : processNode // ignore: cast_nullable_to_non_nullable - as String?, - cores: freezed == cores - ? _self.cores - : cores // ignore: cast_nullable_to_non_nullable - as int?, - threads: freezed == threads - ? _self.threads - : threads // ignore: cast_nullable_to_non_nullable - as int?, - pCores: freezed == pCores - ? _self.pCores - : pCores // ignore: cast_nullable_to_non_nullable - as int?, - eCores: freezed == eCores - ? _self.eCores - : eCores // ignore: cast_nullable_to_non_nullable - as int?, - baseClockGhz: freezed == baseClockGhz - ? _self.baseClockGhz - : baseClockGhz // ignore: cast_nullable_to_non_nullable - as double?, - boostClockGhz: freezed == boostClockGhz - ? _self.boostClockGhz - : boostClockGhz // ignore: cast_nullable_to_non_nullable - as double?, - l3CacheMb: freezed == l3CacheMb - ? _self.l3CacheMb - : l3CacheMb // ignore: cast_nullable_to_non_nullable - as double?, - tdpW: freezed == tdpW - ? _self.tdpW - : tdpW // ignore: cast_nullable_to_non_nullable - as int?, - maxTdpW: freezed == maxTdpW - ? _self.maxTdpW - : maxTdpW // ignore: cast_nullable_to_non_nullable - as int?, - integratedGraphics: freezed == integratedGraphics - ? _self.integratedGraphics - : integratedGraphics // ignore: cast_nullable_to_non_nullable - as String?, - memorySupport: freezed == memorySupport - ? _self.memorySupport - : memorySupport // ignore: cast_nullable_to_non_nullable - as String?, - msrpUsd: freezed == msrpUsd - ? _self.msrpUsd - : msrpUsd // ignore: cast_nullable_to_non_nullable - as int?, - score: freezed == score - ? _self.score - : score // ignore: cast_nullable_to_non_nullable - as CpuScore?, - verified: null == verified - ? _self.verified - : verified // ignore: cast_nullable_to_non_nullable - as bool, - sourceUrls: null == sourceUrls - ? _self.sourceUrls - : sourceUrls // ignore: cast_nullable_to_non_nullable - as List, - url: freezed == url - ? _self.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - )); - } - - /// Create a copy of Cpu - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BrandCopyWith<$Res>? get manufacturer { +/// Create a copy of Cpu +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? slug = null,Object? name = null,Object? id = freezed,Object? manufacturer = freezed,Object? releaseDate = freezed,Object? segment = freezed,Object? architecture = freezed,Object? socket = freezed,Object? processNode = freezed,Object? cores = freezed,Object? threads = freezed,Object? pCores = freezed,Object? eCores = freezed,Object? baseClockGhz = freezed,Object? boostClockGhz = freezed,Object? l3CacheMb = freezed,Object? tdpW = freezed,Object? maxTdpW = freezed,Object? integratedGraphics = freezed,Object? memorySupport = freezed,Object? msrpUsd = freezed,Object? score = freezed,Object? verified = null,Object? sourceUrls = null,Object? url = freezed,}) { + return _then(_self.copyWith( +slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable +as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,manufacturer: freezed == manufacturer ? _self.manufacturer : manufacturer // ignore: cast_nullable_to_non_nullable +as Brand?,releaseDate: freezed == releaseDate ? _self.releaseDate : releaseDate // ignore: cast_nullable_to_non_nullable +as String?,segment: freezed == segment ? _self.segment : segment // ignore: cast_nullable_to_non_nullable +as String?,architecture: freezed == architecture ? _self.architecture : architecture // ignore: cast_nullable_to_non_nullable +as String?,socket: freezed == socket ? _self.socket : socket // ignore: cast_nullable_to_non_nullable +as String?,processNode: freezed == processNode ? _self.processNode : processNode // ignore: cast_nullable_to_non_nullable +as String?,cores: freezed == cores ? _self.cores : cores // ignore: cast_nullable_to_non_nullable +as int?,threads: freezed == threads ? _self.threads : threads // ignore: cast_nullable_to_non_nullable +as int?,pCores: freezed == pCores ? _self.pCores : pCores // ignore: cast_nullable_to_non_nullable +as int?,eCores: freezed == eCores ? _self.eCores : eCores // ignore: cast_nullable_to_non_nullable +as int?,baseClockGhz: freezed == baseClockGhz ? _self.baseClockGhz : baseClockGhz // ignore: cast_nullable_to_non_nullable +as double?,boostClockGhz: freezed == boostClockGhz ? _self.boostClockGhz : boostClockGhz // ignore: cast_nullable_to_non_nullable +as double?,l3CacheMb: freezed == l3CacheMb ? _self.l3CacheMb : l3CacheMb // ignore: cast_nullable_to_non_nullable +as double?,tdpW: freezed == tdpW ? _self.tdpW : tdpW // ignore: cast_nullable_to_non_nullable +as int?,maxTdpW: freezed == maxTdpW ? _self.maxTdpW : maxTdpW // ignore: cast_nullable_to_non_nullable +as int?,integratedGraphics: freezed == integratedGraphics ? _self.integratedGraphics : integratedGraphics // ignore: cast_nullable_to_non_nullable +as String?,memorySupport: freezed == memorySupport ? _self.memorySupport : memorySupport // ignore: cast_nullable_to_non_nullable +as String?,msrpUsd: freezed == msrpUsd ? _self.msrpUsd : msrpUsd // ignore: cast_nullable_to_non_nullable +as int?,score: freezed == score ? _self.score : score // ignore: cast_nullable_to_non_nullable +as CpuScore?,verified: null == verified ? _self.verified : verified // ignore: cast_nullable_to_non_nullable +as bool,sourceUrls: null == sourceUrls ? _self.sourceUrls : sourceUrls // ignore: cast_nullable_to_non_nullable +as List,url: freezed == url ? _self.url : url // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of Cpu +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BrandCopyWith<$Res>? get manufacturer { if (_self.manufacturer == null) { - return null; - } - - return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { - return _then(_self.copyWith(manufacturer: value)); - }); + return null; } - /// Create a copy of Cpu - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CpuScoreCopyWith<$Res>? get score { + return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { + return _then(_self.copyWith(manufacturer: value)); + }); +}/// Create a copy of Cpu +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CpuScoreCopyWith<$Res>? get score { if (_self.score == null) { - return null; - } - - return $CpuScoreCopyWith<$Res>(_self.score!, (value) { - return _then(_self.copyWith(score: value)); - }); + return null; } + + return $CpuScoreCopyWith<$Res>(_self.score!, (value) { + return _then(_self.copyWith(score: value)); + }); } +} + /// Adds pattern-matching-related methods to [Cpu]. extension CpuPatterns on Cpu { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Cpu value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Cpu() when $default != null: +return $default(_that);case _: + return orElse(); - @optionalTypeArgs - TResult maybeMap( - TResult Function(_Cpu value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Cpu() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } - - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_Cpu value) $default, - ) { - final _that = this; - switch (_that) { - case _Cpu(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } - - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_Cpu value)? $default, - ) { - final _that = this; - switch (_that) { - case _Cpu() when $default != null: - return $default(_that); - case _: - return null; - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Cpu value) $default,){ +final _that = this; +switch (_that) { +case _Cpu(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Cpu value)? $default,){ +final _that = this; +switch (_that) { +case _Cpu() when $default != null: +return $default(_that);case _: + return null; - @optionalTypeArgs - TResult maybeWhen( - TResult Function( - String slug, - String name, - int? id, - Brand? manufacturer, - String? releaseDate, - String? segment, - String? architecture, - String? socket, - String? processNode, - int? cores, - int? threads, - int? pCores, - int? eCores, - double? baseClockGhz, - double? boostClockGhz, - double? l3CacheMb, - int? tdpW, - int? maxTdpW, - String? integratedGraphics, - String? memorySupport, - int? msrpUsd, - CpuScore? score, - bool verified, - List sourceUrls, - String? url)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Cpu() when $default != null: - return $default( - _that.slug, - _that.name, - _that.id, - _that.manufacturer, - _that.releaseDate, - _that.segment, - _that.architecture, - _that.socket, - _that.processNode, - _that.cores, - _that.threads, - _that.pCores, - _that.eCores, - _that.baseClockGhz, - _that.boostClockGhz, - _that.l3CacheMb, - _that.tdpW, - _that.maxTdpW, - _that.integratedGraphics, - _that.memorySupport, - _that.msrpUsd, - _that.score, - _that.verified, - _that.sourceUrls, - _that.url); - case _: - return orElse(); - } - } +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String slug, String name, int? id, Brand? manufacturer, String? releaseDate, String? segment, String? architecture, String? socket, String? processNode, int? cores, int? threads, int? pCores, int? eCores, double? baseClockGhz, double? boostClockGhz, double? l3CacheMb, int? tdpW, int? maxTdpW, String? integratedGraphics, String? memorySupport, int? msrpUsd, CpuScore? score, bool verified, List sourceUrls, String? url)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Cpu() when $default != null: +return $default(_that.slug,_that.name,_that.id,_that.manufacturer,_that.releaseDate,_that.segment,_that.architecture,_that.socket,_that.processNode,_that.cores,_that.threads,_that.pCores,_that.eCores,_that.baseClockGhz,_that.boostClockGhz,_that.l3CacheMb,_that.tdpW,_that.maxTdpW,_that.integratedGraphics,_that.memorySupport,_that.msrpUsd,_that.score,_that.verified,_that.sourceUrls,_that.url);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String slug, String name, int? id, Brand? manufacturer, String? releaseDate, String? segment, String? architecture, String? socket, String? processNode, int? cores, int? threads, int? pCores, int? eCores, double? baseClockGhz, double? boostClockGhz, double? l3CacheMb, int? tdpW, int? maxTdpW, String? integratedGraphics, String? memorySupport, int? msrpUsd, CpuScore? score, bool verified, List sourceUrls, String? url) $default,) {final _that = this; +switch (_that) { +case _Cpu(): +return $default(_that.slug,_that.name,_that.id,_that.manufacturer,_that.releaseDate,_that.segment,_that.architecture,_that.socket,_that.processNode,_that.cores,_that.threads,_that.pCores,_that.eCores,_that.baseClockGhz,_that.boostClockGhz,_that.l3CacheMb,_that.tdpW,_that.maxTdpW,_that.integratedGraphics,_that.memorySupport,_that.msrpUsd,_that.score,_that.verified,_that.sourceUrls,_that.url);case _: + throw StateError('Unexpected subclass'); - @optionalTypeArgs - TResult when( - TResult Function( - String slug, - String name, - int? id, - Brand? manufacturer, - String? releaseDate, - String? segment, - String? architecture, - String? socket, - String? processNode, - int? cores, - int? threads, - int? pCores, - int? eCores, - double? baseClockGhz, - double? boostClockGhz, - double? l3CacheMb, - int? tdpW, - int? maxTdpW, - String? integratedGraphics, - String? memorySupport, - int? msrpUsd, - CpuScore? score, - bool verified, - List sourceUrls, - String? url) - $default, - ) { - final _that = this; - switch (_that) { - case _Cpu(): - return $default( - _that.slug, - _that.name, - _that.id, - _that.manufacturer, - _that.releaseDate, - _that.segment, - _that.architecture, - _that.socket, - _that.processNode, - _that.cores, - _that.threads, - _that.pCores, - _that.eCores, - _that.baseClockGhz, - _that.boostClockGhz, - _that.l3CacheMb, - _that.tdpW, - _that.maxTdpW, - _that.integratedGraphics, - _that.memorySupport, - _that.msrpUsd, - _that.score, - _that.verified, - _that.sourceUrls, - _that.url); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String slug, String name, int? id, Brand? manufacturer, String? releaseDate, String? segment, String? architecture, String? socket, String? processNode, int? cores, int? threads, int? pCores, int? eCores, double? baseClockGhz, double? boostClockGhz, double? l3CacheMb, int? tdpW, int? maxTdpW, String? integratedGraphics, String? memorySupport, int? msrpUsd, CpuScore? score, bool verified, List sourceUrls, String? url)? $default,) {final _that = this; +switch (_that) { +case _Cpu() when $default != null: +return $default(_that.slug,_that.name,_that.id,_that.manufacturer,_that.releaseDate,_that.segment,_that.architecture,_that.socket,_that.processNode,_that.cores,_that.threads,_that.pCores,_that.eCores,_that.baseClockGhz,_that.boostClockGhz,_that.l3CacheMb,_that.tdpW,_that.maxTdpW,_that.integratedGraphics,_that.memorySupport,_that.msrpUsd,_that.score,_that.verified,_that.sourceUrls,_that.url);case _: + return null; - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` +} +} - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function( - String slug, - String name, - int? id, - Brand? manufacturer, - String? releaseDate, - String? segment, - String? architecture, - String? socket, - String? processNode, - int? cores, - int? threads, - int? pCores, - int? eCores, - double? baseClockGhz, - double? boostClockGhz, - double? l3CacheMb, - int? tdpW, - int? maxTdpW, - String? integratedGraphics, - String? memorySupport, - int? msrpUsd, - CpuScore? score, - bool verified, - List sourceUrls, - String? url)? - $default, - ) { - final _that = this; - switch (_that) { - case _Cpu() when $default != null: - return $default( - _that.slug, - _that.name, - _that.id, - _that.manufacturer, - _that.releaseDate, - _that.segment, - _that.architecture, - _that.socket, - _that.processNode, - _that.cores, - _that.threads, - _that.pCores, - _that.eCores, - _that.baseClockGhz, - _that.boostClockGhz, - _that.l3CacheMb, - _that.tdpW, - _that.maxTdpW, - _that.integratedGraphics, - _that.memorySupport, - _that.msrpUsd, - _that.score, - _that.verified, - _that.sourceUrls, - _that.url); - case _: - return null; - } - } } /// @nodoc @JsonSerializable() + class _Cpu implements Cpu { - const _Cpu( - {required this.slug, - required this.name, - this.id, - this.manufacturer, - this.releaseDate, - this.segment, - this.architecture, - this.socket, - this.processNode, - this.cores, - this.threads, - this.pCores, - this.eCores, - this.baseClockGhz, - this.boostClockGhz, - this.l3CacheMb, - this.tdpW, - this.maxTdpW, - this.integratedGraphics, - this.memorySupport, - this.msrpUsd, - this.score, - this.verified = false, - final List sourceUrls = const [], - this.url}) - : _sourceUrls = sourceUrls; + const _Cpu({required this.slug, required this.name, this.id, this.manufacturer, this.releaseDate, this.segment, this.architecture, this.socket, this.processNode, this.cores, this.threads, this.pCores, this.eCores, this.baseClockGhz, this.boostClockGhz, this.l3CacheMb, this.tdpW, this.maxTdpW, this.integratedGraphics, this.memorySupport, this.msrpUsd, this.score, this.verified = false, final List sourceUrls = const [], this.url}): _sourceUrls = sourceUrls; factory _Cpu.fromJson(Map json) => _$CpuFromJson(json); - @override - final String slug; - @override - final String name; - @override - final int? id; - @override - final Brand? manufacturer; - @override - final String? releaseDate; - - /// `desktop` / `laptop` / `server` 등. - @override - final String? segment; - @override - final String? architecture; - @override - final String? socket; +@override final String slug; +@override final String name; +@override final int? id; +@override final Brand? manufacturer; +@override final String? releaseDate; +/// `desktop` / `laptop` / `server` 등. +@override final String? segment; +@override final String? architecture; +@override final String? socket; +/// 공정. CPU는 `TSMC N4` 같은 문자열이라 SoC의 `processNm`과 타입이 다르다. +@override final String? processNode; +@override final int? cores; +@override final int? threads; +/// 하이브리드 구조에서만 채워진다. +@override final int? pCores; +@override final int? eCores; +@override final double? baseClockGhz; +@override final double? boostClockGhz; +@override final double? l3CacheMb; +@override final int? tdpW; +@override final int? maxTdpW; +@override final String? integratedGraphics; +@override final String? memorySupport; +@override final int? msrpUsd; +@override final CpuScore? score; +@override@JsonKey() final bool verified; + final List _sourceUrls; +@override@JsonKey() List get sourceUrls { + if (_sourceUrls is EqualUnmodifiableListView) return _sourceUrls; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_sourceUrls); +} - /// 공정. CPU는 `TSMC N4` 같은 문자열이라 SoC의 `processNm`과 타입이 다르다. - @override - final String? processNode; - @override - final int? cores; - @override - final int? threads; +@override final String? url; - /// 하이브리드 구조에서만 채워진다. - @override - final int? pCores; - @override - final int? eCores; - @override - final double? baseClockGhz; - @override - final double? boostClockGhz; - @override - final double? l3CacheMb; - @override - final int? tdpW; - @override - final int? maxTdpW; - @override - final String? integratedGraphics; - @override - final String? memorySupport; - @override - final int? msrpUsd; - @override - final CpuScore? score; - @override - @JsonKey() - final bool verified; - final List _sourceUrls; - @override - @JsonKey() - List get sourceUrls { - if (_sourceUrls is EqualUnmodifiableListView) return _sourceUrls; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_sourceUrls); - } +/// Create a copy of Cpu +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CpuCopyWith<_Cpu> get copyWith => __$CpuCopyWithImpl<_Cpu>(this, _$identity); - @override - final String? url; +@override +Map toJson() { + return _$CpuToJson(this, ); +} - /// Create a copy of Cpu - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$CpuCopyWith<_Cpu> get copyWith => - __$CpuCopyWithImpl<_Cpu>(this, _$identity); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Cpu&&(identical(other.slug, slug) || other.slug == slug)&&(identical(other.name, name) || other.name == name)&&(identical(other.id, id) || other.id == id)&&(identical(other.manufacturer, manufacturer) || other.manufacturer == manufacturer)&&(identical(other.releaseDate, releaseDate) || other.releaseDate == releaseDate)&&(identical(other.segment, segment) || other.segment == segment)&&(identical(other.architecture, architecture) || other.architecture == architecture)&&(identical(other.socket, socket) || other.socket == socket)&&(identical(other.processNode, processNode) || other.processNode == processNode)&&(identical(other.cores, cores) || other.cores == cores)&&(identical(other.threads, threads) || other.threads == threads)&&(identical(other.pCores, pCores) || other.pCores == pCores)&&(identical(other.eCores, eCores) || other.eCores == eCores)&&(identical(other.baseClockGhz, baseClockGhz) || other.baseClockGhz == baseClockGhz)&&(identical(other.boostClockGhz, boostClockGhz) || other.boostClockGhz == boostClockGhz)&&(identical(other.l3CacheMb, l3CacheMb) || other.l3CacheMb == l3CacheMb)&&(identical(other.tdpW, tdpW) || other.tdpW == tdpW)&&(identical(other.maxTdpW, maxTdpW) || other.maxTdpW == maxTdpW)&&(identical(other.integratedGraphics, integratedGraphics) || other.integratedGraphics == integratedGraphics)&&(identical(other.memorySupport, memorySupport) || other.memorySupport == memorySupport)&&(identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd)&&(identical(other.score, score) || other.score == score)&&(identical(other.verified, verified) || other.verified == verified)&&const DeepCollectionEquality().equals(other._sourceUrls, _sourceUrls)&&(identical(other.url, url) || other.url == url)); +} - @override - Map toJson() { - return _$CpuToJson( - this, - ); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,slug,name,id,manufacturer,releaseDate,segment,architecture,socket,processNode,cores,threads,pCores,eCores,baseClockGhz,boostClockGhz,l3CacheMb,tdpW,maxTdpW,integratedGraphics,memorySupport,msrpUsd,score,verified,const DeepCollectionEquality().hash(_sourceUrls),url]); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _Cpu && - (identical(other.slug, slug) || other.slug == slug) && - (identical(other.name, name) || other.name == name) && - (identical(other.id, id) || other.id == id) && - (identical(other.manufacturer, manufacturer) || - other.manufacturer == manufacturer) && - (identical(other.releaseDate, releaseDate) || - other.releaseDate == releaseDate) && - (identical(other.segment, segment) || other.segment == segment) && - (identical(other.architecture, architecture) || - other.architecture == architecture) && - (identical(other.socket, socket) || other.socket == socket) && - (identical(other.processNode, processNode) || - other.processNode == processNode) && - (identical(other.cores, cores) || other.cores == cores) && - (identical(other.threads, threads) || other.threads == threads) && - (identical(other.pCores, pCores) || other.pCores == pCores) && - (identical(other.eCores, eCores) || other.eCores == eCores) && - (identical(other.baseClockGhz, baseClockGhz) || - other.baseClockGhz == baseClockGhz) && - (identical(other.boostClockGhz, boostClockGhz) || - other.boostClockGhz == boostClockGhz) && - (identical(other.l3CacheMb, l3CacheMb) || - other.l3CacheMb == l3CacheMb) && - (identical(other.tdpW, tdpW) || other.tdpW == tdpW) && - (identical(other.maxTdpW, maxTdpW) || other.maxTdpW == maxTdpW) && - (identical(other.integratedGraphics, integratedGraphics) || - other.integratedGraphics == integratedGraphics) && - (identical(other.memorySupport, memorySupport) || - other.memorySupport == memorySupport) && - (identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd) && - (identical(other.score, score) || other.score == score) && - (identical(other.verified, verified) || - other.verified == verified) && - const DeepCollectionEquality() - .equals(other._sourceUrls, _sourceUrls) && - (identical(other.url, url) || other.url == url)); - } +@override +String toString() { + return 'Cpu(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, releaseDate: $releaseDate, segment: $segment, architecture: $architecture, socket: $socket, processNode: $processNode, cores: $cores, threads: $threads, pCores: $pCores, eCores: $eCores, baseClockGhz: $baseClockGhz, boostClockGhz: $boostClockGhz, l3CacheMb: $l3CacheMb, tdpW: $tdpW, maxTdpW: $maxTdpW, integratedGraphics: $integratedGraphics, memorySupport: $memorySupport, msrpUsd: $msrpUsd, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hashAll([ - runtimeType, - slug, - name, - id, - manufacturer, - releaseDate, - segment, - architecture, - socket, - processNode, - cores, - threads, - pCores, - eCores, - baseClockGhz, - boostClockGhz, - l3CacheMb, - tdpW, - maxTdpW, - integratedGraphics, - memorySupport, - msrpUsd, - score, - verified, - const DeepCollectionEquality().hash(_sourceUrls), - url - ]); - @override - String toString() { - return 'Cpu(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, releaseDate: $releaseDate, segment: $segment, architecture: $architecture, socket: $socket, processNode: $processNode, cores: $cores, threads: $threads, pCores: $pCores, eCores: $eCores, baseClockGhz: $baseClockGhz, boostClockGhz: $boostClockGhz, l3CacheMb: $l3CacheMb, tdpW: $tdpW, maxTdpW: $maxTdpW, integratedGraphics: $integratedGraphics, memorySupport: $memorySupport, msrpUsd: $msrpUsd, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; - } } /// @nodoc abstract mixin class _$CpuCopyWith<$Res> implements $CpuCopyWith<$Res> { - factory _$CpuCopyWith(_Cpu value, $Res Function(_Cpu) _then) = - __$CpuCopyWithImpl; - @override - @useResult - $Res call( - {String slug, - String name, - int? id, - Brand? manufacturer, - String? releaseDate, - String? segment, - String? architecture, - String? socket, - String? processNode, - int? cores, - int? threads, - int? pCores, - int? eCores, - double? baseClockGhz, - double? boostClockGhz, - double? l3CacheMb, - int? tdpW, - int? maxTdpW, - String? integratedGraphics, - String? memorySupport, - int? msrpUsd, - CpuScore? score, - bool verified, - List sourceUrls, - String? url}); + factory _$CpuCopyWith(_Cpu value, $Res Function(_Cpu) _then) = __$CpuCopyWithImpl; +@override @useResult +$Res call({ + String slug, String name, int? id, Brand? manufacturer, String? releaseDate, String? segment, String? architecture, String? socket, String? processNode, int? cores, int? threads, int? pCores, int? eCores, double? baseClockGhz, double? boostClockGhz, double? l3CacheMb, int? tdpW, int? maxTdpW, String? integratedGraphics, String? memorySupport, int? msrpUsd, CpuScore? score, bool verified, List sourceUrls, String? url +}); - @override - $BrandCopyWith<$Res>? get manufacturer; - @override - $CpuScoreCopyWith<$Res>? get score; -} +@override $BrandCopyWith<$Res>? get manufacturer;@override $CpuScoreCopyWith<$Res>? get score; + +} /// @nodoc -class __$CpuCopyWithImpl<$Res> implements _$CpuCopyWith<$Res> { +class __$CpuCopyWithImpl<$Res> + implements _$CpuCopyWith<$Res> { __$CpuCopyWithImpl(this._self, this._then); final _Cpu _self; final $Res Function(_Cpu) _then; - /// Create a copy of Cpu - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? slug = null, - Object? name = null, - Object? id = freezed, - Object? manufacturer = freezed, - Object? releaseDate = freezed, - Object? segment = freezed, - Object? architecture = freezed, - Object? socket = freezed, - Object? processNode = freezed, - Object? cores = freezed, - Object? threads = freezed, - Object? pCores = freezed, - Object? eCores = freezed, - Object? baseClockGhz = freezed, - Object? boostClockGhz = freezed, - Object? l3CacheMb = freezed, - Object? tdpW = freezed, - Object? maxTdpW = freezed, - Object? integratedGraphics = freezed, - Object? memorySupport = freezed, - Object? msrpUsd = freezed, - Object? score = freezed, - Object? verified = null, - Object? sourceUrls = null, - Object? url = freezed, - }) { - return _then(_Cpu( - slug: null == slug - ? _self.slug - : slug // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _self.name - : name // ignore: cast_nullable_to_non_nullable - as String, - id: freezed == id - ? _self.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - manufacturer: freezed == manufacturer - ? _self.manufacturer - : manufacturer // ignore: cast_nullable_to_non_nullable - as Brand?, - releaseDate: freezed == releaseDate - ? _self.releaseDate - : releaseDate // ignore: cast_nullable_to_non_nullable - as String?, - segment: freezed == segment - ? _self.segment - : segment // ignore: cast_nullable_to_non_nullable - as String?, - architecture: freezed == architecture - ? _self.architecture - : architecture // ignore: cast_nullable_to_non_nullable - as String?, - socket: freezed == socket - ? _self.socket - : socket // ignore: cast_nullable_to_non_nullable - as String?, - processNode: freezed == processNode - ? _self.processNode - : processNode // ignore: cast_nullable_to_non_nullable - as String?, - cores: freezed == cores - ? _self.cores - : cores // ignore: cast_nullable_to_non_nullable - as int?, - threads: freezed == threads - ? _self.threads - : threads // ignore: cast_nullable_to_non_nullable - as int?, - pCores: freezed == pCores - ? _self.pCores - : pCores // ignore: cast_nullable_to_non_nullable - as int?, - eCores: freezed == eCores - ? _self.eCores - : eCores // ignore: cast_nullable_to_non_nullable - as int?, - baseClockGhz: freezed == baseClockGhz - ? _self.baseClockGhz - : baseClockGhz // ignore: cast_nullable_to_non_nullable - as double?, - boostClockGhz: freezed == boostClockGhz - ? _self.boostClockGhz - : boostClockGhz // ignore: cast_nullable_to_non_nullable - as double?, - l3CacheMb: freezed == l3CacheMb - ? _self.l3CacheMb - : l3CacheMb // ignore: cast_nullable_to_non_nullable - as double?, - tdpW: freezed == tdpW - ? _self.tdpW - : tdpW // ignore: cast_nullable_to_non_nullable - as int?, - maxTdpW: freezed == maxTdpW - ? _self.maxTdpW - : maxTdpW // ignore: cast_nullable_to_non_nullable - as int?, - integratedGraphics: freezed == integratedGraphics - ? _self.integratedGraphics - : integratedGraphics // ignore: cast_nullable_to_non_nullable - as String?, - memorySupport: freezed == memorySupport - ? _self.memorySupport - : memorySupport // ignore: cast_nullable_to_non_nullable - as String?, - msrpUsd: freezed == msrpUsd - ? _self.msrpUsd - : msrpUsd // ignore: cast_nullable_to_non_nullable - as int?, - score: freezed == score - ? _self.score - : score // ignore: cast_nullable_to_non_nullable - as CpuScore?, - verified: null == verified - ? _self.verified - : verified // ignore: cast_nullable_to_non_nullable - as bool, - sourceUrls: null == sourceUrls - ? _self._sourceUrls - : sourceUrls // ignore: cast_nullable_to_non_nullable - as List, - url: freezed == url - ? _self.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +/// Create a copy of Cpu +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? slug = null,Object? name = null,Object? id = freezed,Object? manufacturer = freezed,Object? releaseDate = freezed,Object? segment = freezed,Object? architecture = freezed,Object? socket = freezed,Object? processNode = freezed,Object? cores = freezed,Object? threads = freezed,Object? pCores = freezed,Object? eCores = freezed,Object? baseClockGhz = freezed,Object? boostClockGhz = freezed,Object? l3CacheMb = freezed,Object? tdpW = freezed,Object? maxTdpW = freezed,Object? integratedGraphics = freezed,Object? memorySupport = freezed,Object? msrpUsd = freezed,Object? score = freezed,Object? verified = null,Object? sourceUrls = null,Object? url = freezed,}) { + return _then(_Cpu( +slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable +as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,manufacturer: freezed == manufacturer ? _self.manufacturer : manufacturer // ignore: cast_nullable_to_non_nullable +as Brand?,releaseDate: freezed == releaseDate ? _self.releaseDate : releaseDate // ignore: cast_nullable_to_non_nullable +as String?,segment: freezed == segment ? _self.segment : segment // ignore: cast_nullable_to_non_nullable +as String?,architecture: freezed == architecture ? _self.architecture : architecture // ignore: cast_nullable_to_non_nullable +as String?,socket: freezed == socket ? _self.socket : socket // ignore: cast_nullable_to_non_nullable +as String?,processNode: freezed == processNode ? _self.processNode : processNode // ignore: cast_nullable_to_non_nullable +as String?,cores: freezed == cores ? _self.cores : cores // ignore: cast_nullable_to_non_nullable +as int?,threads: freezed == threads ? _self.threads : threads // ignore: cast_nullable_to_non_nullable +as int?,pCores: freezed == pCores ? _self.pCores : pCores // ignore: cast_nullable_to_non_nullable +as int?,eCores: freezed == eCores ? _self.eCores : eCores // ignore: cast_nullable_to_non_nullable +as int?,baseClockGhz: freezed == baseClockGhz ? _self.baseClockGhz : baseClockGhz // ignore: cast_nullable_to_non_nullable +as double?,boostClockGhz: freezed == boostClockGhz ? _self.boostClockGhz : boostClockGhz // ignore: cast_nullable_to_non_nullable +as double?,l3CacheMb: freezed == l3CacheMb ? _self.l3CacheMb : l3CacheMb // ignore: cast_nullable_to_non_nullable +as double?,tdpW: freezed == tdpW ? _self.tdpW : tdpW // ignore: cast_nullable_to_non_nullable +as int?,maxTdpW: freezed == maxTdpW ? _self.maxTdpW : maxTdpW // ignore: cast_nullable_to_non_nullable +as int?,integratedGraphics: freezed == integratedGraphics ? _self.integratedGraphics : integratedGraphics // ignore: cast_nullable_to_non_nullable +as String?,memorySupport: freezed == memorySupport ? _self.memorySupport : memorySupport // ignore: cast_nullable_to_non_nullable +as String?,msrpUsd: freezed == msrpUsd ? _self.msrpUsd : msrpUsd // ignore: cast_nullable_to_non_nullable +as int?,score: freezed == score ? _self.score : score // ignore: cast_nullable_to_non_nullable +as CpuScore?,verified: null == verified ? _self.verified : verified // ignore: cast_nullable_to_non_nullable +as bool,sourceUrls: null == sourceUrls ? _self._sourceUrls : sourceUrls // ignore: cast_nullable_to_non_nullable +as List,url: freezed == url ? _self.url : url // ignore: cast_nullable_to_non_nullable +as String?, + )); +} - /// Create a copy of Cpu - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BrandCopyWith<$Res>? get manufacturer { +/// Create a copy of Cpu +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BrandCopyWith<$Res>? get manufacturer { if (_self.manufacturer == null) { - return null; - } - - return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { - return _then(_self.copyWith(manufacturer: value)); - }); + return null; } - /// Create a copy of Cpu - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CpuScoreCopyWith<$Res>? get score { + return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { + return _then(_self.copyWith(manufacturer: value)); + }); +}/// Create a copy of Cpu +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CpuScoreCopyWith<$Res>? get score { if (_self.score == null) { - return null; - } - - return $CpuScoreCopyWith<$Res>(_self.score!, (value) { - return _then(_self.copyWith(score: value)); - }); + return null; } + + return $CpuScoreCopyWith<$Res>(_self.score!, (value) { + return _then(_self.copyWith(score: value)); + }); +} } // dart format on diff --git a/lib/data/dto/cpu.g.dart b/lib/data/dto/cpu.g.dart index 9142413..c92fad8 100644 --- a/lib/data/dto/cpu.g.dart +++ b/lib/data/dto/cpu.g.dart @@ -7,64 +7,65 @@ part of 'cpu.dart'; // ************************************************************************** _Cpu _$CpuFromJson(Map json) => _Cpu( - slug: json['slug'] as String, - name: json['name'] as String, - id: (json['id'] as num?)?.toInt(), - manufacturer: json['manufacturer'] == null - ? null - : Brand.fromJson(json['manufacturer'] as Map), - releaseDate: json['release_date'] as String?, - segment: json['segment'] as String?, - architecture: json['architecture'] as String?, - socket: json['socket'] as String?, - processNode: json['process_node'] as String?, - cores: (json['cores'] as num?)?.toInt(), - threads: (json['threads'] as num?)?.toInt(), - pCores: (json['p_cores'] as num?)?.toInt(), - eCores: (json['e_cores'] as num?)?.toInt(), - baseClockGhz: (json['base_clock_ghz'] as num?)?.toDouble(), - boostClockGhz: (json['boost_clock_ghz'] as num?)?.toDouble(), - l3CacheMb: (json['l3_cache_mb'] as num?)?.toDouble(), - tdpW: (json['tdp_w'] as num?)?.toInt(), - maxTdpW: (json['max_tdp_w'] as num?)?.toInt(), - integratedGraphics: json['integrated_graphics'] as String?, - memorySupport: json['memory_support'] as String?, - msrpUsd: (json['msrp_usd'] as num?)?.toInt(), - score: json['score'] == null - ? null - : CpuScore.fromJson(json['score'] as Map), - verified: json['verified'] as bool? ?? false, - sourceUrls: (json['source_urls'] as List?) - ?.map((e) => e as String) - .toList() ?? - const [], - url: json['url'] as String?, - ); + slug: json['slug'] as String, + name: json['name'] as String, + id: (json['id'] as num?)?.toInt(), + manufacturer: json['manufacturer'] == null + ? null + : Brand.fromJson(json['manufacturer'] as Map), + releaseDate: json['release_date'] as String?, + segment: json['segment'] as String?, + architecture: json['architecture'] as String?, + socket: json['socket'] as String?, + processNode: json['process_node'] as String?, + cores: (json['cores'] as num?)?.toInt(), + threads: (json['threads'] as num?)?.toInt(), + pCores: (json['p_cores'] as num?)?.toInt(), + eCores: (json['e_cores'] as num?)?.toInt(), + baseClockGhz: (json['base_clock_ghz'] as num?)?.toDouble(), + boostClockGhz: (json['boost_clock_ghz'] as num?)?.toDouble(), + l3CacheMb: (json['l3_cache_mb'] as num?)?.toDouble(), + tdpW: (json['tdp_w'] as num?)?.toInt(), + maxTdpW: (json['max_tdp_w'] as num?)?.toInt(), + integratedGraphics: json['integrated_graphics'] as String?, + memorySupport: json['memory_support'] as String?, + msrpUsd: (json['msrp_usd'] as num?)?.toInt(), + score: json['score'] == null + ? null + : CpuScore.fromJson(json['score'] as Map), + verified: json['verified'] as bool? ?? false, + sourceUrls: + (json['source_urls'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], + url: json['url'] as String?, +); Map _$CpuToJson(_Cpu instance) => { - 'slug': instance.slug, - 'name': instance.name, - 'id': instance.id, - 'manufacturer': instance.manufacturer?.toJson(), - 'release_date': instance.releaseDate, - 'segment': instance.segment, - 'architecture': instance.architecture, - 'socket': instance.socket, - 'process_node': instance.processNode, - 'cores': instance.cores, - 'threads': instance.threads, - 'p_cores': instance.pCores, - 'e_cores': instance.eCores, - 'base_clock_ghz': instance.baseClockGhz, - 'boost_clock_ghz': instance.boostClockGhz, - 'l3_cache_mb': instance.l3CacheMb, - 'tdp_w': instance.tdpW, - 'max_tdp_w': instance.maxTdpW, - 'integrated_graphics': instance.integratedGraphics, - 'memory_support': instance.memorySupport, - 'msrp_usd': instance.msrpUsd, - 'score': instance.score?.toJson(), - 'verified': instance.verified, - 'source_urls': instance.sourceUrls, - 'url': instance.url, - }; + 'slug': instance.slug, + 'name': instance.name, + 'id': instance.id, + 'manufacturer': instance.manufacturer?.toJson(), + 'release_date': instance.releaseDate, + 'segment': instance.segment, + 'architecture': instance.architecture, + 'socket': instance.socket, + 'process_node': instance.processNode, + 'cores': instance.cores, + 'threads': instance.threads, + 'p_cores': instance.pCores, + 'e_cores': instance.eCores, + 'base_clock_ghz': instance.baseClockGhz, + 'boost_clock_ghz': instance.boostClockGhz, + 'l3_cache_mb': instance.l3CacheMb, + 'tdp_w': instance.tdpW, + 'max_tdp_w': instance.maxTdpW, + 'integrated_graphics': instance.integratedGraphics, + 'memory_support': instance.memorySupport, + 'msrp_usd': instance.msrpUsd, + 'score': instance.score?.toJson(), + 'verified': instance.verified, + 'source_urls': instance.sourceUrls, + 'url': instance.url, +}; diff --git a/lib/data/dto/gpu.freezed.dart b/lib/data/dto/gpu.freezed.dart index cbcf226..c22ad5b 100644 --- a/lib/data/dto/gpu.freezed.dart +++ b/lib/data/dto/gpu.freezed.dart @@ -14,1044 +14,390 @@ T _$identity(T value) => value; /// @nodoc mixin _$Gpu { - String get slug; - String get name; - int? get id; - Brand? get manufacturer; - String? get architecture; - String? get releaseDate; - int? get msrpUsd; - int? get cudaCores; - int? get streamProcessors; - int? get rtCores; - int? get tensorCores; - double? get memoryGb; - String? get memoryType; - int? get memoryBusBit; - double? get memoryBandwidthGbps; - int? get baseClockMhz; - int? get boostClockMhz; - int? get tdpW; - String? get pcieVersion; - double? get fp32Tflops; - double? get blenderScore; - GpuScore? get score; - bool get verified; - List get sourceUrls; - String? get url; - /// Create a copy of Gpu - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $GpuCopyWith get copyWith => - _$GpuCopyWithImpl(this as Gpu, _$identity); + String get slug; String get name; int? get id; Brand? get manufacturer; String? get architecture; String? get releaseDate; int? get msrpUsd; int? get cudaCores; int? get streamProcessors; int? get rtCores; int? get tensorCores; double? get memoryGb; String? get memoryType; int? get memoryBusBit; double? get memoryBandwidthGbps; int? get baseClockMhz; int? get boostClockMhz; int? get tdpW; String? get pcieVersion; double? get fp32Tflops; double? get blenderScore; GpuScore? get score; bool get verified; List get sourceUrls; String? get url; +/// Create a copy of Gpu +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GpuCopyWith get copyWith => _$GpuCopyWithImpl(this as Gpu, _$identity); /// Serializes this Gpu to a JSON map. Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is Gpu && - (identical(other.slug, slug) || other.slug == slug) && - (identical(other.name, name) || other.name == name) && - (identical(other.id, id) || other.id == id) && - (identical(other.manufacturer, manufacturer) || - other.manufacturer == manufacturer) && - (identical(other.architecture, architecture) || - other.architecture == architecture) && - (identical(other.releaseDate, releaseDate) || - other.releaseDate == releaseDate) && - (identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd) && - (identical(other.cudaCores, cudaCores) || - other.cudaCores == cudaCores) && - (identical(other.streamProcessors, streamProcessors) || - other.streamProcessors == streamProcessors) && - (identical(other.rtCores, rtCores) || other.rtCores == rtCores) && - (identical(other.tensorCores, tensorCores) || - other.tensorCores == tensorCores) && - (identical(other.memoryGb, memoryGb) || - other.memoryGb == memoryGb) && - (identical(other.memoryType, memoryType) || - other.memoryType == memoryType) && - (identical(other.memoryBusBit, memoryBusBit) || - other.memoryBusBit == memoryBusBit) && - (identical(other.memoryBandwidthGbps, memoryBandwidthGbps) || - other.memoryBandwidthGbps == memoryBandwidthGbps) && - (identical(other.baseClockMhz, baseClockMhz) || - other.baseClockMhz == baseClockMhz) && - (identical(other.boostClockMhz, boostClockMhz) || - other.boostClockMhz == boostClockMhz) && - (identical(other.tdpW, tdpW) || other.tdpW == tdpW) && - (identical(other.pcieVersion, pcieVersion) || - other.pcieVersion == pcieVersion) && - (identical(other.fp32Tflops, fp32Tflops) || - other.fp32Tflops == fp32Tflops) && - (identical(other.blenderScore, blenderScore) || - other.blenderScore == blenderScore) && - (identical(other.score, score) || other.score == score) && - (identical(other.verified, verified) || - other.verified == verified) && - const DeepCollectionEquality() - .equals(other.sourceUrls, sourceUrls) && - (identical(other.url, url) || other.url == url)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hashAll([ - runtimeType, - slug, - name, - id, - manufacturer, - architecture, - releaseDate, - msrpUsd, - cudaCores, - streamProcessors, - rtCores, - tensorCores, - memoryGb, - memoryType, - memoryBusBit, - memoryBandwidthGbps, - baseClockMhz, - boostClockMhz, - tdpW, - pcieVersion, - fp32Tflops, - blenderScore, - score, - verified, - const DeepCollectionEquality().hash(sourceUrls), - url - ]); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Gpu&&(identical(other.slug, slug) || other.slug == slug)&&(identical(other.name, name) || other.name == name)&&(identical(other.id, id) || other.id == id)&&(identical(other.manufacturer, manufacturer) || other.manufacturer == manufacturer)&&(identical(other.architecture, architecture) || other.architecture == architecture)&&(identical(other.releaseDate, releaseDate) || other.releaseDate == releaseDate)&&(identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd)&&(identical(other.cudaCores, cudaCores) || other.cudaCores == cudaCores)&&(identical(other.streamProcessors, streamProcessors) || other.streamProcessors == streamProcessors)&&(identical(other.rtCores, rtCores) || other.rtCores == rtCores)&&(identical(other.tensorCores, tensorCores) || other.tensorCores == tensorCores)&&(identical(other.memoryGb, memoryGb) || other.memoryGb == memoryGb)&&(identical(other.memoryType, memoryType) || other.memoryType == memoryType)&&(identical(other.memoryBusBit, memoryBusBit) || other.memoryBusBit == memoryBusBit)&&(identical(other.memoryBandwidthGbps, memoryBandwidthGbps) || other.memoryBandwidthGbps == memoryBandwidthGbps)&&(identical(other.baseClockMhz, baseClockMhz) || other.baseClockMhz == baseClockMhz)&&(identical(other.boostClockMhz, boostClockMhz) || other.boostClockMhz == boostClockMhz)&&(identical(other.tdpW, tdpW) || other.tdpW == tdpW)&&(identical(other.pcieVersion, pcieVersion) || other.pcieVersion == pcieVersion)&&(identical(other.fp32Tflops, fp32Tflops) || other.fp32Tflops == fp32Tflops)&&(identical(other.blenderScore, blenderScore) || other.blenderScore == blenderScore)&&(identical(other.score, score) || other.score == score)&&(identical(other.verified, verified) || other.verified == verified)&&const DeepCollectionEquality().equals(other.sourceUrls, sourceUrls)&&(identical(other.url, url) || other.url == url)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,slug,name,id,manufacturer,architecture,releaseDate,msrpUsd,cudaCores,streamProcessors,rtCores,tensorCores,memoryGb,memoryType,memoryBusBit,memoryBandwidthGbps,baseClockMhz,boostClockMhz,tdpW,pcieVersion,fp32Tflops,blenderScore,score,verified,const DeepCollectionEquality().hash(sourceUrls),url]); + +@override +String toString() { + return 'Gpu(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, architecture: $architecture, releaseDate: $releaseDate, msrpUsd: $msrpUsd, cudaCores: $cudaCores, streamProcessors: $streamProcessors, rtCores: $rtCores, tensorCores: $tensorCores, memoryGb: $memoryGb, memoryType: $memoryType, memoryBusBit: $memoryBusBit, memoryBandwidthGbps: $memoryBandwidthGbps, baseClockMhz: $baseClockMhz, boostClockMhz: $boostClockMhz, tdpW: $tdpW, pcieVersion: $pcieVersion, fp32Tflops: $fp32Tflops, blenderScore: $blenderScore, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; +} + - @override - String toString() { - return 'Gpu(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, architecture: $architecture, releaseDate: $releaseDate, msrpUsd: $msrpUsd, cudaCores: $cudaCores, streamProcessors: $streamProcessors, rtCores: $rtCores, tensorCores: $tensorCores, memoryGb: $memoryGb, memoryType: $memoryType, memoryBusBit: $memoryBusBit, memoryBandwidthGbps: $memoryBandwidthGbps, baseClockMhz: $baseClockMhz, boostClockMhz: $boostClockMhz, tdpW: $tdpW, pcieVersion: $pcieVersion, fp32Tflops: $fp32Tflops, blenderScore: $blenderScore, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; - } } /// @nodoc -abstract mixin class $GpuCopyWith<$Res> { +abstract mixin class $GpuCopyWith<$Res> { factory $GpuCopyWith(Gpu value, $Res Function(Gpu) _then) = _$GpuCopyWithImpl; - @useResult - $Res call( - {String slug, - String name, - int? id, - Brand? manufacturer, - String? architecture, - String? releaseDate, - int? msrpUsd, - int? cudaCores, - int? streamProcessors, - int? rtCores, - int? tensorCores, - double? memoryGb, - String? memoryType, - int? memoryBusBit, - double? memoryBandwidthGbps, - int? baseClockMhz, - int? boostClockMhz, - int? tdpW, - String? pcieVersion, - double? fp32Tflops, - double? blenderScore, - GpuScore? score, - bool verified, - List sourceUrls, - String? url}); +@useResult +$Res call({ + String slug, String name, int? id, Brand? manufacturer, String? architecture, String? releaseDate, int? msrpUsd, int? cudaCores, int? streamProcessors, int? rtCores, int? tensorCores, double? memoryGb, String? memoryType, int? memoryBusBit, double? memoryBandwidthGbps, int? baseClockMhz, int? boostClockMhz, int? tdpW, String? pcieVersion, double? fp32Tflops, double? blenderScore, GpuScore? score, bool verified, List sourceUrls, String? url +}); - $BrandCopyWith<$Res>? get manufacturer; - $GpuScoreCopyWith<$Res>? get score; -} +$BrandCopyWith<$Res>? get manufacturer;$GpuScoreCopyWith<$Res>? get score; + +} /// @nodoc -class _$GpuCopyWithImpl<$Res> implements $GpuCopyWith<$Res> { +class _$GpuCopyWithImpl<$Res> + implements $GpuCopyWith<$Res> { _$GpuCopyWithImpl(this._self, this._then); final Gpu _self; final $Res Function(Gpu) _then; - /// Create a copy of Gpu - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? slug = null, - Object? name = null, - Object? id = freezed, - Object? manufacturer = freezed, - Object? architecture = freezed, - Object? releaseDate = freezed, - Object? msrpUsd = freezed, - Object? cudaCores = freezed, - Object? streamProcessors = freezed, - Object? rtCores = freezed, - Object? tensorCores = freezed, - Object? memoryGb = freezed, - Object? memoryType = freezed, - Object? memoryBusBit = freezed, - Object? memoryBandwidthGbps = freezed, - Object? baseClockMhz = freezed, - Object? boostClockMhz = freezed, - Object? tdpW = freezed, - Object? pcieVersion = freezed, - Object? fp32Tflops = freezed, - Object? blenderScore = freezed, - Object? score = freezed, - Object? verified = null, - Object? sourceUrls = null, - Object? url = freezed, - }) { - return _then(_self.copyWith( - slug: null == slug - ? _self.slug - : slug // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _self.name - : name // ignore: cast_nullable_to_non_nullable - as String, - id: freezed == id - ? _self.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - manufacturer: freezed == manufacturer - ? _self.manufacturer - : manufacturer // ignore: cast_nullable_to_non_nullable - as Brand?, - architecture: freezed == architecture - ? _self.architecture - : architecture // ignore: cast_nullable_to_non_nullable - as String?, - releaseDate: freezed == releaseDate - ? _self.releaseDate - : releaseDate // ignore: cast_nullable_to_non_nullable - as String?, - msrpUsd: freezed == msrpUsd - ? _self.msrpUsd - : msrpUsd // ignore: cast_nullable_to_non_nullable - as int?, - cudaCores: freezed == cudaCores - ? _self.cudaCores - : cudaCores // ignore: cast_nullable_to_non_nullable - as int?, - streamProcessors: freezed == streamProcessors - ? _self.streamProcessors - : streamProcessors // ignore: cast_nullable_to_non_nullable - as int?, - rtCores: freezed == rtCores - ? _self.rtCores - : rtCores // ignore: cast_nullable_to_non_nullable - as int?, - tensorCores: freezed == tensorCores - ? _self.tensorCores - : tensorCores // ignore: cast_nullable_to_non_nullable - as int?, - memoryGb: freezed == memoryGb - ? _self.memoryGb - : memoryGb // ignore: cast_nullable_to_non_nullable - as double?, - memoryType: freezed == memoryType - ? _self.memoryType - : memoryType // ignore: cast_nullable_to_non_nullable - as String?, - memoryBusBit: freezed == memoryBusBit - ? _self.memoryBusBit - : memoryBusBit // ignore: cast_nullable_to_non_nullable - as int?, - memoryBandwidthGbps: freezed == memoryBandwidthGbps - ? _self.memoryBandwidthGbps - : memoryBandwidthGbps // ignore: cast_nullable_to_non_nullable - as double?, - baseClockMhz: freezed == baseClockMhz - ? _self.baseClockMhz - : baseClockMhz // ignore: cast_nullable_to_non_nullable - as int?, - boostClockMhz: freezed == boostClockMhz - ? _self.boostClockMhz - : boostClockMhz // ignore: cast_nullable_to_non_nullable - as int?, - tdpW: freezed == tdpW - ? _self.tdpW - : tdpW // ignore: cast_nullable_to_non_nullable - as int?, - pcieVersion: freezed == pcieVersion - ? _self.pcieVersion - : pcieVersion // ignore: cast_nullable_to_non_nullable - as String?, - fp32Tflops: freezed == fp32Tflops - ? _self.fp32Tflops - : fp32Tflops // ignore: cast_nullable_to_non_nullable - as double?, - blenderScore: freezed == blenderScore - ? _self.blenderScore - : blenderScore // ignore: cast_nullable_to_non_nullable - as double?, - score: freezed == score - ? _self.score - : score // ignore: cast_nullable_to_non_nullable - as GpuScore?, - verified: null == verified - ? _self.verified - : verified // ignore: cast_nullable_to_non_nullable - as bool, - sourceUrls: null == sourceUrls - ? _self.sourceUrls - : sourceUrls // ignore: cast_nullable_to_non_nullable - as List, - url: freezed == url - ? _self.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - )); - } - - /// Create a copy of Gpu - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BrandCopyWith<$Res>? get manufacturer { +/// Create a copy of Gpu +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? slug = null,Object? name = null,Object? id = freezed,Object? manufacturer = freezed,Object? architecture = freezed,Object? releaseDate = freezed,Object? msrpUsd = freezed,Object? cudaCores = freezed,Object? streamProcessors = freezed,Object? rtCores = freezed,Object? tensorCores = freezed,Object? memoryGb = freezed,Object? memoryType = freezed,Object? memoryBusBit = freezed,Object? memoryBandwidthGbps = freezed,Object? baseClockMhz = freezed,Object? boostClockMhz = freezed,Object? tdpW = freezed,Object? pcieVersion = freezed,Object? fp32Tflops = freezed,Object? blenderScore = freezed,Object? score = freezed,Object? verified = null,Object? sourceUrls = null,Object? url = freezed,}) { + return _then(_self.copyWith( +slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable +as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,manufacturer: freezed == manufacturer ? _self.manufacturer : manufacturer // ignore: cast_nullable_to_non_nullable +as Brand?,architecture: freezed == architecture ? _self.architecture : architecture // ignore: cast_nullable_to_non_nullable +as String?,releaseDate: freezed == releaseDate ? _self.releaseDate : releaseDate // ignore: cast_nullable_to_non_nullable +as String?,msrpUsd: freezed == msrpUsd ? _self.msrpUsd : msrpUsd // ignore: cast_nullable_to_non_nullable +as int?,cudaCores: freezed == cudaCores ? _self.cudaCores : cudaCores // ignore: cast_nullable_to_non_nullable +as int?,streamProcessors: freezed == streamProcessors ? _self.streamProcessors : streamProcessors // ignore: cast_nullable_to_non_nullable +as int?,rtCores: freezed == rtCores ? _self.rtCores : rtCores // ignore: cast_nullable_to_non_nullable +as int?,tensorCores: freezed == tensorCores ? _self.tensorCores : tensorCores // ignore: cast_nullable_to_non_nullable +as int?,memoryGb: freezed == memoryGb ? _self.memoryGb : memoryGb // ignore: cast_nullable_to_non_nullable +as double?,memoryType: freezed == memoryType ? _self.memoryType : memoryType // ignore: cast_nullable_to_non_nullable +as String?,memoryBusBit: freezed == memoryBusBit ? _self.memoryBusBit : memoryBusBit // ignore: cast_nullable_to_non_nullable +as int?,memoryBandwidthGbps: freezed == memoryBandwidthGbps ? _self.memoryBandwidthGbps : memoryBandwidthGbps // ignore: cast_nullable_to_non_nullable +as double?,baseClockMhz: freezed == baseClockMhz ? _self.baseClockMhz : baseClockMhz // ignore: cast_nullable_to_non_nullable +as int?,boostClockMhz: freezed == boostClockMhz ? _self.boostClockMhz : boostClockMhz // ignore: cast_nullable_to_non_nullable +as int?,tdpW: freezed == tdpW ? _self.tdpW : tdpW // ignore: cast_nullable_to_non_nullable +as int?,pcieVersion: freezed == pcieVersion ? _self.pcieVersion : pcieVersion // ignore: cast_nullable_to_non_nullable +as String?,fp32Tflops: freezed == fp32Tflops ? _self.fp32Tflops : fp32Tflops // ignore: cast_nullable_to_non_nullable +as double?,blenderScore: freezed == blenderScore ? _self.blenderScore : blenderScore // ignore: cast_nullable_to_non_nullable +as double?,score: freezed == score ? _self.score : score // ignore: cast_nullable_to_non_nullable +as GpuScore?,verified: null == verified ? _self.verified : verified // ignore: cast_nullable_to_non_nullable +as bool,sourceUrls: null == sourceUrls ? _self.sourceUrls : sourceUrls // ignore: cast_nullable_to_non_nullable +as List,url: freezed == url ? _self.url : url // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of Gpu +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BrandCopyWith<$Res>? get manufacturer { if (_self.manufacturer == null) { - return null; - } - - return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { - return _then(_self.copyWith(manufacturer: value)); - }); + return null; } - /// Create a copy of Gpu - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $GpuScoreCopyWith<$Res>? get score { + return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { + return _then(_self.copyWith(manufacturer: value)); + }); +}/// Create a copy of Gpu +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GpuScoreCopyWith<$Res>? get score { if (_self.score == null) { - return null; - } - - return $GpuScoreCopyWith<$Res>(_self.score!, (value) { - return _then(_self.copyWith(score: value)); - }); + return null; } + + return $GpuScoreCopyWith<$Res>(_self.score!, (value) { + return _then(_self.copyWith(score: value)); + }); +} } + /// Adds pattern-matching-related methods to [Gpu]. extension GpuPatterns on Gpu { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_Gpu value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Gpu() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } - - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_Gpu value) $default, - ) { - final _that = this; - switch (_that) { - case _Gpu(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Gpu value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Gpu() when $default != null: +return $default(_that);case _: + return orElse(); - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_Gpu value)? $default, - ) { - final _that = this; - switch (_that) { - case _Gpu() when $default != null: - return $default(_that); - case _: - return null; - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Gpu value) $default,){ +final _that = this; +switch (_that) { +case _Gpu(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Gpu value)? $default,){ +final _that = this; +switch (_that) { +case _Gpu() when $default != null: +return $default(_that);case _: + return null; - @optionalTypeArgs - TResult maybeWhen( - TResult Function( - String slug, - String name, - int? id, - Brand? manufacturer, - String? architecture, - String? releaseDate, - int? msrpUsd, - int? cudaCores, - int? streamProcessors, - int? rtCores, - int? tensorCores, - double? memoryGb, - String? memoryType, - int? memoryBusBit, - double? memoryBandwidthGbps, - int? baseClockMhz, - int? boostClockMhz, - int? tdpW, - String? pcieVersion, - double? fp32Tflops, - double? blenderScore, - GpuScore? score, - bool verified, - List sourceUrls, - String? url)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Gpu() when $default != null: - return $default( - _that.slug, - _that.name, - _that.id, - _that.manufacturer, - _that.architecture, - _that.releaseDate, - _that.msrpUsd, - _that.cudaCores, - _that.streamProcessors, - _that.rtCores, - _that.tensorCores, - _that.memoryGb, - _that.memoryType, - _that.memoryBusBit, - _that.memoryBandwidthGbps, - _that.baseClockMhz, - _that.boostClockMhz, - _that.tdpW, - _that.pcieVersion, - _that.fp32Tflops, - _that.blenderScore, - _that.score, - _that.verified, - _that.sourceUrls, - _that.url); - case _: - return orElse(); - } - } +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String slug, String name, int? id, Brand? manufacturer, String? architecture, String? releaseDate, int? msrpUsd, int? cudaCores, int? streamProcessors, int? rtCores, int? tensorCores, double? memoryGb, String? memoryType, int? memoryBusBit, double? memoryBandwidthGbps, int? baseClockMhz, int? boostClockMhz, int? tdpW, String? pcieVersion, double? fp32Tflops, double? blenderScore, GpuScore? score, bool verified, List sourceUrls, String? url)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Gpu() when $default != null: +return $default(_that.slug,_that.name,_that.id,_that.manufacturer,_that.architecture,_that.releaseDate,_that.msrpUsd,_that.cudaCores,_that.streamProcessors,_that.rtCores,_that.tensorCores,_that.memoryGb,_that.memoryType,_that.memoryBusBit,_that.memoryBandwidthGbps,_that.baseClockMhz,_that.boostClockMhz,_that.tdpW,_that.pcieVersion,_that.fp32Tflops,_that.blenderScore,_that.score,_that.verified,_that.sourceUrls,_that.url);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String slug, String name, int? id, Brand? manufacturer, String? architecture, String? releaseDate, int? msrpUsd, int? cudaCores, int? streamProcessors, int? rtCores, int? tensorCores, double? memoryGb, String? memoryType, int? memoryBusBit, double? memoryBandwidthGbps, int? baseClockMhz, int? boostClockMhz, int? tdpW, String? pcieVersion, double? fp32Tflops, double? blenderScore, GpuScore? score, bool verified, List sourceUrls, String? url) $default,) {final _that = this; +switch (_that) { +case _Gpu(): +return $default(_that.slug,_that.name,_that.id,_that.manufacturer,_that.architecture,_that.releaseDate,_that.msrpUsd,_that.cudaCores,_that.streamProcessors,_that.rtCores,_that.tensorCores,_that.memoryGb,_that.memoryType,_that.memoryBusBit,_that.memoryBandwidthGbps,_that.baseClockMhz,_that.boostClockMhz,_that.tdpW,_that.pcieVersion,_that.fp32Tflops,_that.blenderScore,_that.score,_that.verified,_that.sourceUrls,_that.url);case _: + throw StateError('Unexpected subclass'); - @optionalTypeArgs - TResult when( - TResult Function( - String slug, - String name, - int? id, - Brand? manufacturer, - String? architecture, - String? releaseDate, - int? msrpUsd, - int? cudaCores, - int? streamProcessors, - int? rtCores, - int? tensorCores, - double? memoryGb, - String? memoryType, - int? memoryBusBit, - double? memoryBandwidthGbps, - int? baseClockMhz, - int? boostClockMhz, - int? tdpW, - String? pcieVersion, - double? fp32Tflops, - double? blenderScore, - GpuScore? score, - bool verified, - List sourceUrls, - String? url) - $default, - ) { - final _that = this; - switch (_that) { - case _Gpu(): - return $default( - _that.slug, - _that.name, - _that.id, - _that.manufacturer, - _that.architecture, - _that.releaseDate, - _that.msrpUsd, - _that.cudaCores, - _that.streamProcessors, - _that.rtCores, - _that.tensorCores, - _that.memoryGb, - _that.memoryType, - _that.memoryBusBit, - _that.memoryBandwidthGbps, - _that.baseClockMhz, - _that.boostClockMhz, - _that.tdpW, - _that.pcieVersion, - _that.fp32Tflops, - _that.blenderScore, - _that.score, - _that.verified, - _that.sourceUrls, - _that.url); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String slug, String name, int? id, Brand? manufacturer, String? architecture, String? releaseDate, int? msrpUsd, int? cudaCores, int? streamProcessors, int? rtCores, int? tensorCores, double? memoryGb, String? memoryType, int? memoryBusBit, double? memoryBandwidthGbps, int? baseClockMhz, int? boostClockMhz, int? tdpW, String? pcieVersion, double? fp32Tflops, double? blenderScore, GpuScore? score, bool verified, List sourceUrls, String? url)? $default,) {final _that = this; +switch (_that) { +case _Gpu() when $default != null: +return $default(_that.slug,_that.name,_that.id,_that.manufacturer,_that.architecture,_that.releaseDate,_that.msrpUsd,_that.cudaCores,_that.streamProcessors,_that.rtCores,_that.tensorCores,_that.memoryGb,_that.memoryType,_that.memoryBusBit,_that.memoryBandwidthGbps,_that.baseClockMhz,_that.boostClockMhz,_that.tdpW,_that.pcieVersion,_that.fp32Tflops,_that.blenderScore,_that.score,_that.verified,_that.sourceUrls,_that.url);case _: + return null; - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` +} +} - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function( - String slug, - String name, - int? id, - Brand? manufacturer, - String? architecture, - String? releaseDate, - int? msrpUsd, - int? cudaCores, - int? streamProcessors, - int? rtCores, - int? tensorCores, - double? memoryGb, - String? memoryType, - int? memoryBusBit, - double? memoryBandwidthGbps, - int? baseClockMhz, - int? boostClockMhz, - int? tdpW, - String? pcieVersion, - double? fp32Tflops, - double? blenderScore, - GpuScore? score, - bool verified, - List sourceUrls, - String? url)? - $default, - ) { - final _that = this; - switch (_that) { - case _Gpu() when $default != null: - return $default( - _that.slug, - _that.name, - _that.id, - _that.manufacturer, - _that.architecture, - _that.releaseDate, - _that.msrpUsd, - _that.cudaCores, - _that.streamProcessors, - _that.rtCores, - _that.tensorCores, - _that.memoryGb, - _that.memoryType, - _that.memoryBusBit, - _that.memoryBandwidthGbps, - _that.baseClockMhz, - _that.boostClockMhz, - _that.tdpW, - _that.pcieVersion, - _that.fp32Tflops, - _that.blenderScore, - _that.score, - _that.verified, - _that.sourceUrls, - _that.url); - case _: - return null; - } - } } /// @nodoc @JsonSerializable() + class _Gpu implements Gpu { - const _Gpu( - {required this.slug, - required this.name, - this.id, - this.manufacturer, - this.architecture, - this.releaseDate, - this.msrpUsd, - this.cudaCores, - this.streamProcessors, - this.rtCores, - this.tensorCores, - this.memoryGb, - this.memoryType, - this.memoryBusBit, - this.memoryBandwidthGbps, - this.baseClockMhz, - this.boostClockMhz, - this.tdpW, - this.pcieVersion, - this.fp32Tflops, - this.blenderScore, - this.score, - this.verified = false, - final List sourceUrls = const [], - this.url}) - : _sourceUrls = sourceUrls; + const _Gpu({required this.slug, required this.name, this.id, this.manufacturer, this.architecture, this.releaseDate, this.msrpUsd, this.cudaCores, this.streamProcessors, this.rtCores, this.tensorCores, this.memoryGb, this.memoryType, this.memoryBusBit, this.memoryBandwidthGbps, this.baseClockMhz, this.boostClockMhz, this.tdpW, this.pcieVersion, this.fp32Tflops, this.blenderScore, this.score, this.verified = false, final List sourceUrls = const [], this.url}): _sourceUrls = sourceUrls; factory _Gpu.fromJson(Map json) => _$GpuFromJson(json); - @override - final String slug; - @override - final String name; - @override - final int? id; - @override - final Brand? manufacturer; - @override - final String? architecture; - @override - final String? releaseDate; - @override - final int? msrpUsd; - @override - final int? cudaCores; - @override - final int? streamProcessors; - @override - final int? rtCores; - @override - final int? tensorCores; - @override - final double? memoryGb; - @override - final String? memoryType; - @override - final int? memoryBusBit; - @override - final double? memoryBandwidthGbps; - @override - final int? baseClockMhz; - @override - final int? boostClockMhz; - @override - final int? tdpW; - @override - final String? pcieVersion; - @override - final double? fp32Tflops; - @override - final double? blenderScore; - @override - final GpuScore? score; - @override - @JsonKey() - final bool verified; - final List _sourceUrls; - @override - @JsonKey() - List get sourceUrls { - if (_sourceUrls is EqualUnmodifiableListView) return _sourceUrls; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_sourceUrls); - } +@override final String slug; +@override final String name; +@override final int? id; +@override final Brand? manufacturer; +@override final String? architecture; +@override final String? releaseDate; +@override final int? msrpUsd; +@override final int? cudaCores; +@override final int? streamProcessors; +@override final int? rtCores; +@override final int? tensorCores; +@override final double? memoryGb; +@override final String? memoryType; +@override final int? memoryBusBit; +@override final double? memoryBandwidthGbps; +@override final int? baseClockMhz; +@override final int? boostClockMhz; +@override final int? tdpW; +@override final String? pcieVersion; +@override final double? fp32Tflops; +@override final double? blenderScore; +@override final GpuScore? score; +@override@JsonKey() final bool verified; + final List _sourceUrls; +@override@JsonKey() List get sourceUrls { + if (_sourceUrls is EqualUnmodifiableListView) return _sourceUrls; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_sourceUrls); +} - @override - final String? url; +@override final String? url; - /// Create a copy of Gpu - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$GpuCopyWith<_Gpu> get copyWith => - __$GpuCopyWithImpl<_Gpu>(this, _$identity); +/// Create a copy of Gpu +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GpuCopyWith<_Gpu> get copyWith => __$GpuCopyWithImpl<_Gpu>(this, _$identity); - @override - Map toJson() { - return _$GpuToJson( - this, - ); - } +@override +Map toJson() { + return _$GpuToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _Gpu && - (identical(other.slug, slug) || other.slug == slug) && - (identical(other.name, name) || other.name == name) && - (identical(other.id, id) || other.id == id) && - (identical(other.manufacturer, manufacturer) || - other.manufacturer == manufacturer) && - (identical(other.architecture, architecture) || - other.architecture == architecture) && - (identical(other.releaseDate, releaseDate) || - other.releaseDate == releaseDate) && - (identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd) && - (identical(other.cudaCores, cudaCores) || - other.cudaCores == cudaCores) && - (identical(other.streamProcessors, streamProcessors) || - other.streamProcessors == streamProcessors) && - (identical(other.rtCores, rtCores) || other.rtCores == rtCores) && - (identical(other.tensorCores, tensorCores) || - other.tensorCores == tensorCores) && - (identical(other.memoryGb, memoryGb) || - other.memoryGb == memoryGb) && - (identical(other.memoryType, memoryType) || - other.memoryType == memoryType) && - (identical(other.memoryBusBit, memoryBusBit) || - other.memoryBusBit == memoryBusBit) && - (identical(other.memoryBandwidthGbps, memoryBandwidthGbps) || - other.memoryBandwidthGbps == memoryBandwidthGbps) && - (identical(other.baseClockMhz, baseClockMhz) || - other.baseClockMhz == baseClockMhz) && - (identical(other.boostClockMhz, boostClockMhz) || - other.boostClockMhz == boostClockMhz) && - (identical(other.tdpW, tdpW) || other.tdpW == tdpW) && - (identical(other.pcieVersion, pcieVersion) || - other.pcieVersion == pcieVersion) && - (identical(other.fp32Tflops, fp32Tflops) || - other.fp32Tflops == fp32Tflops) && - (identical(other.blenderScore, blenderScore) || - other.blenderScore == blenderScore) && - (identical(other.score, score) || other.score == score) && - (identical(other.verified, verified) || - other.verified == verified) && - const DeepCollectionEquality() - .equals(other._sourceUrls, _sourceUrls) && - (identical(other.url, url) || other.url == url)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Gpu&&(identical(other.slug, slug) || other.slug == slug)&&(identical(other.name, name) || other.name == name)&&(identical(other.id, id) || other.id == id)&&(identical(other.manufacturer, manufacturer) || other.manufacturer == manufacturer)&&(identical(other.architecture, architecture) || other.architecture == architecture)&&(identical(other.releaseDate, releaseDate) || other.releaseDate == releaseDate)&&(identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd)&&(identical(other.cudaCores, cudaCores) || other.cudaCores == cudaCores)&&(identical(other.streamProcessors, streamProcessors) || other.streamProcessors == streamProcessors)&&(identical(other.rtCores, rtCores) || other.rtCores == rtCores)&&(identical(other.tensorCores, tensorCores) || other.tensorCores == tensorCores)&&(identical(other.memoryGb, memoryGb) || other.memoryGb == memoryGb)&&(identical(other.memoryType, memoryType) || other.memoryType == memoryType)&&(identical(other.memoryBusBit, memoryBusBit) || other.memoryBusBit == memoryBusBit)&&(identical(other.memoryBandwidthGbps, memoryBandwidthGbps) || other.memoryBandwidthGbps == memoryBandwidthGbps)&&(identical(other.baseClockMhz, baseClockMhz) || other.baseClockMhz == baseClockMhz)&&(identical(other.boostClockMhz, boostClockMhz) || other.boostClockMhz == boostClockMhz)&&(identical(other.tdpW, tdpW) || other.tdpW == tdpW)&&(identical(other.pcieVersion, pcieVersion) || other.pcieVersion == pcieVersion)&&(identical(other.fp32Tflops, fp32Tflops) || other.fp32Tflops == fp32Tflops)&&(identical(other.blenderScore, blenderScore) || other.blenderScore == blenderScore)&&(identical(other.score, score) || other.score == score)&&(identical(other.verified, verified) || other.verified == verified)&&const DeepCollectionEquality().equals(other._sourceUrls, _sourceUrls)&&(identical(other.url, url) || other.url == url)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,slug,name,id,manufacturer,architecture,releaseDate,msrpUsd,cudaCores,streamProcessors,rtCores,tensorCores,memoryGb,memoryType,memoryBusBit,memoryBandwidthGbps,baseClockMhz,boostClockMhz,tdpW,pcieVersion,fp32Tflops,blenderScore,score,verified,const DeepCollectionEquality().hash(_sourceUrls),url]); + +@override +String toString() { + return 'Gpu(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, architecture: $architecture, releaseDate: $releaseDate, msrpUsd: $msrpUsd, cudaCores: $cudaCores, streamProcessors: $streamProcessors, rtCores: $rtCores, tensorCores: $tensorCores, memoryGb: $memoryGb, memoryType: $memoryType, memoryBusBit: $memoryBusBit, memoryBandwidthGbps: $memoryBandwidthGbps, baseClockMhz: $baseClockMhz, boostClockMhz: $boostClockMhz, tdpW: $tdpW, pcieVersion: $pcieVersion, fp32Tflops: $fp32Tflops, blenderScore: $blenderScore, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hashAll([ - runtimeType, - slug, - name, - id, - manufacturer, - architecture, - releaseDate, - msrpUsd, - cudaCores, - streamProcessors, - rtCores, - tensorCores, - memoryGb, - memoryType, - memoryBusBit, - memoryBandwidthGbps, - baseClockMhz, - boostClockMhz, - tdpW, - pcieVersion, - fp32Tflops, - blenderScore, - score, - verified, - const DeepCollectionEquality().hash(_sourceUrls), - url - ]); - @override - String toString() { - return 'Gpu(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, architecture: $architecture, releaseDate: $releaseDate, msrpUsd: $msrpUsd, cudaCores: $cudaCores, streamProcessors: $streamProcessors, rtCores: $rtCores, tensorCores: $tensorCores, memoryGb: $memoryGb, memoryType: $memoryType, memoryBusBit: $memoryBusBit, memoryBandwidthGbps: $memoryBandwidthGbps, baseClockMhz: $baseClockMhz, boostClockMhz: $boostClockMhz, tdpW: $tdpW, pcieVersion: $pcieVersion, fp32Tflops: $fp32Tflops, blenderScore: $blenderScore, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; - } } /// @nodoc abstract mixin class _$GpuCopyWith<$Res> implements $GpuCopyWith<$Res> { - factory _$GpuCopyWith(_Gpu value, $Res Function(_Gpu) _then) = - __$GpuCopyWithImpl; - @override - @useResult - $Res call( - {String slug, - String name, - int? id, - Brand? manufacturer, - String? architecture, - String? releaseDate, - int? msrpUsd, - int? cudaCores, - int? streamProcessors, - int? rtCores, - int? tensorCores, - double? memoryGb, - String? memoryType, - int? memoryBusBit, - double? memoryBandwidthGbps, - int? baseClockMhz, - int? boostClockMhz, - int? tdpW, - String? pcieVersion, - double? fp32Tflops, - double? blenderScore, - GpuScore? score, - bool verified, - List sourceUrls, - String? url}); + factory _$GpuCopyWith(_Gpu value, $Res Function(_Gpu) _then) = __$GpuCopyWithImpl; +@override @useResult +$Res call({ + String slug, String name, int? id, Brand? manufacturer, String? architecture, String? releaseDate, int? msrpUsd, int? cudaCores, int? streamProcessors, int? rtCores, int? tensorCores, double? memoryGb, String? memoryType, int? memoryBusBit, double? memoryBandwidthGbps, int? baseClockMhz, int? boostClockMhz, int? tdpW, String? pcieVersion, double? fp32Tflops, double? blenderScore, GpuScore? score, bool verified, List sourceUrls, String? url +}); - @override - $BrandCopyWith<$Res>? get manufacturer; - @override - $GpuScoreCopyWith<$Res>? get score; -} +@override $BrandCopyWith<$Res>? get manufacturer;@override $GpuScoreCopyWith<$Res>? get score; + +} /// @nodoc -class __$GpuCopyWithImpl<$Res> implements _$GpuCopyWith<$Res> { +class __$GpuCopyWithImpl<$Res> + implements _$GpuCopyWith<$Res> { __$GpuCopyWithImpl(this._self, this._then); final _Gpu _self; final $Res Function(_Gpu) _then; - /// Create a copy of Gpu - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? slug = null, - Object? name = null, - Object? id = freezed, - Object? manufacturer = freezed, - Object? architecture = freezed, - Object? releaseDate = freezed, - Object? msrpUsd = freezed, - Object? cudaCores = freezed, - Object? streamProcessors = freezed, - Object? rtCores = freezed, - Object? tensorCores = freezed, - Object? memoryGb = freezed, - Object? memoryType = freezed, - Object? memoryBusBit = freezed, - Object? memoryBandwidthGbps = freezed, - Object? baseClockMhz = freezed, - Object? boostClockMhz = freezed, - Object? tdpW = freezed, - Object? pcieVersion = freezed, - Object? fp32Tflops = freezed, - Object? blenderScore = freezed, - Object? score = freezed, - Object? verified = null, - Object? sourceUrls = null, - Object? url = freezed, - }) { - return _then(_Gpu( - slug: null == slug - ? _self.slug - : slug // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _self.name - : name // ignore: cast_nullable_to_non_nullable - as String, - id: freezed == id - ? _self.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - manufacturer: freezed == manufacturer - ? _self.manufacturer - : manufacturer // ignore: cast_nullable_to_non_nullable - as Brand?, - architecture: freezed == architecture - ? _self.architecture - : architecture // ignore: cast_nullable_to_non_nullable - as String?, - releaseDate: freezed == releaseDate - ? _self.releaseDate - : releaseDate // ignore: cast_nullable_to_non_nullable - as String?, - msrpUsd: freezed == msrpUsd - ? _self.msrpUsd - : msrpUsd // ignore: cast_nullable_to_non_nullable - as int?, - cudaCores: freezed == cudaCores - ? _self.cudaCores - : cudaCores // ignore: cast_nullable_to_non_nullable - as int?, - streamProcessors: freezed == streamProcessors - ? _self.streamProcessors - : streamProcessors // ignore: cast_nullable_to_non_nullable - as int?, - rtCores: freezed == rtCores - ? _self.rtCores - : rtCores // ignore: cast_nullable_to_non_nullable - as int?, - tensorCores: freezed == tensorCores - ? _self.tensorCores - : tensorCores // ignore: cast_nullable_to_non_nullable - as int?, - memoryGb: freezed == memoryGb - ? _self.memoryGb - : memoryGb // ignore: cast_nullable_to_non_nullable - as double?, - memoryType: freezed == memoryType - ? _self.memoryType - : memoryType // ignore: cast_nullable_to_non_nullable - as String?, - memoryBusBit: freezed == memoryBusBit - ? _self.memoryBusBit - : memoryBusBit // ignore: cast_nullable_to_non_nullable - as int?, - memoryBandwidthGbps: freezed == memoryBandwidthGbps - ? _self.memoryBandwidthGbps - : memoryBandwidthGbps // ignore: cast_nullable_to_non_nullable - as double?, - baseClockMhz: freezed == baseClockMhz - ? _self.baseClockMhz - : baseClockMhz // ignore: cast_nullable_to_non_nullable - as int?, - boostClockMhz: freezed == boostClockMhz - ? _self.boostClockMhz - : boostClockMhz // ignore: cast_nullable_to_non_nullable - as int?, - tdpW: freezed == tdpW - ? _self.tdpW - : tdpW // ignore: cast_nullable_to_non_nullable - as int?, - pcieVersion: freezed == pcieVersion - ? _self.pcieVersion - : pcieVersion // ignore: cast_nullable_to_non_nullable - as String?, - fp32Tflops: freezed == fp32Tflops - ? _self.fp32Tflops - : fp32Tflops // ignore: cast_nullable_to_non_nullable - as double?, - blenderScore: freezed == blenderScore - ? _self.blenderScore - : blenderScore // ignore: cast_nullable_to_non_nullable - as double?, - score: freezed == score - ? _self.score - : score // ignore: cast_nullable_to_non_nullable - as GpuScore?, - verified: null == verified - ? _self.verified - : verified // ignore: cast_nullable_to_non_nullable - as bool, - sourceUrls: null == sourceUrls - ? _self._sourceUrls - : sourceUrls // ignore: cast_nullable_to_non_nullable - as List, - url: freezed == url - ? _self.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +/// Create a copy of Gpu +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? slug = null,Object? name = null,Object? id = freezed,Object? manufacturer = freezed,Object? architecture = freezed,Object? releaseDate = freezed,Object? msrpUsd = freezed,Object? cudaCores = freezed,Object? streamProcessors = freezed,Object? rtCores = freezed,Object? tensorCores = freezed,Object? memoryGb = freezed,Object? memoryType = freezed,Object? memoryBusBit = freezed,Object? memoryBandwidthGbps = freezed,Object? baseClockMhz = freezed,Object? boostClockMhz = freezed,Object? tdpW = freezed,Object? pcieVersion = freezed,Object? fp32Tflops = freezed,Object? blenderScore = freezed,Object? score = freezed,Object? verified = null,Object? sourceUrls = null,Object? url = freezed,}) { + return _then(_Gpu( +slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable +as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,manufacturer: freezed == manufacturer ? _self.manufacturer : manufacturer // ignore: cast_nullable_to_non_nullable +as Brand?,architecture: freezed == architecture ? _self.architecture : architecture // ignore: cast_nullable_to_non_nullable +as String?,releaseDate: freezed == releaseDate ? _self.releaseDate : releaseDate // ignore: cast_nullable_to_non_nullable +as String?,msrpUsd: freezed == msrpUsd ? _self.msrpUsd : msrpUsd // ignore: cast_nullable_to_non_nullable +as int?,cudaCores: freezed == cudaCores ? _self.cudaCores : cudaCores // ignore: cast_nullable_to_non_nullable +as int?,streamProcessors: freezed == streamProcessors ? _self.streamProcessors : streamProcessors // ignore: cast_nullable_to_non_nullable +as int?,rtCores: freezed == rtCores ? _self.rtCores : rtCores // ignore: cast_nullable_to_non_nullable +as int?,tensorCores: freezed == tensorCores ? _self.tensorCores : tensorCores // ignore: cast_nullable_to_non_nullable +as int?,memoryGb: freezed == memoryGb ? _self.memoryGb : memoryGb // ignore: cast_nullable_to_non_nullable +as double?,memoryType: freezed == memoryType ? _self.memoryType : memoryType // ignore: cast_nullable_to_non_nullable +as String?,memoryBusBit: freezed == memoryBusBit ? _self.memoryBusBit : memoryBusBit // ignore: cast_nullable_to_non_nullable +as int?,memoryBandwidthGbps: freezed == memoryBandwidthGbps ? _self.memoryBandwidthGbps : memoryBandwidthGbps // ignore: cast_nullable_to_non_nullable +as double?,baseClockMhz: freezed == baseClockMhz ? _self.baseClockMhz : baseClockMhz // ignore: cast_nullable_to_non_nullable +as int?,boostClockMhz: freezed == boostClockMhz ? _self.boostClockMhz : boostClockMhz // ignore: cast_nullable_to_non_nullable +as int?,tdpW: freezed == tdpW ? _self.tdpW : tdpW // ignore: cast_nullable_to_non_nullable +as int?,pcieVersion: freezed == pcieVersion ? _self.pcieVersion : pcieVersion // ignore: cast_nullable_to_non_nullable +as String?,fp32Tflops: freezed == fp32Tflops ? _self.fp32Tflops : fp32Tflops // ignore: cast_nullable_to_non_nullable +as double?,blenderScore: freezed == blenderScore ? _self.blenderScore : blenderScore // ignore: cast_nullable_to_non_nullable +as double?,score: freezed == score ? _self.score : score // ignore: cast_nullable_to_non_nullable +as GpuScore?,verified: null == verified ? _self.verified : verified // ignore: cast_nullable_to_non_nullable +as bool,sourceUrls: null == sourceUrls ? _self._sourceUrls : sourceUrls // ignore: cast_nullable_to_non_nullable +as List,url: freezed == url ? _self.url : url // ignore: cast_nullable_to_non_nullable +as String?, + )); +} - /// Create a copy of Gpu - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BrandCopyWith<$Res>? get manufacturer { +/// Create a copy of Gpu +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BrandCopyWith<$Res>? get manufacturer { if (_self.manufacturer == null) { - return null; - } - - return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { - return _then(_self.copyWith(manufacturer: value)); - }); + return null; } - /// Create a copy of Gpu - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $GpuScoreCopyWith<$Res>? get score { + return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { + return _then(_self.copyWith(manufacturer: value)); + }); +}/// Create a copy of Gpu +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GpuScoreCopyWith<$Res>? get score { if (_self.score == null) { - return null; - } - - return $GpuScoreCopyWith<$Res>(_self.score!, (value) { - return _then(_self.copyWith(score: value)); - }); + return null; } + + return $GpuScoreCopyWith<$Res>(_self.score!, (value) { + return _then(_self.copyWith(score: value)); + }); +} } // dart format on diff --git a/lib/data/dto/gpu.g.dart b/lib/data/dto/gpu.g.dart index 2082bc0..68afb76 100644 --- a/lib/data/dto/gpu.g.dart +++ b/lib/data/dto/gpu.g.dart @@ -7,64 +7,65 @@ part of 'gpu.dart'; // ************************************************************************** _Gpu _$GpuFromJson(Map json) => _Gpu( - slug: json['slug'] as String, - name: json['name'] as String, - id: (json['id'] as num?)?.toInt(), - manufacturer: json['manufacturer'] == null - ? null - : Brand.fromJson(json['manufacturer'] as Map), - architecture: json['architecture'] as String?, - releaseDate: json['release_date'] as String?, - msrpUsd: (json['msrp_usd'] as num?)?.toInt(), - cudaCores: (json['cuda_cores'] as num?)?.toInt(), - streamProcessors: (json['stream_processors'] as num?)?.toInt(), - rtCores: (json['rt_cores'] as num?)?.toInt(), - tensorCores: (json['tensor_cores'] as num?)?.toInt(), - memoryGb: (json['memory_gb'] as num?)?.toDouble(), - memoryType: json['memory_type'] as String?, - memoryBusBit: (json['memory_bus_bit'] as num?)?.toInt(), - memoryBandwidthGbps: (json['memory_bandwidth_gbps'] as num?)?.toDouble(), - baseClockMhz: (json['base_clock_mhz'] as num?)?.toInt(), - boostClockMhz: (json['boost_clock_mhz'] as num?)?.toInt(), - tdpW: (json['tdp_w'] as num?)?.toInt(), - pcieVersion: json['pcie_version'] as String?, - fp32Tflops: (json['fp32_tflops'] as num?)?.toDouble(), - blenderScore: (json['blender_score'] as num?)?.toDouble(), - score: json['score'] == null - ? null - : GpuScore.fromJson(json['score'] as Map), - verified: json['verified'] as bool? ?? false, - sourceUrls: (json['source_urls'] as List?) - ?.map((e) => e as String) - .toList() ?? - const [], - url: json['url'] as String?, - ); + slug: json['slug'] as String, + name: json['name'] as String, + id: (json['id'] as num?)?.toInt(), + manufacturer: json['manufacturer'] == null + ? null + : Brand.fromJson(json['manufacturer'] as Map), + architecture: json['architecture'] as String?, + releaseDate: json['release_date'] as String?, + msrpUsd: (json['msrp_usd'] as num?)?.toInt(), + cudaCores: (json['cuda_cores'] as num?)?.toInt(), + streamProcessors: (json['stream_processors'] as num?)?.toInt(), + rtCores: (json['rt_cores'] as num?)?.toInt(), + tensorCores: (json['tensor_cores'] as num?)?.toInt(), + memoryGb: (json['memory_gb'] as num?)?.toDouble(), + memoryType: json['memory_type'] as String?, + memoryBusBit: (json['memory_bus_bit'] as num?)?.toInt(), + memoryBandwidthGbps: (json['memory_bandwidth_gbps'] as num?)?.toDouble(), + baseClockMhz: (json['base_clock_mhz'] as num?)?.toInt(), + boostClockMhz: (json['boost_clock_mhz'] as num?)?.toInt(), + tdpW: (json['tdp_w'] as num?)?.toInt(), + pcieVersion: json['pcie_version'] as String?, + fp32Tflops: (json['fp32_tflops'] as num?)?.toDouble(), + blenderScore: (json['blender_score'] as num?)?.toDouble(), + score: json['score'] == null + ? null + : GpuScore.fromJson(json['score'] as Map), + verified: json['verified'] as bool? ?? false, + sourceUrls: + (json['source_urls'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], + url: json['url'] as String?, +); Map _$GpuToJson(_Gpu instance) => { - 'slug': instance.slug, - 'name': instance.name, - 'id': instance.id, - 'manufacturer': instance.manufacturer?.toJson(), - 'architecture': instance.architecture, - 'release_date': instance.releaseDate, - 'msrp_usd': instance.msrpUsd, - 'cuda_cores': instance.cudaCores, - 'stream_processors': instance.streamProcessors, - 'rt_cores': instance.rtCores, - 'tensor_cores': instance.tensorCores, - 'memory_gb': instance.memoryGb, - 'memory_type': instance.memoryType, - 'memory_bus_bit': instance.memoryBusBit, - 'memory_bandwidth_gbps': instance.memoryBandwidthGbps, - 'base_clock_mhz': instance.baseClockMhz, - 'boost_clock_mhz': instance.boostClockMhz, - 'tdp_w': instance.tdpW, - 'pcie_version': instance.pcieVersion, - 'fp32_tflops': instance.fp32Tflops, - 'blender_score': instance.blenderScore, - 'score': instance.score?.toJson(), - 'verified': instance.verified, - 'source_urls': instance.sourceUrls, - 'url': instance.url, - }; + 'slug': instance.slug, + 'name': instance.name, + 'id': instance.id, + 'manufacturer': instance.manufacturer?.toJson(), + 'architecture': instance.architecture, + 'release_date': instance.releaseDate, + 'msrp_usd': instance.msrpUsd, + 'cuda_cores': instance.cudaCores, + 'stream_processors': instance.streamProcessors, + 'rt_cores': instance.rtCores, + 'tensor_cores': instance.tensorCores, + 'memory_gb': instance.memoryGb, + 'memory_type': instance.memoryType, + 'memory_bus_bit': instance.memoryBusBit, + 'memory_bandwidth_gbps': instance.memoryBandwidthGbps, + 'base_clock_mhz': instance.baseClockMhz, + 'boost_clock_mhz': instance.boostClockMhz, + 'tdp_w': instance.tdpW, + 'pcie_version': instance.pcieVersion, + 'fp32_tflops': instance.fp32Tflops, + 'blender_score': instance.blenderScore, + 'score': instance.score?.toJson(), + 'verified': instance.verified, + 'source_urls': instance.sourceUrls, + 'url': instance.url, +}; diff --git a/lib/data/dto/score.freezed.dart b/lib/data/dto/score.freezed.dart index b291b24..f1a5d0b 100644 --- a/lib/data/dto/score.freezed.dart +++ b/lib/data/dto/score.freezed.dart @@ -14,477 +14,334 @@ T _$identity(T value) => value; /// @nodoc mixin _$ScoreMetric { - /// 0–100 정규화 지수. - double? get index; - /// 같은 세대 안에서의 백분위. - double? get percentile; +/// 0–100 정규화 지수. + double? get index;/// 같은 세대 안에서의 백분위. + double? get percentile;/// S / A / B / C … 등급. + String? get tier;/// 비교 기준이 된 세대 (예: `2024-2026`). + String? get era;/// 원본 벤치마크 (예: `geekbench`, `timespy_score`). + String? get source; +/// Create a copy of ScoreMetric +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ScoreMetricCopyWith get copyWith => _$ScoreMetricCopyWithImpl(this as ScoreMetric, _$identity); - /// S / A / B / C … 등급. - String? get tier; - - /// 비교 기준이 된 세대 (예: `2024-2026`). - String? get era; + /// Serializes this ScoreMetric to a JSON map. + Map toJson(); - /// 원본 벤치마크 (예: `geekbench`, `timespy_score`). - String? get source; - /// Create a copy of ScoreMetric - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $ScoreMetricCopyWith get copyWith => - _$ScoreMetricCopyWithImpl(this as ScoreMetric, _$identity); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ScoreMetric&&(identical(other.index, index) || other.index == index)&&(identical(other.percentile, percentile) || other.percentile == percentile)&&(identical(other.tier, tier) || other.tier == tier)&&(identical(other.era, era) || other.era == era)&&(identical(other.source, source) || other.source == source)); +} - /// Serializes this ScoreMetric to a JSON map. - Map toJson(); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,index,percentile,tier,era,source); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is ScoreMetric && - (identical(other.index, index) || other.index == index) && - (identical(other.percentile, percentile) || - other.percentile == percentile) && - (identical(other.tier, tier) || other.tier == tier) && - (identical(other.era, era) || other.era == era) && - (identical(other.source, source) || other.source == source)); - } +@override +String toString() { + return 'ScoreMetric(index: $index, percentile: $percentile, tier: $tier, era: $era, source: $source)'; +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, index, percentile, tier, era, source); - @override - String toString() { - return 'ScoreMetric(index: $index, percentile: $percentile, tier: $tier, era: $era, source: $source)'; - } } /// @nodoc -abstract mixin class $ScoreMetricCopyWith<$Res> { - factory $ScoreMetricCopyWith( - ScoreMetric value, $Res Function(ScoreMetric) _then) = - _$ScoreMetricCopyWithImpl; - @useResult - $Res call( - {double? index, - double? percentile, - String? tier, - String? era, - String? source}); -} +abstract mixin class $ScoreMetricCopyWith<$Res> { + factory $ScoreMetricCopyWith(ScoreMetric value, $Res Function(ScoreMetric) _then) = _$ScoreMetricCopyWithImpl; +@useResult +$Res call({ + double? index, double? percentile, String? tier, String? era, String? source +}); + + + +} /// @nodoc -class _$ScoreMetricCopyWithImpl<$Res> implements $ScoreMetricCopyWith<$Res> { +class _$ScoreMetricCopyWithImpl<$Res> + implements $ScoreMetricCopyWith<$Res> { _$ScoreMetricCopyWithImpl(this._self, this._then); final ScoreMetric _self; final $Res Function(ScoreMetric) _then; - /// Create a copy of ScoreMetric - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? index = freezed, - Object? percentile = freezed, - Object? tier = freezed, - Object? era = freezed, - Object? source = freezed, - }) { - return _then(_self.copyWith( - index: freezed == index - ? _self.index - : index // ignore: cast_nullable_to_non_nullable - as double?, - percentile: freezed == percentile - ? _self.percentile - : percentile // ignore: cast_nullable_to_non_nullable - as double?, - tier: freezed == tier - ? _self.tier - : tier // ignore: cast_nullable_to_non_nullable - as String?, - era: freezed == era - ? _self.era - : era // ignore: cast_nullable_to_non_nullable - as String?, - source: freezed == source - ? _self.source - : source // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +/// Create a copy of ScoreMetric +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? index = freezed,Object? percentile = freezed,Object? tier = freezed,Object? era = freezed,Object? source = freezed,}) { + return _then(_self.copyWith( +index: freezed == index ? _self.index : index // ignore: cast_nullable_to_non_nullable +as double?,percentile: freezed == percentile ? _self.percentile : percentile // ignore: cast_nullable_to_non_nullable +as double?,tier: freezed == tier ? _self.tier : tier // ignore: cast_nullable_to_non_nullable +as String?,era: freezed == era ? _self.era : era // ignore: cast_nullable_to_non_nullable +as String?,source: freezed == source ? _self.source : source // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + } + /// Adds pattern-matching-related methods to [ScoreMetric]. extension ScoreMetricPatterns on ScoreMetric { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_ScoreMetric value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _ScoreMetric() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ScoreMetric value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ScoreMetric() when $default != null: +return $default(_that);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_ScoreMetric value) $default, - ) { - final _that = this; - switch (_that) { - case _ScoreMetric(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ScoreMetric value) $default,){ +final _that = this; +switch (_that) { +case _ScoreMetric(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_ScoreMetric value)? $default, - ) { - final _that = this; - switch (_that) { - case _ScoreMetric() when $default != null: - return $default(_that); - case _: - return null; - } - } +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ScoreMetric value)? $default,){ +final _that = this; +switch (_that) { +case _ScoreMetric() when $default != null: +return $default(_that);case _: + return null; - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function(double? index, double? percentile, String? tier, - String? era, String? source)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _ScoreMetric() when $default != null: - return $default( - _that.index, _that.percentile, _that.tier, _that.era, _that.source); - case _: - return orElse(); - } - } +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( double? index, double? percentile, String? tier, String? era, String? source)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ScoreMetric() when $default != null: +return $default(_that.index,_that.percentile,_that.tier,_that.era,_that.source);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function(double? index, double? percentile, String? tier, - String? era, String? source) - $default, - ) { - final _that = this; - switch (_that) { - case _ScoreMetric(): - return $default( - _that.index, _that.percentile, _that.tier, _that.era, _that.source); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( double? index, double? percentile, String? tier, String? era, String? source) $default,) {final _that = this; +switch (_that) { +case _ScoreMetric(): +return $default(_that.index,_that.percentile,_that.tier,_that.era,_that.source);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( double? index, double? percentile, String? tier, String? era, String? source)? $default,) {final _that = this; +switch (_that) { +case _ScoreMetric() when $default != null: +return $default(_that.index,_that.percentile,_that.tier,_that.era,_that.source);case _: + return null; + +} +} - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(double? index, double? percentile, String? tier, - String? era, String? source)? - $default, - ) { - final _that = this; - switch (_that) { - case _ScoreMetric() when $default != null: - return $default( - _that.index, _that.percentile, _that.tier, _that.era, _that.source); - case _: - return null; - } - } } /// @nodoc @JsonSerializable() + class _ScoreMetric implements ScoreMetric { - const _ScoreMetric( - {this.index, this.percentile, this.tier, this.era, this.source}); - factory _ScoreMetric.fromJson(Map json) => - _$ScoreMetricFromJson(json); - - /// 0–100 정규화 지수. - @override - final double? index; - - /// 같은 세대 안에서의 백분위. - @override - final double? percentile; - - /// S / A / B / C … 등급. - @override - final String? tier; - - /// 비교 기준이 된 세대 (예: `2024-2026`). - @override - final String? era; - - /// 원본 벤치마크 (예: `geekbench`, `timespy_score`). - @override - final String? source; - - /// Create a copy of ScoreMetric - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$ScoreMetricCopyWith<_ScoreMetric> get copyWith => - __$ScoreMetricCopyWithImpl<_ScoreMetric>(this, _$identity); - - @override - Map toJson() { - return _$ScoreMetricToJson( - this, - ); - } + const _ScoreMetric({this.index, this.percentile, this.tier, this.era, this.source}); + factory _ScoreMetric.fromJson(Map json) => _$ScoreMetricFromJson(json); + +/// 0–100 정규화 지수. +@override final double? index; +/// 같은 세대 안에서의 백분위. +@override final double? percentile; +/// S / A / B / C … 등급. +@override final String? tier; +/// 비교 기준이 된 세대 (예: `2024-2026`). +@override final String? era; +/// 원본 벤치마크 (예: `geekbench`, `timespy_score`). +@override final String? source; + +/// Create a copy of ScoreMetric +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ScoreMetricCopyWith<_ScoreMetric> get copyWith => __$ScoreMetricCopyWithImpl<_ScoreMetric>(this, _$identity); + +@override +Map toJson() { + return _$ScoreMetricToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _ScoreMetric && - (identical(other.index, index) || other.index == index) && - (identical(other.percentile, percentile) || - other.percentile == percentile) && - (identical(other.tier, tier) || other.tier == tier) && - (identical(other.era, era) || other.era == era) && - (identical(other.source, source) || other.source == source)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ScoreMetric&&(identical(other.index, index) || other.index == index)&&(identical(other.percentile, percentile) || other.percentile == percentile)&&(identical(other.tier, tier) || other.tier == tier)&&(identical(other.era, era) || other.era == era)&&(identical(other.source, source) || other.source == source)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, index, percentile, tier, era, source); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,index,percentile,tier,era,source); - @override - String toString() { - return 'ScoreMetric(index: $index, percentile: $percentile, tier: $tier, era: $era, source: $source)'; - } +@override +String toString() { + return 'ScoreMetric(index: $index, percentile: $percentile, tier: $tier, era: $era, source: $source)'; } -/// @nodoc -abstract mixin class _$ScoreMetricCopyWith<$Res> - implements $ScoreMetricCopyWith<$Res> { - factory _$ScoreMetricCopyWith( - _ScoreMetric value, $Res Function(_ScoreMetric) _then) = - __$ScoreMetricCopyWithImpl; - @override - @useResult - $Res call( - {double? index, - double? percentile, - String? tier, - String? era, - String? source}); + } /// @nodoc -class __$ScoreMetricCopyWithImpl<$Res> implements _$ScoreMetricCopyWith<$Res> { +abstract mixin class _$ScoreMetricCopyWith<$Res> implements $ScoreMetricCopyWith<$Res> { + factory _$ScoreMetricCopyWith(_ScoreMetric value, $Res Function(_ScoreMetric) _then) = __$ScoreMetricCopyWithImpl; +@override @useResult +$Res call({ + double? index, double? percentile, String? tier, String? era, String? source +}); + + + + +} +/// @nodoc +class __$ScoreMetricCopyWithImpl<$Res> + implements _$ScoreMetricCopyWith<$Res> { __$ScoreMetricCopyWithImpl(this._self, this._then); final _ScoreMetric _self; final $Res Function(_ScoreMetric) _then; - /// Create a copy of ScoreMetric - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? index = freezed, - Object? percentile = freezed, - Object? tier = freezed, - Object? era = freezed, - Object? source = freezed, - }) { - return _then(_ScoreMetric( - index: freezed == index - ? _self.index - : index // ignore: cast_nullable_to_non_nullable - as double?, - percentile: freezed == percentile - ? _self.percentile - : percentile // ignore: cast_nullable_to_non_nullable - as double?, - tier: freezed == tier - ? _self.tier - : tier // ignore: cast_nullable_to_non_nullable - as String?, - era: freezed == era - ? _self.era - : era // ignore: cast_nullable_to_non_nullable - as String?, - source: freezed == source - ? _self.source - : source // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +/// Create a copy of ScoreMetric +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? index = freezed,Object? percentile = freezed,Object? tier = freezed,Object? era = freezed,Object? source = freezed,}) { + return _then(_ScoreMetric( +index: freezed == index ? _self.index : index // ignore: cast_nullable_to_non_nullable +as double?,percentile: freezed == percentile ? _self.percentile : percentile // ignore: cast_nullable_to_non_nullable +as double?,tier: freezed == tier ? _self.tier : tier // ignore: cast_nullable_to_non_nullable +as String?,era: freezed == era ? _self.era : era // ignore: cast_nullable_to_non_nullable +as String?,source: freezed == source ? _self.source : source // ignore: cast_nullable_to_non_nullable +as String?, + )); } + +} + + /// @nodoc mixin _$SmartphoneScore { - String? get algorithmVersion; - double? get overall; - double? get performance; - double? get camera; - double? get battery; - double? get display; - - /// 가격 대비 가치. `msrp_usd`가 없으면 산출되지 않는다. - double? get value; - - /// 성능 축의 근거가 된 벤치마크 지표. - ScoreMetric? get perf; - - /// Create a copy of SmartphoneScore - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $SmartphoneScoreCopyWith get copyWith => - _$SmartphoneScoreCopyWithImpl( - this as SmartphoneScore, _$identity); + + String? get algorithmVersion; double? get overall; double? get performance; double? get camera; double? get battery; double? get display;/// 가격 대비 가치. `msrp_usd`가 없으면 산출되지 않는다. + double? get value;/// 성능 축의 근거가 된 벤치마크 지표. + ScoreMetric? get perf; +/// Create a copy of SmartphoneScore +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SmartphoneScoreCopyWith get copyWith => _$SmartphoneScoreCopyWithImpl(this as SmartphoneScore, _$identity); /// Serializes this SmartphoneScore to a JSON map. Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is SmartphoneScore && - (identical(other.algorithmVersion, algorithmVersion) || - other.algorithmVersion == algorithmVersion) && - (identical(other.overall, overall) || other.overall == overall) && - (identical(other.performance, performance) || - other.performance == performance) && - (identical(other.camera, camera) || other.camera == camera) && - (identical(other.battery, battery) || other.battery == battery) && - (identical(other.display, display) || other.display == display) && - (identical(other.value, value) || other.value == value) && - (identical(other.perf, perf) || other.perf == perf)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, algorithmVersion, overall, - performance, camera, battery, display, value, perf); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SmartphoneScore&&(identical(other.algorithmVersion, algorithmVersion) || other.algorithmVersion == algorithmVersion)&&(identical(other.overall, overall) || other.overall == overall)&&(identical(other.performance, performance) || other.performance == performance)&&(identical(other.camera, camera) || other.camera == camera)&&(identical(other.battery, battery) || other.battery == battery)&&(identical(other.display, display) || other.display == display)&&(identical(other.value, value) || other.value == value)&&(identical(other.perf, perf) || other.perf == perf)); +} - @override - String toString() { - return 'SmartphoneScore(algorithmVersion: $algorithmVersion, overall: $overall, performance: $performance, camera: $camera, battery: $battery, display: $display, value: $value, perf: $perf)'; - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,algorithmVersion,overall,performance,camera,battery,display,value,perf); + +@override +String toString() { + return 'SmartphoneScore(algorithmVersion: $algorithmVersion, overall: $overall, performance: $performance, camera: $camera, battery: $battery, display: $display, value: $value, perf: $perf)'; } -/// @nodoc -abstract mixin class $SmartphoneScoreCopyWith<$Res> { - factory $SmartphoneScoreCopyWith( - SmartphoneScore value, $Res Function(SmartphoneScore) _then) = - _$SmartphoneScoreCopyWithImpl; - @useResult - $Res call( - {String? algorithmVersion, - double? overall, - double? performance, - double? camera, - double? battery, - double? display, - double? value, - ScoreMetric? perf}); - - $ScoreMetricCopyWith<$Res>? get perf; + } +/// @nodoc +abstract mixin class $SmartphoneScoreCopyWith<$Res> { + factory $SmartphoneScoreCopyWith(SmartphoneScore value, $Res Function(SmartphoneScore) _then) = _$SmartphoneScoreCopyWithImpl; +@useResult +$Res call({ + String? algorithmVersion, double? overall, double? performance, double? camera, double? battery, double? display, double? value, ScoreMetric? perf +}); + + +$ScoreMetricCopyWith<$Res>? get perf; + +} /// @nodoc class _$SmartphoneScoreCopyWithImpl<$Res> implements $SmartphoneScoreCopyWith<$Res> { @@ -493,380 +350,225 @@ class _$SmartphoneScoreCopyWithImpl<$Res> final SmartphoneScore _self; final $Res Function(SmartphoneScore) _then; - /// Create a copy of SmartphoneScore - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? algorithmVersion = freezed, - Object? overall = freezed, - Object? performance = freezed, - Object? camera = freezed, - Object? battery = freezed, - Object? display = freezed, - Object? value = freezed, - Object? perf = freezed, - }) { - return _then(_self.copyWith( - algorithmVersion: freezed == algorithmVersion - ? _self.algorithmVersion - : algorithmVersion // ignore: cast_nullable_to_non_nullable - as String?, - overall: freezed == overall - ? _self.overall - : overall // ignore: cast_nullable_to_non_nullable - as double?, - performance: freezed == performance - ? _self.performance - : performance // ignore: cast_nullable_to_non_nullable - as double?, - camera: freezed == camera - ? _self.camera - : camera // ignore: cast_nullable_to_non_nullable - as double?, - battery: freezed == battery - ? _self.battery - : battery // ignore: cast_nullable_to_non_nullable - as double?, - display: freezed == display - ? _self.display - : display // ignore: cast_nullable_to_non_nullable - as double?, - value: freezed == value - ? _self.value - : value // ignore: cast_nullable_to_non_nullable - as double?, - perf: freezed == perf - ? _self.perf - : perf // ignore: cast_nullable_to_non_nullable - as ScoreMetric?, - )); - } - - /// Create a copy of SmartphoneScore - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ScoreMetricCopyWith<$Res>? get perf { +/// Create a copy of SmartphoneScore +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? algorithmVersion = freezed,Object? overall = freezed,Object? performance = freezed,Object? camera = freezed,Object? battery = freezed,Object? display = freezed,Object? value = freezed,Object? perf = freezed,}) { + return _then(_self.copyWith( +algorithmVersion: freezed == algorithmVersion ? _self.algorithmVersion : algorithmVersion // ignore: cast_nullable_to_non_nullable +as String?,overall: freezed == overall ? _self.overall : overall // ignore: cast_nullable_to_non_nullable +as double?,performance: freezed == performance ? _self.performance : performance // ignore: cast_nullable_to_non_nullable +as double?,camera: freezed == camera ? _self.camera : camera // ignore: cast_nullable_to_non_nullable +as double?,battery: freezed == battery ? _self.battery : battery // ignore: cast_nullable_to_non_nullable +as double?,display: freezed == display ? _self.display : display // ignore: cast_nullable_to_non_nullable +as double?,value: freezed == value ? _self.value : value // ignore: cast_nullable_to_non_nullable +as double?,perf: freezed == perf ? _self.perf : perf // ignore: cast_nullable_to_non_nullable +as ScoreMetric?, + )); +} +/// Create a copy of SmartphoneScore +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ScoreMetricCopyWith<$Res>? get perf { if (_self.perf == null) { - return null; - } - - return $ScoreMetricCopyWith<$Res>(_self.perf!, (value) { - return _then(_self.copyWith(perf: value)); - }); + return null; } + + return $ScoreMetricCopyWith<$Res>(_self.perf!, (value) { + return _then(_self.copyWith(perf: value)); + }); +} } + /// Adds pattern-matching-related methods to [SmartphoneScore]. extension SmartphoneScorePatterns on SmartphoneScore { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_SmartphoneScore value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _SmartphoneScore() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _SmartphoneScore value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _SmartphoneScore() when $default != null: +return $default(_that);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_SmartphoneScore value) $default, - ) { - final _that = this; - switch (_that) { - case _SmartphoneScore(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _SmartphoneScore value) $default,){ +final _that = this; +switch (_that) { +case _SmartphoneScore(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_SmartphoneScore value)? $default, - ) { - final _that = this; - switch (_that) { - case _SmartphoneScore() when $default != null: - return $default(_that); - case _: - return null; - } - } +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SmartphoneScore value)? $default,){ +final _that = this; +switch (_that) { +case _SmartphoneScore() when $default != null: +return $default(_that);case _: + return null; - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function( - String? algorithmVersion, - double? overall, - double? performance, - double? camera, - double? battery, - double? display, - double? value, - ScoreMetric? perf)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _SmartphoneScore() when $default != null: - return $default( - _that.algorithmVersion, - _that.overall, - _that.performance, - _that.camera, - _that.battery, - _that.display, - _that.value, - _that.perf); - case _: - return orElse(); - } - } +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? algorithmVersion, double? overall, double? performance, double? camera, double? battery, double? display, double? value, ScoreMetric? perf)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _SmartphoneScore() when $default != null: +return $default(_that.algorithmVersion,_that.overall,_that.performance,_that.camera,_that.battery,_that.display,_that.value,_that.perf);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function( - String? algorithmVersion, - double? overall, - double? performance, - double? camera, - double? battery, - double? display, - double? value, - ScoreMetric? perf) - $default, - ) { - final _that = this; - switch (_that) { - case _SmartphoneScore(): - return $default( - _that.algorithmVersion, - _that.overall, - _that.performance, - _that.camera, - _that.battery, - _that.display, - _that.value, - _that.perf); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? algorithmVersion, double? overall, double? performance, double? camera, double? battery, double? display, double? value, ScoreMetric? perf) $default,) {final _that = this; +switch (_that) { +case _SmartphoneScore(): +return $default(_that.algorithmVersion,_that.overall,_that.performance,_that.camera,_that.battery,_that.display,_that.value,_that.perf);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? algorithmVersion, double? overall, double? performance, double? camera, double? battery, double? display, double? value, ScoreMetric? perf)? $default,) {final _that = this; +switch (_that) { +case _SmartphoneScore() when $default != null: +return $default(_that.algorithmVersion,_that.overall,_that.performance,_that.camera,_that.battery,_that.display,_that.value,_that.perf);case _: + return null; + +} +} - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function( - String? algorithmVersion, - double? overall, - double? performance, - double? camera, - double? battery, - double? display, - double? value, - ScoreMetric? perf)? - $default, - ) { - final _that = this; - switch (_that) { - case _SmartphoneScore() when $default != null: - return $default( - _that.algorithmVersion, - _that.overall, - _that.performance, - _that.camera, - _that.battery, - _that.display, - _that.value, - _that.perf); - case _: - return null; - } - } } /// @nodoc @JsonSerializable() + class _SmartphoneScore implements SmartphoneScore { - const _SmartphoneScore( - {this.algorithmVersion, - this.overall, - this.performance, - this.camera, - this.battery, - this.display, - this.value, - this.perf}); - factory _SmartphoneScore.fromJson(Map json) => - _$SmartphoneScoreFromJson(json); - - @override - final String? algorithmVersion; - @override - final double? overall; - @override - final double? performance; - @override - final double? camera; - @override - final double? battery; - @override - final double? display; - - /// 가격 대비 가치. `msrp_usd`가 없으면 산출되지 않는다. - @override - final double? value; - - /// 성능 축의 근거가 된 벤치마크 지표. - @override - final ScoreMetric? perf; - - /// Create a copy of SmartphoneScore - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$SmartphoneScoreCopyWith<_SmartphoneScore> get copyWith => - __$SmartphoneScoreCopyWithImpl<_SmartphoneScore>(this, _$identity); - - @override - Map toJson() { - return _$SmartphoneScoreToJson( - this, - ); - } + const _SmartphoneScore({this.algorithmVersion, this.overall, this.performance, this.camera, this.battery, this.display, this.value, this.perf}); + factory _SmartphoneScore.fromJson(Map json) => _$SmartphoneScoreFromJson(json); + +@override final String? algorithmVersion; +@override final double? overall; +@override final double? performance; +@override final double? camera; +@override final double? battery; +@override final double? display; +/// 가격 대비 가치. `msrp_usd`가 없으면 산출되지 않는다. +@override final double? value; +/// 성능 축의 근거가 된 벤치마크 지표. +@override final ScoreMetric? perf; + +/// Create a copy of SmartphoneScore +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SmartphoneScoreCopyWith<_SmartphoneScore> get copyWith => __$SmartphoneScoreCopyWithImpl<_SmartphoneScore>(this, _$identity); + +@override +Map toJson() { + return _$SmartphoneScoreToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _SmartphoneScore && - (identical(other.algorithmVersion, algorithmVersion) || - other.algorithmVersion == algorithmVersion) && - (identical(other.overall, overall) || other.overall == overall) && - (identical(other.performance, performance) || - other.performance == performance) && - (identical(other.camera, camera) || other.camera == camera) && - (identical(other.battery, battery) || other.battery == battery) && - (identical(other.display, display) || other.display == display) && - (identical(other.value, value) || other.value == value) && - (identical(other.perf, perf) || other.perf == perf)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SmartphoneScore&&(identical(other.algorithmVersion, algorithmVersion) || other.algorithmVersion == algorithmVersion)&&(identical(other.overall, overall) || other.overall == overall)&&(identical(other.performance, performance) || other.performance == performance)&&(identical(other.camera, camera) || other.camera == camera)&&(identical(other.battery, battery) || other.battery == battery)&&(identical(other.display, display) || other.display == display)&&(identical(other.value, value) || other.value == value)&&(identical(other.perf, perf) || other.perf == perf)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, algorithmVersion, overall, - performance, camera, battery, display, value, perf); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,algorithmVersion,overall,performance,camera,battery,display,value,perf); - @override - String toString() { - return 'SmartphoneScore(algorithmVersion: $algorithmVersion, overall: $overall, performance: $performance, camera: $camera, battery: $battery, display: $display, value: $value, perf: $perf)'; - } +@override +String toString() { + return 'SmartphoneScore(algorithmVersion: $algorithmVersion, overall: $overall, performance: $performance, camera: $camera, battery: $battery, display: $display, value: $value, perf: $perf)'; } -/// @nodoc -abstract mixin class _$SmartphoneScoreCopyWith<$Res> - implements $SmartphoneScoreCopyWith<$Res> { - factory _$SmartphoneScoreCopyWith( - _SmartphoneScore value, $Res Function(_SmartphoneScore) _then) = - __$SmartphoneScoreCopyWithImpl; - @override - @useResult - $Res call( - {String? algorithmVersion, - double? overall, - double? performance, - double? camera, - double? battery, - double? display, - double? value, - ScoreMetric? perf}); - - @override - $ScoreMetricCopyWith<$Res>? get perf; + } +/// @nodoc +abstract mixin class _$SmartphoneScoreCopyWith<$Res> implements $SmartphoneScoreCopyWith<$Res> { + factory _$SmartphoneScoreCopyWith(_SmartphoneScore value, $Res Function(_SmartphoneScore) _then) = __$SmartphoneScoreCopyWithImpl; +@override @useResult +$Res call({ + String? algorithmVersion, double? overall, double? performance, double? camera, double? battery, double? display, double? value, ScoreMetric? perf +}); + + +@override $ScoreMetricCopyWith<$Res>? get perf; + +} /// @nodoc class __$SmartphoneScoreCopyWithImpl<$Res> implements _$SmartphoneScoreCopyWith<$Res> { @@ -875,1293 +577,968 @@ class __$SmartphoneScoreCopyWithImpl<$Res> final _SmartphoneScore _self; final $Res Function(_SmartphoneScore) _then; - /// Create a copy of SmartphoneScore - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? algorithmVersion = freezed, - Object? overall = freezed, - Object? performance = freezed, - Object? camera = freezed, - Object? battery = freezed, - Object? display = freezed, - Object? value = freezed, - Object? perf = freezed, - }) { - return _then(_SmartphoneScore( - algorithmVersion: freezed == algorithmVersion - ? _self.algorithmVersion - : algorithmVersion // ignore: cast_nullable_to_non_nullable - as String?, - overall: freezed == overall - ? _self.overall - : overall // ignore: cast_nullable_to_non_nullable - as double?, - performance: freezed == performance - ? _self.performance - : performance // ignore: cast_nullable_to_non_nullable - as double?, - camera: freezed == camera - ? _self.camera - : camera // ignore: cast_nullable_to_non_nullable - as double?, - battery: freezed == battery - ? _self.battery - : battery // ignore: cast_nullable_to_non_nullable - as double?, - display: freezed == display - ? _self.display - : display // ignore: cast_nullable_to_non_nullable - as double?, - value: freezed == value - ? _self.value - : value // ignore: cast_nullable_to_non_nullable - as double?, - perf: freezed == perf - ? _self.perf - : perf // ignore: cast_nullable_to_non_nullable - as ScoreMetric?, - )); - } +/// Create a copy of SmartphoneScore +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? algorithmVersion = freezed,Object? overall = freezed,Object? performance = freezed,Object? camera = freezed,Object? battery = freezed,Object? display = freezed,Object? value = freezed,Object? perf = freezed,}) { + return _then(_SmartphoneScore( +algorithmVersion: freezed == algorithmVersion ? _self.algorithmVersion : algorithmVersion // ignore: cast_nullable_to_non_nullable +as String?,overall: freezed == overall ? _self.overall : overall // ignore: cast_nullable_to_non_nullable +as double?,performance: freezed == performance ? _self.performance : performance // ignore: cast_nullable_to_non_nullable +as double?,camera: freezed == camera ? _self.camera : camera // ignore: cast_nullable_to_non_nullable +as double?,battery: freezed == battery ? _self.battery : battery // ignore: cast_nullable_to_non_nullable +as double?,display: freezed == display ? _self.display : display // ignore: cast_nullable_to_non_nullable +as double?,value: freezed == value ? _self.value : value // ignore: cast_nullable_to_non_nullable +as double?,perf: freezed == perf ? _self.perf : perf // ignore: cast_nullable_to_non_nullable +as ScoreMetric?, + )); +} - /// Create a copy of SmartphoneScore - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ScoreMetricCopyWith<$Res>? get perf { +/// Create a copy of SmartphoneScore +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ScoreMetricCopyWith<$Res>? get perf { if (_self.perf == null) { - return null; - } - - return $ScoreMetricCopyWith<$Res>(_self.perf!, (value) { - return _then(_self.copyWith(perf: value)); - }); + return null; } + + return $ScoreMetricCopyWith<$Res>(_self.perf!, (value) { + return _then(_self.copyWith(perf: value)); + }); } +} + /// @nodoc mixin _$CpuScore { - String? get algorithmVersion; - double? get overall; - ScoreMetric? get single; - ScoreMetric? get multi; - - /// Create a copy of CpuScore - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $CpuScoreCopyWith get copyWith => - _$CpuScoreCopyWithImpl(this as CpuScore, _$identity); + + String? get algorithmVersion; double? get overall; ScoreMetric? get single; ScoreMetric? get multi; +/// Create a copy of CpuScore +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CpuScoreCopyWith get copyWith => _$CpuScoreCopyWithImpl(this as CpuScore, _$identity); /// Serializes this CpuScore to a JSON map. Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is CpuScore && - (identical(other.algorithmVersion, algorithmVersion) || - other.algorithmVersion == algorithmVersion) && - (identical(other.overall, overall) || other.overall == overall) && - (identical(other.single, single) || other.single == single) && - (identical(other.multi, multi) || other.multi == multi)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, algorithmVersion, overall, single, multi); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CpuScore&&(identical(other.algorithmVersion, algorithmVersion) || other.algorithmVersion == algorithmVersion)&&(identical(other.overall, overall) || other.overall == overall)&&(identical(other.single, single) || other.single == single)&&(identical(other.multi, multi) || other.multi == multi)); +} - @override - String toString() { - return 'CpuScore(algorithmVersion: $algorithmVersion, overall: $overall, single: $single, multi: $multi)'; - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,algorithmVersion,overall,single,multi); + +@override +String toString() { + return 'CpuScore(algorithmVersion: $algorithmVersion, overall: $overall, single: $single, multi: $multi)'; } -/// @nodoc -abstract mixin class $CpuScoreCopyWith<$Res> { - factory $CpuScoreCopyWith(CpuScore value, $Res Function(CpuScore) _then) = - _$CpuScoreCopyWithImpl; - @useResult - $Res call( - {String? algorithmVersion, - double? overall, - ScoreMetric? single, - ScoreMetric? multi}); - $ScoreMetricCopyWith<$Res>? get single; - $ScoreMetricCopyWith<$Res>? get multi; } /// @nodoc -class _$CpuScoreCopyWithImpl<$Res> implements $CpuScoreCopyWith<$Res> { +abstract mixin class $CpuScoreCopyWith<$Res> { + factory $CpuScoreCopyWith(CpuScore value, $Res Function(CpuScore) _then) = _$CpuScoreCopyWithImpl; +@useResult +$Res call({ + String? algorithmVersion, double? overall, ScoreMetric? single, ScoreMetric? multi +}); + + +$ScoreMetricCopyWith<$Res>? get single;$ScoreMetricCopyWith<$Res>? get multi; + +} +/// @nodoc +class _$CpuScoreCopyWithImpl<$Res> + implements $CpuScoreCopyWith<$Res> { _$CpuScoreCopyWithImpl(this._self, this._then); final CpuScore _self; final $Res Function(CpuScore) _then; - /// Create a copy of CpuScore - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? algorithmVersion = freezed, - Object? overall = freezed, - Object? single = freezed, - Object? multi = freezed, - }) { - return _then(_self.copyWith( - algorithmVersion: freezed == algorithmVersion - ? _self.algorithmVersion - : algorithmVersion // ignore: cast_nullable_to_non_nullable - as String?, - overall: freezed == overall - ? _self.overall - : overall // ignore: cast_nullable_to_non_nullable - as double?, - single: freezed == single - ? _self.single - : single // ignore: cast_nullable_to_non_nullable - as ScoreMetric?, - multi: freezed == multi - ? _self.multi - : multi // ignore: cast_nullable_to_non_nullable - as ScoreMetric?, - )); - } - - /// Create a copy of CpuScore - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ScoreMetricCopyWith<$Res>? get single { +/// Create a copy of CpuScore +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? algorithmVersion = freezed,Object? overall = freezed,Object? single = freezed,Object? multi = freezed,}) { + return _then(_self.copyWith( +algorithmVersion: freezed == algorithmVersion ? _self.algorithmVersion : algorithmVersion // ignore: cast_nullable_to_non_nullable +as String?,overall: freezed == overall ? _self.overall : overall // ignore: cast_nullable_to_non_nullable +as double?,single: freezed == single ? _self.single : single // ignore: cast_nullable_to_non_nullable +as ScoreMetric?,multi: freezed == multi ? _self.multi : multi // ignore: cast_nullable_to_non_nullable +as ScoreMetric?, + )); +} +/// Create a copy of CpuScore +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ScoreMetricCopyWith<$Res>? get single { if (_self.single == null) { - return null; - } - - return $ScoreMetricCopyWith<$Res>(_self.single!, (value) { - return _then(_self.copyWith(single: value)); - }); + return null; } - /// Create a copy of CpuScore - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ScoreMetricCopyWith<$Res>? get multi { + return $ScoreMetricCopyWith<$Res>(_self.single!, (value) { + return _then(_self.copyWith(single: value)); + }); +}/// Create a copy of CpuScore +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ScoreMetricCopyWith<$Res>? get multi { if (_self.multi == null) { - return null; - } - - return $ScoreMetricCopyWith<$Res>(_self.multi!, (value) { - return _then(_self.copyWith(multi: value)); - }); + return null; } + + return $ScoreMetricCopyWith<$Res>(_self.multi!, (value) { + return _then(_self.copyWith(multi: value)); + }); +} } + /// Adds pattern-matching-related methods to [CpuScore]. extension CpuScorePatterns on CpuScore { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_CpuScore value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _CpuScore() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CpuScore value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CpuScore() when $default != null: +return $default(_that);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_CpuScore value) $default, - ) { - final _that = this; - switch (_that) { - case _CpuScore(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CpuScore value) $default,){ +final _that = this; +switch (_that) { +case _CpuScore(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_CpuScore value)? $default, - ) { - final _that = this; - switch (_that) { - case _CpuScore() when $default != null: - return $default(_that); - case _: - return null; - } - } +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CpuScore value)? $default,){ +final _that = this; +switch (_that) { +case _CpuScore() when $default != null: +return $default(_that);case _: + return null; - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function(String? algorithmVersion, double? overall, - ScoreMetric? single, ScoreMetric? multi)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _CpuScore() when $default != null: - return $default( - _that.algorithmVersion, _that.overall, _that.single, _that.multi); - case _: - return orElse(); - } - } +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? algorithmVersion, double? overall, ScoreMetric? single, ScoreMetric? multi)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CpuScore() when $default != null: +return $default(_that.algorithmVersion,_that.overall,_that.single,_that.multi);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function(String? algorithmVersion, double? overall, - ScoreMetric? single, ScoreMetric? multi) - $default, - ) { - final _that = this; - switch (_that) { - case _CpuScore(): - return $default( - _that.algorithmVersion, _that.overall, _that.single, _that.multi); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? algorithmVersion, double? overall, ScoreMetric? single, ScoreMetric? multi) $default,) {final _that = this; +switch (_that) { +case _CpuScore(): +return $default(_that.algorithmVersion,_that.overall,_that.single,_that.multi);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? algorithmVersion, double? overall, ScoreMetric? single, ScoreMetric? multi)? $default,) {final _that = this; +switch (_that) { +case _CpuScore() when $default != null: +return $default(_that.algorithmVersion,_that.overall,_that.single,_that.multi);case _: + return null; + +} +} - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(String? algorithmVersion, double? overall, - ScoreMetric? single, ScoreMetric? multi)? - $default, - ) { - final _that = this; - switch (_that) { - case _CpuScore() when $default != null: - return $default( - _that.algorithmVersion, _that.overall, _that.single, _that.multi); - case _: - return null; - } - } } /// @nodoc @JsonSerializable() + class _CpuScore implements CpuScore { - const _CpuScore( - {this.algorithmVersion, this.overall, this.single, this.multi}); - factory _CpuScore.fromJson(Map json) => - _$CpuScoreFromJson(json); - - @override - final String? algorithmVersion; - @override - final double? overall; - @override - final ScoreMetric? single; - @override - final ScoreMetric? multi; - - /// Create a copy of CpuScore - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$CpuScoreCopyWith<_CpuScore> get copyWith => - __$CpuScoreCopyWithImpl<_CpuScore>(this, _$identity); - - @override - Map toJson() { - return _$CpuScoreToJson( - this, - ); - } + const _CpuScore({this.algorithmVersion, this.overall, this.single, this.multi}); + factory _CpuScore.fromJson(Map json) => _$CpuScoreFromJson(json); + +@override final String? algorithmVersion; +@override final double? overall; +@override final ScoreMetric? single; +@override final ScoreMetric? multi; + +/// Create a copy of CpuScore +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CpuScoreCopyWith<_CpuScore> get copyWith => __$CpuScoreCopyWithImpl<_CpuScore>(this, _$identity); + +@override +Map toJson() { + return _$CpuScoreToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _CpuScore && - (identical(other.algorithmVersion, algorithmVersion) || - other.algorithmVersion == algorithmVersion) && - (identical(other.overall, overall) || other.overall == overall) && - (identical(other.single, single) || other.single == single) && - (identical(other.multi, multi) || other.multi == multi)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CpuScore&&(identical(other.algorithmVersion, algorithmVersion) || other.algorithmVersion == algorithmVersion)&&(identical(other.overall, overall) || other.overall == overall)&&(identical(other.single, single) || other.single == single)&&(identical(other.multi, multi) || other.multi == multi)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, algorithmVersion, overall, single, multi); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,algorithmVersion,overall,single,multi); - @override - String toString() { - return 'CpuScore(algorithmVersion: $algorithmVersion, overall: $overall, single: $single, multi: $multi)'; - } +@override +String toString() { + return 'CpuScore(algorithmVersion: $algorithmVersion, overall: $overall, single: $single, multi: $multi)'; } -/// @nodoc -abstract mixin class _$CpuScoreCopyWith<$Res> - implements $CpuScoreCopyWith<$Res> { - factory _$CpuScoreCopyWith(_CpuScore value, $Res Function(_CpuScore) _then) = - __$CpuScoreCopyWithImpl; - @override - @useResult - $Res call( - {String? algorithmVersion, - double? overall, - ScoreMetric? single, - ScoreMetric? multi}); - - @override - $ScoreMetricCopyWith<$Res>? get single; - @override - $ScoreMetricCopyWith<$Res>? get multi; + } /// @nodoc -class __$CpuScoreCopyWithImpl<$Res> implements _$CpuScoreCopyWith<$Res> { +abstract mixin class _$CpuScoreCopyWith<$Res> implements $CpuScoreCopyWith<$Res> { + factory _$CpuScoreCopyWith(_CpuScore value, $Res Function(_CpuScore) _then) = __$CpuScoreCopyWithImpl; +@override @useResult +$Res call({ + String? algorithmVersion, double? overall, ScoreMetric? single, ScoreMetric? multi +}); + + +@override $ScoreMetricCopyWith<$Res>? get single;@override $ScoreMetricCopyWith<$Res>? get multi; + +} +/// @nodoc +class __$CpuScoreCopyWithImpl<$Res> + implements _$CpuScoreCopyWith<$Res> { __$CpuScoreCopyWithImpl(this._self, this._then); final _CpuScore _self; final $Res Function(_CpuScore) _then; - /// Create a copy of CpuScore - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? algorithmVersion = freezed, - Object? overall = freezed, - Object? single = freezed, - Object? multi = freezed, - }) { - return _then(_CpuScore( - algorithmVersion: freezed == algorithmVersion - ? _self.algorithmVersion - : algorithmVersion // ignore: cast_nullable_to_non_nullable - as String?, - overall: freezed == overall - ? _self.overall - : overall // ignore: cast_nullable_to_non_nullable - as double?, - single: freezed == single - ? _self.single - : single // ignore: cast_nullable_to_non_nullable - as ScoreMetric?, - multi: freezed == multi - ? _self.multi - : multi // ignore: cast_nullable_to_non_nullable - as ScoreMetric?, - )); - } +/// Create a copy of CpuScore +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? algorithmVersion = freezed,Object? overall = freezed,Object? single = freezed,Object? multi = freezed,}) { + return _then(_CpuScore( +algorithmVersion: freezed == algorithmVersion ? _self.algorithmVersion : algorithmVersion // ignore: cast_nullable_to_non_nullable +as String?,overall: freezed == overall ? _self.overall : overall // ignore: cast_nullable_to_non_nullable +as double?,single: freezed == single ? _self.single : single // ignore: cast_nullable_to_non_nullable +as ScoreMetric?,multi: freezed == multi ? _self.multi : multi // ignore: cast_nullable_to_non_nullable +as ScoreMetric?, + )); +} - /// Create a copy of CpuScore - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ScoreMetricCopyWith<$Res>? get single { +/// Create a copy of CpuScore +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ScoreMetricCopyWith<$Res>? get single { if (_self.single == null) { - return null; - } - - return $ScoreMetricCopyWith<$Res>(_self.single!, (value) { - return _then(_self.copyWith(single: value)); - }); + return null; } - /// Create a copy of CpuScore - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ScoreMetricCopyWith<$Res>? get multi { + return $ScoreMetricCopyWith<$Res>(_self.single!, (value) { + return _then(_self.copyWith(single: value)); + }); +}/// Create a copy of CpuScore +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ScoreMetricCopyWith<$Res>? get multi { if (_self.multi == null) { - return null; - } - - return $ScoreMetricCopyWith<$Res>(_self.multi!, (value) { - return _then(_self.copyWith(multi: value)); - }); + return null; } + + return $ScoreMetricCopyWith<$Res>(_self.multi!, (value) { + return _then(_self.copyWith(multi: value)); + }); } +} + /// @nodoc mixin _$GpuScore { - String? get algorithmVersion; - double? get overall; - ScoreMetric? get graphics; - /// Create a copy of GpuScore - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $GpuScoreCopyWith get copyWith => - _$GpuScoreCopyWithImpl(this as GpuScore, _$identity); + String? get algorithmVersion; double? get overall; ScoreMetric? get graphics; +/// Create a copy of GpuScore +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GpuScoreCopyWith get copyWith => _$GpuScoreCopyWithImpl(this as GpuScore, _$identity); /// Serializes this GpuScore to a JSON map. Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is GpuScore && - (identical(other.algorithmVersion, algorithmVersion) || - other.algorithmVersion == algorithmVersion) && - (identical(other.overall, overall) || other.overall == overall) && - (identical(other.graphics, graphics) || - other.graphics == graphics)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, algorithmVersion, overall, graphics); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GpuScore&&(identical(other.algorithmVersion, algorithmVersion) || other.algorithmVersion == algorithmVersion)&&(identical(other.overall, overall) || other.overall == overall)&&(identical(other.graphics, graphics) || other.graphics == graphics)); +} - @override - String toString() { - return 'GpuScore(algorithmVersion: $algorithmVersion, overall: $overall, graphics: $graphics)'; - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,algorithmVersion,overall,graphics); + +@override +String toString() { + return 'GpuScore(algorithmVersion: $algorithmVersion, overall: $overall, graphics: $graphics)'; } -/// @nodoc -abstract mixin class $GpuScoreCopyWith<$Res> { - factory $GpuScoreCopyWith(GpuScore value, $Res Function(GpuScore) _then) = - _$GpuScoreCopyWithImpl; - @useResult - $Res call({String? algorithmVersion, double? overall, ScoreMetric? graphics}); - $ScoreMetricCopyWith<$Res>? get graphics; } /// @nodoc -class _$GpuScoreCopyWithImpl<$Res> implements $GpuScoreCopyWith<$Res> { +abstract mixin class $GpuScoreCopyWith<$Res> { + factory $GpuScoreCopyWith(GpuScore value, $Res Function(GpuScore) _then) = _$GpuScoreCopyWithImpl; +@useResult +$Res call({ + String? algorithmVersion, double? overall, ScoreMetric? graphics +}); + + +$ScoreMetricCopyWith<$Res>? get graphics; + +} +/// @nodoc +class _$GpuScoreCopyWithImpl<$Res> + implements $GpuScoreCopyWith<$Res> { _$GpuScoreCopyWithImpl(this._self, this._then); final GpuScore _self; final $Res Function(GpuScore) _then; - /// Create a copy of GpuScore - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? algorithmVersion = freezed, - Object? overall = freezed, - Object? graphics = freezed, - }) { - return _then(_self.copyWith( - algorithmVersion: freezed == algorithmVersion - ? _self.algorithmVersion - : algorithmVersion // ignore: cast_nullable_to_non_nullable - as String?, - overall: freezed == overall - ? _self.overall - : overall // ignore: cast_nullable_to_non_nullable - as double?, - graphics: freezed == graphics - ? _self.graphics - : graphics // ignore: cast_nullable_to_non_nullable - as ScoreMetric?, - )); - } - - /// Create a copy of GpuScore - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ScoreMetricCopyWith<$Res>? get graphics { +/// Create a copy of GpuScore +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? algorithmVersion = freezed,Object? overall = freezed,Object? graphics = freezed,}) { + return _then(_self.copyWith( +algorithmVersion: freezed == algorithmVersion ? _self.algorithmVersion : algorithmVersion // ignore: cast_nullable_to_non_nullable +as String?,overall: freezed == overall ? _self.overall : overall // ignore: cast_nullable_to_non_nullable +as double?,graphics: freezed == graphics ? _self.graphics : graphics // ignore: cast_nullable_to_non_nullable +as ScoreMetric?, + )); +} +/// Create a copy of GpuScore +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ScoreMetricCopyWith<$Res>? get graphics { if (_self.graphics == null) { - return null; - } - - return $ScoreMetricCopyWith<$Res>(_self.graphics!, (value) { - return _then(_self.copyWith(graphics: value)); - }); + return null; } + + return $ScoreMetricCopyWith<$Res>(_self.graphics!, (value) { + return _then(_self.copyWith(graphics: value)); + }); +} } + /// Adds pattern-matching-related methods to [GpuScore]. extension GpuScorePatterns on GpuScore { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_GpuScore value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _GpuScore() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _GpuScore value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _GpuScore() when $default != null: +return $default(_that);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_GpuScore value) $default, - ) { - final _that = this; - switch (_that) { - case _GpuScore(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _GpuScore value) $default,){ +final _that = this; +switch (_that) { +case _GpuScore(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_GpuScore value)? $default, - ) { - final _that = this; - switch (_that) { - case _GpuScore() when $default != null: - return $default(_that); - case _: - return null; - } - } +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _GpuScore value)? $default,){ +final _that = this; +switch (_that) { +case _GpuScore() when $default != null: +return $default(_that);case _: + return null; - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function( - String? algorithmVersion, double? overall, ScoreMetric? graphics)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _GpuScore() when $default != null: - return $default(_that.algorithmVersion, _that.overall, _that.graphics); - case _: - return orElse(); - } - } +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? algorithmVersion, double? overall, ScoreMetric? graphics)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _GpuScore() when $default != null: +return $default(_that.algorithmVersion,_that.overall,_that.graphics);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function( - String? algorithmVersion, double? overall, ScoreMetric? graphics) - $default, - ) { - final _that = this; - switch (_that) { - case _GpuScore(): - return $default(_that.algorithmVersion, _that.overall, _that.graphics); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? algorithmVersion, double? overall, ScoreMetric? graphics) $default,) {final _that = this; +switch (_that) { +case _GpuScore(): +return $default(_that.algorithmVersion,_that.overall,_that.graphics);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? algorithmVersion, double? overall, ScoreMetric? graphics)? $default,) {final _that = this; +switch (_that) { +case _GpuScore() when $default != null: +return $default(_that.algorithmVersion,_that.overall,_that.graphics);case _: + return null; + +} +} - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function( - String? algorithmVersion, double? overall, ScoreMetric? graphics)? - $default, - ) { - final _that = this; - switch (_that) { - case _GpuScore() when $default != null: - return $default(_that.algorithmVersion, _that.overall, _that.graphics); - case _: - return null; - } - } } /// @nodoc @JsonSerializable() + class _GpuScore implements GpuScore { const _GpuScore({this.algorithmVersion, this.overall, this.graphics}); - factory _GpuScore.fromJson(Map json) => - _$GpuScoreFromJson(json); - - @override - final String? algorithmVersion; - @override - final double? overall; - @override - final ScoreMetric? graphics; - - /// Create a copy of GpuScore - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$GpuScoreCopyWith<_GpuScore> get copyWith => - __$GpuScoreCopyWithImpl<_GpuScore>(this, _$identity); - - @override - Map toJson() { - return _$GpuScoreToJson( - this, - ); - } + factory _GpuScore.fromJson(Map json) => _$GpuScoreFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _GpuScore && - (identical(other.algorithmVersion, algorithmVersion) || - other.algorithmVersion == algorithmVersion) && - (identical(other.overall, overall) || other.overall == overall) && - (identical(other.graphics, graphics) || - other.graphics == graphics)); - } +@override final String? algorithmVersion; +@override final double? overall; +@override final ScoreMetric? graphics; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, algorithmVersion, overall, graphics); +/// Create a copy of GpuScore +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GpuScoreCopyWith<_GpuScore> get copyWith => __$GpuScoreCopyWithImpl<_GpuScore>(this, _$identity); - @override - String toString() { - return 'GpuScore(algorithmVersion: $algorithmVersion, overall: $overall, graphics: $graphics)'; - } +@override +Map toJson() { + return _$GpuScoreToJson(this, ); } -/// @nodoc -abstract mixin class _$GpuScoreCopyWith<$Res> - implements $GpuScoreCopyWith<$Res> { - factory _$GpuScoreCopyWith(_GpuScore value, $Res Function(_GpuScore) _then) = - __$GpuScoreCopyWithImpl; - @override - @useResult - $Res call({String? algorithmVersion, double? overall, ScoreMetric? graphics}); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GpuScore&&(identical(other.algorithmVersion, algorithmVersion) || other.algorithmVersion == algorithmVersion)&&(identical(other.overall, overall) || other.overall == overall)&&(identical(other.graphics, graphics) || other.graphics == graphics)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,algorithmVersion,overall,graphics); - @override - $ScoreMetricCopyWith<$Res>? get graphics; +@override +String toString() { + return 'GpuScore(algorithmVersion: $algorithmVersion, overall: $overall, graphics: $graphics)'; } + +} + +/// @nodoc +abstract mixin class _$GpuScoreCopyWith<$Res> implements $GpuScoreCopyWith<$Res> { + factory _$GpuScoreCopyWith(_GpuScore value, $Res Function(_GpuScore) _then) = __$GpuScoreCopyWithImpl; +@override @useResult +$Res call({ + String? algorithmVersion, double? overall, ScoreMetric? graphics +}); + + +@override $ScoreMetricCopyWith<$Res>? get graphics; + +} /// @nodoc -class __$GpuScoreCopyWithImpl<$Res> implements _$GpuScoreCopyWith<$Res> { +class __$GpuScoreCopyWithImpl<$Res> + implements _$GpuScoreCopyWith<$Res> { __$GpuScoreCopyWithImpl(this._self, this._then); final _GpuScore _self; final $Res Function(_GpuScore) _then; - /// Create a copy of GpuScore - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? algorithmVersion = freezed, - Object? overall = freezed, - Object? graphics = freezed, - }) { - return _then(_GpuScore( - algorithmVersion: freezed == algorithmVersion - ? _self.algorithmVersion - : algorithmVersion // ignore: cast_nullable_to_non_nullable - as String?, - overall: freezed == overall - ? _self.overall - : overall // ignore: cast_nullable_to_non_nullable - as double?, - graphics: freezed == graphics - ? _self.graphics - : graphics // ignore: cast_nullable_to_non_nullable - as ScoreMetric?, - )); - } +/// Create a copy of GpuScore +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? algorithmVersion = freezed,Object? overall = freezed,Object? graphics = freezed,}) { + return _then(_GpuScore( +algorithmVersion: freezed == algorithmVersion ? _self.algorithmVersion : algorithmVersion // ignore: cast_nullable_to_non_nullable +as String?,overall: freezed == overall ? _self.overall : overall // ignore: cast_nullable_to_non_nullable +as double?,graphics: freezed == graphics ? _self.graphics : graphics // ignore: cast_nullable_to_non_nullable +as ScoreMetric?, + )); +} - /// Create a copy of GpuScore - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ScoreMetricCopyWith<$Res>? get graphics { +/// Create a copy of GpuScore +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ScoreMetricCopyWith<$Res>? get graphics { if (_self.graphics == null) { - return null; - } - - return $ScoreMetricCopyWith<$Res>(_self.graphics!, (value) { - return _then(_self.copyWith(graphics: value)); - }); + return null; } + + return $ScoreMetricCopyWith<$Res>(_self.graphics!, (value) { + return _then(_self.copyWith(graphics: value)); + }); +} } + /// @nodoc mixin _$SocScore { - String? get algorithmVersion; - double? get overall; - ScoreMetric? get cpu; - ScoreMetric? get system; - - /// Create a copy of SocScore - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $SocScoreCopyWith get copyWith => - _$SocScoreCopyWithImpl(this as SocScore, _$identity); + + String? get algorithmVersion; double? get overall; ScoreMetric? get cpu; ScoreMetric? get system; +/// Create a copy of SocScore +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SocScoreCopyWith get copyWith => _$SocScoreCopyWithImpl(this as SocScore, _$identity); /// Serializes this SocScore to a JSON map. Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is SocScore && - (identical(other.algorithmVersion, algorithmVersion) || - other.algorithmVersion == algorithmVersion) && - (identical(other.overall, overall) || other.overall == overall) && - (identical(other.cpu, cpu) || other.cpu == cpu) && - (identical(other.system, system) || other.system == system)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, algorithmVersion, overall, cpu, system); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SocScore&&(identical(other.algorithmVersion, algorithmVersion) || other.algorithmVersion == algorithmVersion)&&(identical(other.overall, overall) || other.overall == overall)&&(identical(other.cpu, cpu) || other.cpu == cpu)&&(identical(other.system, system) || other.system == system)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,algorithmVersion,overall,cpu,system); - @override - String toString() { - return 'SocScore(algorithmVersion: $algorithmVersion, overall: $overall, cpu: $cpu, system: $system)'; - } +@override +String toString() { + return 'SocScore(algorithmVersion: $algorithmVersion, overall: $overall, cpu: $cpu, system: $system)'; } -/// @nodoc -abstract mixin class $SocScoreCopyWith<$Res> { - factory $SocScoreCopyWith(SocScore value, $Res Function(SocScore) _then) = - _$SocScoreCopyWithImpl; - @useResult - $Res call( - {String? algorithmVersion, - double? overall, - ScoreMetric? cpu, - ScoreMetric? system}); - $ScoreMetricCopyWith<$Res>? get cpu; - $ScoreMetricCopyWith<$Res>? get system; } /// @nodoc -class _$SocScoreCopyWithImpl<$Res> implements $SocScoreCopyWith<$Res> { +abstract mixin class $SocScoreCopyWith<$Res> { + factory $SocScoreCopyWith(SocScore value, $Res Function(SocScore) _then) = _$SocScoreCopyWithImpl; +@useResult +$Res call({ + String? algorithmVersion, double? overall, ScoreMetric? cpu, ScoreMetric? system +}); + + +$ScoreMetricCopyWith<$Res>? get cpu;$ScoreMetricCopyWith<$Res>? get system; + +} +/// @nodoc +class _$SocScoreCopyWithImpl<$Res> + implements $SocScoreCopyWith<$Res> { _$SocScoreCopyWithImpl(this._self, this._then); final SocScore _self; final $Res Function(SocScore) _then; - /// Create a copy of SocScore - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? algorithmVersion = freezed, - Object? overall = freezed, - Object? cpu = freezed, - Object? system = freezed, - }) { - return _then(_self.copyWith( - algorithmVersion: freezed == algorithmVersion - ? _self.algorithmVersion - : algorithmVersion // ignore: cast_nullable_to_non_nullable - as String?, - overall: freezed == overall - ? _self.overall - : overall // ignore: cast_nullable_to_non_nullable - as double?, - cpu: freezed == cpu - ? _self.cpu - : cpu // ignore: cast_nullable_to_non_nullable - as ScoreMetric?, - system: freezed == system - ? _self.system - : system // ignore: cast_nullable_to_non_nullable - as ScoreMetric?, - )); - } - - /// Create a copy of SocScore - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ScoreMetricCopyWith<$Res>? get cpu { +/// Create a copy of SocScore +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? algorithmVersion = freezed,Object? overall = freezed,Object? cpu = freezed,Object? system = freezed,}) { + return _then(_self.copyWith( +algorithmVersion: freezed == algorithmVersion ? _self.algorithmVersion : algorithmVersion // ignore: cast_nullable_to_non_nullable +as String?,overall: freezed == overall ? _self.overall : overall // ignore: cast_nullable_to_non_nullable +as double?,cpu: freezed == cpu ? _self.cpu : cpu // ignore: cast_nullable_to_non_nullable +as ScoreMetric?,system: freezed == system ? _self.system : system // ignore: cast_nullable_to_non_nullable +as ScoreMetric?, + )); +} +/// Create a copy of SocScore +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ScoreMetricCopyWith<$Res>? get cpu { if (_self.cpu == null) { - return null; - } - - return $ScoreMetricCopyWith<$Res>(_self.cpu!, (value) { - return _then(_self.copyWith(cpu: value)); - }); + return null; } - /// Create a copy of SocScore - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ScoreMetricCopyWith<$Res>? get system { + return $ScoreMetricCopyWith<$Res>(_self.cpu!, (value) { + return _then(_self.copyWith(cpu: value)); + }); +}/// Create a copy of SocScore +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ScoreMetricCopyWith<$Res>? get system { if (_self.system == null) { - return null; - } - - return $ScoreMetricCopyWith<$Res>(_self.system!, (value) { - return _then(_self.copyWith(system: value)); - }); + return null; } + + return $ScoreMetricCopyWith<$Res>(_self.system!, (value) { + return _then(_self.copyWith(system: value)); + }); +} } + /// Adds pattern-matching-related methods to [SocScore]. extension SocScorePatterns on SocScore { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_SocScore value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _SocScore() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _SocScore value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _SocScore() when $default != null: +return $default(_that);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_SocScore value) $default, - ) { - final _that = this; - switch (_that) { - case _SocScore(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _SocScore value) $default,){ +final _that = this; +switch (_that) { +case _SocScore(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_SocScore value)? $default, - ) { - final _that = this; - switch (_that) { - case _SocScore() when $default != null: - return $default(_that); - case _: - return null; - } - } +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SocScore value)? $default,){ +final _that = this; +switch (_that) { +case _SocScore() when $default != null: +return $default(_that);case _: + return null; - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function(String? algorithmVersion, double? overall, - ScoreMetric? cpu, ScoreMetric? system)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _SocScore() when $default != null: - return $default( - _that.algorithmVersion, _that.overall, _that.cpu, _that.system); - case _: - return orElse(); - } - } +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? algorithmVersion, double? overall, ScoreMetric? cpu, ScoreMetric? system)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _SocScore() when $default != null: +return $default(_that.algorithmVersion,_that.overall,_that.cpu,_that.system);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function(String? algorithmVersion, double? overall, - ScoreMetric? cpu, ScoreMetric? system) - $default, - ) { - final _that = this; - switch (_that) { - case _SocScore(): - return $default( - _that.algorithmVersion, _that.overall, _that.cpu, _that.system); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? algorithmVersion, double? overall, ScoreMetric? cpu, ScoreMetric? system) $default,) {final _that = this; +switch (_that) { +case _SocScore(): +return $default(_that.algorithmVersion,_that.overall,_that.cpu,_that.system);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? algorithmVersion, double? overall, ScoreMetric? cpu, ScoreMetric? system)? $default,) {final _that = this; +switch (_that) { +case _SocScore() when $default != null: +return $default(_that.algorithmVersion,_that.overall,_that.cpu,_that.system);case _: + return null; + +} +} - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(String? algorithmVersion, double? overall, - ScoreMetric? cpu, ScoreMetric? system)? - $default, - ) { - final _that = this; - switch (_that) { - case _SocScore() when $default != null: - return $default( - _that.algorithmVersion, _that.overall, _that.cpu, _that.system); - case _: - return null; - } - } } /// @nodoc @JsonSerializable() + class _SocScore implements SocScore { const _SocScore({this.algorithmVersion, this.overall, this.cpu, this.system}); - factory _SocScore.fromJson(Map json) => - _$SocScoreFromJson(json); - - @override - final String? algorithmVersion; - @override - final double? overall; - @override - final ScoreMetric? cpu; - @override - final ScoreMetric? system; - - /// Create a copy of SocScore - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$SocScoreCopyWith<_SocScore> get copyWith => - __$SocScoreCopyWithImpl<_SocScore>(this, _$identity); - - @override - Map toJson() { - return _$SocScoreToJson( - this, - ); - } + factory _SocScore.fromJson(Map json) => _$SocScoreFromJson(json); + +@override final String? algorithmVersion; +@override final double? overall; +@override final ScoreMetric? cpu; +@override final ScoreMetric? system; + +/// Create a copy of SocScore +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SocScoreCopyWith<_SocScore> get copyWith => __$SocScoreCopyWithImpl<_SocScore>(this, _$identity); + +@override +Map toJson() { + return _$SocScoreToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _SocScore && - (identical(other.algorithmVersion, algorithmVersion) || - other.algorithmVersion == algorithmVersion) && - (identical(other.overall, overall) || other.overall == overall) && - (identical(other.cpu, cpu) || other.cpu == cpu) && - (identical(other.system, system) || other.system == system)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SocScore&&(identical(other.algorithmVersion, algorithmVersion) || other.algorithmVersion == algorithmVersion)&&(identical(other.overall, overall) || other.overall == overall)&&(identical(other.cpu, cpu) || other.cpu == cpu)&&(identical(other.system, system) || other.system == system)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, algorithmVersion, overall, cpu, system); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,algorithmVersion,overall,cpu,system); - @override - String toString() { - return 'SocScore(algorithmVersion: $algorithmVersion, overall: $overall, cpu: $cpu, system: $system)'; - } +@override +String toString() { + return 'SocScore(algorithmVersion: $algorithmVersion, overall: $overall, cpu: $cpu, system: $system)'; } -/// @nodoc -abstract mixin class _$SocScoreCopyWith<$Res> - implements $SocScoreCopyWith<$Res> { - factory _$SocScoreCopyWith(_SocScore value, $Res Function(_SocScore) _then) = - __$SocScoreCopyWithImpl; - @override - @useResult - $Res call( - {String? algorithmVersion, - double? overall, - ScoreMetric? cpu, - ScoreMetric? system}); - - @override - $ScoreMetricCopyWith<$Res>? get cpu; - @override - $ScoreMetricCopyWith<$Res>? get system; + } /// @nodoc -class __$SocScoreCopyWithImpl<$Res> implements _$SocScoreCopyWith<$Res> { +abstract mixin class _$SocScoreCopyWith<$Res> implements $SocScoreCopyWith<$Res> { + factory _$SocScoreCopyWith(_SocScore value, $Res Function(_SocScore) _then) = __$SocScoreCopyWithImpl; +@override @useResult +$Res call({ + String? algorithmVersion, double? overall, ScoreMetric? cpu, ScoreMetric? system +}); + + +@override $ScoreMetricCopyWith<$Res>? get cpu;@override $ScoreMetricCopyWith<$Res>? get system; + +} +/// @nodoc +class __$SocScoreCopyWithImpl<$Res> + implements _$SocScoreCopyWith<$Res> { __$SocScoreCopyWithImpl(this._self, this._then); final _SocScore _self; final $Res Function(_SocScore) _then; - /// Create a copy of SocScore - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? algorithmVersion = freezed, - Object? overall = freezed, - Object? cpu = freezed, - Object? system = freezed, - }) { - return _then(_SocScore( - algorithmVersion: freezed == algorithmVersion - ? _self.algorithmVersion - : algorithmVersion // ignore: cast_nullable_to_non_nullable - as String?, - overall: freezed == overall - ? _self.overall - : overall // ignore: cast_nullable_to_non_nullable - as double?, - cpu: freezed == cpu - ? _self.cpu - : cpu // ignore: cast_nullable_to_non_nullable - as ScoreMetric?, - system: freezed == system - ? _self.system - : system // ignore: cast_nullable_to_non_nullable - as ScoreMetric?, - )); - } +/// Create a copy of SocScore +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? algorithmVersion = freezed,Object? overall = freezed,Object? cpu = freezed,Object? system = freezed,}) { + return _then(_SocScore( +algorithmVersion: freezed == algorithmVersion ? _self.algorithmVersion : algorithmVersion // ignore: cast_nullable_to_non_nullable +as String?,overall: freezed == overall ? _self.overall : overall // ignore: cast_nullable_to_non_nullable +as double?,cpu: freezed == cpu ? _self.cpu : cpu // ignore: cast_nullable_to_non_nullable +as ScoreMetric?,system: freezed == system ? _self.system : system // ignore: cast_nullable_to_non_nullable +as ScoreMetric?, + )); +} - /// Create a copy of SocScore - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ScoreMetricCopyWith<$Res>? get cpu { +/// Create a copy of SocScore +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ScoreMetricCopyWith<$Res>? get cpu { if (_self.cpu == null) { - return null; - } - - return $ScoreMetricCopyWith<$Res>(_self.cpu!, (value) { - return _then(_self.copyWith(cpu: value)); - }); + return null; } - /// Create a copy of SocScore - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ScoreMetricCopyWith<$Res>? get system { + return $ScoreMetricCopyWith<$Res>(_self.cpu!, (value) { + return _then(_self.copyWith(cpu: value)); + }); +}/// Create a copy of SocScore +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ScoreMetricCopyWith<$Res>? get system { if (_self.system == null) { - return null; - } - - return $ScoreMetricCopyWith<$Res>(_self.system!, (value) { - return _then(_self.copyWith(system: value)); - }); + return null; } + + return $ScoreMetricCopyWith<$Res>(_self.system!, (value) { + return _then(_self.copyWith(system: value)); + }); +} } // dart format on diff --git a/lib/data/dto/score.g.dart b/lib/data/dto/score.g.dart index 5aa5220..aa7ad6c 100644 --- a/lib/data/dto/score.g.dart +++ b/lib/data/dto/score.g.dart @@ -7,12 +7,12 @@ part of 'score.dart'; // ************************************************************************** _ScoreMetric _$ScoreMetricFromJson(Map json) => _ScoreMetric( - index: (json['index'] as num?)?.toDouble(), - percentile: (json['percentile'] as num?)?.toDouble(), - tier: json['tier'] as String?, - era: json['era'] as String?, - source: json['source'] as String?, - ); + index: (json['index'] as num?)?.toDouble(), + percentile: (json['percentile'] as num?)?.toDouble(), + tier: json['tier'] as String?, + era: json['era'] as String?, + source: json['source'] as String?, +); Map _$ScoreMetricToJson(_ScoreMetric instance) => { @@ -50,51 +50,51 @@ Map _$SmartphoneScoreToJson(_SmartphoneScore instance) => }; _CpuScore _$CpuScoreFromJson(Map json) => _CpuScore( - algorithmVersion: json['algorithm_version'] as String?, - overall: (json['overall'] as num?)?.toDouble(), - single: json['single'] == null - ? null - : ScoreMetric.fromJson(json['single'] as Map), - multi: json['multi'] == null - ? null - : ScoreMetric.fromJson(json['multi'] as Map), - ); + algorithmVersion: json['algorithm_version'] as String?, + overall: (json['overall'] as num?)?.toDouble(), + single: json['single'] == null + ? null + : ScoreMetric.fromJson(json['single'] as Map), + multi: json['multi'] == null + ? null + : ScoreMetric.fromJson(json['multi'] as Map), +); Map _$CpuScoreToJson(_CpuScore instance) => { - 'algorithm_version': instance.algorithmVersion, - 'overall': instance.overall, - 'single': instance.single?.toJson(), - 'multi': instance.multi?.toJson(), - }; + 'algorithm_version': instance.algorithmVersion, + 'overall': instance.overall, + 'single': instance.single?.toJson(), + 'multi': instance.multi?.toJson(), +}; _GpuScore _$GpuScoreFromJson(Map json) => _GpuScore( - algorithmVersion: json['algorithm_version'] as String?, - overall: (json['overall'] as num?)?.toDouble(), - graphics: json['graphics'] == null - ? null - : ScoreMetric.fromJson(json['graphics'] as Map), - ); + algorithmVersion: json['algorithm_version'] as String?, + overall: (json['overall'] as num?)?.toDouble(), + graphics: json['graphics'] == null + ? null + : ScoreMetric.fromJson(json['graphics'] as Map), +); Map _$GpuScoreToJson(_GpuScore instance) => { - 'algorithm_version': instance.algorithmVersion, - 'overall': instance.overall, - 'graphics': instance.graphics?.toJson(), - }; + 'algorithm_version': instance.algorithmVersion, + 'overall': instance.overall, + 'graphics': instance.graphics?.toJson(), +}; _SocScore _$SocScoreFromJson(Map json) => _SocScore( - algorithmVersion: json['algorithm_version'] as String?, - overall: (json['overall'] as num?)?.toDouble(), - cpu: json['cpu'] == null - ? null - : ScoreMetric.fromJson(json['cpu'] as Map), - system: json['system'] == null - ? null - : ScoreMetric.fromJson(json['system'] as Map), - ); + algorithmVersion: json['algorithm_version'] as String?, + overall: (json['overall'] as num?)?.toDouble(), + cpu: json['cpu'] == null + ? null + : ScoreMetric.fromJson(json['cpu'] as Map), + system: json['system'] == null + ? null + : ScoreMetric.fromJson(json['system'] as Map), +); Map _$SocScoreToJson(_SocScore instance) => { - 'algorithm_version': instance.algorithmVersion, - 'overall': instance.overall, - 'cpu': instance.cpu?.toJson(), - 'system': instance.system?.toJson(), - }; + 'algorithm_version': instance.algorithmVersion, + 'overall': instance.overall, + 'cpu': instance.cpu?.toJson(), + 'system': instance.system?.toJson(), +}; diff --git a/lib/data/dto/smartphone.freezed.dart b/lib/data/dto/smartphone.freezed.dart index 0194850..f84e779 100644 --- a/lib/data/dto/smartphone.freezed.dart +++ b/lib/data/dto/smartphone.freezed.dart @@ -14,1473 +14,1085 @@ T _$identity(T value) => value; /// @nodoc mixin _$Display { - double? get sizeInch; - /// `2340x1080` 형태의 문자열. 숫자로 파싱하지 않는다. - String? get resolution; - int? get refreshHz; - - /// 패널 종류 (예: `Dynamic AMOLED 2X`). - String? get type; - int? get ppi; - int? get brightnessNits; - - /// Create a copy of Display - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $DisplayCopyWith get copyWith => - _$DisplayCopyWithImpl(this as Display, _$identity); + double? get sizeInch;/// `2340x1080` 형태의 문자열. 숫자로 파싱하지 않는다. + String? get resolution; int? get refreshHz;/// 패널 종류 (예: `Dynamic AMOLED 2X`). + String? get type; int? get ppi; int? get brightnessNits; +/// Create a copy of Display +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$DisplayCopyWith get copyWith => _$DisplayCopyWithImpl(this as Display, _$identity); /// Serializes this Display to a JSON map. Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is Display && - (identical(other.sizeInch, sizeInch) || - other.sizeInch == sizeInch) && - (identical(other.resolution, resolution) || - other.resolution == resolution) && - (identical(other.refreshHz, refreshHz) || - other.refreshHz == refreshHz) && - (identical(other.type, type) || other.type == type) && - (identical(other.ppi, ppi) || other.ppi == ppi) && - (identical(other.brightnessNits, brightnessNits) || - other.brightnessNits == brightnessNits)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, sizeInch, resolution, refreshHz, type, ppi, brightnessNits); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Display&&(identical(other.sizeInch, sizeInch) || other.sizeInch == sizeInch)&&(identical(other.resolution, resolution) || other.resolution == resolution)&&(identical(other.refreshHz, refreshHz) || other.refreshHz == refreshHz)&&(identical(other.type, type) || other.type == type)&&(identical(other.ppi, ppi) || other.ppi == ppi)&&(identical(other.brightnessNits, brightnessNits) || other.brightnessNits == brightnessNits)); +} - @override - String toString() { - return 'Display(sizeInch: $sizeInch, resolution: $resolution, refreshHz: $refreshHz, type: $type, ppi: $ppi, brightnessNits: $brightnessNits)'; - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,sizeInch,resolution,refreshHz,type,ppi,brightnessNits); + +@override +String toString() { + return 'Display(sizeInch: $sizeInch, resolution: $resolution, refreshHz: $refreshHz, type: $type, ppi: $ppi, brightnessNits: $brightnessNits)'; } -/// @nodoc -abstract mixin class $DisplayCopyWith<$Res> { - factory $DisplayCopyWith(Display value, $Res Function(Display) _then) = - _$DisplayCopyWithImpl; - @useResult - $Res call( - {double? sizeInch, - String? resolution, - int? refreshHz, - String? type, - int? ppi, - int? brightnessNits}); + } /// @nodoc -class _$DisplayCopyWithImpl<$Res> implements $DisplayCopyWith<$Res> { +abstract mixin class $DisplayCopyWith<$Res> { + factory $DisplayCopyWith(Display value, $Res Function(Display) _then) = _$DisplayCopyWithImpl; +@useResult +$Res call({ + double? sizeInch, String? resolution, int? refreshHz, String? type, int? ppi, int? brightnessNits +}); + + + + +} +/// @nodoc +class _$DisplayCopyWithImpl<$Res> + implements $DisplayCopyWith<$Res> { _$DisplayCopyWithImpl(this._self, this._then); final Display _self; final $Res Function(Display) _then; - /// Create a copy of Display - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? sizeInch = freezed, - Object? resolution = freezed, - Object? refreshHz = freezed, - Object? type = freezed, - Object? ppi = freezed, - Object? brightnessNits = freezed, - }) { - return _then(_self.copyWith( - sizeInch: freezed == sizeInch - ? _self.sizeInch - : sizeInch // ignore: cast_nullable_to_non_nullable - as double?, - resolution: freezed == resolution - ? _self.resolution - : resolution // ignore: cast_nullable_to_non_nullable - as String?, - refreshHz: freezed == refreshHz - ? _self.refreshHz - : refreshHz // ignore: cast_nullable_to_non_nullable - as int?, - type: freezed == type - ? _self.type - : type // ignore: cast_nullable_to_non_nullable - as String?, - ppi: freezed == ppi - ? _self.ppi - : ppi // ignore: cast_nullable_to_non_nullable - as int?, - brightnessNits: freezed == brightnessNits - ? _self.brightnessNits - : brightnessNits // ignore: cast_nullable_to_non_nullable - as int?, - )); - } +/// Create a copy of Display +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? sizeInch = freezed,Object? resolution = freezed,Object? refreshHz = freezed,Object? type = freezed,Object? ppi = freezed,Object? brightnessNits = freezed,}) { + return _then(_self.copyWith( +sizeInch: freezed == sizeInch ? _self.sizeInch : sizeInch // ignore: cast_nullable_to_non_nullable +as double?,resolution: freezed == resolution ? _self.resolution : resolution // ignore: cast_nullable_to_non_nullable +as String?,refreshHz: freezed == refreshHz ? _self.refreshHz : refreshHz // ignore: cast_nullable_to_non_nullable +as int?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?,ppi: freezed == ppi ? _self.ppi : ppi // ignore: cast_nullable_to_non_nullable +as int?,brightnessNits: freezed == brightnessNits ? _self.brightnessNits : brightnessNits // ignore: cast_nullable_to_non_nullable +as int?, + )); } +} + + /// Adds pattern-matching-related methods to [Display]. extension DisplayPatterns on Display { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_Display value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Display() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Display value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Display() when $default != null: +return $default(_that);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_Display value) $default, - ) { - final _that = this; - switch (_that) { - case _Display(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Display value) $default,){ +final _that = this; +switch (_that) { +case _Display(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_Display value)? $default, - ) { - final _that = this; - switch (_that) { - case _Display() when $default != null: - return $default(_that); - case _: - return null; - } - } +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Display value)? $default,){ +final _that = this; +switch (_that) { +case _Display() when $default != null: +return $default(_that);case _: + return null; - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function(double? sizeInch, String? resolution, int? refreshHz, - String? type, int? ppi, int? brightnessNits)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Display() when $default != null: - return $default(_that.sizeInch, _that.resolution, _that.refreshHz, - _that.type, _that.ppi, _that.brightnessNits); - case _: - return orElse(); - } - } +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( double? sizeInch, String? resolution, int? refreshHz, String? type, int? ppi, int? brightnessNits)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Display() when $default != null: +return $default(_that.sizeInch,_that.resolution,_that.refreshHz,_that.type,_that.ppi,_that.brightnessNits);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function(double? sizeInch, String? resolution, int? refreshHz, - String? type, int? ppi, int? brightnessNits) - $default, - ) { - final _that = this; - switch (_that) { - case _Display(): - return $default(_that.sizeInch, _that.resolution, _that.refreshHz, - _that.type, _that.ppi, _that.brightnessNits); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( double? sizeInch, String? resolution, int? refreshHz, String? type, int? ppi, int? brightnessNits) $default,) {final _that = this; +switch (_that) { +case _Display(): +return $default(_that.sizeInch,_that.resolution,_that.refreshHz,_that.type,_that.ppi,_that.brightnessNits);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( double? sizeInch, String? resolution, int? refreshHz, String? type, int? ppi, int? brightnessNits)? $default,) {final _that = this; +switch (_that) { +case _Display() when $default != null: +return $default(_that.sizeInch,_that.resolution,_that.refreshHz,_that.type,_that.ppi,_that.brightnessNits);case _: + return null; + +} +} - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(double? sizeInch, String? resolution, int? refreshHz, - String? type, int? ppi, int? brightnessNits)? - $default, - ) { - final _that = this; - switch (_that) { - case _Display() when $default != null: - return $default(_that.sizeInch, _that.resolution, _that.refreshHz, - _that.type, _that.ppi, _that.brightnessNits); - case _: - return null; - } - } } /// @nodoc @JsonSerializable() + class _Display implements Display { - const _Display( - {this.sizeInch, - this.resolution, - this.refreshHz, - this.type, - this.ppi, - this.brightnessNits}); - factory _Display.fromJson(Map json) => - _$DisplayFromJson(json); - - @override - final double? sizeInch; - - /// `2340x1080` 형태의 문자열. 숫자로 파싱하지 않는다. - @override - final String? resolution; - @override - final int? refreshHz; - - /// 패널 종류 (예: `Dynamic AMOLED 2X`). - @override - final String? type; - @override - final int? ppi; - @override - final int? brightnessNits; - - /// Create a copy of Display - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$DisplayCopyWith<_Display> get copyWith => - __$DisplayCopyWithImpl<_Display>(this, _$identity); - - @override - Map toJson() { - return _$DisplayToJson( - this, - ); - } + const _Display({this.sizeInch, this.resolution, this.refreshHz, this.type, this.ppi, this.brightnessNits}); + factory _Display.fromJson(Map json) => _$DisplayFromJson(json); + +@override final double? sizeInch; +/// `2340x1080` 형태의 문자열. 숫자로 파싱하지 않는다. +@override final String? resolution; +@override final int? refreshHz; +/// 패널 종류 (예: `Dynamic AMOLED 2X`). +@override final String? type; +@override final int? ppi; +@override final int? brightnessNits; + +/// Create a copy of Display +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$DisplayCopyWith<_Display> get copyWith => __$DisplayCopyWithImpl<_Display>(this, _$identity); + +@override +Map toJson() { + return _$DisplayToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _Display && - (identical(other.sizeInch, sizeInch) || - other.sizeInch == sizeInch) && - (identical(other.resolution, resolution) || - other.resolution == resolution) && - (identical(other.refreshHz, refreshHz) || - other.refreshHz == refreshHz) && - (identical(other.type, type) || other.type == type) && - (identical(other.ppi, ppi) || other.ppi == ppi) && - (identical(other.brightnessNits, brightnessNits) || - other.brightnessNits == brightnessNits)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Display&&(identical(other.sizeInch, sizeInch) || other.sizeInch == sizeInch)&&(identical(other.resolution, resolution) || other.resolution == resolution)&&(identical(other.refreshHz, refreshHz) || other.refreshHz == refreshHz)&&(identical(other.type, type) || other.type == type)&&(identical(other.ppi, ppi) || other.ppi == ppi)&&(identical(other.brightnessNits, brightnessNits) || other.brightnessNits == brightnessNits)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,sizeInch,resolution,refreshHz,type,ppi,brightnessNits); + +@override +String toString() { + return 'Display(sizeInch: $sizeInch, resolution: $resolution, refreshHz: $refreshHz, type: $type, ppi: $ppi, brightnessNits: $brightnessNits)'; +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, sizeInch, resolution, refreshHz, type, ppi, brightnessNits); - @override - String toString() { - return 'Display(sizeInch: $sizeInch, resolution: $resolution, refreshHz: $refreshHz, type: $type, ppi: $ppi, brightnessNits: $brightnessNits)'; - } } /// @nodoc abstract mixin class _$DisplayCopyWith<$Res> implements $DisplayCopyWith<$Res> { - factory _$DisplayCopyWith(_Display value, $Res Function(_Display) _then) = - __$DisplayCopyWithImpl; - @override - @useResult - $Res call( - {double? sizeInch, - String? resolution, - int? refreshHz, - String? type, - int? ppi, - int? brightnessNits}); -} + factory _$DisplayCopyWith(_Display value, $Res Function(_Display) _then) = __$DisplayCopyWithImpl; +@override @useResult +$Res call({ + double? sizeInch, String? resolution, int? refreshHz, String? type, int? ppi, int? brightnessNits +}); + + + +} /// @nodoc -class __$DisplayCopyWithImpl<$Res> implements _$DisplayCopyWith<$Res> { +class __$DisplayCopyWithImpl<$Res> + implements _$DisplayCopyWith<$Res> { __$DisplayCopyWithImpl(this._self, this._then); final _Display _self; final $Res Function(_Display) _then; - /// Create a copy of Display - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? sizeInch = freezed, - Object? resolution = freezed, - Object? refreshHz = freezed, - Object? type = freezed, - Object? ppi = freezed, - Object? brightnessNits = freezed, - }) { - return _then(_Display( - sizeInch: freezed == sizeInch - ? _self.sizeInch - : sizeInch // ignore: cast_nullable_to_non_nullable - as double?, - resolution: freezed == resolution - ? _self.resolution - : resolution // ignore: cast_nullable_to_non_nullable - as String?, - refreshHz: freezed == refreshHz - ? _self.refreshHz - : refreshHz // ignore: cast_nullable_to_non_nullable - as int?, - type: freezed == type - ? _self.type - : type // ignore: cast_nullable_to_non_nullable - as String?, - ppi: freezed == ppi - ? _self.ppi - : ppi // ignore: cast_nullable_to_non_nullable - as int?, - brightnessNits: freezed == brightnessNits - ? _self.brightnessNits - : brightnessNits // ignore: cast_nullable_to_non_nullable - as int?, - )); - } +/// Create a copy of Display +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? sizeInch = freezed,Object? resolution = freezed,Object? refreshHz = freezed,Object? type = freezed,Object? ppi = freezed,Object? brightnessNits = freezed,}) { + return _then(_Display( +sizeInch: freezed == sizeInch ? _self.sizeInch : sizeInch // ignore: cast_nullable_to_non_nullable +as double?,resolution: freezed == resolution ? _self.resolution : resolution // ignore: cast_nullable_to_non_nullable +as String?,refreshHz: freezed == refreshHz ? _self.refreshHz : refreshHz // ignore: cast_nullable_to_non_nullable +as int?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?,ppi: freezed == ppi ? _self.ppi : ppi // ignore: cast_nullable_to_non_nullable +as int?,brightnessNits: freezed == brightnessNits ? _self.brightnessNits : brightnessNits // ignore: cast_nullable_to_non_nullable +as int?, + )); } -/// @nodoc -mixin _$Camera { - String? get type; - /// 화소 (메가픽셀). - double? get mp; - double? get aperture; +} - /// 광학식 손떨림 보정. - bool? get ois; - String? get sensor; - double? get opticalZoom; - /// Create a copy of Camera - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $CameraCopyWith get copyWith => - _$CameraCopyWithImpl(this as Camera, _$identity); +/// @nodoc +mixin _$Camera { + + String? get type;/// 화소 (메가픽셀). + double? get mp; double? get aperture;/// 광학식 손떨림 보정. + bool? get ois; String? get sensor; double? get opticalZoom; +/// Create a copy of Camera +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CameraCopyWith get copyWith => _$CameraCopyWithImpl(this as Camera, _$identity); /// Serializes this Camera to a JSON map. Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is Camera && - (identical(other.type, type) || other.type == type) && - (identical(other.mp, mp) || other.mp == mp) && - (identical(other.aperture, aperture) || - other.aperture == aperture) && - (identical(other.ois, ois) || other.ois == ois) && - (identical(other.sensor, sensor) || other.sensor == sensor) && - (identical(other.opticalZoom, opticalZoom) || - other.opticalZoom == opticalZoom)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, type, mp, aperture, ois, sensor, opticalZoom); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Camera&&(identical(other.type, type) || other.type == type)&&(identical(other.mp, mp) || other.mp == mp)&&(identical(other.aperture, aperture) || other.aperture == aperture)&&(identical(other.ois, ois) || other.ois == ois)&&(identical(other.sensor, sensor) || other.sensor == sensor)&&(identical(other.opticalZoom, opticalZoom) || other.opticalZoom == opticalZoom)); +} - @override - String toString() { - return 'Camera(type: $type, mp: $mp, aperture: $aperture, ois: $ois, sensor: $sensor, opticalZoom: $opticalZoom)'; - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,type,mp,aperture,ois,sensor,opticalZoom); + +@override +String toString() { + return 'Camera(type: $type, mp: $mp, aperture: $aperture, ois: $ois, sensor: $sensor, opticalZoom: $opticalZoom)'; } -/// @nodoc -abstract mixin class $CameraCopyWith<$Res> { - factory $CameraCopyWith(Camera value, $Res Function(Camera) _then) = - _$CameraCopyWithImpl; - @useResult - $Res call( - {String? type, - double? mp, - double? aperture, - bool? ois, - String? sensor, - double? opticalZoom}); + } /// @nodoc -class _$CameraCopyWithImpl<$Res> implements $CameraCopyWith<$Res> { +abstract mixin class $CameraCopyWith<$Res> { + factory $CameraCopyWith(Camera value, $Res Function(Camera) _then) = _$CameraCopyWithImpl; +@useResult +$Res call({ + String? type, double? mp, double? aperture, bool? ois, String? sensor, double? opticalZoom +}); + + + + +} +/// @nodoc +class _$CameraCopyWithImpl<$Res> + implements $CameraCopyWith<$Res> { _$CameraCopyWithImpl(this._self, this._then); final Camera _self; final $Res Function(Camera) _then; - /// Create a copy of Camera - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? type = freezed, - Object? mp = freezed, - Object? aperture = freezed, - Object? ois = freezed, - Object? sensor = freezed, - Object? opticalZoom = freezed, - }) { - return _then(_self.copyWith( - type: freezed == type - ? _self.type - : type // ignore: cast_nullable_to_non_nullable - as String?, - mp: freezed == mp - ? _self.mp - : mp // ignore: cast_nullable_to_non_nullable - as double?, - aperture: freezed == aperture - ? _self.aperture - : aperture // ignore: cast_nullable_to_non_nullable - as double?, - ois: freezed == ois - ? _self.ois - : ois // ignore: cast_nullable_to_non_nullable - as bool?, - sensor: freezed == sensor - ? _self.sensor - : sensor // ignore: cast_nullable_to_non_nullable - as String?, - opticalZoom: freezed == opticalZoom - ? _self.opticalZoom - : opticalZoom // ignore: cast_nullable_to_non_nullable - as double?, - )); - } +/// Create a copy of Camera +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? type = freezed,Object? mp = freezed,Object? aperture = freezed,Object? ois = freezed,Object? sensor = freezed,Object? opticalZoom = freezed,}) { + return _then(_self.copyWith( +type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?,mp: freezed == mp ? _self.mp : mp // ignore: cast_nullable_to_non_nullable +as double?,aperture: freezed == aperture ? _self.aperture : aperture // ignore: cast_nullable_to_non_nullable +as double?,ois: freezed == ois ? _self.ois : ois // ignore: cast_nullable_to_non_nullable +as bool?,sensor: freezed == sensor ? _self.sensor : sensor // ignore: cast_nullable_to_non_nullable +as String?,opticalZoom: freezed == opticalZoom ? _self.opticalZoom : opticalZoom // ignore: cast_nullable_to_non_nullable +as double?, + )); } +} + + /// Adds pattern-matching-related methods to [Camera]. extension CameraPatterns on Camera { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_Camera value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Camera() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Camera value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Camera() when $default != null: +return $default(_that);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_Camera value) $default, - ) { - final _that = this; - switch (_that) { - case _Camera(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Camera value) $default,){ +final _that = this; +switch (_that) { +case _Camera(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_Camera value)? $default, - ) { - final _that = this; - switch (_that) { - case _Camera() when $default != null: - return $default(_that); - case _: - return null; - } - } +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Camera value)? $default,){ +final _that = this; +switch (_that) { +case _Camera() when $default != null: +return $default(_that);case _: + return null; - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function(String? type, double? mp, double? aperture, bool? ois, - String? sensor, double? opticalZoom)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Camera() when $default != null: - return $default(_that.type, _that.mp, _that.aperture, _that.ois, - _that.sensor, _that.opticalZoom); - case _: - return orElse(); - } - } +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? type, double? mp, double? aperture, bool? ois, String? sensor, double? opticalZoom)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Camera() when $default != null: +return $default(_that.type,_that.mp,_that.aperture,_that.ois,_that.sensor,_that.opticalZoom);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function(String? type, double? mp, double? aperture, bool? ois, - String? sensor, double? opticalZoom) - $default, - ) { - final _that = this; - switch (_that) { - case _Camera(): - return $default(_that.type, _that.mp, _that.aperture, _that.ois, - _that.sensor, _that.opticalZoom); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? type, double? mp, double? aperture, bool? ois, String? sensor, double? opticalZoom) $default,) {final _that = this; +switch (_that) { +case _Camera(): +return $default(_that.type,_that.mp,_that.aperture,_that.ois,_that.sensor,_that.opticalZoom);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? type, double? mp, double? aperture, bool? ois, String? sensor, double? opticalZoom)? $default,) {final _that = this; +switch (_that) { +case _Camera() when $default != null: +return $default(_that.type,_that.mp,_that.aperture,_that.ois,_that.sensor,_that.opticalZoom);case _: + return null; + +} +} - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(String? type, double? mp, double? aperture, bool? ois, - String? sensor, double? opticalZoom)? - $default, - ) { - final _that = this; - switch (_that) { - case _Camera() when $default != null: - return $default(_that.type, _that.mp, _that.aperture, _that.ois, - _that.sensor, _that.opticalZoom); - case _: - return null; - } - } } /// @nodoc @JsonSerializable() + class _Camera implements Camera { - const _Camera( - {this.type, - this.mp, - this.aperture, - this.ois, - this.sensor, - this.opticalZoom}); + const _Camera({this.type, this.mp, this.aperture, this.ois, this.sensor, this.opticalZoom}); factory _Camera.fromJson(Map json) => _$CameraFromJson(json); - @override - final String? type; - - /// 화소 (메가픽셀). - @override - final double? mp; - @override - final double? aperture; - - /// 광학식 손떨림 보정. - @override - final bool? ois; - @override - final String? sensor; - @override - final double? opticalZoom; - - /// Create a copy of Camera - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$CameraCopyWith<_Camera> get copyWith => - __$CameraCopyWithImpl<_Camera>(this, _$identity); - - @override - Map toJson() { - return _$CameraToJson( - this, - ); - } +@override final String? type; +/// 화소 (메가픽셀). +@override final double? mp; +@override final double? aperture; +/// 광학식 손떨림 보정. +@override final bool? ois; +@override final String? sensor; +@override final double? opticalZoom; + +/// Create a copy of Camera +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CameraCopyWith<_Camera> get copyWith => __$CameraCopyWithImpl<_Camera>(this, _$identity); + +@override +Map toJson() { + return _$CameraToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _Camera && - (identical(other.type, type) || other.type == type) && - (identical(other.mp, mp) || other.mp == mp) && - (identical(other.aperture, aperture) || - other.aperture == aperture) && - (identical(other.ois, ois) || other.ois == ois) && - (identical(other.sensor, sensor) || other.sensor == sensor) && - (identical(other.opticalZoom, opticalZoom) || - other.opticalZoom == opticalZoom)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Camera&&(identical(other.type, type) || other.type == type)&&(identical(other.mp, mp) || other.mp == mp)&&(identical(other.aperture, aperture) || other.aperture == aperture)&&(identical(other.ois, ois) || other.ois == ois)&&(identical(other.sensor, sensor) || other.sensor == sensor)&&(identical(other.opticalZoom, opticalZoom) || other.opticalZoom == opticalZoom)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,type,mp,aperture,ois,sensor,opticalZoom); + +@override +String toString() { + return 'Camera(type: $type, mp: $mp, aperture: $aperture, ois: $ois, sensor: $sensor, opticalZoom: $opticalZoom)'; +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, type, mp, aperture, ois, sensor, opticalZoom); - @override - String toString() { - return 'Camera(type: $type, mp: $mp, aperture: $aperture, ois: $ois, sensor: $sensor, opticalZoom: $opticalZoom)'; - } } /// @nodoc abstract mixin class _$CameraCopyWith<$Res> implements $CameraCopyWith<$Res> { - factory _$CameraCopyWith(_Camera value, $Res Function(_Camera) _then) = - __$CameraCopyWithImpl; - @override - @useResult - $Res call( - {String? type, - double? mp, - double? aperture, - bool? ois, - String? sensor, - double? opticalZoom}); -} + factory _$CameraCopyWith(_Camera value, $Res Function(_Camera) _then) = __$CameraCopyWithImpl; +@override @useResult +$Res call({ + String? type, double? mp, double? aperture, bool? ois, String? sensor, double? opticalZoom +}); + + + +} /// @nodoc -class __$CameraCopyWithImpl<$Res> implements _$CameraCopyWith<$Res> { +class __$CameraCopyWithImpl<$Res> + implements _$CameraCopyWith<$Res> { __$CameraCopyWithImpl(this._self, this._then); final _Camera _self; final $Res Function(_Camera) _then; - /// Create a copy of Camera - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? type = freezed, - Object? mp = freezed, - Object? aperture = freezed, - Object? ois = freezed, - Object? sensor = freezed, - Object? opticalZoom = freezed, - }) { - return _then(_Camera( - type: freezed == type - ? _self.type - : type // ignore: cast_nullable_to_non_nullable - as String?, - mp: freezed == mp - ? _self.mp - : mp // ignore: cast_nullable_to_non_nullable - as double?, - aperture: freezed == aperture - ? _self.aperture - : aperture // ignore: cast_nullable_to_non_nullable - as double?, - ois: freezed == ois - ? _self.ois - : ois // ignore: cast_nullable_to_non_nullable - as bool?, - sensor: freezed == sensor - ? _self.sensor - : sensor // ignore: cast_nullable_to_non_nullable - as String?, - opticalZoom: freezed == opticalZoom - ? _self.opticalZoom - : opticalZoom // ignore: cast_nullable_to_non_nullable - as double?, - )); - } +/// Create a copy of Camera +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? type = freezed,Object? mp = freezed,Object? aperture = freezed,Object? ois = freezed,Object? sensor = freezed,Object? opticalZoom = freezed,}) { + return _then(_Camera( +type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?,mp: freezed == mp ? _self.mp : mp // ignore: cast_nullable_to_non_nullable +as double?,aperture: freezed == aperture ? _self.aperture : aperture // ignore: cast_nullable_to_non_nullable +as double?,ois: freezed == ois ? _self.ois : ois // ignore: cast_nullable_to_non_nullable +as bool?,sensor: freezed == sensor ? _self.sensor : sensor // ignore: cast_nullable_to_non_nullable +as String?,opticalZoom: freezed == opticalZoom ? _self.opticalZoom : opticalZoom // ignore: cast_nullable_to_non_nullable +as double?, + )); } + +} + + /// @nodoc mixin _$Dimensions { - double? get heightMm; - double? get widthMm; - double? get depthMm; - /// Create a copy of Dimensions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $DimensionsCopyWith get copyWith => - _$DimensionsCopyWithImpl(this as Dimensions, _$identity); + double? get heightMm; double? get widthMm; double? get depthMm; +/// Create a copy of Dimensions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$DimensionsCopyWith get copyWith => _$DimensionsCopyWithImpl(this as Dimensions, _$identity); /// Serializes this Dimensions to a JSON map. Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is Dimensions && - (identical(other.heightMm, heightMm) || - other.heightMm == heightMm) && - (identical(other.widthMm, widthMm) || other.widthMm == widthMm) && - (identical(other.depthMm, depthMm) || other.depthMm == depthMm)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, heightMm, widthMm, depthMm); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Dimensions&&(identical(other.heightMm, heightMm) || other.heightMm == heightMm)&&(identical(other.widthMm, widthMm) || other.widthMm == widthMm)&&(identical(other.depthMm, depthMm) || other.depthMm == depthMm)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,heightMm,widthMm,depthMm); - @override - String toString() { - return 'Dimensions(heightMm: $heightMm, widthMm: $widthMm, depthMm: $depthMm)'; - } +@override +String toString() { + return 'Dimensions(heightMm: $heightMm, widthMm: $widthMm, depthMm: $depthMm)'; } -/// @nodoc -abstract mixin class $DimensionsCopyWith<$Res> { - factory $DimensionsCopyWith( - Dimensions value, $Res Function(Dimensions) _then) = - _$DimensionsCopyWithImpl; - @useResult - $Res call({double? heightMm, double? widthMm, double? depthMm}); + } /// @nodoc -class _$DimensionsCopyWithImpl<$Res> implements $DimensionsCopyWith<$Res> { +abstract mixin class $DimensionsCopyWith<$Res> { + factory $DimensionsCopyWith(Dimensions value, $Res Function(Dimensions) _then) = _$DimensionsCopyWithImpl; +@useResult +$Res call({ + double? heightMm, double? widthMm, double? depthMm +}); + + + + +} +/// @nodoc +class _$DimensionsCopyWithImpl<$Res> + implements $DimensionsCopyWith<$Res> { _$DimensionsCopyWithImpl(this._self, this._then); final Dimensions _self; final $Res Function(Dimensions) _then; - /// Create a copy of Dimensions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? heightMm = freezed, - Object? widthMm = freezed, - Object? depthMm = freezed, - }) { - return _then(_self.copyWith( - heightMm: freezed == heightMm - ? _self.heightMm - : heightMm // ignore: cast_nullable_to_non_nullable - as double?, - widthMm: freezed == widthMm - ? _self.widthMm - : widthMm // ignore: cast_nullable_to_non_nullable - as double?, - depthMm: freezed == depthMm - ? _self.depthMm - : depthMm // ignore: cast_nullable_to_non_nullable - as double?, - )); - } +/// Create a copy of Dimensions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? heightMm = freezed,Object? widthMm = freezed,Object? depthMm = freezed,}) { + return _then(_self.copyWith( +heightMm: freezed == heightMm ? _self.heightMm : heightMm // ignore: cast_nullable_to_non_nullable +as double?,widthMm: freezed == widthMm ? _self.widthMm : widthMm // ignore: cast_nullable_to_non_nullable +as double?,depthMm: freezed == depthMm ? _self.depthMm : depthMm // ignore: cast_nullable_to_non_nullable +as double?, + )); } +} + + /// Adds pattern-matching-related methods to [Dimensions]. extension DimensionsPatterns on Dimensions { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_Dimensions value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Dimensions() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Dimensions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Dimensions() when $default != null: +return $default(_that);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_Dimensions value) $default, - ) { - final _that = this; - switch (_that) { - case _Dimensions(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Dimensions value) $default,){ +final _that = this; +switch (_that) { +case _Dimensions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_Dimensions value)? $default, - ) { - final _that = this; - switch (_that) { - case _Dimensions() when $default != null: - return $default(_that); - case _: - return null; - } - } +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Dimensions value)? $default,){ +final _that = this; +switch (_that) { +case _Dimensions() when $default != null: +return $default(_that);case _: + return null; - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function(double? heightMm, double? widthMm, double? depthMm)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Dimensions() when $default != null: - return $default(_that.heightMm, _that.widthMm, _that.depthMm); - case _: - return orElse(); - } - } +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( double? heightMm, double? widthMm, double? depthMm)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Dimensions() when $default != null: +return $default(_that.heightMm,_that.widthMm,_that.depthMm);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function(double? heightMm, double? widthMm, double? depthMm) - $default, - ) { - final _that = this; - switch (_that) { - case _Dimensions(): - return $default(_that.heightMm, _that.widthMm, _that.depthMm); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( double? heightMm, double? widthMm, double? depthMm) $default,) {final _that = this; +switch (_that) { +case _Dimensions(): +return $default(_that.heightMm,_that.widthMm,_that.depthMm);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( double? heightMm, double? widthMm, double? depthMm)? $default,) {final _that = this; +switch (_that) { +case _Dimensions() when $default != null: +return $default(_that.heightMm,_that.widthMm,_that.depthMm);case _: + return null; + +} +} - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(double? heightMm, double? widthMm, double? depthMm)? - $default, - ) { - final _that = this; - switch (_that) { - case _Dimensions() when $default != null: - return $default(_that.heightMm, _that.widthMm, _that.depthMm); - case _: - return null; - } - } } /// @nodoc @JsonSerializable() + class _Dimensions implements Dimensions { const _Dimensions({this.heightMm, this.widthMm, this.depthMm}); - factory _Dimensions.fromJson(Map json) => - _$DimensionsFromJson(json); - - @override - final double? heightMm; - @override - final double? widthMm; - @override - final double? depthMm; - - /// Create a copy of Dimensions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$DimensionsCopyWith<_Dimensions> get copyWith => - __$DimensionsCopyWithImpl<_Dimensions>(this, _$identity); - - @override - Map toJson() { - return _$DimensionsToJson( - this, - ); - } + factory _Dimensions.fromJson(Map json) => _$DimensionsFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _Dimensions && - (identical(other.heightMm, heightMm) || - other.heightMm == heightMm) && - (identical(other.widthMm, widthMm) || other.widthMm == widthMm) && - (identical(other.depthMm, depthMm) || other.depthMm == depthMm)); - } +@override final double? heightMm; +@override final double? widthMm; +@override final double? depthMm; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, heightMm, widthMm, depthMm); +/// Create a copy of Dimensions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$DimensionsCopyWith<_Dimensions> get copyWith => __$DimensionsCopyWithImpl<_Dimensions>(this, _$identity); - @override - String toString() { - return 'Dimensions(heightMm: $heightMm, widthMm: $widthMm, depthMm: $depthMm)'; - } +@override +Map toJson() { + return _$DimensionsToJson(this, ); } -/// @nodoc -abstract mixin class _$DimensionsCopyWith<$Res> - implements $DimensionsCopyWith<$Res> { - factory _$DimensionsCopyWith( - _Dimensions value, $Res Function(_Dimensions) _then) = - __$DimensionsCopyWithImpl; - @override - @useResult - $Res call({double? heightMm, double? widthMm, double? depthMm}); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Dimensions&&(identical(other.heightMm, heightMm) || other.heightMm == heightMm)&&(identical(other.widthMm, widthMm) || other.widthMm == widthMm)&&(identical(other.depthMm, depthMm) || other.depthMm == depthMm)); } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,heightMm,widthMm,depthMm); + +@override +String toString() { + return 'Dimensions(heightMm: $heightMm, widthMm: $widthMm, depthMm: $depthMm)'; +} + + +} + +/// @nodoc +abstract mixin class _$DimensionsCopyWith<$Res> implements $DimensionsCopyWith<$Res> { + factory _$DimensionsCopyWith(_Dimensions value, $Res Function(_Dimensions) _then) = __$DimensionsCopyWithImpl; +@override @useResult +$Res call({ + double? heightMm, double? widthMm, double? depthMm +}); + + + + +} /// @nodoc -class __$DimensionsCopyWithImpl<$Res> implements _$DimensionsCopyWith<$Res> { +class __$DimensionsCopyWithImpl<$Res> + implements _$DimensionsCopyWith<$Res> { __$DimensionsCopyWithImpl(this._self, this._then); final _Dimensions _self; final $Res Function(_Dimensions) _then; - /// Create a copy of Dimensions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? heightMm = freezed, - Object? widthMm = freezed, - Object? depthMm = freezed, - }) { - return _then(_Dimensions( - heightMm: freezed == heightMm - ? _self.heightMm - : heightMm // ignore: cast_nullable_to_non_nullable - as double?, - widthMm: freezed == widthMm - ? _self.widthMm - : widthMm // ignore: cast_nullable_to_non_nullable - as double?, - depthMm: freezed == depthMm - ? _self.depthMm - : depthMm // ignore: cast_nullable_to_non_nullable - as double?, - )); - } +/// Create a copy of Dimensions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? heightMm = freezed,Object? widthMm = freezed,Object? depthMm = freezed,}) { + return _then(_Dimensions( +heightMm: freezed == heightMm ? _self.heightMm : heightMm // ignore: cast_nullable_to_non_nullable +as double?,widthMm: freezed == widthMm ? _self.widthMm : widthMm // ignore: cast_nullable_to_non_nullable +as double?,depthMm: freezed == depthMm ? _self.depthMm : depthMm // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + + } + /// @nodoc mixin _$Connectivity { - String? get wifi; - String? get bluetooth; - bool? get nfc; - String? get usb; - - /// Create a copy of Connectivity - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $ConnectivityCopyWith get copyWith => - _$ConnectivityCopyWithImpl( - this as Connectivity, _$identity); + + String? get wifi; String? get bluetooth; bool? get nfc; String? get usb; +/// Create a copy of Connectivity +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConnectivityCopyWith get copyWith => _$ConnectivityCopyWithImpl(this as Connectivity, _$identity); /// Serializes this Connectivity to a JSON map. Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is Connectivity && - (identical(other.wifi, wifi) || other.wifi == wifi) && - (identical(other.bluetooth, bluetooth) || - other.bluetooth == bluetooth) && - (identical(other.nfc, nfc) || other.nfc == nfc) && - (identical(other.usb, usb) || other.usb == usb)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, wifi, bluetooth, nfc, usb); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Connectivity&&(identical(other.wifi, wifi) || other.wifi == wifi)&&(identical(other.bluetooth, bluetooth) || other.bluetooth == bluetooth)&&(identical(other.nfc, nfc) || other.nfc == nfc)&&(identical(other.usb, usb) || other.usb == usb)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,wifi,bluetooth,nfc,usb); - @override - String toString() { - return 'Connectivity(wifi: $wifi, bluetooth: $bluetooth, nfc: $nfc, usb: $usb)'; - } +@override +String toString() { + return 'Connectivity(wifi: $wifi, bluetooth: $bluetooth, nfc: $nfc, usb: $usb)'; } -/// @nodoc -abstract mixin class $ConnectivityCopyWith<$Res> { - factory $ConnectivityCopyWith( - Connectivity value, $Res Function(Connectivity) _then) = - _$ConnectivityCopyWithImpl; - @useResult - $Res call({String? wifi, String? bluetooth, bool? nfc, String? usb}); + } /// @nodoc -class _$ConnectivityCopyWithImpl<$Res> implements $ConnectivityCopyWith<$Res> { +abstract mixin class $ConnectivityCopyWith<$Res> { + factory $ConnectivityCopyWith(Connectivity value, $Res Function(Connectivity) _then) = _$ConnectivityCopyWithImpl; +@useResult +$Res call({ + String? wifi, String? bluetooth, bool? nfc, String? usb +}); + + + + +} +/// @nodoc +class _$ConnectivityCopyWithImpl<$Res> + implements $ConnectivityCopyWith<$Res> { _$ConnectivityCopyWithImpl(this._self, this._then); final Connectivity _self; final $Res Function(Connectivity) _then; - /// Create a copy of Connectivity - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? wifi = freezed, - Object? bluetooth = freezed, - Object? nfc = freezed, - Object? usb = freezed, - }) { - return _then(_self.copyWith( - wifi: freezed == wifi - ? _self.wifi - : wifi // ignore: cast_nullable_to_non_nullable - as String?, - bluetooth: freezed == bluetooth - ? _self.bluetooth - : bluetooth // ignore: cast_nullable_to_non_nullable - as String?, - nfc: freezed == nfc - ? _self.nfc - : nfc // ignore: cast_nullable_to_non_nullable - as bool?, - usb: freezed == usb - ? _self.usb - : usb // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +/// Create a copy of Connectivity +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? wifi = freezed,Object? bluetooth = freezed,Object? nfc = freezed,Object? usb = freezed,}) { + return _then(_self.copyWith( +wifi: freezed == wifi ? _self.wifi : wifi // ignore: cast_nullable_to_non_nullable +as String?,bluetooth: freezed == bluetooth ? _self.bluetooth : bluetooth // ignore: cast_nullable_to_non_nullable +as String?,nfc: freezed == nfc ? _self.nfc : nfc // ignore: cast_nullable_to_non_nullable +as bool?,usb: freezed == usb ? _self.usb : usb // ignore: cast_nullable_to_non_nullable +as String?, + )); } +} + + /// Adds pattern-matching-related methods to [Connectivity]. extension ConnectivityPatterns on Connectivity { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_Connectivity value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Connectivity() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Connectivity value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Connectivity() when $default != null: +return $default(_that);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_Connectivity value) $default, - ) { - final _that = this; - switch (_that) { - case _Connectivity(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Connectivity value) $default,){ +final _that = this; +switch (_that) { +case _Connectivity(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_Connectivity value)? $default, - ) { - final _that = this; - switch (_that) { - case _Connectivity() when $default != null: - return $default(_that); - case _: - return null; - } - } +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Connectivity value)? $default,){ +final _that = this; +switch (_that) { +case _Connectivity() when $default != null: +return $default(_that);case _: + return null; - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function(String? wifi, String? bluetooth, bool? nfc, String? usb)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Connectivity() when $default != null: - return $default(_that.wifi, _that.bluetooth, _that.nfc, _that.usb); - case _: - return orElse(); - } - } +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? wifi, String? bluetooth, bool? nfc, String? usb)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Connectivity() when $default != null: +return $default(_that.wifi,_that.bluetooth,_that.nfc,_that.usb);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function(String? wifi, String? bluetooth, bool? nfc, String? usb) - $default, - ) { - final _that = this; - switch (_that) { - case _Connectivity(): - return $default(_that.wifi, _that.bluetooth, _that.nfc, _that.usb); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? wifi, String? bluetooth, bool? nfc, String? usb) $default,) {final _that = this; +switch (_that) { +case _Connectivity(): +return $default(_that.wifi,_that.bluetooth,_that.nfc,_that.usb);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? wifi, String? bluetooth, bool? nfc, String? usb)? $default,) {final _that = this; +switch (_that) { +case _Connectivity() when $default != null: +return $default(_that.wifi,_that.bluetooth,_that.nfc,_that.usb);case _: + return null; + +} +} - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(String? wifi, String? bluetooth, bool? nfc, String? usb)? - $default, - ) { - final _that = this; - switch (_that) { - case _Connectivity() when $default != null: - return $default(_that.wifi, _that.bluetooth, _that.nfc, _that.usb); - case _: - return null; - } - } } /// @nodoc @JsonSerializable() + class _Connectivity implements Connectivity { const _Connectivity({this.wifi, this.bluetooth, this.nfc, this.usb}); - factory _Connectivity.fromJson(Map json) => - _$ConnectivityFromJson(json); - - @override - final String? wifi; - @override - final String? bluetooth; - @override - final bool? nfc; - @override - final String? usb; - - /// Create a copy of Connectivity - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$ConnectivityCopyWith<_Connectivity> get copyWith => - __$ConnectivityCopyWithImpl<_Connectivity>(this, _$identity); - - @override - Map toJson() { - return _$ConnectivityToJson( - this, - ); - } + factory _Connectivity.fromJson(Map json) => _$ConnectivityFromJson(json); + +@override final String? wifi; +@override final String? bluetooth; +@override final bool? nfc; +@override final String? usb; + +/// Create a copy of Connectivity +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConnectivityCopyWith<_Connectivity> get copyWith => __$ConnectivityCopyWithImpl<_Connectivity>(this, _$identity); + +@override +Map toJson() { + return _$ConnectivityToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _Connectivity && - (identical(other.wifi, wifi) || other.wifi == wifi) && - (identical(other.bluetooth, bluetooth) || - other.bluetooth == bluetooth) && - (identical(other.nfc, nfc) || other.nfc == nfc) && - (identical(other.usb, usb) || other.usb == usb)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Connectivity&&(identical(other.wifi, wifi) || other.wifi == wifi)&&(identical(other.bluetooth, bluetooth) || other.bluetooth == bluetooth)&&(identical(other.nfc, nfc) || other.nfc == nfc)&&(identical(other.usb, usb) || other.usb == usb)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, wifi, bluetooth, nfc, usb); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,wifi,bluetooth,nfc,usb); - @override - String toString() { - return 'Connectivity(wifi: $wifi, bluetooth: $bluetooth, nfc: $nfc, usb: $usb)'; - } +@override +String toString() { + return 'Connectivity(wifi: $wifi, bluetooth: $bluetooth, nfc: $nfc, usb: $usb)'; } -/// @nodoc -abstract mixin class _$ConnectivityCopyWith<$Res> - implements $ConnectivityCopyWith<$Res> { - factory _$ConnectivityCopyWith( - _Connectivity value, $Res Function(_Connectivity) _then) = - __$ConnectivityCopyWithImpl; - @override - @useResult - $Res call({String? wifi, String? bluetooth, bool? nfc, String? usb}); + } +/// @nodoc +abstract mixin class _$ConnectivityCopyWith<$Res> implements $ConnectivityCopyWith<$Res> { + factory _$ConnectivityCopyWith(_Connectivity value, $Res Function(_Connectivity) _then) = __$ConnectivityCopyWithImpl; +@override @useResult +$Res call({ + String? wifi, String? bluetooth, bool? nfc, String? usb +}); + + + + +} /// @nodoc class __$ConnectivityCopyWithImpl<$Res> implements _$ConnectivityCopyWith<$Res> { @@ -1489,1362 +1101,552 @@ class __$ConnectivityCopyWithImpl<$Res> final _Connectivity _self; final $Res Function(_Connectivity) _then; - /// Create a copy of Connectivity - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? wifi = freezed, - Object? bluetooth = freezed, - Object? nfc = freezed, - Object? usb = freezed, - }) { - return _then(_Connectivity( - wifi: freezed == wifi - ? _self.wifi - : wifi // ignore: cast_nullable_to_non_nullable - as String?, - bluetooth: freezed == bluetooth - ? _self.bluetooth - : bluetooth // ignore: cast_nullable_to_non_nullable - as String?, - nfc: freezed == nfc - ? _self.nfc - : nfc // ignore: cast_nullable_to_non_nullable - as bool?, - usb: freezed == usb - ? _self.usb - : usb // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +/// Create a copy of Connectivity +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? wifi = freezed,Object? bluetooth = freezed,Object? nfc = freezed,Object? usb = freezed,}) { + return _then(_Connectivity( +wifi: freezed == wifi ? _self.wifi : wifi // ignore: cast_nullable_to_non_nullable +as String?,bluetooth: freezed == bluetooth ? _self.bluetooth : bluetooth // ignore: cast_nullable_to_non_nullable +as String?,nfc: freezed == nfc ? _self.nfc : nfc // ignore: cast_nullable_to_non_nullable +as bool?,usb: freezed == usb ? _self.usb : usb // ignore: cast_nullable_to_non_nullable +as String?, + )); } + +} + + /// @nodoc mixin _$Smartphone { - String get slug; - String get name; - int? get id; - - /// 파생 모델일 때 원본 모델의 slug (예: Plus/Ultra 변형). - String? get baseModelSlug; - Brand? get brand; - Soc? get soc; - - /// `YYYY-MM-DD`. 일자가 불확실하면 월초로 채워져 있다. - String? get releaseDate; - int? get msrpUsd; - int? get ramGb; - List get storageOptionsGb; - - /// 지역·구성별 변형 정보. 스키마가 고정되어 있지 않아 원본 그대로 둔다. - Map get variant; - Display? get display; - List get cameras; - int? get batteryMah; - int? get chargingWiredW; - int? get chargingWirelessW; - double? get weightG; - Dimensions? get dimensions; - - /// 방수·방진 등급 (예: `IP68`). - String? get ipRating; - String? get os; - String? get osVersion; - Connectivity? get connectivity; - String? get imageUrl; - List get images; - SmartphoneScore? get score; - bool get verified; - - /// CC-BY-SA 4.0 조건상 UI에 반드시 노출해야 한다. - List get sourceUrls; - String? get createdAt; - String? get updatedAt; - - /// Create a copy of Smartphone - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $SmartphoneCopyWith get copyWith => - _$SmartphoneCopyWithImpl(this as Smartphone, _$identity); + + String get slug; String get name; int? get id;/// 파생 모델일 때 원본 모델의 slug (예: Plus/Ultra 변형). + String? get baseModelSlug; Brand? get brand; Soc? get soc;/// `YYYY-MM-DD`. 일자가 불확실하면 월초로 채워져 있다. + String? get releaseDate; int? get msrpUsd; int? get ramGb; List get storageOptionsGb;/// 지역·구성별 변형 정보. 스키마가 고정되어 있지 않아 원본 그대로 둔다. + Map get variant; Display? get display; List get cameras; int? get batteryMah; int? get chargingWiredW; int? get chargingWirelessW; double? get weightG; Dimensions? get dimensions;/// 방수·방진 등급 (예: `IP68`). + String? get ipRating; String? get os; String? get osVersion; Connectivity? get connectivity; String? get imageUrl; List get images; SmartphoneScore? get score; bool get verified;/// CC-BY-SA 4.0 조건상 UI에 반드시 노출해야 한다. + List get sourceUrls; String? get createdAt; String? get updatedAt; +/// Create a copy of Smartphone +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SmartphoneCopyWith get copyWith => _$SmartphoneCopyWithImpl(this as Smartphone, _$identity); /// Serializes this Smartphone to a JSON map. Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is Smartphone && - (identical(other.slug, slug) || other.slug == slug) && - (identical(other.name, name) || other.name == name) && - (identical(other.id, id) || other.id == id) && - (identical(other.baseModelSlug, baseModelSlug) || - other.baseModelSlug == baseModelSlug) && - (identical(other.brand, brand) || other.brand == brand) && - (identical(other.soc, soc) || other.soc == soc) && - (identical(other.releaseDate, releaseDate) || - other.releaseDate == releaseDate) && - (identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd) && - (identical(other.ramGb, ramGb) || other.ramGb == ramGb) && - const DeepCollectionEquality() - .equals(other.storageOptionsGb, storageOptionsGb) && - const DeepCollectionEquality().equals(other.variant, variant) && - (identical(other.display, display) || other.display == display) && - const DeepCollectionEquality().equals(other.cameras, cameras) && - (identical(other.batteryMah, batteryMah) || - other.batteryMah == batteryMah) && - (identical(other.chargingWiredW, chargingWiredW) || - other.chargingWiredW == chargingWiredW) && - (identical(other.chargingWirelessW, chargingWirelessW) || - other.chargingWirelessW == chargingWirelessW) && - (identical(other.weightG, weightG) || other.weightG == weightG) && - (identical(other.dimensions, dimensions) || - other.dimensions == dimensions) && - (identical(other.ipRating, ipRating) || - other.ipRating == ipRating) && - (identical(other.os, os) || other.os == os) && - (identical(other.osVersion, osVersion) || - other.osVersion == osVersion) && - (identical(other.connectivity, connectivity) || - other.connectivity == connectivity) && - (identical(other.imageUrl, imageUrl) || - other.imageUrl == imageUrl) && - const DeepCollectionEquality().equals(other.images, images) && - (identical(other.score, score) || other.score == score) && - (identical(other.verified, verified) || - other.verified == verified) && - const DeepCollectionEquality() - .equals(other.sourceUrls, sourceUrls) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hashAll([ - runtimeType, - slug, - name, - id, - baseModelSlug, - brand, - soc, - releaseDate, - msrpUsd, - ramGb, - const DeepCollectionEquality().hash(storageOptionsGb), - const DeepCollectionEquality().hash(variant), - display, - const DeepCollectionEquality().hash(cameras), - batteryMah, - chargingWiredW, - chargingWirelessW, - weightG, - dimensions, - ipRating, - os, - osVersion, - connectivity, - imageUrl, - const DeepCollectionEquality().hash(images), - score, - verified, - const DeepCollectionEquality().hash(sourceUrls), - createdAt, - updatedAt - ]); - - @override - String toString() { - return 'Smartphone(slug: $slug, name: $name, id: $id, baseModelSlug: $baseModelSlug, brand: $brand, soc: $soc, releaseDate: $releaseDate, msrpUsd: $msrpUsd, ramGb: $ramGb, storageOptionsGb: $storageOptionsGb, variant: $variant, display: $display, cameras: $cameras, batteryMah: $batteryMah, chargingWiredW: $chargingWiredW, chargingWirelessW: $chargingWirelessW, weightG: $weightG, dimensions: $dimensions, ipRating: $ipRating, os: $os, osVersion: $osVersion, connectivity: $connectivity, imageUrl: $imageUrl, images: $images, score: $score, verified: $verified, sourceUrls: $sourceUrls, createdAt: $createdAt, updatedAt: $updatedAt)'; - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Smartphone&&(identical(other.slug, slug) || other.slug == slug)&&(identical(other.name, name) || other.name == name)&&(identical(other.id, id) || other.id == id)&&(identical(other.baseModelSlug, baseModelSlug) || other.baseModelSlug == baseModelSlug)&&(identical(other.brand, brand) || other.brand == brand)&&(identical(other.soc, soc) || other.soc == soc)&&(identical(other.releaseDate, releaseDate) || other.releaseDate == releaseDate)&&(identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd)&&(identical(other.ramGb, ramGb) || other.ramGb == ramGb)&&const DeepCollectionEquality().equals(other.storageOptionsGb, storageOptionsGb)&&const DeepCollectionEquality().equals(other.variant, variant)&&(identical(other.display, display) || other.display == display)&&const DeepCollectionEquality().equals(other.cameras, cameras)&&(identical(other.batteryMah, batteryMah) || other.batteryMah == batteryMah)&&(identical(other.chargingWiredW, chargingWiredW) || other.chargingWiredW == chargingWiredW)&&(identical(other.chargingWirelessW, chargingWirelessW) || other.chargingWirelessW == chargingWirelessW)&&(identical(other.weightG, weightG) || other.weightG == weightG)&&(identical(other.dimensions, dimensions) || other.dimensions == dimensions)&&(identical(other.ipRating, ipRating) || other.ipRating == ipRating)&&(identical(other.os, os) || other.os == os)&&(identical(other.osVersion, osVersion) || other.osVersion == osVersion)&&(identical(other.connectivity, connectivity) || other.connectivity == connectivity)&&(identical(other.imageUrl, imageUrl) || other.imageUrl == imageUrl)&&const DeepCollectionEquality().equals(other.images, images)&&(identical(other.score, score) || other.score == score)&&(identical(other.verified, verified) || other.verified == verified)&&const DeepCollectionEquality().equals(other.sourceUrls, sourceUrls)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); } -/// @nodoc -abstract mixin class $SmartphoneCopyWith<$Res> { - factory $SmartphoneCopyWith( - Smartphone value, $Res Function(Smartphone) _then) = - _$SmartphoneCopyWithImpl; - @useResult - $Res call( - {String slug, - String name, - int? id, - String? baseModelSlug, - Brand? brand, - Soc? soc, - String? releaseDate, - int? msrpUsd, - int? ramGb, - List storageOptionsGb, - Map variant, - Display? display, - List cameras, - int? batteryMah, - int? chargingWiredW, - int? chargingWirelessW, - double? weightG, - Dimensions? dimensions, - String? ipRating, - String? os, - String? osVersion, - Connectivity? connectivity, - String? imageUrl, - List images, - SmartphoneScore? score, - bool verified, - List sourceUrls, - String? createdAt, - String? updatedAt}); - - $BrandCopyWith<$Res>? get brand; - $SocCopyWith<$Res>? get soc; - $DisplayCopyWith<$Res>? get display; - $DimensionsCopyWith<$Res>? get dimensions; - $ConnectivityCopyWith<$Res>? get connectivity; - $SmartphoneScoreCopyWith<$Res>? get score; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,slug,name,id,baseModelSlug,brand,soc,releaseDate,msrpUsd,ramGb,const DeepCollectionEquality().hash(storageOptionsGb),const DeepCollectionEquality().hash(variant),display,const DeepCollectionEquality().hash(cameras),batteryMah,chargingWiredW,chargingWirelessW,weightG,dimensions,ipRating,os,osVersion,connectivity,imageUrl,const DeepCollectionEquality().hash(images),score,verified,const DeepCollectionEquality().hash(sourceUrls),createdAt,updatedAt]); + +@override +String toString() { + return 'Smartphone(slug: $slug, name: $name, id: $id, baseModelSlug: $baseModelSlug, brand: $brand, soc: $soc, releaseDate: $releaseDate, msrpUsd: $msrpUsd, ramGb: $ramGb, storageOptionsGb: $storageOptionsGb, variant: $variant, display: $display, cameras: $cameras, batteryMah: $batteryMah, chargingWiredW: $chargingWiredW, chargingWirelessW: $chargingWirelessW, weightG: $weightG, dimensions: $dimensions, ipRating: $ipRating, os: $os, osVersion: $osVersion, connectivity: $connectivity, imageUrl: $imageUrl, images: $images, score: $score, verified: $verified, sourceUrls: $sourceUrls, createdAt: $createdAt, updatedAt: $updatedAt)'; } + +} + +/// @nodoc +abstract mixin class $SmartphoneCopyWith<$Res> { + factory $SmartphoneCopyWith(Smartphone value, $Res Function(Smartphone) _then) = _$SmartphoneCopyWithImpl; +@useResult +$Res call({ + String slug, String name, int? id, String? baseModelSlug, Brand? brand, Soc? soc, String? releaseDate, int? msrpUsd, int? ramGb, List storageOptionsGb, Map variant, Display? display, List cameras, int? batteryMah, int? chargingWiredW, int? chargingWirelessW, double? weightG, Dimensions? dimensions, String? ipRating, String? os, String? osVersion, Connectivity? connectivity, String? imageUrl, List images, SmartphoneScore? score, bool verified, List sourceUrls, String? createdAt, String? updatedAt +}); + + +$BrandCopyWith<$Res>? get brand;$SocCopyWith<$Res>? get soc;$DisplayCopyWith<$Res>? get display;$DimensionsCopyWith<$Res>? get dimensions;$ConnectivityCopyWith<$Res>? get connectivity;$SmartphoneScoreCopyWith<$Res>? get score; + +} /// @nodoc -class _$SmartphoneCopyWithImpl<$Res> implements $SmartphoneCopyWith<$Res> { +class _$SmartphoneCopyWithImpl<$Res> + implements $SmartphoneCopyWith<$Res> { _$SmartphoneCopyWithImpl(this._self, this._then); final Smartphone _self; final $Res Function(Smartphone) _then; - /// Create a copy of Smartphone - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? slug = null, - Object? name = null, - Object? id = freezed, - Object? baseModelSlug = freezed, - Object? brand = freezed, - Object? soc = freezed, - Object? releaseDate = freezed, - Object? msrpUsd = freezed, - Object? ramGb = freezed, - Object? storageOptionsGb = null, - Object? variant = null, - Object? display = freezed, - Object? cameras = null, - Object? batteryMah = freezed, - Object? chargingWiredW = freezed, - Object? chargingWirelessW = freezed, - Object? weightG = freezed, - Object? dimensions = freezed, - Object? ipRating = freezed, - Object? os = freezed, - Object? osVersion = freezed, - Object? connectivity = freezed, - Object? imageUrl = freezed, - Object? images = null, - Object? score = freezed, - Object? verified = null, - Object? sourceUrls = null, - Object? createdAt = freezed, - Object? updatedAt = freezed, - }) { - return _then(_self.copyWith( - slug: null == slug - ? _self.slug - : slug // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _self.name - : name // ignore: cast_nullable_to_non_nullable - as String, - id: freezed == id - ? _self.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - baseModelSlug: freezed == baseModelSlug - ? _self.baseModelSlug - : baseModelSlug // ignore: cast_nullable_to_non_nullable - as String?, - brand: freezed == brand - ? _self.brand - : brand // ignore: cast_nullable_to_non_nullable - as Brand?, - soc: freezed == soc - ? _self.soc - : soc // ignore: cast_nullable_to_non_nullable - as Soc?, - releaseDate: freezed == releaseDate - ? _self.releaseDate - : releaseDate // ignore: cast_nullable_to_non_nullable - as String?, - msrpUsd: freezed == msrpUsd - ? _self.msrpUsd - : msrpUsd // ignore: cast_nullable_to_non_nullable - as int?, - ramGb: freezed == ramGb - ? _self.ramGb - : ramGb // ignore: cast_nullable_to_non_nullable - as int?, - storageOptionsGb: null == storageOptionsGb - ? _self.storageOptionsGb - : storageOptionsGb // ignore: cast_nullable_to_non_nullable - as List, - variant: null == variant - ? _self.variant - : variant // ignore: cast_nullable_to_non_nullable - as Map, - display: freezed == display - ? _self.display - : display // ignore: cast_nullable_to_non_nullable - as Display?, - cameras: null == cameras - ? _self.cameras - : cameras // ignore: cast_nullable_to_non_nullable - as List, - batteryMah: freezed == batteryMah - ? _self.batteryMah - : batteryMah // ignore: cast_nullable_to_non_nullable - as int?, - chargingWiredW: freezed == chargingWiredW - ? _self.chargingWiredW - : chargingWiredW // ignore: cast_nullable_to_non_nullable - as int?, - chargingWirelessW: freezed == chargingWirelessW - ? _self.chargingWirelessW - : chargingWirelessW // ignore: cast_nullable_to_non_nullable - as int?, - weightG: freezed == weightG - ? _self.weightG - : weightG // ignore: cast_nullable_to_non_nullable - as double?, - dimensions: freezed == dimensions - ? _self.dimensions - : dimensions // ignore: cast_nullable_to_non_nullable - as Dimensions?, - ipRating: freezed == ipRating - ? _self.ipRating - : ipRating // ignore: cast_nullable_to_non_nullable - as String?, - os: freezed == os - ? _self.os - : os // ignore: cast_nullable_to_non_nullable - as String?, - osVersion: freezed == osVersion - ? _self.osVersion - : osVersion // ignore: cast_nullable_to_non_nullable - as String?, - connectivity: freezed == connectivity - ? _self.connectivity - : connectivity // ignore: cast_nullable_to_non_nullable - as Connectivity?, - imageUrl: freezed == imageUrl - ? _self.imageUrl - : imageUrl // ignore: cast_nullable_to_non_nullable - as String?, - images: null == images - ? _self.images - : images // ignore: cast_nullable_to_non_nullable - as List, - score: freezed == score - ? _self.score - : score // ignore: cast_nullable_to_non_nullable - as SmartphoneScore?, - verified: null == verified - ? _self.verified - : verified // ignore: cast_nullable_to_non_nullable - as bool, - sourceUrls: null == sourceUrls - ? _self.sourceUrls - : sourceUrls // ignore: cast_nullable_to_non_nullable - as List, - createdAt: freezed == createdAt - ? _self.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as String?, - updatedAt: freezed == updatedAt - ? _self.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as String?, - )); - } - - /// Create a copy of Smartphone - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BrandCopyWith<$Res>? get brand { +/// Create a copy of Smartphone +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? slug = null,Object? name = null,Object? id = freezed,Object? baseModelSlug = freezed,Object? brand = freezed,Object? soc = freezed,Object? releaseDate = freezed,Object? msrpUsd = freezed,Object? ramGb = freezed,Object? storageOptionsGb = null,Object? variant = null,Object? display = freezed,Object? cameras = null,Object? batteryMah = freezed,Object? chargingWiredW = freezed,Object? chargingWirelessW = freezed,Object? weightG = freezed,Object? dimensions = freezed,Object? ipRating = freezed,Object? os = freezed,Object? osVersion = freezed,Object? connectivity = freezed,Object? imageUrl = freezed,Object? images = null,Object? score = freezed,Object? verified = null,Object? sourceUrls = null,Object? createdAt = freezed,Object? updatedAt = freezed,}) { + return _then(_self.copyWith( +slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable +as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,baseModelSlug: freezed == baseModelSlug ? _self.baseModelSlug : baseModelSlug // ignore: cast_nullable_to_non_nullable +as String?,brand: freezed == brand ? _self.brand : brand // ignore: cast_nullable_to_non_nullable +as Brand?,soc: freezed == soc ? _self.soc : soc // ignore: cast_nullable_to_non_nullable +as Soc?,releaseDate: freezed == releaseDate ? _self.releaseDate : releaseDate // ignore: cast_nullable_to_non_nullable +as String?,msrpUsd: freezed == msrpUsd ? _self.msrpUsd : msrpUsd // ignore: cast_nullable_to_non_nullable +as int?,ramGb: freezed == ramGb ? _self.ramGb : ramGb // ignore: cast_nullable_to_non_nullable +as int?,storageOptionsGb: null == storageOptionsGb ? _self.storageOptionsGb : storageOptionsGb // ignore: cast_nullable_to_non_nullable +as List,variant: null == variant ? _self.variant : variant // ignore: cast_nullable_to_non_nullable +as Map,display: freezed == display ? _self.display : display // ignore: cast_nullable_to_non_nullable +as Display?,cameras: null == cameras ? _self.cameras : cameras // ignore: cast_nullable_to_non_nullable +as List,batteryMah: freezed == batteryMah ? _self.batteryMah : batteryMah // ignore: cast_nullable_to_non_nullable +as int?,chargingWiredW: freezed == chargingWiredW ? _self.chargingWiredW : chargingWiredW // ignore: cast_nullable_to_non_nullable +as int?,chargingWirelessW: freezed == chargingWirelessW ? _self.chargingWirelessW : chargingWirelessW // ignore: cast_nullable_to_non_nullable +as int?,weightG: freezed == weightG ? _self.weightG : weightG // ignore: cast_nullable_to_non_nullable +as double?,dimensions: freezed == dimensions ? _self.dimensions : dimensions // ignore: cast_nullable_to_non_nullable +as Dimensions?,ipRating: freezed == ipRating ? _self.ipRating : ipRating // ignore: cast_nullable_to_non_nullable +as String?,os: freezed == os ? _self.os : os // ignore: cast_nullable_to_non_nullable +as String?,osVersion: freezed == osVersion ? _self.osVersion : osVersion // ignore: cast_nullable_to_non_nullable +as String?,connectivity: freezed == connectivity ? _self.connectivity : connectivity // ignore: cast_nullable_to_non_nullable +as Connectivity?,imageUrl: freezed == imageUrl ? _self.imageUrl : imageUrl // ignore: cast_nullable_to_non_nullable +as String?,images: null == images ? _self.images : images // ignore: cast_nullable_to_non_nullable +as List,score: freezed == score ? _self.score : score // ignore: cast_nullable_to_non_nullable +as SmartphoneScore?,verified: null == verified ? _self.verified : verified // ignore: cast_nullable_to_non_nullable +as bool,sourceUrls: null == sourceUrls ? _self.sourceUrls : sourceUrls // ignore: cast_nullable_to_non_nullable +as List,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as String?,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of Smartphone +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BrandCopyWith<$Res>? get brand { if (_self.brand == null) { - return null; - } - - return $BrandCopyWith<$Res>(_self.brand!, (value) { - return _then(_self.copyWith(brand: value)); - }); + return null; } - /// Create a copy of Smartphone - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $SocCopyWith<$Res>? get soc { + return $BrandCopyWith<$Res>(_self.brand!, (value) { + return _then(_self.copyWith(brand: value)); + }); +}/// Create a copy of Smartphone +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SocCopyWith<$Res>? get soc { if (_self.soc == null) { - return null; - } - - return $SocCopyWith<$Res>(_self.soc!, (value) { - return _then(_self.copyWith(soc: value)); - }); + return null; } - /// Create a copy of Smartphone - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $DisplayCopyWith<$Res>? get display { + return $SocCopyWith<$Res>(_self.soc!, (value) { + return _then(_self.copyWith(soc: value)); + }); +}/// Create a copy of Smartphone +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DisplayCopyWith<$Res>? get display { if (_self.display == null) { - return null; - } - - return $DisplayCopyWith<$Res>(_self.display!, (value) { - return _then(_self.copyWith(display: value)); - }); + return null; } - /// Create a copy of Smartphone - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $DimensionsCopyWith<$Res>? get dimensions { + return $DisplayCopyWith<$Res>(_self.display!, (value) { + return _then(_self.copyWith(display: value)); + }); +}/// Create a copy of Smartphone +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DimensionsCopyWith<$Res>? get dimensions { if (_self.dimensions == null) { - return null; - } - - return $DimensionsCopyWith<$Res>(_self.dimensions!, (value) { - return _then(_self.copyWith(dimensions: value)); - }); + return null; } - /// Create a copy of Smartphone - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ConnectivityCopyWith<$Res>? get connectivity { + return $DimensionsCopyWith<$Res>(_self.dimensions!, (value) { + return _then(_self.copyWith(dimensions: value)); + }); +}/// Create a copy of Smartphone +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ConnectivityCopyWith<$Res>? get connectivity { if (_self.connectivity == null) { - return null; - } - - return $ConnectivityCopyWith<$Res>(_self.connectivity!, (value) { - return _then(_self.copyWith(connectivity: value)); - }); + return null; } - /// Create a copy of Smartphone - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $SmartphoneScoreCopyWith<$Res>? get score { + return $ConnectivityCopyWith<$Res>(_self.connectivity!, (value) { + return _then(_self.copyWith(connectivity: value)); + }); +}/// Create a copy of Smartphone +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SmartphoneScoreCopyWith<$Res>? get score { if (_self.score == null) { - return null; - } - - return $SmartphoneScoreCopyWith<$Res>(_self.score!, (value) { - return _then(_self.copyWith(score: value)); - }); + return null; } + + return $SmartphoneScoreCopyWith<$Res>(_self.score!, (value) { + return _then(_self.copyWith(score: value)); + }); } +} + /// Adds pattern-matching-related methods to [Smartphone]. extension SmartphonePatterns on Smartphone { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_Smartphone value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Smartphone() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Smartphone value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Smartphone() when $default != null: +return $default(_that);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_Smartphone value) $default, - ) { - final _that = this; - switch (_that) { - case _Smartphone(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Smartphone value) $default,){ +final _that = this; +switch (_that) { +case _Smartphone(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_Smartphone value)? $default, - ) { - final _that = this; - switch (_that) { - case _Smartphone() when $default != null: - return $default(_that); - case _: - return null; - } - } +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Smartphone value)? $default,){ +final _that = this; +switch (_that) { +case _Smartphone() when $default != null: +return $default(_that);case _: + return null; - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function( - String slug, - String name, - int? id, - String? baseModelSlug, - Brand? brand, - Soc? soc, - String? releaseDate, - int? msrpUsd, - int? ramGb, - List storageOptionsGb, - Map variant, - Display? display, - List cameras, - int? batteryMah, - int? chargingWiredW, - int? chargingWirelessW, - double? weightG, - Dimensions? dimensions, - String? ipRating, - String? os, - String? osVersion, - Connectivity? connectivity, - String? imageUrl, - List images, - SmartphoneScore? score, - bool verified, - List sourceUrls, - String? createdAt, - String? updatedAt)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Smartphone() when $default != null: - return $default( - _that.slug, - _that.name, - _that.id, - _that.baseModelSlug, - _that.brand, - _that.soc, - _that.releaseDate, - _that.msrpUsd, - _that.ramGb, - _that.storageOptionsGb, - _that.variant, - _that.display, - _that.cameras, - _that.batteryMah, - _that.chargingWiredW, - _that.chargingWirelessW, - _that.weightG, - _that.dimensions, - _that.ipRating, - _that.os, - _that.osVersion, - _that.connectivity, - _that.imageUrl, - _that.images, - _that.score, - _that.verified, - _that.sourceUrls, - _that.createdAt, - _that.updatedAt); - case _: - return orElse(); - } - } +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String slug, String name, int? id, String? baseModelSlug, Brand? brand, Soc? soc, String? releaseDate, int? msrpUsd, int? ramGb, List storageOptionsGb, Map variant, Display? display, List cameras, int? batteryMah, int? chargingWiredW, int? chargingWirelessW, double? weightG, Dimensions? dimensions, String? ipRating, String? os, String? osVersion, Connectivity? connectivity, String? imageUrl, List images, SmartphoneScore? score, bool verified, List sourceUrls, String? createdAt, String? updatedAt)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Smartphone() when $default != null: +return $default(_that.slug,_that.name,_that.id,_that.baseModelSlug,_that.brand,_that.soc,_that.releaseDate,_that.msrpUsd,_that.ramGb,_that.storageOptionsGb,_that.variant,_that.display,_that.cameras,_that.batteryMah,_that.chargingWiredW,_that.chargingWirelessW,_that.weightG,_that.dimensions,_that.ipRating,_that.os,_that.osVersion,_that.connectivity,_that.imageUrl,_that.images,_that.score,_that.verified,_that.sourceUrls,_that.createdAt,_that.updatedAt);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function( - String slug, - String name, - int? id, - String? baseModelSlug, - Brand? brand, - Soc? soc, - String? releaseDate, - int? msrpUsd, - int? ramGb, - List storageOptionsGb, - Map variant, - Display? display, - List cameras, - int? batteryMah, - int? chargingWiredW, - int? chargingWirelessW, - double? weightG, - Dimensions? dimensions, - String? ipRating, - String? os, - String? osVersion, - Connectivity? connectivity, - String? imageUrl, - List images, - SmartphoneScore? score, - bool verified, - List sourceUrls, - String? createdAt, - String? updatedAt) - $default, - ) { - final _that = this; - switch (_that) { - case _Smartphone(): - return $default( - _that.slug, - _that.name, - _that.id, - _that.baseModelSlug, - _that.brand, - _that.soc, - _that.releaseDate, - _that.msrpUsd, - _that.ramGb, - _that.storageOptionsGb, - _that.variant, - _that.display, - _that.cameras, - _that.batteryMah, - _that.chargingWiredW, - _that.chargingWirelessW, - _that.weightG, - _that.dimensions, - _that.ipRating, - _that.os, - _that.osVersion, - _that.connectivity, - _that.imageUrl, - _that.images, - _that.score, - _that.verified, - _that.sourceUrls, - _that.createdAt, - _that.updatedAt); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String slug, String name, int? id, String? baseModelSlug, Brand? brand, Soc? soc, String? releaseDate, int? msrpUsd, int? ramGb, List storageOptionsGb, Map variant, Display? display, List cameras, int? batteryMah, int? chargingWiredW, int? chargingWirelessW, double? weightG, Dimensions? dimensions, String? ipRating, String? os, String? osVersion, Connectivity? connectivity, String? imageUrl, List images, SmartphoneScore? score, bool verified, List sourceUrls, String? createdAt, String? updatedAt) $default,) {final _that = this; +switch (_that) { +case _Smartphone(): +return $default(_that.slug,_that.name,_that.id,_that.baseModelSlug,_that.brand,_that.soc,_that.releaseDate,_that.msrpUsd,_that.ramGb,_that.storageOptionsGb,_that.variant,_that.display,_that.cameras,_that.batteryMah,_that.chargingWiredW,_that.chargingWirelessW,_that.weightG,_that.dimensions,_that.ipRating,_that.os,_that.osVersion,_that.connectivity,_that.imageUrl,_that.images,_that.score,_that.verified,_that.sourceUrls,_that.createdAt,_that.updatedAt);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String slug, String name, int? id, String? baseModelSlug, Brand? brand, Soc? soc, String? releaseDate, int? msrpUsd, int? ramGb, List storageOptionsGb, Map variant, Display? display, List cameras, int? batteryMah, int? chargingWiredW, int? chargingWirelessW, double? weightG, Dimensions? dimensions, String? ipRating, String? os, String? osVersion, Connectivity? connectivity, String? imageUrl, List images, SmartphoneScore? score, bool verified, List sourceUrls, String? createdAt, String? updatedAt)? $default,) {final _that = this; +switch (_that) { +case _Smartphone() when $default != null: +return $default(_that.slug,_that.name,_that.id,_that.baseModelSlug,_that.brand,_that.soc,_that.releaseDate,_that.msrpUsd,_that.ramGb,_that.storageOptionsGb,_that.variant,_that.display,_that.cameras,_that.batteryMah,_that.chargingWiredW,_that.chargingWirelessW,_that.weightG,_that.dimensions,_that.ipRating,_that.os,_that.osVersion,_that.connectivity,_that.imageUrl,_that.images,_that.score,_that.verified,_that.sourceUrls,_that.createdAt,_that.updatedAt);case _: + return null; + +} +} - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function( - String slug, - String name, - int? id, - String? baseModelSlug, - Brand? brand, - Soc? soc, - String? releaseDate, - int? msrpUsd, - int? ramGb, - List storageOptionsGb, - Map variant, - Display? display, - List cameras, - int? batteryMah, - int? chargingWiredW, - int? chargingWirelessW, - double? weightG, - Dimensions? dimensions, - String? ipRating, - String? os, - String? osVersion, - Connectivity? connectivity, - String? imageUrl, - List images, - SmartphoneScore? score, - bool verified, - List sourceUrls, - String? createdAt, - String? updatedAt)? - $default, - ) { - final _that = this; - switch (_that) { - case _Smartphone() when $default != null: - return $default( - _that.slug, - _that.name, - _that.id, - _that.baseModelSlug, - _that.brand, - _that.soc, - _that.releaseDate, - _that.msrpUsd, - _that.ramGb, - _that.storageOptionsGb, - _that.variant, - _that.display, - _that.cameras, - _that.batteryMah, - _that.chargingWiredW, - _that.chargingWirelessW, - _that.weightG, - _that.dimensions, - _that.ipRating, - _that.os, - _that.osVersion, - _that.connectivity, - _that.imageUrl, - _that.images, - _that.score, - _that.verified, - _that.sourceUrls, - _that.createdAt, - _that.updatedAt); - case _: - return null; - } - } } /// @nodoc @JsonSerializable() + class _Smartphone implements Smartphone { - const _Smartphone( - {required this.slug, - required this.name, - this.id, - this.baseModelSlug, - this.brand, - this.soc, - this.releaseDate, - this.msrpUsd, - this.ramGb, - final List storageOptionsGb = const [], - final Map variant = const {}, - this.display, - final List cameras = const [], - this.batteryMah, - this.chargingWiredW, - this.chargingWirelessW, - this.weightG, - this.dimensions, - this.ipRating, - this.os, - this.osVersion, - this.connectivity, - this.imageUrl, - final List images = const [], - this.score, - this.verified = false, - final List sourceUrls = const [], - this.createdAt, - this.updatedAt}) - : _storageOptionsGb = storageOptionsGb, - _variant = variant, - _cameras = cameras, - _images = images, - _sourceUrls = sourceUrls; - factory _Smartphone.fromJson(Map json) => - _$SmartphoneFromJson(json); - - @override - final String slug; - @override - final String name; - @override - final int? id; - - /// 파생 모델일 때 원본 모델의 slug (예: Plus/Ultra 변형). - @override - final String? baseModelSlug; - @override - final Brand? brand; - @override - final Soc? soc; - - /// `YYYY-MM-DD`. 일자가 불확실하면 월초로 채워져 있다. - @override - final String? releaseDate; - @override - final int? msrpUsd; - @override - final int? ramGb; - final List _storageOptionsGb; - @override - @JsonKey() - List get storageOptionsGb { - if (_storageOptionsGb is EqualUnmodifiableListView) - return _storageOptionsGb; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_storageOptionsGb); - } + const _Smartphone({required this.slug, required this.name, this.id, this.baseModelSlug, this.brand, this.soc, this.releaseDate, this.msrpUsd, this.ramGb, final List storageOptionsGb = const [], final Map variant = const {}, this.display, final List cameras = const [], this.batteryMah, this.chargingWiredW, this.chargingWirelessW, this.weightG, this.dimensions, this.ipRating, this.os, this.osVersion, this.connectivity, this.imageUrl, final List images = const [], this.score, this.verified = false, final List sourceUrls = const [], this.createdAt, this.updatedAt}): _storageOptionsGb = storageOptionsGb,_variant = variant,_cameras = cameras,_images = images,_sourceUrls = sourceUrls; + factory _Smartphone.fromJson(Map json) => _$SmartphoneFromJson(json); + +@override final String slug; +@override final String name; +@override final int? id; +/// 파생 모델일 때 원본 모델의 slug (예: Plus/Ultra 변형). +@override final String? baseModelSlug; +@override final Brand? brand; +@override final Soc? soc; +/// `YYYY-MM-DD`. 일자가 불확실하면 월초로 채워져 있다. +@override final String? releaseDate; +@override final int? msrpUsd; +@override final int? ramGb; + final List _storageOptionsGb; +@override@JsonKey() List get storageOptionsGb { + if (_storageOptionsGb is EqualUnmodifiableListView) return _storageOptionsGb; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_storageOptionsGb); +} - /// 지역·구성별 변형 정보. 스키마가 고정되어 있지 않아 원본 그대로 둔다. - final Map _variant; +/// 지역·구성별 변형 정보. 스키마가 고정되어 있지 않아 원본 그대로 둔다. + final Map _variant; +/// 지역·구성별 변형 정보. 스키마가 고정되어 있지 않아 원본 그대로 둔다. +@override@JsonKey() Map get variant { + if (_variant is EqualUnmodifiableMapView) return _variant; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_variant); +} - /// 지역·구성별 변형 정보. 스키마가 고정되어 있지 않아 원본 그대로 둔다. - @override - @JsonKey() - Map get variant { - if (_variant is EqualUnmodifiableMapView) return _variant; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(_variant); - } +@override final Display? display; + final List _cameras; +@override@JsonKey() List get cameras { + if (_cameras is EqualUnmodifiableListView) return _cameras; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_cameras); +} - @override - final Display? display; - final List _cameras; - @override - @JsonKey() - List get cameras { - if (_cameras is EqualUnmodifiableListView) return _cameras; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_cameras); - } +@override final int? batteryMah; +@override final int? chargingWiredW; +@override final int? chargingWirelessW; +@override final double? weightG; +@override final Dimensions? dimensions; +/// 방수·방진 등급 (예: `IP68`). +@override final String? ipRating; +@override final String? os; +@override final String? osVersion; +@override final Connectivity? connectivity; +@override final String? imageUrl; + final List _images; +@override@JsonKey() List get images { + if (_images is EqualUnmodifiableListView) return _images; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_images); +} - @override - final int? batteryMah; - @override - final int? chargingWiredW; - @override - final int? chargingWirelessW; - @override - final double? weightG; - @override - final Dimensions? dimensions; - - /// 방수·방진 등급 (예: `IP68`). - @override - final String? ipRating; - @override - final String? os; - @override - final String? osVersion; - @override - final Connectivity? connectivity; - @override - final String? imageUrl; - final List _images; - @override - @JsonKey() - List get images { - if (_images is EqualUnmodifiableListView) return _images; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_images); - } +@override final SmartphoneScore? score; +@override@JsonKey() final bool verified; +/// CC-BY-SA 4.0 조건상 UI에 반드시 노출해야 한다. + final List _sourceUrls; +/// CC-BY-SA 4.0 조건상 UI에 반드시 노출해야 한다. +@override@JsonKey() List get sourceUrls { + if (_sourceUrls is EqualUnmodifiableListView) return _sourceUrls; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_sourceUrls); +} - @override - final SmartphoneScore? score; - @override - @JsonKey() - final bool verified; - - /// CC-BY-SA 4.0 조건상 UI에 반드시 노출해야 한다. - final List _sourceUrls; - - /// CC-BY-SA 4.0 조건상 UI에 반드시 노출해야 한다. - @override - @JsonKey() - List get sourceUrls { - if (_sourceUrls is EqualUnmodifiableListView) return _sourceUrls; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_sourceUrls); - } +@override final String? createdAt; +@override final String? updatedAt; - @override - final String? createdAt; - @override - final String? updatedAt; - - /// Create a copy of Smartphone - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$SmartphoneCopyWith<_Smartphone> get copyWith => - __$SmartphoneCopyWithImpl<_Smartphone>(this, _$identity); - - @override - Map toJson() { - return _$SmartphoneToJson( - this, - ); - } +/// Create a copy of Smartphone +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SmartphoneCopyWith<_Smartphone> get copyWith => __$SmartphoneCopyWithImpl<_Smartphone>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _Smartphone && - (identical(other.slug, slug) || other.slug == slug) && - (identical(other.name, name) || other.name == name) && - (identical(other.id, id) || other.id == id) && - (identical(other.baseModelSlug, baseModelSlug) || - other.baseModelSlug == baseModelSlug) && - (identical(other.brand, brand) || other.brand == brand) && - (identical(other.soc, soc) || other.soc == soc) && - (identical(other.releaseDate, releaseDate) || - other.releaseDate == releaseDate) && - (identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd) && - (identical(other.ramGb, ramGb) || other.ramGb == ramGb) && - const DeepCollectionEquality() - .equals(other._storageOptionsGb, _storageOptionsGb) && - const DeepCollectionEquality().equals(other._variant, _variant) && - (identical(other.display, display) || other.display == display) && - const DeepCollectionEquality().equals(other._cameras, _cameras) && - (identical(other.batteryMah, batteryMah) || - other.batteryMah == batteryMah) && - (identical(other.chargingWiredW, chargingWiredW) || - other.chargingWiredW == chargingWiredW) && - (identical(other.chargingWirelessW, chargingWirelessW) || - other.chargingWirelessW == chargingWirelessW) && - (identical(other.weightG, weightG) || other.weightG == weightG) && - (identical(other.dimensions, dimensions) || - other.dimensions == dimensions) && - (identical(other.ipRating, ipRating) || - other.ipRating == ipRating) && - (identical(other.os, os) || other.os == os) && - (identical(other.osVersion, osVersion) || - other.osVersion == osVersion) && - (identical(other.connectivity, connectivity) || - other.connectivity == connectivity) && - (identical(other.imageUrl, imageUrl) || - other.imageUrl == imageUrl) && - const DeepCollectionEquality().equals(other._images, _images) && - (identical(other.score, score) || other.score == score) && - (identical(other.verified, verified) || - other.verified == verified) && - const DeepCollectionEquality() - .equals(other._sourceUrls, _sourceUrls) && - (identical(other.createdAt, createdAt) || - other.createdAt == createdAt) && - (identical(other.updatedAt, updatedAt) || - other.updatedAt == updatedAt)); - } +@override +Map toJson() { + return _$SmartphoneToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hashAll([ - runtimeType, - slug, - name, - id, - baseModelSlug, - brand, - soc, - releaseDate, - msrpUsd, - ramGb, - const DeepCollectionEquality().hash(_storageOptionsGb), - const DeepCollectionEquality().hash(_variant), - display, - const DeepCollectionEquality().hash(_cameras), - batteryMah, - chargingWiredW, - chargingWirelessW, - weightG, - dimensions, - ipRating, - os, - osVersion, - connectivity, - imageUrl, - const DeepCollectionEquality().hash(_images), - score, - verified, - const DeepCollectionEquality().hash(_sourceUrls), - createdAt, - updatedAt - ]); - - @override - String toString() { - return 'Smartphone(slug: $slug, name: $name, id: $id, baseModelSlug: $baseModelSlug, brand: $brand, soc: $soc, releaseDate: $releaseDate, msrpUsd: $msrpUsd, ramGb: $ramGb, storageOptionsGb: $storageOptionsGb, variant: $variant, display: $display, cameras: $cameras, batteryMah: $batteryMah, chargingWiredW: $chargingWiredW, chargingWirelessW: $chargingWirelessW, weightG: $weightG, dimensions: $dimensions, ipRating: $ipRating, os: $os, osVersion: $osVersion, connectivity: $connectivity, imageUrl: $imageUrl, images: $images, score: $score, verified: $verified, sourceUrls: $sourceUrls, createdAt: $createdAt, updatedAt: $updatedAt)'; - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Smartphone&&(identical(other.slug, slug) || other.slug == slug)&&(identical(other.name, name) || other.name == name)&&(identical(other.id, id) || other.id == id)&&(identical(other.baseModelSlug, baseModelSlug) || other.baseModelSlug == baseModelSlug)&&(identical(other.brand, brand) || other.brand == brand)&&(identical(other.soc, soc) || other.soc == soc)&&(identical(other.releaseDate, releaseDate) || other.releaseDate == releaseDate)&&(identical(other.msrpUsd, msrpUsd) || other.msrpUsd == msrpUsd)&&(identical(other.ramGb, ramGb) || other.ramGb == ramGb)&&const DeepCollectionEquality().equals(other._storageOptionsGb, _storageOptionsGb)&&const DeepCollectionEquality().equals(other._variant, _variant)&&(identical(other.display, display) || other.display == display)&&const DeepCollectionEquality().equals(other._cameras, _cameras)&&(identical(other.batteryMah, batteryMah) || other.batteryMah == batteryMah)&&(identical(other.chargingWiredW, chargingWiredW) || other.chargingWiredW == chargingWiredW)&&(identical(other.chargingWirelessW, chargingWirelessW) || other.chargingWirelessW == chargingWirelessW)&&(identical(other.weightG, weightG) || other.weightG == weightG)&&(identical(other.dimensions, dimensions) || other.dimensions == dimensions)&&(identical(other.ipRating, ipRating) || other.ipRating == ipRating)&&(identical(other.os, os) || other.os == os)&&(identical(other.osVersion, osVersion) || other.osVersion == osVersion)&&(identical(other.connectivity, connectivity) || other.connectivity == connectivity)&&(identical(other.imageUrl, imageUrl) || other.imageUrl == imageUrl)&&const DeepCollectionEquality().equals(other._images, _images)&&(identical(other.score, score) || other.score == score)&&(identical(other.verified, verified) || other.verified == verified)&&const DeepCollectionEquality().equals(other._sourceUrls, _sourceUrls)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)); } -/// @nodoc -abstract mixin class _$SmartphoneCopyWith<$Res> - implements $SmartphoneCopyWith<$Res> { - factory _$SmartphoneCopyWith( - _Smartphone value, $Res Function(_Smartphone) _then) = - __$SmartphoneCopyWithImpl; - @override - @useResult - $Res call( - {String slug, - String name, - int? id, - String? baseModelSlug, - Brand? brand, - Soc? soc, - String? releaseDate, - int? msrpUsd, - int? ramGb, - List storageOptionsGb, - Map variant, - Display? display, - List cameras, - int? batteryMah, - int? chargingWiredW, - int? chargingWirelessW, - double? weightG, - Dimensions? dimensions, - String? ipRating, - String? os, - String? osVersion, - Connectivity? connectivity, - String? imageUrl, - List images, - SmartphoneScore? score, - bool verified, - List sourceUrls, - String? createdAt, - String? updatedAt}); - - @override - $BrandCopyWith<$Res>? get brand; - @override - $SocCopyWith<$Res>? get soc; - @override - $DisplayCopyWith<$Res>? get display; - @override - $DimensionsCopyWith<$Res>? get dimensions; - @override - $ConnectivityCopyWith<$Res>? get connectivity; - @override - $SmartphoneScoreCopyWith<$Res>? get score; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,slug,name,id,baseModelSlug,brand,soc,releaseDate,msrpUsd,ramGb,const DeepCollectionEquality().hash(_storageOptionsGb),const DeepCollectionEquality().hash(_variant),display,const DeepCollectionEquality().hash(_cameras),batteryMah,chargingWiredW,chargingWirelessW,weightG,dimensions,ipRating,os,osVersion,connectivity,imageUrl,const DeepCollectionEquality().hash(_images),score,verified,const DeepCollectionEquality().hash(_sourceUrls),createdAt,updatedAt]); + +@override +String toString() { + return 'Smartphone(slug: $slug, name: $name, id: $id, baseModelSlug: $baseModelSlug, brand: $brand, soc: $soc, releaseDate: $releaseDate, msrpUsd: $msrpUsd, ramGb: $ramGb, storageOptionsGb: $storageOptionsGb, variant: $variant, display: $display, cameras: $cameras, batteryMah: $batteryMah, chargingWiredW: $chargingWiredW, chargingWirelessW: $chargingWirelessW, weightG: $weightG, dimensions: $dimensions, ipRating: $ipRating, os: $os, osVersion: $osVersion, connectivity: $connectivity, imageUrl: $imageUrl, images: $images, score: $score, verified: $verified, sourceUrls: $sourceUrls, createdAt: $createdAt, updatedAt: $updatedAt)'; } + +} + +/// @nodoc +abstract mixin class _$SmartphoneCopyWith<$Res> implements $SmartphoneCopyWith<$Res> { + factory _$SmartphoneCopyWith(_Smartphone value, $Res Function(_Smartphone) _then) = __$SmartphoneCopyWithImpl; +@override @useResult +$Res call({ + String slug, String name, int? id, String? baseModelSlug, Brand? brand, Soc? soc, String? releaseDate, int? msrpUsd, int? ramGb, List storageOptionsGb, Map variant, Display? display, List cameras, int? batteryMah, int? chargingWiredW, int? chargingWirelessW, double? weightG, Dimensions? dimensions, String? ipRating, String? os, String? osVersion, Connectivity? connectivity, String? imageUrl, List images, SmartphoneScore? score, bool verified, List sourceUrls, String? createdAt, String? updatedAt +}); + + +@override $BrandCopyWith<$Res>? get brand;@override $SocCopyWith<$Res>? get soc;@override $DisplayCopyWith<$Res>? get display;@override $DimensionsCopyWith<$Res>? get dimensions;@override $ConnectivityCopyWith<$Res>? get connectivity;@override $SmartphoneScoreCopyWith<$Res>? get score; + +} /// @nodoc -class __$SmartphoneCopyWithImpl<$Res> implements _$SmartphoneCopyWith<$Res> { +class __$SmartphoneCopyWithImpl<$Res> + implements _$SmartphoneCopyWith<$Res> { __$SmartphoneCopyWithImpl(this._self, this._then); final _Smartphone _self; final $Res Function(_Smartphone) _then; - /// Create a copy of Smartphone - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? slug = null, - Object? name = null, - Object? id = freezed, - Object? baseModelSlug = freezed, - Object? brand = freezed, - Object? soc = freezed, - Object? releaseDate = freezed, - Object? msrpUsd = freezed, - Object? ramGb = freezed, - Object? storageOptionsGb = null, - Object? variant = null, - Object? display = freezed, - Object? cameras = null, - Object? batteryMah = freezed, - Object? chargingWiredW = freezed, - Object? chargingWirelessW = freezed, - Object? weightG = freezed, - Object? dimensions = freezed, - Object? ipRating = freezed, - Object? os = freezed, - Object? osVersion = freezed, - Object? connectivity = freezed, - Object? imageUrl = freezed, - Object? images = null, - Object? score = freezed, - Object? verified = null, - Object? sourceUrls = null, - Object? createdAt = freezed, - Object? updatedAt = freezed, - }) { - return _then(_Smartphone( - slug: null == slug - ? _self.slug - : slug // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _self.name - : name // ignore: cast_nullable_to_non_nullable - as String, - id: freezed == id - ? _self.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - baseModelSlug: freezed == baseModelSlug - ? _self.baseModelSlug - : baseModelSlug // ignore: cast_nullable_to_non_nullable - as String?, - brand: freezed == brand - ? _self.brand - : brand // ignore: cast_nullable_to_non_nullable - as Brand?, - soc: freezed == soc - ? _self.soc - : soc // ignore: cast_nullable_to_non_nullable - as Soc?, - releaseDate: freezed == releaseDate - ? _self.releaseDate - : releaseDate // ignore: cast_nullable_to_non_nullable - as String?, - msrpUsd: freezed == msrpUsd - ? _self.msrpUsd - : msrpUsd // ignore: cast_nullable_to_non_nullable - as int?, - ramGb: freezed == ramGb - ? _self.ramGb - : ramGb // ignore: cast_nullable_to_non_nullable - as int?, - storageOptionsGb: null == storageOptionsGb - ? _self._storageOptionsGb - : storageOptionsGb // ignore: cast_nullable_to_non_nullable - as List, - variant: null == variant - ? _self._variant - : variant // ignore: cast_nullable_to_non_nullable - as Map, - display: freezed == display - ? _self.display - : display // ignore: cast_nullable_to_non_nullable - as Display?, - cameras: null == cameras - ? _self._cameras - : cameras // ignore: cast_nullable_to_non_nullable - as List, - batteryMah: freezed == batteryMah - ? _self.batteryMah - : batteryMah // ignore: cast_nullable_to_non_nullable - as int?, - chargingWiredW: freezed == chargingWiredW - ? _self.chargingWiredW - : chargingWiredW // ignore: cast_nullable_to_non_nullable - as int?, - chargingWirelessW: freezed == chargingWirelessW - ? _self.chargingWirelessW - : chargingWirelessW // ignore: cast_nullable_to_non_nullable - as int?, - weightG: freezed == weightG - ? _self.weightG - : weightG // ignore: cast_nullable_to_non_nullable - as double?, - dimensions: freezed == dimensions - ? _self.dimensions - : dimensions // ignore: cast_nullable_to_non_nullable - as Dimensions?, - ipRating: freezed == ipRating - ? _self.ipRating - : ipRating // ignore: cast_nullable_to_non_nullable - as String?, - os: freezed == os - ? _self.os - : os // ignore: cast_nullable_to_non_nullable - as String?, - osVersion: freezed == osVersion - ? _self.osVersion - : osVersion // ignore: cast_nullable_to_non_nullable - as String?, - connectivity: freezed == connectivity - ? _self.connectivity - : connectivity // ignore: cast_nullable_to_non_nullable - as Connectivity?, - imageUrl: freezed == imageUrl - ? _self.imageUrl - : imageUrl // ignore: cast_nullable_to_non_nullable - as String?, - images: null == images - ? _self._images - : images // ignore: cast_nullable_to_non_nullable - as List, - score: freezed == score - ? _self.score - : score // ignore: cast_nullable_to_non_nullable - as SmartphoneScore?, - verified: null == verified - ? _self.verified - : verified // ignore: cast_nullable_to_non_nullable - as bool, - sourceUrls: null == sourceUrls - ? _self._sourceUrls - : sourceUrls // ignore: cast_nullable_to_non_nullable - as List, - createdAt: freezed == createdAt - ? _self.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as String?, - updatedAt: freezed == updatedAt - ? _self.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +/// Create a copy of Smartphone +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? slug = null,Object? name = null,Object? id = freezed,Object? baseModelSlug = freezed,Object? brand = freezed,Object? soc = freezed,Object? releaseDate = freezed,Object? msrpUsd = freezed,Object? ramGb = freezed,Object? storageOptionsGb = null,Object? variant = null,Object? display = freezed,Object? cameras = null,Object? batteryMah = freezed,Object? chargingWiredW = freezed,Object? chargingWirelessW = freezed,Object? weightG = freezed,Object? dimensions = freezed,Object? ipRating = freezed,Object? os = freezed,Object? osVersion = freezed,Object? connectivity = freezed,Object? imageUrl = freezed,Object? images = null,Object? score = freezed,Object? verified = null,Object? sourceUrls = null,Object? createdAt = freezed,Object? updatedAt = freezed,}) { + return _then(_Smartphone( +slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable +as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,baseModelSlug: freezed == baseModelSlug ? _self.baseModelSlug : baseModelSlug // ignore: cast_nullable_to_non_nullable +as String?,brand: freezed == brand ? _self.brand : brand // ignore: cast_nullable_to_non_nullable +as Brand?,soc: freezed == soc ? _self.soc : soc // ignore: cast_nullable_to_non_nullable +as Soc?,releaseDate: freezed == releaseDate ? _self.releaseDate : releaseDate // ignore: cast_nullable_to_non_nullable +as String?,msrpUsd: freezed == msrpUsd ? _self.msrpUsd : msrpUsd // ignore: cast_nullable_to_non_nullable +as int?,ramGb: freezed == ramGb ? _self.ramGb : ramGb // ignore: cast_nullable_to_non_nullable +as int?,storageOptionsGb: null == storageOptionsGb ? _self._storageOptionsGb : storageOptionsGb // ignore: cast_nullable_to_non_nullable +as List,variant: null == variant ? _self._variant : variant // ignore: cast_nullable_to_non_nullable +as Map,display: freezed == display ? _self.display : display // ignore: cast_nullable_to_non_nullable +as Display?,cameras: null == cameras ? _self._cameras : cameras // ignore: cast_nullable_to_non_nullable +as List,batteryMah: freezed == batteryMah ? _self.batteryMah : batteryMah // ignore: cast_nullable_to_non_nullable +as int?,chargingWiredW: freezed == chargingWiredW ? _self.chargingWiredW : chargingWiredW // ignore: cast_nullable_to_non_nullable +as int?,chargingWirelessW: freezed == chargingWirelessW ? _self.chargingWirelessW : chargingWirelessW // ignore: cast_nullable_to_non_nullable +as int?,weightG: freezed == weightG ? _self.weightG : weightG // ignore: cast_nullable_to_non_nullable +as double?,dimensions: freezed == dimensions ? _self.dimensions : dimensions // ignore: cast_nullable_to_non_nullable +as Dimensions?,ipRating: freezed == ipRating ? _self.ipRating : ipRating // ignore: cast_nullable_to_non_nullable +as String?,os: freezed == os ? _self.os : os // ignore: cast_nullable_to_non_nullable +as String?,osVersion: freezed == osVersion ? _self.osVersion : osVersion // ignore: cast_nullable_to_non_nullable +as String?,connectivity: freezed == connectivity ? _self.connectivity : connectivity // ignore: cast_nullable_to_non_nullable +as Connectivity?,imageUrl: freezed == imageUrl ? _self.imageUrl : imageUrl // ignore: cast_nullable_to_non_nullable +as String?,images: null == images ? _self._images : images // ignore: cast_nullable_to_non_nullable +as List,score: freezed == score ? _self.score : score // ignore: cast_nullable_to_non_nullable +as SmartphoneScore?,verified: null == verified ? _self.verified : verified // ignore: cast_nullable_to_non_nullable +as bool,sourceUrls: null == sourceUrls ? _self._sourceUrls : sourceUrls // ignore: cast_nullable_to_non_nullable +as List,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as String?,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable +as String?, + )); +} - /// Create a copy of Smartphone - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BrandCopyWith<$Res>? get brand { +/// Create a copy of Smartphone +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BrandCopyWith<$Res>? get brand { if (_self.brand == null) { - return null; - } - - return $BrandCopyWith<$Res>(_self.brand!, (value) { - return _then(_self.copyWith(brand: value)); - }); + return null; } - /// Create a copy of Smartphone - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $SocCopyWith<$Res>? get soc { + return $BrandCopyWith<$Res>(_self.brand!, (value) { + return _then(_self.copyWith(brand: value)); + }); +}/// Create a copy of Smartphone +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SocCopyWith<$Res>? get soc { if (_self.soc == null) { - return null; - } - - return $SocCopyWith<$Res>(_self.soc!, (value) { - return _then(_self.copyWith(soc: value)); - }); + return null; } - /// Create a copy of Smartphone - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $DisplayCopyWith<$Res>? get display { + return $SocCopyWith<$Res>(_self.soc!, (value) { + return _then(_self.copyWith(soc: value)); + }); +}/// Create a copy of Smartphone +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DisplayCopyWith<$Res>? get display { if (_self.display == null) { - return null; - } - - return $DisplayCopyWith<$Res>(_self.display!, (value) { - return _then(_self.copyWith(display: value)); - }); + return null; } - /// Create a copy of Smartphone - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $DimensionsCopyWith<$Res>? get dimensions { + return $DisplayCopyWith<$Res>(_self.display!, (value) { + return _then(_self.copyWith(display: value)); + }); +}/// Create a copy of Smartphone +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DimensionsCopyWith<$Res>? get dimensions { if (_self.dimensions == null) { - return null; - } - - return $DimensionsCopyWith<$Res>(_self.dimensions!, (value) { - return _then(_self.copyWith(dimensions: value)); - }); + return null; } - /// Create a copy of Smartphone - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ConnectivityCopyWith<$Res>? get connectivity { + return $DimensionsCopyWith<$Res>(_self.dimensions!, (value) { + return _then(_self.copyWith(dimensions: value)); + }); +}/// Create a copy of Smartphone +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ConnectivityCopyWith<$Res>? get connectivity { if (_self.connectivity == null) { - return null; - } - - return $ConnectivityCopyWith<$Res>(_self.connectivity!, (value) { - return _then(_self.copyWith(connectivity: value)); - }); + return null; } - /// Create a copy of Smartphone - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $SmartphoneScoreCopyWith<$Res>? get score { + return $ConnectivityCopyWith<$Res>(_self.connectivity!, (value) { + return _then(_self.copyWith(connectivity: value)); + }); +}/// Create a copy of Smartphone +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SmartphoneScoreCopyWith<$Res>? get score { if (_self.score == null) { - return null; - } - - return $SmartphoneScoreCopyWith<$Res>(_self.score!, (value) { - return _then(_self.copyWith(score: value)); - }); + return null; } + + return $SmartphoneScoreCopyWith<$Res>(_self.score!, (value) { + return _then(_self.copyWith(score: value)); + }); +} } // dart format on diff --git a/lib/data/dto/smartphone.g.dart b/lib/data/dto/smartphone.g.dart index ecddd90..71aaa18 100644 --- a/lib/data/dto/smartphone.g.dart +++ b/lib/data/dto/smartphone.g.dart @@ -7,46 +7,46 @@ part of 'smartphone.dart'; // ************************************************************************** _Display _$DisplayFromJson(Map json) => _Display( - sizeInch: (json['size_inch'] as num?)?.toDouble(), - resolution: json['resolution'] as String?, - refreshHz: (json['refresh_hz'] as num?)?.toInt(), - type: json['type'] as String?, - ppi: (json['ppi'] as num?)?.toInt(), - brightnessNits: (json['brightness_nits'] as num?)?.toInt(), - ); + sizeInch: (json['size_inch'] as num?)?.toDouble(), + resolution: json['resolution'] as String?, + refreshHz: (json['refresh_hz'] as num?)?.toInt(), + type: json['type'] as String?, + ppi: (json['ppi'] as num?)?.toInt(), + brightnessNits: (json['brightness_nits'] as num?)?.toInt(), +); Map _$DisplayToJson(_Display instance) => { - 'size_inch': instance.sizeInch, - 'resolution': instance.resolution, - 'refresh_hz': instance.refreshHz, - 'type': instance.type, - 'ppi': instance.ppi, - 'brightness_nits': instance.brightnessNits, - }; + 'size_inch': instance.sizeInch, + 'resolution': instance.resolution, + 'refresh_hz': instance.refreshHz, + 'type': instance.type, + 'ppi': instance.ppi, + 'brightness_nits': instance.brightnessNits, +}; _Camera _$CameraFromJson(Map json) => _Camera( - type: json['type'] as String?, - mp: (json['mp'] as num?)?.toDouble(), - aperture: (json['aperture'] as num?)?.toDouble(), - ois: json['ois'] as bool?, - sensor: json['sensor'] as String?, - opticalZoom: (json['optical_zoom'] as num?)?.toDouble(), - ); + type: json['type'] as String?, + mp: (json['mp'] as num?)?.toDouble(), + aperture: (json['aperture'] as num?)?.toDouble(), + ois: json['ois'] as bool?, + sensor: json['sensor'] as String?, + opticalZoom: (json['optical_zoom'] as num?)?.toDouble(), +); Map _$CameraToJson(_Camera instance) => { - 'type': instance.type, - 'mp': instance.mp, - 'aperture': instance.aperture, - 'ois': instance.ois, - 'sensor': instance.sensor, - 'optical_zoom': instance.opticalZoom, - }; + 'type': instance.type, + 'mp': instance.mp, + 'aperture': instance.aperture, + 'ois': instance.ois, + 'sensor': instance.sensor, + 'optical_zoom': instance.opticalZoom, +}; _Dimensions _$DimensionsFromJson(Map json) => _Dimensions( - heightMm: (json['height_mm'] as num?)?.toDouble(), - widthMm: (json['width_mm'] as num?)?.toDouble(), - depthMm: (json['depth_mm'] as num?)?.toDouble(), - ); + heightMm: (json['height_mm'] as num?)?.toDouble(), + widthMm: (json['width_mm'] as num?)?.toDouble(), + depthMm: (json['depth_mm'] as num?)?.toDouble(), +); Map _$DimensionsToJson(_Dimensions instance) => { @@ -72,61 +72,63 @@ Map _$ConnectivityToJson(_Connectivity instance) => }; _Smartphone _$SmartphoneFromJson(Map json) => _Smartphone( - slug: json['slug'] as String, - name: json['name'] as String, - id: (json['id'] as num?)?.toInt(), - baseModelSlug: json['base_model_slug'] as String?, - brand: json['brand'] == null - ? null - : Brand.fromJson(json['brand'] as Map), - soc: json['soc'] == null - ? null - : Soc.fromJson(json['soc'] as Map), - releaseDate: json['release_date'] as String?, - msrpUsd: (json['msrp_usd'] as num?)?.toInt(), - ramGb: (json['ram_gb'] as num?)?.toInt(), - storageOptionsGb: (json['storage_options_gb'] as List?) - ?.map((e) => (e as num).toInt()) - .toList() ?? - const [], - variant: - json['variant'] as Map? ?? const {}, - display: json['display'] == null - ? null - : Display.fromJson(json['display'] as Map), - cameras: (json['cameras'] as List?) - ?.map((e) => Camera.fromJson(e as Map)) - .toList() ?? - const [], - batteryMah: (json['battery_mah'] as num?)?.toInt(), - chargingWiredW: (json['charging_wired_w'] as num?)?.toInt(), - chargingWirelessW: (json['charging_wireless_w'] as num?)?.toInt(), - weightG: (json['weight_g'] as num?)?.toDouble(), - dimensions: json['dimensions'] == null - ? null - : Dimensions.fromJson(json['dimensions'] as Map), - ipRating: json['ip_rating'] as String?, - os: json['os'] as String?, - osVersion: json['os_version'] as String?, - connectivity: json['connectivity'] == null - ? null - : Connectivity.fromJson(json['connectivity'] as Map), - imageUrl: json['image_url'] as String?, - images: (json['images'] as List?) - ?.map((e) => e as String) - .toList() ?? - const [], - score: json['score'] == null - ? null - : SmartphoneScore.fromJson(json['score'] as Map), - verified: json['verified'] as bool? ?? false, - sourceUrls: (json['source_urls'] as List?) - ?.map((e) => e as String) - .toList() ?? - const [], - createdAt: json['created_at'] as String?, - updatedAt: json['updated_at'] as String?, - ); + slug: json['slug'] as String, + name: json['name'] as String, + id: (json['id'] as num?)?.toInt(), + baseModelSlug: json['base_model_slug'] as String?, + brand: json['brand'] == null + ? null + : Brand.fromJson(json['brand'] as Map), + soc: json['soc'] == null + ? null + : Soc.fromJson(json['soc'] as Map), + releaseDate: json['release_date'] as String?, + msrpUsd: (json['msrp_usd'] as num?)?.toInt(), + ramGb: (json['ram_gb'] as num?)?.toInt(), + storageOptionsGb: + (json['storage_options_gb'] as List?) + ?.map((e) => (e as num).toInt()) + .toList() ?? + const [], + variant: + json['variant'] as Map? ?? const {}, + display: json['display'] == null + ? null + : Display.fromJson(json['display'] as Map), + cameras: + (json['cameras'] as List?) + ?.map((e) => Camera.fromJson(e as Map)) + .toList() ?? + const [], + batteryMah: (json['battery_mah'] as num?)?.toInt(), + chargingWiredW: (json['charging_wired_w'] as num?)?.toInt(), + chargingWirelessW: (json['charging_wireless_w'] as num?)?.toInt(), + weightG: (json['weight_g'] as num?)?.toDouble(), + dimensions: json['dimensions'] == null + ? null + : Dimensions.fromJson(json['dimensions'] as Map), + ipRating: json['ip_rating'] as String?, + os: json['os'] as String?, + osVersion: json['os_version'] as String?, + connectivity: json['connectivity'] == null + ? null + : Connectivity.fromJson(json['connectivity'] as Map), + imageUrl: json['image_url'] as String?, + images: + (json['images'] as List?)?.map((e) => e as String).toList() ?? + const [], + score: json['score'] == null + ? null + : SmartphoneScore.fromJson(json['score'] as Map), + verified: json['verified'] as bool? ?? false, + sourceUrls: + (json['source_urls'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], + createdAt: json['created_at'] as String?, + updatedAt: json['updated_at'] as String?, +); Map _$SmartphoneToJson(_Smartphone instance) => { diff --git a/lib/data/dto/soc.freezed.dart b/lib/data/dto/soc.freezed.dart index 1ebd0f9..203f39b 100644 --- a/lib/data/dto/soc.freezed.dart +++ b/lib/data/dto/soc.freezed.dart @@ -14,1252 +14,681 @@ T _$identity(T value) => value; /// @nodoc mixin _$CpuConfig { - /// 고성능 코어 수. - int? get performance; - /// 효율 코어 수. - int? get efficiency; - String? get architecture; - - /// 클러스터별 최대 클럭. 길이는 고정이 아니다. - List get clocksGhz; - - /// Create a copy of CpuConfig - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $CpuConfigCopyWith get copyWith => - _$CpuConfigCopyWithImpl(this as CpuConfig, _$identity); +/// 고성능 코어 수. + int? get performance;/// 효율 코어 수. + int? get efficiency; String? get architecture;/// 클러스터별 최대 클럭. 길이는 고정이 아니다. + List get clocksGhz; +/// Create a copy of CpuConfig +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CpuConfigCopyWith get copyWith => _$CpuConfigCopyWithImpl(this as CpuConfig, _$identity); /// Serializes this CpuConfig to a JSON map. Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is CpuConfig && - (identical(other.performance, performance) || - other.performance == performance) && - (identical(other.efficiency, efficiency) || - other.efficiency == efficiency) && - (identical(other.architecture, architecture) || - other.architecture == architecture) && - const DeepCollectionEquality().equals(other.clocksGhz, clocksGhz)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, performance, efficiency, - architecture, const DeepCollectionEquality().hash(clocksGhz)); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CpuConfig&&(identical(other.performance, performance) || other.performance == performance)&&(identical(other.efficiency, efficiency) || other.efficiency == efficiency)&&(identical(other.architecture, architecture) || other.architecture == architecture)&&const DeepCollectionEquality().equals(other.clocksGhz, clocksGhz)); +} - @override - String toString() { - return 'CpuConfig(performance: $performance, efficiency: $efficiency, architecture: $architecture, clocksGhz: $clocksGhz)'; - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,performance,efficiency,architecture,const DeepCollectionEquality().hash(clocksGhz)); + +@override +String toString() { + return 'CpuConfig(performance: $performance, efficiency: $efficiency, architecture: $architecture, clocksGhz: $clocksGhz)'; } -/// @nodoc -abstract mixin class $CpuConfigCopyWith<$Res> { - factory $CpuConfigCopyWith(CpuConfig value, $Res Function(CpuConfig) _then) = - _$CpuConfigCopyWithImpl; - @useResult - $Res call( - {int? performance, - int? efficiency, - String? architecture, - List clocksGhz}); + } /// @nodoc -class _$CpuConfigCopyWithImpl<$Res> implements $CpuConfigCopyWith<$Res> { +abstract mixin class $CpuConfigCopyWith<$Res> { + factory $CpuConfigCopyWith(CpuConfig value, $Res Function(CpuConfig) _then) = _$CpuConfigCopyWithImpl; +@useResult +$Res call({ + int? performance, int? efficiency, String? architecture, List clocksGhz +}); + + + + +} +/// @nodoc +class _$CpuConfigCopyWithImpl<$Res> + implements $CpuConfigCopyWith<$Res> { _$CpuConfigCopyWithImpl(this._self, this._then); final CpuConfig _self; final $Res Function(CpuConfig) _then; - /// Create a copy of CpuConfig - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? performance = freezed, - Object? efficiency = freezed, - Object? architecture = freezed, - Object? clocksGhz = null, - }) { - return _then(_self.copyWith( - performance: freezed == performance - ? _self.performance - : performance // ignore: cast_nullable_to_non_nullable - as int?, - efficiency: freezed == efficiency - ? _self.efficiency - : efficiency // ignore: cast_nullable_to_non_nullable - as int?, - architecture: freezed == architecture - ? _self.architecture - : architecture // ignore: cast_nullable_to_non_nullable - as String?, - clocksGhz: null == clocksGhz - ? _self.clocksGhz - : clocksGhz // ignore: cast_nullable_to_non_nullable - as List, - )); - } +/// Create a copy of CpuConfig +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? performance = freezed,Object? efficiency = freezed,Object? architecture = freezed,Object? clocksGhz = null,}) { + return _then(_self.copyWith( +performance: freezed == performance ? _self.performance : performance // ignore: cast_nullable_to_non_nullable +as int?,efficiency: freezed == efficiency ? _self.efficiency : efficiency // ignore: cast_nullable_to_non_nullable +as int?,architecture: freezed == architecture ? _self.architecture : architecture // ignore: cast_nullable_to_non_nullable +as String?,clocksGhz: null == clocksGhz ? _self.clocksGhz : clocksGhz // ignore: cast_nullable_to_non_nullable +as List, + )); } +} + + /// Adds pattern-matching-related methods to [CpuConfig]. extension CpuConfigPatterns on CpuConfig { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_CpuConfig value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _CpuConfig() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CpuConfig value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CpuConfig() when $default != null: +return $default(_that);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_CpuConfig value) $default, - ) { - final _that = this; - switch (_that) { - case _CpuConfig(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CpuConfig value) $default,){ +final _that = this; +switch (_that) { +case _CpuConfig(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_CpuConfig value)? $default, - ) { - final _that = this; - switch (_that) { - case _CpuConfig() when $default != null: - return $default(_that); - case _: - return null; - } - } +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CpuConfig value)? $default,){ +final _that = this; +switch (_that) { +case _CpuConfig() when $default != null: +return $default(_that);case _: + return null; - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function(int? performance, int? efficiency, String? architecture, - List clocksGhz)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _CpuConfig() when $default != null: - return $default(_that.performance, _that.efficiency, _that.architecture, - _that.clocksGhz); - case _: - return orElse(); - } - } +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? performance, int? efficiency, String? architecture, List clocksGhz)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CpuConfig() when $default != null: +return $default(_that.performance,_that.efficiency,_that.architecture,_that.clocksGhz);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function(int? performance, int? efficiency, String? architecture, - List clocksGhz) - $default, - ) { - final _that = this; - switch (_that) { - case _CpuConfig(): - return $default(_that.performance, _that.efficiency, _that.architecture, - _that.clocksGhz); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? performance, int? efficiency, String? architecture, List clocksGhz) $default,) {final _that = this; +switch (_that) { +case _CpuConfig(): +return $default(_that.performance,_that.efficiency,_that.architecture,_that.clocksGhz);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? performance, int? efficiency, String? architecture, List clocksGhz)? $default,) {final _that = this; +switch (_that) { +case _CpuConfig() when $default != null: +return $default(_that.performance,_that.efficiency,_that.architecture,_that.clocksGhz);case _: + return null; + +} +} - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(int? performance, int? efficiency, String? architecture, - List clocksGhz)? - $default, - ) { - final _that = this; - switch (_that) { - case _CpuConfig() when $default != null: - return $default(_that.performance, _that.efficiency, _that.architecture, - _that.clocksGhz); - case _: - return null; - } - } } /// @nodoc @JsonSerializable() + class _CpuConfig implements CpuConfig { - const _CpuConfig( - {this.performance, - this.efficiency, - this.architecture, - final List clocksGhz = const []}) - : _clocksGhz = clocksGhz; - factory _CpuConfig.fromJson(Map json) => - _$CpuConfigFromJson(json); - - /// 고성능 코어 수. - @override - final int? performance; - - /// 효율 코어 수. - @override - final int? efficiency; - @override - final String? architecture; - - /// 클러스터별 최대 클럭. 길이는 고정이 아니다. - final List _clocksGhz; - - /// 클러스터별 최대 클럭. 길이는 고정이 아니다. - @override - @JsonKey() - List get clocksGhz { - if (_clocksGhz is EqualUnmodifiableListView) return _clocksGhz; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_clocksGhz); - } + const _CpuConfig({this.performance, this.efficiency, this.architecture, final List clocksGhz = const []}): _clocksGhz = clocksGhz; + factory _CpuConfig.fromJson(Map json) => _$CpuConfigFromJson(json); + +/// 고성능 코어 수. +@override final int? performance; +/// 효율 코어 수. +@override final int? efficiency; +@override final String? architecture; +/// 클러스터별 최대 클럭. 길이는 고정이 아니다. + final List _clocksGhz; +/// 클러스터별 최대 클럭. 길이는 고정이 아니다. +@override@JsonKey() List get clocksGhz { + if (_clocksGhz is EqualUnmodifiableListView) return _clocksGhz; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_clocksGhz); +} - /// Create a copy of CpuConfig - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$CpuConfigCopyWith<_CpuConfig> get copyWith => - __$CpuConfigCopyWithImpl<_CpuConfig>(this, _$identity); - - @override - Map toJson() { - return _$CpuConfigToJson( - this, - ); - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _CpuConfig && - (identical(other.performance, performance) || - other.performance == performance) && - (identical(other.efficiency, efficiency) || - other.efficiency == efficiency) && - (identical(other.architecture, architecture) || - other.architecture == architecture) && - const DeepCollectionEquality() - .equals(other._clocksGhz, _clocksGhz)); - } +/// Create a copy of CpuConfig +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CpuConfigCopyWith<_CpuConfig> get copyWith => __$CpuConfigCopyWithImpl<_CpuConfig>(this, _$identity); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, performance, efficiency, - architecture, const DeepCollectionEquality().hash(_clocksGhz)); +@override +Map toJson() { + return _$CpuConfigToJson(this, ); +} - @override - String toString() { - return 'CpuConfig(performance: $performance, efficiency: $efficiency, architecture: $architecture, clocksGhz: $clocksGhz)'; - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CpuConfig&&(identical(other.performance, performance) || other.performance == performance)&&(identical(other.efficiency, efficiency) || other.efficiency == efficiency)&&(identical(other.architecture, architecture) || other.architecture == architecture)&&const DeepCollectionEquality().equals(other._clocksGhz, _clocksGhz)); } -/// @nodoc -abstract mixin class _$CpuConfigCopyWith<$Res> - implements $CpuConfigCopyWith<$Res> { - factory _$CpuConfigCopyWith( - _CpuConfig value, $Res Function(_CpuConfig) _then) = - __$CpuConfigCopyWithImpl; - @override - @useResult - $Res call( - {int? performance, - int? efficiency, - String? architecture, - List clocksGhz}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,performance,efficiency,architecture,const DeepCollectionEquality().hash(_clocksGhz)); + +@override +String toString() { + return 'CpuConfig(performance: $performance, efficiency: $efficiency, architecture: $architecture, clocksGhz: $clocksGhz)'; } + +} + +/// @nodoc +abstract mixin class _$CpuConfigCopyWith<$Res> implements $CpuConfigCopyWith<$Res> { + factory _$CpuConfigCopyWith(_CpuConfig value, $Res Function(_CpuConfig) _then) = __$CpuConfigCopyWithImpl; +@override @useResult +$Res call({ + int? performance, int? efficiency, String? architecture, List clocksGhz +}); + + + + +} /// @nodoc -class __$CpuConfigCopyWithImpl<$Res> implements _$CpuConfigCopyWith<$Res> { +class __$CpuConfigCopyWithImpl<$Res> + implements _$CpuConfigCopyWith<$Res> { __$CpuConfigCopyWithImpl(this._self, this._then); final _CpuConfig _self; final $Res Function(_CpuConfig) _then; - /// Create a copy of CpuConfig - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? performance = freezed, - Object? efficiency = freezed, - Object? architecture = freezed, - Object? clocksGhz = null, - }) { - return _then(_CpuConfig( - performance: freezed == performance - ? _self.performance - : performance // ignore: cast_nullable_to_non_nullable - as int?, - efficiency: freezed == efficiency - ? _self.efficiency - : efficiency // ignore: cast_nullable_to_non_nullable - as int?, - architecture: freezed == architecture - ? _self.architecture - : architecture // ignore: cast_nullable_to_non_nullable - as String?, - clocksGhz: null == clocksGhz - ? _self._clocksGhz - : clocksGhz // ignore: cast_nullable_to_non_nullable - as List, - )); - } +/// Create a copy of CpuConfig +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? performance = freezed,Object? efficiency = freezed,Object? architecture = freezed,Object? clocksGhz = null,}) { + return _then(_CpuConfig( +performance: freezed == performance ? _self.performance : performance // ignore: cast_nullable_to_non_nullable +as int?,efficiency: freezed == efficiency ? _self.efficiency : efficiency // ignore: cast_nullable_to_non_nullable +as int?,architecture: freezed == architecture ? _self.architecture : architecture // ignore: cast_nullable_to_non_nullable +as String?,clocksGhz: null == clocksGhz ? _self._clocksGhz : clocksGhz // ignore: cast_nullable_to_non_nullable +as List, + )); +} + + } + /// @nodoc mixin _$Soc { - String get slug; - String get name; - int? get id; - Brand? get manufacturer; - String? get releaseDate; - - /// 공정 (나노미터). - double? get processNm; - double? get transistorsBillion; - CpuConfig? get cpuConfig; - String? get gpuName; - int? get gpuCores; - int? get gpuClockMhz; - - /// NPU 연산 성능 (TOPS). - double? get npuTops; - String? get modem; - SocScore? get score; - - /// 큐레이터가 출처를 검증했는지. 데이터셋 상당수가 false다. - bool get verified; - List get sourceUrls; - String? get url; - - /// Create a copy of Soc - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - $SocCopyWith get copyWith => - _$SocCopyWithImpl(this as Soc, _$identity); + + String get slug; String get name; int? get id; Brand? get manufacturer; String? get releaseDate;/// 공정 (나노미터). + double? get processNm; double? get transistorsBillion; CpuConfig? get cpuConfig; String? get gpuName; int? get gpuCores; int? get gpuClockMhz;/// NPU 연산 성능 (TOPS). + double? get npuTops; String? get modem; SocScore? get score;/// 큐레이터가 출처를 검증했는지. 데이터셋 상당수가 false다. + bool get verified; List get sourceUrls; String? get url; +/// Create a copy of Soc +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SocCopyWith get copyWith => _$SocCopyWithImpl(this as Soc, _$identity); /// Serializes this Soc to a JSON map. Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is Soc && - (identical(other.slug, slug) || other.slug == slug) && - (identical(other.name, name) || other.name == name) && - (identical(other.id, id) || other.id == id) && - (identical(other.manufacturer, manufacturer) || - other.manufacturer == manufacturer) && - (identical(other.releaseDate, releaseDate) || - other.releaseDate == releaseDate) && - (identical(other.processNm, processNm) || - other.processNm == processNm) && - (identical(other.transistorsBillion, transistorsBillion) || - other.transistorsBillion == transistorsBillion) && - (identical(other.cpuConfig, cpuConfig) || - other.cpuConfig == cpuConfig) && - (identical(other.gpuName, gpuName) || other.gpuName == gpuName) && - (identical(other.gpuCores, gpuCores) || - other.gpuCores == gpuCores) && - (identical(other.gpuClockMhz, gpuClockMhz) || - other.gpuClockMhz == gpuClockMhz) && - (identical(other.npuTops, npuTops) || other.npuTops == npuTops) && - (identical(other.modem, modem) || other.modem == modem) && - (identical(other.score, score) || other.score == score) && - (identical(other.verified, verified) || - other.verified == verified) && - const DeepCollectionEquality() - .equals(other.sourceUrls, sourceUrls) && - (identical(other.url, url) || other.url == url)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - slug, - name, - id, - manufacturer, - releaseDate, - processNm, - transistorsBillion, - cpuConfig, - gpuName, - gpuCores, - gpuClockMhz, - npuTops, - modem, - score, - verified, - const DeepCollectionEquality().hash(sourceUrls), - url); - - @override - String toString() { - return 'Soc(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, releaseDate: $releaseDate, processNm: $processNm, transistorsBillion: $transistorsBillion, cpuConfig: $cpuConfig, gpuName: $gpuName, gpuCores: $gpuCores, gpuClockMhz: $gpuClockMhz, npuTops: $npuTops, modem: $modem, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Soc&&(identical(other.slug, slug) || other.slug == slug)&&(identical(other.name, name) || other.name == name)&&(identical(other.id, id) || other.id == id)&&(identical(other.manufacturer, manufacturer) || other.manufacturer == manufacturer)&&(identical(other.releaseDate, releaseDate) || other.releaseDate == releaseDate)&&(identical(other.processNm, processNm) || other.processNm == processNm)&&(identical(other.transistorsBillion, transistorsBillion) || other.transistorsBillion == transistorsBillion)&&(identical(other.cpuConfig, cpuConfig) || other.cpuConfig == cpuConfig)&&(identical(other.gpuName, gpuName) || other.gpuName == gpuName)&&(identical(other.gpuCores, gpuCores) || other.gpuCores == gpuCores)&&(identical(other.gpuClockMhz, gpuClockMhz) || other.gpuClockMhz == gpuClockMhz)&&(identical(other.npuTops, npuTops) || other.npuTops == npuTops)&&(identical(other.modem, modem) || other.modem == modem)&&(identical(other.score, score) || other.score == score)&&(identical(other.verified, verified) || other.verified == verified)&&const DeepCollectionEquality().equals(other.sourceUrls, sourceUrls)&&(identical(other.url, url) || other.url == url)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,slug,name,id,manufacturer,releaseDate,processNm,transistorsBillion,cpuConfig,gpuName,gpuCores,gpuClockMhz,npuTops,modem,score,verified,const DeepCollectionEquality().hash(sourceUrls),url); + +@override +String toString() { + return 'Soc(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, releaseDate: $releaseDate, processNm: $processNm, transistorsBillion: $transistorsBillion, cpuConfig: $cpuConfig, gpuName: $gpuName, gpuCores: $gpuCores, gpuClockMhz: $gpuClockMhz, npuTops: $npuTops, modem: $modem, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; +} + + } /// @nodoc -abstract mixin class $SocCopyWith<$Res> { +abstract mixin class $SocCopyWith<$Res> { factory $SocCopyWith(Soc value, $Res Function(Soc) _then) = _$SocCopyWithImpl; - @useResult - $Res call( - {String slug, - String name, - int? id, - Brand? manufacturer, - String? releaseDate, - double? processNm, - double? transistorsBillion, - CpuConfig? cpuConfig, - String? gpuName, - int? gpuCores, - int? gpuClockMhz, - double? npuTops, - String? modem, - SocScore? score, - bool verified, - List sourceUrls, - String? url}); - - $BrandCopyWith<$Res>? get manufacturer; - $CpuConfigCopyWith<$Res>? get cpuConfig; - $SocScoreCopyWith<$Res>? get score; -} +@useResult +$Res call({ + String slug, String name, int? id, Brand? manufacturer, String? releaseDate, double? processNm, double? transistorsBillion, CpuConfig? cpuConfig, String? gpuName, int? gpuCores, int? gpuClockMhz, double? npuTops, String? modem, SocScore? score, bool verified, List sourceUrls, String? url +}); + +$BrandCopyWith<$Res>? get manufacturer;$CpuConfigCopyWith<$Res>? get cpuConfig;$SocScoreCopyWith<$Res>? get score; + +} /// @nodoc -class _$SocCopyWithImpl<$Res> implements $SocCopyWith<$Res> { +class _$SocCopyWithImpl<$Res> + implements $SocCopyWith<$Res> { _$SocCopyWithImpl(this._self, this._then); final Soc _self; final $Res Function(Soc) _then; - /// Create a copy of Soc - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? slug = null, - Object? name = null, - Object? id = freezed, - Object? manufacturer = freezed, - Object? releaseDate = freezed, - Object? processNm = freezed, - Object? transistorsBillion = freezed, - Object? cpuConfig = freezed, - Object? gpuName = freezed, - Object? gpuCores = freezed, - Object? gpuClockMhz = freezed, - Object? npuTops = freezed, - Object? modem = freezed, - Object? score = freezed, - Object? verified = null, - Object? sourceUrls = null, - Object? url = freezed, - }) { - return _then(_self.copyWith( - slug: null == slug - ? _self.slug - : slug // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _self.name - : name // ignore: cast_nullable_to_non_nullable - as String, - id: freezed == id - ? _self.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - manufacturer: freezed == manufacturer - ? _self.manufacturer - : manufacturer // ignore: cast_nullable_to_non_nullable - as Brand?, - releaseDate: freezed == releaseDate - ? _self.releaseDate - : releaseDate // ignore: cast_nullable_to_non_nullable - as String?, - processNm: freezed == processNm - ? _self.processNm - : processNm // ignore: cast_nullable_to_non_nullable - as double?, - transistorsBillion: freezed == transistorsBillion - ? _self.transistorsBillion - : transistorsBillion // ignore: cast_nullable_to_non_nullable - as double?, - cpuConfig: freezed == cpuConfig - ? _self.cpuConfig - : cpuConfig // ignore: cast_nullable_to_non_nullable - as CpuConfig?, - gpuName: freezed == gpuName - ? _self.gpuName - : gpuName // ignore: cast_nullable_to_non_nullable - as String?, - gpuCores: freezed == gpuCores - ? _self.gpuCores - : gpuCores // ignore: cast_nullable_to_non_nullable - as int?, - gpuClockMhz: freezed == gpuClockMhz - ? _self.gpuClockMhz - : gpuClockMhz // ignore: cast_nullable_to_non_nullable - as int?, - npuTops: freezed == npuTops - ? _self.npuTops - : npuTops // ignore: cast_nullable_to_non_nullable - as double?, - modem: freezed == modem - ? _self.modem - : modem // ignore: cast_nullable_to_non_nullable - as String?, - score: freezed == score - ? _self.score - : score // ignore: cast_nullable_to_non_nullable - as SocScore?, - verified: null == verified - ? _self.verified - : verified // ignore: cast_nullable_to_non_nullable - as bool, - sourceUrls: null == sourceUrls - ? _self.sourceUrls - : sourceUrls // ignore: cast_nullable_to_non_nullable - as List, - url: freezed == url - ? _self.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - )); - } - - /// Create a copy of Soc - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BrandCopyWith<$Res>? get manufacturer { +/// Create a copy of Soc +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? slug = null,Object? name = null,Object? id = freezed,Object? manufacturer = freezed,Object? releaseDate = freezed,Object? processNm = freezed,Object? transistorsBillion = freezed,Object? cpuConfig = freezed,Object? gpuName = freezed,Object? gpuCores = freezed,Object? gpuClockMhz = freezed,Object? npuTops = freezed,Object? modem = freezed,Object? score = freezed,Object? verified = null,Object? sourceUrls = null,Object? url = freezed,}) { + return _then(_self.copyWith( +slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable +as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,manufacturer: freezed == manufacturer ? _self.manufacturer : manufacturer // ignore: cast_nullable_to_non_nullable +as Brand?,releaseDate: freezed == releaseDate ? _self.releaseDate : releaseDate // ignore: cast_nullable_to_non_nullable +as String?,processNm: freezed == processNm ? _self.processNm : processNm // ignore: cast_nullable_to_non_nullable +as double?,transistorsBillion: freezed == transistorsBillion ? _self.transistorsBillion : transistorsBillion // ignore: cast_nullable_to_non_nullable +as double?,cpuConfig: freezed == cpuConfig ? _self.cpuConfig : cpuConfig // ignore: cast_nullable_to_non_nullable +as CpuConfig?,gpuName: freezed == gpuName ? _self.gpuName : gpuName // ignore: cast_nullable_to_non_nullable +as String?,gpuCores: freezed == gpuCores ? _self.gpuCores : gpuCores // ignore: cast_nullable_to_non_nullable +as int?,gpuClockMhz: freezed == gpuClockMhz ? _self.gpuClockMhz : gpuClockMhz // ignore: cast_nullable_to_non_nullable +as int?,npuTops: freezed == npuTops ? _self.npuTops : npuTops // ignore: cast_nullable_to_non_nullable +as double?,modem: freezed == modem ? _self.modem : modem // ignore: cast_nullable_to_non_nullable +as String?,score: freezed == score ? _self.score : score // ignore: cast_nullable_to_non_nullable +as SocScore?,verified: null == verified ? _self.verified : verified // ignore: cast_nullable_to_non_nullable +as bool,sourceUrls: null == sourceUrls ? _self.sourceUrls : sourceUrls // ignore: cast_nullable_to_non_nullable +as List,url: freezed == url ? _self.url : url // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of Soc +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BrandCopyWith<$Res>? get manufacturer { if (_self.manufacturer == null) { - return null; - } - - return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { - return _then(_self.copyWith(manufacturer: value)); - }); + return null; } - /// Create a copy of Soc - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CpuConfigCopyWith<$Res>? get cpuConfig { + return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { + return _then(_self.copyWith(manufacturer: value)); + }); +}/// Create a copy of Soc +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CpuConfigCopyWith<$Res>? get cpuConfig { if (_self.cpuConfig == null) { - return null; - } - - return $CpuConfigCopyWith<$Res>(_self.cpuConfig!, (value) { - return _then(_self.copyWith(cpuConfig: value)); - }); + return null; } - /// Create a copy of Soc - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $SocScoreCopyWith<$Res>? get score { + return $CpuConfigCopyWith<$Res>(_self.cpuConfig!, (value) { + return _then(_self.copyWith(cpuConfig: value)); + }); +}/// Create a copy of Soc +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SocScoreCopyWith<$Res>? get score { if (_self.score == null) { - return null; - } - - return $SocScoreCopyWith<$Res>(_self.score!, (value) { - return _then(_self.copyWith(score: value)); - }); + return null; } + + return $SocScoreCopyWith<$Res>(_self.score!, (value) { + return _then(_self.copyWith(score: value)); + }); +} } + /// Adds pattern-matching-related methods to [Soc]. extension SocPatterns on Soc { - /// A variant of `map` that fallback to returning `orElse`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeMap( - TResult Function(_Soc value)? $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Soc() when $default != null: - return $default(_that); - case _: - return orElse(); - } - } +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Soc value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Soc() when $default != null: +return $default(_that);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// Callbacks receives the raw object, upcasted. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case final Subclass2 value: - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult map( - TResult Function(_Soc value) $default, - ) { - final _that = this; - switch (_that) { - case _Soc(): - return $default(_that); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Soc value) $default,){ +final _that = this; +switch (_that) { +case _Soc(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// A variant of `map` that fallback to returning `null`. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case final Subclass value: - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_Soc value)? $default, - ) { - final _that = this; - switch (_that) { - case _Soc() when $default != null: - return $default(_that); - case _: - return null; - } - } +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Soc value)? $default,){ +final _that = this; +switch (_that) { +case _Soc() when $default != null: +return $default(_that);case _: + return null; - /// A variant of `when` that fallback to an `orElse` callback. - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return orElse(); - /// } - /// ``` - - @optionalTypeArgs - TResult maybeWhen( - TResult Function( - String slug, - String name, - int? id, - Brand? manufacturer, - String? releaseDate, - double? processNm, - double? transistorsBillion, - CpuConfig? cpuConfig, - String? gpuName, - int? gpuCores, - int? gpuClockMhz, - double? npuTops, - String? modem, - SocScore? score, - bool verified, - List sourceUrls, - String? url)? - $default, { - required TResult orElse(), - }) { - final _that = this; - switch (_that) { - case _Soc() when $default != null: - return $default( - _that.slug, - _that.name, - _that.id, - _that.manufacturer, - _that.releaseDate, - _that.processNm, - _that.transistorsBillion, - _that.cpuConfig, - _that.gpuName, - _that.gpuCores, - _that.gpuClockMhz, - _that.npuTops, - _that.modem, - _that.score, - _that.verified, - _that.sourceUrls, - _that.url); - case _: - return orElse(); - } - } +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String slug, String name, int? id, Brand? manufacturer, String? releaseDate, double? processNm, double? transistorsBillion, CpuConfig? cpuConfig, String? gpuName, int? gpuCores, int? gpuClockMhz, double? npuTops, String? modem, SocScore? score, bool verified, List sourceUrls, String? url)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Soc() when $default != null: +return $default(_that.slug,_that.name,_that.id,_that.manufacturer,_that.releaseDate,_that.processNm,_that.transistorsBillion,_that.cpuConfig,_that.gpuName,_that.gpuCores,_that.gpuClockMhz,_that.npuTops,_that.modem,_that.score,_that.verified,_that.sourceUrls,_that.url);case _: + return orElse(); - /// A `switch`-like method, using callbacks. - /// - /// As opposed to `map`, this offers destructuring. - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case Subclass2(:final field2): - /// return ...; - /// } - /// ``` - - @optionalTypeArgs - TResult when( - TResult Function( - String slug, - String name, - int? id, - Brand? manufacturer, - String? releaseDate, - double? processNm, - double? transistorsBillion, - CpuConfig? cpuConfig, - String? gpuName, - int? gpuCores, - int? gpuClockMhz, - double? npuTops, - String? modem, - SocScore? score, - bool verified, - List sourceUrls, - String? url) - $default, - ) { - final _that = this; - switch (_that) { - case _Soc(): - return $default( - _that.slug, - _that.name, - _that.id, - _that.manufacturer, - _that.releaseDate, - _that.processNm, - _that.transistorsBillion, - _that.cpuConfig, - _that.gpuName, - _that.gpuCores, - _that.gpuClockMhz, - _that.npuTops, - _that.modem, - _that.score, - _that.verified, - _that.sourceUrls, - _that.url); - case _: - throw StateError('Unexpected subclass'); - } - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String slug, String name, int? id, Brand? manufacturer, String? releaseDate, double? processNm, double? transistorsBillion, CpuConfig? cpuConfig, String? gpuName, int? gpuCores, int? gpuClockMhz, double? npuTops, String? modem, SocScore? score, bool verified, List sourceUrls, String? url) $default,) {final _that = this; +switch (_that) { +case _Soc(): +return $default(_that.slug,_that.name,_that.id,_that.manufacturer,_that.releaseDate,_that.processNm,_that.transistorsBillion,_that.cpuConfig,_that.gpuName,_that.gpuCores,_that.gpuClockMhz,_that.npuTops,_that.modem,_that.score,_that.verified,_that.sourceUrls,_that.url);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String slug, String name, int? id, Brand? manufacturer, String? releaseDate, double? processNm, double? transistorsBillion, CpuConfig? cpuConfig, String? gpuName, int? gpuCores, int? gpuClockMhz, double? npuTops, String? modem, SocScore? score, bool verified, List sourceUrls, String? url)? $default,) {final _that = this; +switch (_that) { +case _Soc() when $default != null: +return $default(_that.slug,_that.name,_that.id,_that.manufacturer,_that.releaseDate,_that.processNm,_that.transistorsBillion,_that.cpuConfig,_that.gpuName,_that.gpuCores,_that.gpuClockMhz,_that.npuTops,_that.modem,_that.score,_that.verified,_that.sourceUrls,_that.url);case _: + return null; + +} +} - /// A variant of `when` that fallback to returning `null` - /// - /// It is equivalent to doing: - /// ```dart - /// switch (sealedClass) { - /// case Subclass(:final field): - /// return ...; - /// case _: - /// return null; - /// } - /// ``` - - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function( - String slug, - String name, - int? id, - Brand? manufacturer, - String? releaseDate, - double? processNm, - double? transistorsBillion, - CpuConfig? cpuConfig, - String? gpuName, - int? gpuCores, - int? gpuClockMhz, - double? npuTops, - String? modem, - SocScore? score, - bool verified, - List sourceUrls, - String? url)? - $default, - ) { - final _that = this; - switch (_that) { - case _Soc() when $default != null: - return $default( - _that.slug, - _that.name, - _that.id, - _that.manufacturer, - _that.releaseDate, - _that.processNm, - _that.transistorsBillion, - _that.cpuConfig, - _that.gpuName, - _that.gpuCores, - _that.gpuClockMhz, - _that.npuTops, - _that.modem, - _that.score, - _that.verified, - _that.sourceUrls, - _that.url); - case _: - return null; - } - } } /// @nodoc @JsonSerializable() + class _Soc implements Soc { - const _Soc( - {required this.slug, - required this.name, - this.id, - this.manufacturer, - this.releaseDate, - this.processNm, - this.transistorsBillion, - this.cpuConfig, - this.gpuName, - this.gpuCores, - this.gpuClockMhz, - this.npuTops, - this.modem, - this.score, - this.verified = false, - final List sourceUrls = const [], - this.url}) - : _sourceUrls = sourceUrls; + const _Soc({required this.slug, required this.name, this.id, this.manufacturer, this.releaseDate, this.processNm, this.transistorsBillion, this.cpuConfig, this.gpuName, this.gpuCores, this.gpuClockMhz, this.npuTops, this.modem, this.score, this.verified = false, final List sourceUrls = const [], this.url}): _sourceUrls = sourceUrls; factory _Soc.fromJson(Map json) => _$SocFromJson(json); - @override - final String slug; - @override - final String name; - @override - final int? id; - @override - final Brand? manufacturer; - @override - final String? releaseDate; - - /// 공정 (나노미터). - @override - final double? processNm; - @override - final double? transistorsBillion; - @override - final CpuConfig? cpuConfig; - @override - final String? gpuName; - @override - final int? gpuCores; - @override - final int? gpuClockMhz; - - /// NPU 연산 성능 (TOPS). - @override - final double? npuTops; - @override - final String? modem; - @override - final SocScore? score; - - /// 큐레이터가 출처를 검증했는지. 데이터셋 상당수가 false다. - @override - @JsonKey() - final bool verified; - final List _sourceUrls; - @override - @JsonKey() - List get sourceUrls { - if (_sourceUrls is EqualUnmodifiableListView) return _sourceUrls; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_sourceUrls); - } +@override final String slug; +@override final String name; +@override final int? id; +@override final Brand? manufacturer; +@override final String? releaseDate; +/// 공정 (나노미터). +@override final double? processNm; +@override final double? transistorsBillion; +@override final CpuConfig? cpuConfig; +@override final String? gpuName; +@override final int? gpuCores; +@override final int? gpuClockMhz; +/// NPU 연산 성능 (TOPS). +@override final double? npuTops; +@override final String? modem; +@override final SocScore? score; +/// 큐레이터가 출처를 검증했는지. 데이터셋 상당수가 false다. +@override@JsonKey() final bool verified; + final List _sourceUrls; +@override@JsonKey() List get sourceUrls { + if (_sourceUrls is EqualUnmodifiableListView) return _sourceUrls; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_sourceUrls); +} - @override - final String? url; - - /// Create a copy of Soc - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - @pragma('vm:prefer-inline') - _$SocCopyWith<_Soc> get copyWith => - __$SocCopyWithImpl<_Soc>(this, _$identity); - - @override - Map toJson() { - return _$SocToJson( - this, - ); - } +@override final String? url; + +/// Create a copy of Soc +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SocCopyWith<_Soc> get copyWith => __$SocCopyWithImpl<_Soc>(this, _$identity); + +@override +Map toJson() { + return _$SocToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Soc&&(identical(other.slug, slug) || other.slug == slug)&&(identical(other.name, name) || other.name == name)&&(identical(other.id, id) || other.id == id)&&(identical(other.manufacturer, manufacturer) || other.manufacturer == manufacturer)&&(identical(other.releaseDate, releaseDate) || other.releaseDate == releaseDate)&&(identical(other.processNm, processNm) || other.processNm == processNm)&&(identical(other.transistorsBillion, transistorsBillion) || other.transistorsBillion == transistorsBillion)&&(identical(other.cpuConfig, cpuConfig) || other.cpuConfig == cpuConfig)&&(identical(other.gpuName, gpuName) || other.gpuName == gpuName)&&(identical(other.gpuCores, gpuCores) || other.gpuCores == gpuCores)&&(identical(other.gpuClockMhz, gpuClockMhz) || other.gpuClockMhz == gpuClockMhz)&&(identical(other.npuTops, npuTops) || other.npuTops == npuTops)&&(identical(other.modem, modem) || other.modem == modem)&&(identical(other.score, score) || other.score == score)&&(identical(other.verified, verified) || other.verified == verified)&&const DeepCollectionEquality().equals(other._sourceUrls, _sourceUrls)&&(identical(other.url, url) || other.url == url)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,slug,name,id,manufacturer,releaseDate,processNm,transistorsBillion,cpuConfig,gpuName,gpuCores,gpuClockMhz,npuTops,modem,score,verified,const DeepCollectionEquality().hash(_sourceUrls),url); + +@override +String toString() { + return 'Soc(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, releaseDate: $releaseDate, processNm: $processNm, transistorsBillion: $transistorsBillion, cpuConfig: $cpuConfig, gpuName: $gpuName, gpuCores: $gpuCores, gpuClockMhz: $gpuClockMhz, npuTops: $npuTops, modem: $modem, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _Soc && - (identical(other.slug, slug) || other.slug == slug) && - (identical(other.name, name) || other.name == name) && - (identical(other.id, id) || other.id == id) && - (identical(other.manufacturer, manufacturer) || - other.manufacturer == manufacturer) && - (identical(other.releaseDate, releaseDate) || - other.releaseDate == releaseDate) && - (identical(other.processNm, processNm) || - other.processNm == processNm) && - (identical(other.transistorsBillion, transistorsBillion) || - other.transistorsBillion == transistorsBillion) && - (identical(other.cpuConfig, cpuConfig) || - other.cpuConfig == cpuConfig) && - (identical(other.gpuName, gpuName) || other.gpuName == gpuName) && - (identical(other.gpuCores, gpuCores) || - other.gpuCores == gpuCores) && - (identical(other.gpuClockMhz, gpuClockMhz) || - other.gpuClockMhz == gpuClockMhz) && - (identical(other.npuTops, npuTops) || other.npuTops == npuTops) && - (identical(other.modem, modem) || other.modem == modem) && - (identical(other.score, score) || other.score == score) && - (identical(other.verified, verified) || - other.verified == verified) && - const DeepCollectionEquality() - .equals(other._sourceUrls, _sourceUrls) && - (identical(other.url, url) || other.url == url)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - slug, - name, - id, - manufacturer, - releaseDate, - processNm, - transistorsBillion, - cpuConfig, - gpuName, - gpuCores, - gpuClockMhz, - npuTops, - modem, - score, - verified, - const DeepCollectionEquality().hash(_sourceUrls), - url); - - @override - String toString() { - return 'Soc(slug: $slug, name: $name, id: $id, manufacturer: $manufacturer, releaseDate: $releaseDate, processNm: $processNm, transistorsBillion: $transistorsBillion, cpuConfig: $cpuConfig, gpuName: $gpuName, gpuCores: $gpuCores, gpuClockMhz: $gpuClockMhz, npuTops: $npuTops, modem: $modem, score: $score, verified: $verified, sourceUrls: $sourceUrls, url: $url)'; - } } /// @nodoc abstract mixin class _$SocCopyWith<$Res> implements $SocCopyWith<$Res> { - factory _$SocCopyWith(_Soc value, $Res Function(_Soc) _then) = - __$SocCopyWithImpl; - @override - @useResult - $Res call( - {String slug, - String name, - int? id, - Brand? manufacturer, - String? releaseDate, - double? processNm, - double? transistorsBillion, - CpuConfig? cpuConfig, - String? gpuName, - int? gpuCores, - int? gpuClockMhz, - double? npuTops, - String? modem, - SocScore? score, - bool verified, - List sourceUrls, - String? url}); - - @override - $BrandCopyWith<$Res>? get manufacturer; - @override - $CpuConfigCopyWith<$Res>? get cpuConfig; - @override - $SocScoreCopyWith<$Res>? get score; -} + factory _$SocCopyWith(_Soc value, $Res Function(_Soc) _then) = __$SocCopyWithImpl; +@override @useResult +$Res call({ + String slug, String name, int? id, Brand? manufacturer, String? releaseDate, double? processNm, double? transistorsBillion, CpuConfig? cpuConfig, String? gpuName, int? gpuCores, int? gpuClockMhz, double? npuTops, String? modem, SocScore? score, bool verified, List sourceUrls, String? url +}); + + +@override $BrandCopyWith<$Res>? get manufacturer;@override $CpuConfigCopyWith<$Res>? get cpuConfig;@override $SocScoreCopyWith<$Res>? get score; +} /// @nodoc -class __$SocCopyWithImpl<$Res> implements _$SocCopyWith<$Res> { +class __$SocCopyWithImpl<$Res> + implements _$SocCopyWith<$Res> { __$SocCopyWithImpl(this._self, this._then); final _Soc _self; final $Res Function(_Soc) _then; - /// Create a copy of Soc - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $Res call({ - Object? slug = null, - Object? name = null, - Object? id = freezed, - Object? manufacturer = freezed, - Object? releaseDate = freezed, - Object? processNm = freezed, - Object? transistorsBillion = freezed, - Object? cpuConfig = freezed, - Object? gpuName = freezed, - Object? gpuCores = freezed, - Object? gpuClockMhz = freezed, - Object? npuTops = freezed, - Object? modem = freezed, - Object? score = freezed, - Object? verified = null, - Object? sourceUrls = null, - Object? url = freezed, - }) { - return _then(_Soc( - slug: null == slug - ? _self.slug - : slug // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _self.name - : name // ignore: cast_nullable_to_non_nullable - as String, - id: freezed == id - ? _self.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - manufacturer: freezed == manufacturer - ? _self.manufacturer - : manufacturer // ignore: cast_nullable_to_non_nullable - as Brand?, - releaseDate: freezed == releaseDate - ? _self.releaseDate - : releaseDate // ignore: cast_nullable_to_non_nullable - as String?, - processNm: freezed == processNm - ? _self.processNm - : processNm // ignore: cast_nullable_to_non_nullable - as double?, - transistorsBillion: freezed == transistorsBillion - ? _self.transistorsBillion - : transistorsBillion // ignore: cast_nullable_to_non_nullable - as double?, - cpuConfig: freezed == cpuConfig - ? _self.cpuConfig - : cpuConfig // ignore: cast_nullable_to_non_nullable - as CpuConfig?, - gpuName: freezed == gpuName - ? _self.gpuName - : gpuName // ignore: cast_nullable_to_non_nullable - as String?, - gpuCores: freezed == gpuCores - ? _self.gpuCores - : gpuCores // ignore: cast_nullable_to_non_nullable - as int?, - gpuClockMhz: freezed == gpuClockMhz - ? _self.gpuClockMhz - : gpuClockMhz // ignore: cast_nullable_to_non_nullable - as int?, - npuTops: freezed == npuTops - ? _self.npuTops - : npuTops // ignore: cast_nullable_to_non_nullable - as double?, - modem: freezed == modem - ? _self.modem - : modem // ignore: cast_nullable_to_non_nullable - as String?, - score: freezed == score - ? _self.score - : score // ignore: cast_nullable_to_non_nullable - as SocScore?, - verified: null == verified - ? _self.verified - : verified // ignore: cast_nullable_to_non_nullable - as bool, - sourceUrls: null == sourceUrls - ? _self._sourceUrls - : sourceUrls // ignore: cast_nullable_to_non_nullable - as List, - url: freezed == url - ? _self.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +/// Create a copy of Soc +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? slug = null,Object? name = null,Object? id = freezed,Object? manufacturer = freezed,Object? releaseDate = freezed,Object? processNm = freezed,Object? transistorsBillion = freezed,Object? cpuConfig = freezed,Object? gpuName = freezed,Object? gpuCores = freezed,Object? gpuClockMhz = freezed,Object? npuTops = freezed,Object? modem = freezed,Object? score = freezed,Object? verified = null,Object? sourceUrls = null,Object? url = freezed,}) { + return _then(_Soc( +slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable +as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,manufacturer: freezed == manufacturer ? _self.manufacturer : manufacturer // ignore: cast_nullable_to_non_nullable +as Brand?,releaseDate: freezed == releaseDate ? _self.releaseDate : releaseDate // ignore: cast_nullable_to_non_nullable +as String?,processNm: freezed == processNm ? _self.processNm : processNm // ignore: cast_nullable_to_non_nullable +as double?,transistorsBillion: freezed == transistorsBillion ? _self.transistorsBillion : transistorsBillion // ignore: cast_nullable_to_non_nullable +as double?,cpuConfig: freezed == cpuConfig ? _self.cpuConfig : cpuConfig // ignore: cast_nullable_to_non_nullable +as CpuConfig?,gpuName: freezed == gpuName ? _self.gpuName : gpuName // ignore: cast_nullable_to_non_nullable +as String?,gpuCores: freezed == gpuCores ? _self.gpuCores : gpuCores // ignore: cast_nullable_to_non_nullable +as int?,gpuClockMhz: freezed == gpuClockMhz ? _self.gpuClockMhz : gpuClockMhz // ignore: cast_nullable_to_non_nullable +as int?,npuTops: freezed == npuTops ? _self.npuTops : npuTops // ignore: cast_nullable_to_non_nullable +as double?,modem: freezed == modem ? _self.modem : modem // ignore: cast_nullable_to_non_nullable +as String?,score: freezed == score ? _self.score : score // ignore: cast_nullable_to_non_nullable +as SocScore?,verified: null == verified ? _self.verified : verified // ignore: cast_nullable_to_non_nullable +as bool,sourceUrls: null == sourceUrls ? _self._sourceUrls : sourceUrls // ignore: cast_nullable_to_non_nullable +as List,url: freezed == url ? _self.url : url // ignore: cast_nullable_to_non_nullable +as String?, + )); +} - /// Create a copy of Soc - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BrandCopyWith<$Res>? get manufacturer { +/// Create a copy of Soc +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BrandCopyWith<$Res>? get manufacturer { if (_self.manufacturer == null) { - return null; - } - - return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { - return _then(_self.copyWith(manufacturer: value)); - }); + return null; } - /// Create a copy of Soc - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CpuConfigCopyWith<$Res>? get cpuConfig { + return $BrandCopyWith<$Res>(_self.manufacturer!, (value) { + return _then(_self.copyWith(manufacturer: value)); + }); +}/// Create a copy of Soc +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CpuConfigCopyWith<$Res>? get cpuConfig { if (_self.cpuConfig == null) { - return null; - } - - return $CpuConfigCopyWith<$Res>(_self.cpuConfig!, (value) { - return _then(_self.copyWith(cpuConfig: value)); - }); + return null; } - /// Create a copy of Soc - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $SocScoreCopyWith<$Res>? get score { + return $CpuConfigCopyWith<$Res>(_self.cpuConfig!, (value) { + return _then(_self.copyWith(cpuConfig: value)); + }); +}/// Create a copy of Soc +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SocScoreCopyWith<$Res>? get score { if (_self.score == null) { - return null; - } - - return $SocScoreCopyWith<$Res>(_self.score!, (value) { - return _then(_self.copyWith(score: value)); - }); + return null; } + + return $SocScoreCopyWith<$Res>(_self.score!, (value) { + return _then(_self.copyWith(score: value)); + }); +} } // dart format on diff --git a/lib/data/dto/soc.g.dart b/lib/data/dto/soc.g.dart index f8ab3dd..5a4ceed 100644 --- a/lib/data/dto/soc.g.dart +++ b/lib/data/dto/soc.g.dart @@ -7,14 +7,15 @@ part of 'soc.dart'; // ************************************************************************** _CpuConfig _$CpuConfigFromJson(Map json) => _CpuConfig( - performance: (json['performance'] as num?)?.toInt(), - efficiency: (json['efficiency'] as num?)?.toInt(), - architecture: json['architecture'] as String?, - clocksGhz: (json['clocks_ghz'] as List?) - ?.map((e) => (e as num).toDouble()) - .toList() ?? - const [], - ); + performance: (json['performance'] as num?)?.toInt(), + efficiency: (json['efficiency'] as num?)?.toInt(), + architecture: json['architecture'] as String?, + clocksGhz: + (json['clocks_ghz'] as List?) + ?.map((e) => (e as num).toDouble()) + .toList() ?? + const [], +); Map _$CpuConfigToJson(_CpuConfig instance) => { @@ -25,50 +26,51 @@ Map _$CpuConfigToJson(_CpuConfig instance) => }; _Soc _$SocFromJson(Map json) => _Soc( - slug: json['slug'] as String, - name: json['name'] as String, - id: (json['id'] as num?)?.toInt(), - manufacturer: json['manufacturer'] == null - ? null - : Brand.fromJson(json['manufacturer'] as Map), - releaseDate: json['release_date'] as String?, - processNm: (json['process_nm'] as num?)?.toDouble(), - transistorsBillion: (json['transistors_billion'] as num?)?.toDouble(), - cpuConfig: json['cpu_config'] == null - ? null - : CpuConfig.fromJson(json['cpu_config'] as Map), - gpuName: json['gpu_name'] as String?, - gpuCores: (json['gpu_cores'] as num?)?.toInt(), - gpuClockMhz: (json['gpu_clock_mhz'] as num?)?.toInt(), - npuTops: (json['npu_tops'] as num?)?.toDouble(), - modem: json['modem'] as String?, - score: json['score'] == null - ? null - : SocScore.fromJson(json['score'] as Map), - verified: json['verified'] as bool? ?? false, - sourceUrls: (json['source_urls'] as List?) - ?.map((e) => e as String) - .toList() ?? - const [], - url: json['url'] as String?, - ); + slug: json['slug'] as String, + name: json['name'] as String, + id: (json['id'] as num?)?.toInt(), + manufacturer: json['manufacturer'] == null + ? null + : Brand.fromJson(json['manufacturer'] as Map), + releaseDate: json['release_date'] as String?, + processNm: (json['process_nm'] as num?)?.toDouble(), + transistorsBillion: (json['transistors_billion'] as num?)?.toDouble(), + cpuConfig: json['cpu_config'] == null + ? null + : CpuConfig.fromJson(json['cpu_config'] as Map), + gpuName: json['gpu_name'] as String?, + gpuCores: (json['gpu_cores'] as num?)?.toInt(), + gpuClockMhz: (json['gpu_clock_mhz'] as num?)?.toInt(), + npuTops: (json['npu_tops'] as num?)?.toDouble(), + modem: json['modem'] as String?, + score: json['score'] == null + ? null + : SocScore.fromJson(json['score'] as Map), + verified: json['verified'] as bool? ?? false, + sourceUrls: + (json['source_urls'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], + url: json['url'] as String?, +); Map _$SocToJson(_Soc instance) => { - 'slug': instance.slug, - 'name': instance.name, - 'id': instance.id, - 'manufacturer': instance.manufacturer?.toJson(), - 'release_date': instance.releaseDate, - 'process_nm': instance.processNm, - 'transistors_billion': instance.transistorsBillion, - 'cpu_config': instance.cpuConfig?.toJson(), - 'gpu_name': instance.gpuName, - 'gpu_cores': instance.gpuCores, - 'gpu_clock_mhz': instance.gpuClockMhz, - 'npu_tops': instance.npuTops, - 'modem': instance.modem, - 'score': instance.score?.toJson(), - 'verified': instance.verified, - 'source_urls': instance.sourceUrls, - 'url': instance.url, - }; + 'slug': instance.slug, + 'name': instance.name, + 'id': instance.id, + 'manufacturer': instance.manufacturer?.toJson(), + 'release_date': instance.releaseDate, + 'process_nm': instance.processNm, + 'transistors_billion': instance.transistorsBillion, + 'cpu_config': instance.cpuConfig?.toJson(), + 'gpu_name': instance.gpuName, + 'gpu_cores': instance.gpuCores, + 'gpu_clock_mhz': instance.gpuClockMhz, + 'npu_tops': instance.npuTops, + 'modem': instance.modem, + 'score': instance.score?.toJson(), + 'verified': instance.verified, + 'source_urls': instance.sourceUrls, + 'url': instance.url, +};