From 03c941c970e3e9cdf1e0a7347ea099e1760ad1d6 Mon Sep 17 00:00:00 2001 From: xkeyC <3334969096@qq.com> Date: Sun, 4 May 2025 14:07:56 +0800 Subject: [PATCH] feat: 42kit Nav feat: Animation Optimization --- analysis_options.yaml | 6 +- lib/api/udb.dart | 14 + lib/app.g.dart | 2 +- lib/common/utils/file_cache_utils.dart | 101 + lib/data/nav_api_data.dart | 246 + lib/data/nav_api_data.freezed.dart | 3959 +++++++++++++++++ lib/data/nav_api_data.g.dart | 336 ++ lib/ui/about/about_ui.dart | 111 +- .../advanced_localization_ui.dart | 240 +- .../localization/localization_dialog_ui.dart | 271 +- lib/ui/index_ui.dart | 22 +- lib/ui/nav/nav_state.dart | 41 + lib/ui/nav/nav_state.freezed.dart | 173 + lib/ui/nav/nav_state.g.dart | 24 + lib/ui/nav/nav_ui.dart | 203 + lib/ui/tools/tools_ui.dart | 172 +- lib/ui/tools/tools_ui_model.g.dart | 2 +- lib/widgets/src/cache_image.dart | 27 +- lib/widgets/src/cache_svg_image.dart | 64 + lib/widgets/src/grid_item_animator.dart | 71 + lib/widgets/widgets.dart | 20 +- pubspec.lock | 4 +- pubspec.yaml | 2 + 23 files changed, 5618 insertions(+), 493 deletions(-) create mode 100644 lib/api/udb.dart create mode 100644 lib/common/utils/file_cache_utils.dart create mode 100644 lib/data/nav_api_data.dart create mode 100644 lib/data/nav_api_data.freezed.dart create mode 100644 lib/data/nav_api_data.g.dart create mode 100644 lib/ui/nav/nav_state.dart create mode 100644 lib/ui/nav/nav_state.freezed.dart create mode 100644 lib/ui/nav/nav_state.g.dart create mode 100644 lib/ui/nav/nav_ui.dart create mode 100644 lib/widgets/src/cache_svg_image.dart create mode 100644 lib/widgets/src/grid_item_animator.dart diff --git a/analysis_options.yaml b/analysis_options.yaml index 7f789a0..ac13dd4 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -29,6 +29,10 @@ linter: analyzer: plugins: - custom_lint - + exclude: + - "**/*.g.dart" + - "**/*.freezed.dart" + errors: + invalid_annotation_target: ignore # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options diff --git a/lib/api/udb.dart b/lib/api/udb.dart new file mode 100644 index 0000000..b0fb48a --- /dev/null +++ b/lib/api/udb.dart @@ -0,0 +1,14 @@ +import 'dart:convert'; + +import 'package:starcitizen_doctor/common/io/rs_http.dart'; +import 'package:starcitizen_doctor/data/nav_api_data.dart'; + +class UDBNavApi { + static Future getNavItems({int pageNo = 1}) async { + final r = await RSHttp.getText( + "https://payload.citizenwiki.cn/api/community-navs?sort=is_sponsored&depth=2&page=$pageNo&limit=1000"); + if (r.isEmpty) throw "Network Error"; + final result = NavApiData.fromJson(jsonDecode(r)); + return result; + } +} diff --git a/lib/app.g.dart b/lib/app.g.dart index 136ce31..b097aa9 100644 --- a/lib/app.g.dart +++ b/lib/app.g.dart @@ -22,7 +22,7 @@ final routerProvider = AutoDisposeProvider.internal( @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element typedef RouterRef = AutoDisposeProviderRef; -String _$appGlobalModelHash() => r'8aa468bda409c425a76e3ef9e7739ca4ed055d2b'; +String _$appGlobalModelHash() => r'eb06413ab3a70f26712d897cee745ee62e89e75e'; /// See also [AppGlobalModel]. @ProviderFor(AppGlobalModel) diff --git a/lib/common/utils/file_cache_utils.dart b/lib/common/utils/file_cache_utils.dart new file mode 100644 index 0000000..98180ba --- /dev/null +++ b/lib/common/utils/file_cache_utils.dart @@ -0,0 +1,101 @@ +import 'dart:io'; +import 'package:flutter/foundation.dart'; +import 'package:path/path.dart' as path; +import 'package:path_provider/path_provider.dart'; +import 'dart:convert'; +import 'package:crypto/crypto.dart'; +import 'package:starcitizen_doctor/common/io/rs_http.dart'; + +class FileCacheUtils { + // 存储正在进行的下载任务 + static final Map> _downloadingTasks = {}; + + // 缓存目录 + static Directory? _cacheDir; + + /// 获取缓存目录 + static Future _getCacheDirectory() async { + if (_cacheDir != null) return _cacheDir!; + + final tempDir = await getTemporaryDirectory(); + _cacheDir = Directory(path.join(tempDir.path, 'ScToolbox_File_Cache')); + + if (!await _cacheDir!.exists()) { + await _cacheDir!.create(recursive: true); + } + + return _cacheDir!; + } + + /// 从URL获取文件,如果已经在下载中,则共享同一个下载任务 + static Future getFile(String url) async { + // 如果已经在下载中,直接返回正在进行的下载任务 + if (_downloadingTasks.containsKey(url)) { + return _downloadingTasks[url]!; + } + + final fileTask = _downloadFile(url); + _downloadingTasks[url] = fileTask; + + try { + final file = await fileTask; + return file; + } finally { + // 无论成功失败,下载完成后从任务列表中移除 + _downloadingTasks.remove(url); + } + } + + /// 实际进行下载的方法 + static Future _downloadFile(String url) async { + // 生成文件名 (使用URL的MD5哈希作为文件名) + final filename = md5.convert(utf8.encode(url)).toString(); + final cacheDir = await _getCacheDirectory(); + final file = File(path.join(cacheDir.path, filename)); + + // 检查文件是否已经存在 + if (await file.exists()) { + return file; + } + + // 下载文件 + final response = await RSHttp.get(url); + + if (response.statusCode == 200) { + await file.writeAsBytes(response.data ?? []); + return file; + } else { + throw Exception('Failed to download file: ${response.statusCode}'); + } + } + + /// 清除特定URL的缓存 + static Future clearCache(String url) async { + try { + final filename = md5.convert(utf8.encode(url)).toString(); + final cacheDir = await _getCacheDirectory(); + final file = File(path.join(cacheDir.path, filename)); + + if (await file.exists()) { + await file.delete(); + return true; + } + return false; + } catch (e) { + return false; + } + } + + /// 清除所有缓存 + static Future clearAllCache() async { + try { + final cacheDir = await _getCacheDirectory(); + if (await cacheDir.exists()) { + await cacheDir.delete(recursive: true); + await cacheDir.create(); + } + } catch (e) { + debugPrint('清除缓存失败: $e'); + } + } +} diff --git a/lib/data/nav_api_data.dart b/lib/data/nav_api_data.dart new file mode 100644 index 0000000..4229039 --- /dev/null +++ b/lib/data/nav_api_data.dart @@ -0,0 +1,246 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'nav_api_data.freezed.dart'; + +part 'nav_api_data.g.dart'; + +@freezed +class NavApiDocsItemData with _$NavApiDocsItemData { + const factory NavApiDocsItemData({ + @Default('') @JsonKey(name: 'id') String id, + @Default('') @JsonKey(name: 'name') String name, + @Default('') @JsonKey(name: 'slug') String slug, + @Default('') @JsonKey(name: 'abstract') String abstract_, + @Default('') @JsonKey(name: 'description') String description, + @Default(NavApiDocsItemImageData()) + @JsonKey(name: 'image') + NavApiDocsItemImageData image, + @Default('') @JsonKey(name: 'link') String link, + @Default(false) @JsonKey(name: 'is_sponsored') bool isSponsored, + @Default([]) + @JsonKey(name: 'tags') + List tags, + @Default('') @JsonKey(name: 'updatedAt') String updatedAt, + @Default('') @JsonKey(name: 'createdAt') String createdAt, + }) = _NavApiDocsItemData; + + const NavApiDocsItemData._(); + + factory NavApiDocsItemData.fromJson(Map json) => + _$NavApiDocsItemDataFromJson(json); +} + +@freezed +class NavApiDocsItemImageData with _$NavApiDocsItemImageData { + const factory NavApiDocsItemImageData({ + @Default('') @JsonKey(name: 'id') String id, + @Default(NavApiDocsItemImageCreatedByData()) + @JsonKey(name: 'createdBy') + NavApiDocsItemImageCreatedByData createdBy, + @Default('') @JsonKey(name: 'title') String title, + @Default(false) @JsonKey(name: 'original') bool original, + @Default('') @JsonKey(name: 'credit') String credit, + @Default('') @JsonKey(name: 'source') String source, + @Default('') @JsonKey(name: 'license') String license, + @JsonKey(name: 'caption') dynamic caption, + @Default('') @JsonKey(name: 'updatedAt') String updatedAt, + @Default('') @JsonKey(name: 'createdAt') String createdAt, + @Default('') @JsonKey(name: 'url') String url, + @Default('') @JsonKey(name: 'filename') String filename, + @Default('') @JsonKey(name: 'mimeType') String mimeType, + @Default(0) @JsonKey(name: 'filesize') int filesize, + @Default(0) @JsonKey(name: 'width') int width, + @Default(0) @JsonKey(name: 'height') int height, + @Default(NavApiDocsItemImageSizesData()) + @JsonKey(name: 'sizes') + NavApiDocsItemImageSizesData sizes, + }) = _NavApiDocsItemImageData; + + const NavApiDocsItemImageData._(); + + factory NavApiDocsItemImageData.fromJson(Map json) => + _$NavApiDocsItemImageDataFromJson(json); +} + +@freezed +class NavApiDocsItemImageCreatedByData with _$NavApiDocsItemImageCreatedByData { + const factory NavApiDocsItemImageCreatedByData({ + @Default('') @JsonKey(name: 'id') String id, + @Default('') @JsonKey(name: 'sub') String sub, + @Default('') @JsonKey(name: 'external_provider') String externalProvider, + @Default('') @JsonKey(name: 'username') String username, + @Default('') @JsonKey(name: 'name') String name, + @Default([]) @JsonKey(name: 'roles') List roles, + @Default('') @JsonKey(name: 'avatar_url') String avatarUrl, + @Default('') @JsonKey(name: 'updatedAt') String updatedAt, + @Default('') @JsonKey(name: 'createdAt') String createdAt, + @Default('') @JsonKey(name: 'email') String email, + @Default(0) @JsonKey(name: 'loginAttempts') int loginAttempts, + @Default('') @JsonKey(name: 'avatar') String avatar, + }) = _NavApiDocsItemImageCreatedByData; + + const NavApiDocsItemImageCreatedByData._(); + + factory NavApiDocsItemImageCreatedByData.fromJson( + Map json) => + _$NavApiDocsItemImageCreatedByDataFromJson(json); +} + +@freezed +class NavApiDocsItemImageSizesThumbnailData + with _$NavApiDocsItemImageSizesThumbnailData { + const factory NavApiDocsItemImageSizesThumbnailData({ + @Default('') @JsonKey(name: 'url') String url, + @Default(0) @JsonKey(name: 'width') int width, + @Default(0) @JsonKey(name: 'height') int height, + @Default('') @JsonKey(name: 'mimeType') String mimeType, + @Default(0) @JsonKey(name: 'filesize') int filesize, + @Default('') @JsonKey(name: 'filename') String filename, + }) = _NavApiDocsItemImageSizesThumbnailData; + + const NavApiDocsItemImageSizesThumbnailData._(); + + factory NavApiDocsItemImageSizesThumbnailData.fromJson( + Map json) => + _$NavApiDocsItemImageSizesThumbnailDataFromJson(json); +} + +@freezed +class NavApiDocsItemImageSizesData with _$NavApiDocsItemImageSizesData { + const factory NavApiDocsItemImageSizesData({ + @Default(NavApiDocsItemImageSizesThumbnailData()) + @JsonKey(name: 'thumbnail') + NavApiDocsItemImageSizesThumbnailData thumbnail, + @Default(NavApiDocsItemImageSizesPreloadData()) + @JsonKey(name: 'preload') + NavApiDocsItemImageSizesPreloadData preload, + @Default(NavApiDocsItemImageSizesCardData()) + @JsonKey(name: 'card') + NavApiDocsItemImageSizesCardData card, + @Default(NavApiDocsItemImageSizesTabletData()) + @JsonKey(name: 'tablet') + NavApiDocsItemImageSizesTabletData tablet, + @Default(NavApiDocsItemImageSizesAvatarData()) + @JsonKey(name: 'avatar') + NavApiDocsItemImageSizesAvatarData avatar, + }) = _NavApiDocsItemImageSizesData; + + const NavApiDocsItemImageSizesData._(); + + factory NavApiDocsItemImageSizesData.fromJson(Map json) => + _$NavApiDocsItemImageSizesDataFromJson(json); +} + +@freezed +class NavApiDocsItemImageSizesPreloadData + with _$NavApiDocsItemImageSizesPreloadData { + const factory NavApiDocsItemImageSizesPreloadData({ + @JsonKey(name: 'url') dynamic url, + @JsonKey(name: 'width') dynamic width, + @JsonKey(name: 'height') dynamic height, + @JsonKey(name: 'mimeType') dynamic mimeType, + @JsonKey(name: 'filesize') dynamic filesize, + @JsonKey(name: 'filename') dynamic filename, + }) = _NavApiDocsItemImageSizesPreloadData; + + const NavApiDocsItemImageSizesPreloadData._(); + + factory NavApiDocsItemImageSizesPreloadData.fromJson( + Map json) => + _$NavApiDocsItemImageSizesPreloadDataFromJson(json); +} + +@freezed +class NavApiDocsItemImageSizesCardData with _$NavApiDocsItemImageSizesCardData { + const factory NavApiDocsItemImageSizesCardData({ + @Default('') @JsonKey(name: 'url') String url, + @Default(0) @JsonKey(name: 'width') int width, + @Default(0) @JsonKey(name: 'height') int height, + @Default('') @JsonKey(name: 'mimeType') String mimeType, + @Default(0) @JsonKey(name: 'filesize') int filesize, + @Default('') @JsonKey(name: 'filename') String filename, + }) = _NavApiDocsItemImageSizesCardData; + + const NavApiDocsItemImageSizesCardData._(); + + factory NavApiDocsItemImageSizesCardData.fromJson( + Map json) => + _$NavApiDocsItemImageSizesCardDataFromJson(json); +} + +@freezed +class NavApiDocsItemImageSizesTabletData + with _$NavApiDocsItemImageSizesTabletData { + const factory NavApiDocsItemImageSizesTabletData({ + @Default('') @JsonKey(name: 'url') String url, + @Default(0) @JsonKey(name: 'width') int width, + @Default(0) @JsonKey(name: 'height') int height, + @Default('') @JsonKey(name: 'mimeType') String mimeType, + @Default(0) @JsonKey(name: 'filesize') int filesize, + @Default('') @JsonKey(name: 'filename') String filename, + }) = _NavApiDocsItemImageSizesTabletData; + + const NavApiDocsItemImageSizesTabletData._(); + + factory NavApiDocsItemImageSizesTabletData.fromJson( + Map json) => + _$NavApiDocsItemImageSizesTabletDataFromJson(json); +} + +@freezed +class NavApiDocsItemImageSizesAvatarData + with _$NavApiDocsItemImageSizesAvatarData { + const factory NavApiDocsItemImageSizesAvatarData({ + @Default('') @JsonKey(name: 'url') String url, + @Default(0) @JsonKey(name: 'width') int width, + @Default(0) @JsonKey(name: 'height') int height, + @Default('') @JsonKey(name: 'mimeType') String mimeType, + @Default(0) @JsonKey(name: 'filesize') int filesize, + @Default('') @JsonKey(name: 'filename') String filename, + }) = _NavApiDocsItemImageSizesAvatarData; + + const NavApiDocsItemImageSizesAvatarData._(); + + factory NavApiDocsItemImageSizesAvatarData.fromJson( + Map json) => + _$NavApiDocsItemImageSizesAvatarDataFromJson(json); +} + +@freezed +class NavApiDocsItemTagsItemData with _$NavApiDocsItemTagsItemData { + const factory NavApiDocsItemTagsItemData({ + @Default('') @JsonKey(name: 'id') String id, + @Default('') @JsonKey(name: 'name') String name, + @Default('') @JsonKey(name: 'slug') String slug, + @Default('') @JsonKey(name: 'updatedAt') String updatedAt, + @Default('') @JsonKey(name: 'createdAt') String createdAt, + }) = _NavApiDocsItemTagsItemData; + + const NavApiDocsItemTagsItemData._(); + + factory NavApiDocsItemTagsItemData.fromJson(Map json) => + _$NavApiDocsItemTagsItemDataFromJson(json); +} + +@freezed +class NavApiData with _$NavApiData { + const factory NavApiData({ + @Default([]) + @JsonKey(name: 'docs') + List docs, + @Default(false) @JsonKey(name: 'hasNextPage') bool hasNextPage, + @Default(false) @JsonKey(name: 'hasPrevPage') bool hasPrevPage, + @Default(0) @JsonKey(name: 'limit') int limit, + @JsonKey(name: 'nextPage') dynamic nextPage, + @Default(0) @JsonKey(name: 'page') int page, + @Default(0) @JsonKey(name: 'pagingCounter') int pagingCounter, + @JsonKey(name: 'prevPage') dynamic prevPage, + @Default(0) @JsonKey(name: 'totalDocs') int totalDocs, + @Default(0) @JsonKey(name: 'totalPages') int totalPages, + }) = _NavApiData; + + const NavApiData._(); + + factory NavApiData.fromJson(Map json) => + _$NavApiDataFromJson(json); +} diff --git a/lib/data/nav_api_data.freezed.dart b/lib/data/nav_api_data.freezed.dart new file mode 100644 index 0000000..1fd55ae --- /dev/null +++ b/lib/data/nav_api_data.freezed.dart @@ -0,0 +1,3959 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// 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 'nav_api_data.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +NavApiDocsItemData _$NavApiDocsItemDataFromJson(Map json) { + return _NavApiDocsItemData.fromJson(json); +} + +/// @nodoc +mixin _$NavApiDocsItemData { + @JsonKey(name: 'id') + String get id => throw _privateConstructorUsedError; + @JsonKey(name: 'name') + String get name => throw _privateConstructorUsedError; + @JsonKey(name: 'slug') + String get slug => throw _privateConstructorUsedError; + @JsonKey(name: 'abstract') + String get abstract_ => throw _privateConstructorUsedError; + @JsonKey(name: 'description') + String get description => throw _privateConstructorUsedError; + @JsonKey(name: 'image') + NavApiDocsItemImageData get image => throw _privateConstructorUsedError; + @JsonKey(name: 'link') + String get link => throw _privateConstructorUsedError; + @JsonKey(name: 'is_sponsored') + bool get isSponsored => throw _privateConstructorUsedError; + @JsonKey(name: 'tags') + List get tags => + throw _privateConstructorUsedError; + @JsonKey(name: 'updatedAt') + String get updatedAt => throw _privateConstructorUsedError; + @JsonKey(name: 'createdAt') + String get createdAt => throw _privateConstructorUsedError; + + /// Serializes this NavApiDocsItemData to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of NavApiDocsItemData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $NavApiDocsItemDataCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $NavApiDocsItemDataCopyWith<$Res> { + factory $NavApiDocsItemDataCopyWith( + NavApiDocsItemData value, $Res Function(NavApiDocsItemData) then) = + _$NavApiDocsItemDataCopyWithImpl<$Res, NavApiDocsItemData>; + @useResult + $Res call( + {@JsonKey(name: 'id') String id, + @JsonKey(name: 'name') String name, + @JsonKey(name: 'slug') String slug, + @JsonKey(name: 'abstract') String abstract_, + @JsonKey(name: 'description') String description, + @JsonKey(name: 'image') NavApiDocsItemImageData image, + @JsonKey(name: 'link') String link, + @JsonKey(name: 'is_sponsored') bool isSponsored, + @JsonKey(name: 'tags') List tags, + @JsonKey(name: 'updatedAt') String updatedAt, + @JsonKey(name: 'createdAt') String createdAt}); + + $NavApiDocsItemImageDataCopyWith<$Res> get image; +} + +/// @nodoc +class _$NavApiDocsItemDataCopyWithImpl<$Res, $Val extends NavApiDocsItemData> + implements $NavApiDocsItemDataCopyWith<$Res> { + _$NavApiDocsItemDataCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of NavApiDocsItemData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? slug = null, + Object? abstract_ = null, + Object? description = null, + Object? image = null, + Object? link = null, + Object? isSponsored = null, + Object? tags = null, + Object? updatedAt = null, + Object? createdAt = null, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + slug: null == slug + ? _value.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + abstract_: null == abstract_ + ? _value.abstract_ + : abstract_ // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + image: null == image + ? _value.image + : image // ignore: cast_nullable_to_non_nullable + as NavApiDocsItemImageData, + link: null == link + ? _value.link + : link // ignore: cast_nullable_to_non_nullable + as String, + isSponsored: null == isSponsored + ? _value.isSponsored + : isSponsored // ignore: cast_nullable_to_non_nullable + as bool, + tags: null == tags + ? _value.tags + : tags // ignore: cast_nullable_to_non_nullable + as List, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as String, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as String, + ) as $Val); + } + + /// Create a copy of NavApiDocsItemData + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $NavApiDocsItemImageDataCopyWith<$Res> get image { + return $NavApiDocsItemImageDataCopyWith<$Res>(_value.image, (value) { + return _then(_value.copyWith(image: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$NavApiDocsItemDataImplCopyWith<$Res> + implements $NavApiDocsItemDataCopyWith<$Res> { + factory _$$NavApiDocsItemDataImplCopyWith(_$NavApiDocsItemDataImpl value, + $Res Function(_$NavApiDocsItemDataImpl) then) = + __$$NavApiDocsItemDataImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: 'id') String id, + @JsonKey(name: 'name') String name, + @JsonKey(name: 'slug') String slug, + @JsonKey(name: 'abstract') String abstract_, + @JsonKey(name: 'description') String description, + @JsonKey(name: 'image') NavApiDocsItemImageData image, + @JsonKey(name: 'link') String link, + @JsonKey(name: 'is_sponsored') bool isSponsored, + @JsonKey(name: 'tags') List tags, + @JsonKey(name: 'updatedAt') String updatedAt, + @JsonKey(name: 'createdAt') String createdAt}); + + @override + $NavApiDocsItemImageDataCopyWith<$Res> get image; +} + +/// @nodoc +class __$$NavApiDocsItemDataImplCopyWithImpl<$Res> + extends _$NavApiDocsItemDataCopyWithImpl<$Res, _$NavApiDocsItemDataImpl> + implements _$$NavApiDocsItemDataImplCopyWith<$Res> { + __$$NavApiDocsItemDataImplCopyWithImpl(_$NavApiDocsItemDataImpl _value, + $Res Function(_$NavApiDocsItemDataImpl) _then) + : super(_value, _then); + + /// Create a copy of NavApiDocsItemData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? slug = null, + Object? abstract_ = null, + Object? description = null, + Object? image = null, + Object? link = null, + Object? isSponsored = null, + Object? tags = null, + Object? updatedAt = null, + Object? createdAt = null, + }) { + return _then(_$NavApiDocsItemDataImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + slug: null == slug + ? _value.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + abstract_: null == abstract_ + ? _value.abstract_ + : abstract_ // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + image: null == image + ? _value.image + : image // ignore: cast_nullable_to_non_nullable + as NavApiDocsItemImageData, + link: null == link + ? _value.link + : link // ignore: cast_nullable_to_non_nullable + as String, + isSponsored: null == isSponsored + ? _value.isSponsored + : isSponsored // ignore: cast_nullable_to_non_nullable + as bool, + tags: null == tags + ? _value._tags + : tags // ignore: cast_nullable_to_non_nullable + as List, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as String, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$NavApiDocsItemDataImpl extends _NavApiDocsItemData { + const _$NavApiDocsItemDataImpl( + {@JsonKey(name: 'id') this.id = '', + @JsonKey(name: 'name') this.name = '', + @JsonKey(name: 'slug') this.slug = '', + @JsonKey(name: 'abstract') this.abstract_ = '', + @JsonKey(name: 'description') this.description = '', + @JsonKey(name: 'image') this.image = const NavApiDocsItemImageData(), + @JsonKey(name: 'link') this.link = '', + @JsonKey(name: 'is_sponsored') this.isSponsored = false, + @JsonKey(name: 'tags') final List tags = + const [], + @JsonKey(name: 'updatedAt') this.updatedAt = '', + @JsonKey(name: 'createdAt') this.createdAt = ''}) + : _tags = tags, + super._(); + + factory _$NavApiDocsItemDataImpl.fromJson(Map json) => + _$$NavApiDocsItemDataImplFromJson(json); + + @override + @JsonKey(name: 'id') + final String id; + @override + @JsonKey(name: 'name') + final String name; + @override + @JsonKey(name: 'slug') + final String slug; + @override + @JsonKey(name: 'abstract') + final String abstract_; + @override + @JsonKey(name: 'description') + final String description; + @override + @JsonKey(name: 'image') + final NavApiDocsItemImageData image; + @override + @JsonKey(name: 'link') + final String link; + @override + @JsonKey(name: 'is_sponsored') + final bool isSponsored; + final List _tags; + @override + @JsonKey(name: 'tags') + List get tags { + if (_tags is EqualUnmodifiableListView) return _tags; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_tags); + } + + @override + @JsonKey(name: 'updatedAt') + final String updatedAt; + @override + @JsonKey(name: 'createdAt') + final String createdAt; + + @override + String toString() { + return 'NavApiDocsItemData(id: $id, name: $name, slug: $slug, abstract_: $abstract_, description: $description, image: $image, link: $link, isSponsored: $isSponsored, tags: $tags, updatedAt: $updatedAt, createdAt: $createdAt)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NavApiDocsItemDataImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.name, name) || other.name == name) && + (identical(other.slug, slug) || other.slug == slug) && + (identical(other.abstract_, abstract_) || + other.abstract_ == abstract_) && + (identical(other.description, description) || + other.description == description) && + (identical(other.image, image) || other.image == image) && + (identical(other.link, link) || other.link == link) && + (identical(other.isSponsored, isSponsored) || + other.isSponsored == isSponsored) && + const DeepCollectionEquality().equals(other._tags, _tags) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + id, + name, + slug, + abstract_, + description, + image, + link, + isSponsored, + const DeepCollectionEquality().hash(_tags), + updatedAt, + createdAt); + + /// Create a copy of NavApiDocsItemData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$NavApiDocsItemDataImplCopyWith<_$NavApiDocsItemDataImpl> get copyWith => + __$$NavApiDocsItemDataImplCopyWithImpl<_$NavApiDocsItemDataImpl>( + this, _$identity); + + @override + Map toJson() { + return _$$NavApiDocsItemDataImplToJson( + this, + ); + } +} + +abstract class _NavApiDocsItemData extends NavApiDocsItemData { + const factory _NavApiDocsItemData( + {@JsonKey(name: 'id') final String id, + @JsonKey(name: 'name') final String name, + @JsonKey(name: 'slug') final String slug, + @JsonKey(name: 'abstract') final String abstract_, + @JsonKey(name: 'description') final String description, + @JsonKey(name: 'image') final NavApiDocsItemImageData image, + @JsonKey(name: 'link') final String link, + @JsonKey(name: 'is_sponsored') final bool isSponsored, + @JsonKey(name: 'tags') final List tags, + @JsonKey(name: 'updatedAt') final String updatedAt, + @JsonKey(name: 'createdAt') final String createdAt}) = + _$NavApiDocsItemDataImpl; + const _NavApiDocsItemData._() : super._(); + + factory _NavApiDocsItemData.fromJson(Map json) = + _$NavApiDocsItemDataImpl.fromJson; + + @override + @JsonKey(name: 'id') + String get id; + @override + @JsonKey(name: 'name') + String get name; + @override + @JsonKey(name: 'slug') + String get slug; + @override + @JsonKey(name: 'abstract') + String get abstract_; + @override + @JsonKey(name: 'description') + String get description; + @override + @JsonKey(name: 'image') + NavApiDocsItemImageData get image; + @override + @JsonKey(name: 'link') + String get link; + @override + @JsonKey(name: 'is_sponsored') + bool get isSponsored; + @override + @JsonKey(name: 'tags') + List get tags; + @override + @JsonKey(name: 'updatedAt') + String get updatedAt; + @override + @JsonKey(name: 'createdAt') + String get createdAt; + + /// Create a copy of NavApiDocsItemData + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$NavApiDocsItemDataImplCopyWith<_$NavApiDocsItemDataImpl> get copyWith => + throw _privateConstructorUsedError; +} + +NavApiDocsItemImageData _$NavApiDocsItemImageDataFromJson( + Map json) { + return _NavApiDocsItemImageData.fromJson(json); +} + +/// @nodoc +mixin _$NavApiDocsItemImageData { + @JsonKey(name: 'id') + String get id => throw _privateConstructorUsedError; + @JsonKey(name: 'createdBy') + NavApiDocsItemImageCreatedByData get createdBy => + throw _privateConstructorUsedError; + @JsonKey(name: 'title') + String get title => throw _privateConstructorUsedError; + @JsonKey(name: 'original') + bool get original => throw _privateConstructorUsedError; + @JsonKey(name: 'credit') + String get credit => throw _privateConstructorUsedError; + @JsonKey(name: 'source') + String get source => throw _privateConstructorUsedError; + @JsonKey(name: 'license') + String get license => throw _privateConstructorUsedError; + @JsonKey(name: 'caption') + dynamic get caption => throw _privateConstructorUsedError; + @JsonKey(name: 'updatedAt') + String get updatedAt => throw _privateConstructorUsedError; + @JsonKey(name: 'createdAt') + String get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: 'url') + String get url => throw _privateConstructorUsedError; + @JsonKey(name: 'filename') + String get filename => throw _privateConstructorUsedError; + @JsonKey(name: 'mimeType') + String get mimeType => throw _privateConstructorUsedError; + @JsonKey(name: 'filesize') + int get filesize => throw _privateConstructorUsedError; + @JsonKey(name: 'width') + int get width => throw _privateConstructorUsedError; + @JsonKey(name: 'height') + int get height => throw _privateConstructorUsedError; + @JsonKey(name: 'sizes') + NavApiDocsItemImageSizesData get sizes => throw _privateConstructorUsedError; + + /// Serializes this NavApiDocsItemImageData to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of NavApiDocsItemImageData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $NavApiDocsItemImageDataCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $NavApiDocsItemImageDataCopyWith<$Res> { + factory $NavApiDocsItemImageDataCopyWith(NavApiDocsItemImageData value, + $Res Function(NavApiDocsItemImageData) then) = + _$NavApiDocsItemImageDataCopyWithImpl<$Res, NavApiDocsItemImageData>; + @useResult + $Res call( + {@JsonKey(name: 'id') String id, + @JsonKey(name: 'createdBy') NavApiDocsItemImageCreatedByData createdBy, + @JsonKey(name: 'title') String title, + @JsonKey(name: 'original') bool original, + @JsonKey(name: 'credit') String credit, + @JsonKey(name: 'source') String source, + @JsonKey(name: 'license') String license, + @JsonKey(name: 'caption') dynamic caption, + @JsonKey(name: 'updatedAt') String updatedAt, + @JsonKey(name: 'createdAt') String createdAt, + @JsonKey(name: 'url') String url, + @JsonKey(name: 'filename') String filename, + @JsonKey(name: 'mimeType') String mimeType, + @JsonKey(name: 'filesize') int filesize, + @JsonKey(name: 'width') int width, + @JsonKey(name: 'height') int height, + @JsonKey(name: 'sizes') NavApiDocsItemImageSizesData sizes}); + + $NavApiDocsItemImageCreatedByDataCopyWith<$Res> get createdBy; + $NavApiDocsItemImageSizesDataCopyWith<$Res> get sizes; +} + +/// @nodoc +class _$NavApiDocsItemImageDataCopyWithImpl<$Res, + $Val extends NavApiDocsItemImageData> + implements $NavApiDocsItemImageDataCopyWith<$Res> { + _$NavApiDocsItemImageDataCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of NavApiDocsItemImageData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? createdBy = null, + Object? title = null, + Object? original = null, + Object? credit = null, + Object? source = null, + Object? license = null, + Object? caption = freezed, + Object? updatedAt = null, + Object? createdAt = null, + Object? url = null, + Object? filename = null, + Object? mimeType = null, + Object? filesize = null, + Object? width = null, + Object? height = null, + Object? sizes = null, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + createdBy: null == createdBy + ? _value.createdBy + : createdBy // ignore: cast_nullable_to_non_nullable + as NavApiDocsItemImageCreatedByData, + title: null == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String, + original: null == original + ? _value.original + : original // ignore: cast_nullable_to_non_nullable + as bool, + credit: null == credit + ? _value.credit + : credit // ignore: cast_nullable_to_non_nullable + as String, + source: null == source + ? _value.source + : source // ignore: cast_nullable_to_non_nullable + as String, + license: null == license + ? _value.license + : license // ignore: cast_nullable_to_non_nullable + as String, + caption: freezed == caption + ? _value.caption + : caption // ignore: cast_nullable_to_non_nullable + as dynamic, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as String, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as String, + url: null == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String, + filename: null == filename + ? _value.filename + : filename // ignore: cast_nullable_to_non_nullable + as String, + mimeType: null == mimeType + ? _value.mimeType + : mimeType // ignore: cast_nullable_to_non_nullable + as String, + filesize: null == filesize + ? _value.filesize + : filesize // ignore: cast_nullable_to_non_nullable + as int, + width: null == width + ? _value.width + : width // ignore: cast_nullable_to_non_nullable + as int, + height: null == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as int, + sizes: null == sizes + ? _value.sizes + : sizes // ignore: cast_nullable_to_non_nullable + as NavApiDocsItemImageSizesData, + ) as $Val); + } + + /// Create a copy of NavApiDocsItemImageData + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $NavApiDocsItemImageCreatedByDataCopyWith<$Res> get createdBy { + return $NavApiDocsItemImageCreatedByDataCopyWith<$Res>(_value.createdBy, + (value) { + return _then(_value.copyWith(createdBy: value) as $Val); + }); + } + + /// Create a copy of NavApiDocsItemImageData + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $NavApiDocsItemImageSizesDataCopyWith<$Res> get sizes { + return $NavApiDocsItemImageSizesDataCopyWith<$Res>(_value.sizes, (value) { + return _then(_value.copyWith(sizes: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$NavApiDocsItemImageDataImplCopyWith<$Res> + implements $NavApiDocsItemImageDataCopyWith<$Res> { + factory _$$NavApiDocsItemImageDataImplCopyWith( + _$NavApiDocsItemImageDataImpl value, + $Res Function(_$NavApiDocsItemImageDataImpl) then) = + __$$NavApiDocsItemImageDataImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: 'id') String id, + @JsonKey(name: 'createdBy') NavApiDocsItemImageCreatedByData createdBy, + @JsonKey(name: 'title') String title, + @JsonKey(name: 'original') bool original, + @JsonKey(name: 'credit') String credit, + @JsonKey(name: 'source') String source, + @JsonKey(name: 'license') String license, + @JsonKey(name: 'caption') dynamic caption, + @JsonKey(name: 'updatedAt') String updatedAt, + @JsonKey(name: 'createdAt') String createdAt, + @JsonKey(name: 'url') String url, + @JsonKey(name: 'filename') String filename, + @JsonKey(name: 'mimeType') String mimeType, + @JsonKey(name: 'filesize') int filesize, + @JsonKey(name: 'width') int width, + @JsonKey(name: 'height') int height, + @JsonKey(name: 'sizes') NavApiDocsItemImageSizesData sizes}); + + @override + $NavApiDocsItemImageCreatedByDataCopyWith<$Res> get createdBy; + @override + $NavApiDocsItemImageSizesDataCopyWith<$Res> get sizes; +} + +/// @nodoc +class __$$NavApiDocsItemImageDataImplCopyWithImpl<$Res> + extends _$NavApiDocsItemImageDataCopyWithImpl<$Res, + _$NavApiDocsItemImageDataImpl> + implements _$$NavApiDocsItemImageDataImplCopyWith<$Res> { + __$$NavApiDocsItemImageDataImplCopyWithImpl( + _$NavApiDocsItemImageDataImpl _value, + $Res Function(_$NavApiDocsItemImageDataImpl) _then) + : super(_value, _then); + + /// Create a copy of NavApiDocsItemImageData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? createdBy = null, + Object? title = null, + Object? original = null, + Object? credit = null, + Object? source = null, + Object? license = null, + Object? caption = freezed, + Object? updatedAt = null, + Object? createdAt = null, + Object? url = null, + Object? filename = null, + Object? mimeType = null, + Object? filesize = null, + Object? width = null, + Object? height = null, + Object? sizes = null, + }) { + return _then(_$NavApiDocsItemImageDataImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + createdBy: null == createdBy + ? _value.createdBy + : createdBy // ignore: cast_nullable_to_non_nullable + as NavApiDocsItemImageCreatedByData, + title: null == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String, + original: null == original + ? _value.original + : original // ignore: cast_nullable_to_non_nullable + as bool, + credit: null == credit + ? _value.credit + : credit // ignore: cast_nullable_to_non_nullable + as String, + source: null == source + ? _value.source + : source // ignore: cast_nullable_to_non_nullable + as String, + license: null == license + ? _value.license + : license // ignore: cast_nullable_to_non_nullable + as String, + caption: freezed == caption + ? _value.caption + : caption // ignore: cast_nullable_to_non_nullable + as dynamic, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as String, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as String, + url: null == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String, + filename: null == filename + ? _value.filename + : filename // ignore: cast_nullable_to_non_nullable + as String, + mimeType: null == mimeType + ? _value.mimeType + : mimeType // ignore: cast_nullable_to_non_nullable + as String, + filesize: null == filesize + ? _value.filesize + : filesize // ignore: cast_nullable_to_non_nullable + as int, + width: null == width + ? _value.width + : width // ignore: cast_nullable_to_non_nullable + as int, + height: null == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as int, + sizes: null == sizes + ? _value.sizes + : sizes // ignore: cast_nullable_to_non_nullable + as NavApiDocsItemImageSizesData, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$NavApiDocsItemImageDataImpl extends _NavApiDocsItemImageData { + const _$NavApiDocsItemImageDataImpl( + {@JsonKey(name: 'id') this.id = '', + @JsonKey(name: 'createdBy') + this.createdBy = const NavApiDocsItemImageCreatedByData(), + @JsonKey(name: 'title') this.title = '', + @JsonKey(name: 'original') this.original = false, + @JsonKey(name: 'credit') this.credit = '', + @JsonKey(name: 'source') this.source = '', + @JsonKey(name: 'license') this.license = '', + @JsonKey(name: 'caption') this.caption, + @JsonKey(name: 'updatedAt') this.updatedAt = '', + @JsonKey(name: 'createdAt') this.createdAt = '', + @JsonKey(name: 'url') this.url = '', + @JsonKey(name: 'filename') this.filename = '', + @JsonKey(name: 'mimeType') this.mimeType = '', + @JsonKey(name: 'filesize') this.filesize = 0, + @JsonKey(name: 'width') this.width = 0, + @JsonKey(name: 'height') this.height = 0, + @JsonKey(name: 'sizes') + this.sizes = const NavApiDocsItemImageSizesData()}) + : super._(); + + factory _$NavApiDocsItemImageDataImpl.fromJson(Map json) => + _$$NavApiDocsItemImageDataImplFromJson(json); + + @override + @JsonKey(name: 'id') + final String id; + @override + @JsonKey(name: 'createdBy') + final NavApiDocsItemImageCreatedByData createdBy; + @override + @JsonKey(name: 'title') + final String title; + @override + @JsonKey(name: 'original') + final bool original; + @override + @JsonKey(name: 'credit') + final String credit; + @override + @JsonKey(name: 'source') + final String source; + @override + @JsonKey(name: 'license') + final String license; + @override + @JsonKey(name: 'caption') + final dynamic caption; + @override + @JsonKey(name: 'updatedAt') + final String updatedAt; + @override + @JsonKey(name: 'createdAt') + final String createdAt; + @override + @JsonKey(name: 'url') + final String url; + @override + @JsonKey(name: 'filename') + final String filename; + @override + @JsonKey(name: 'mimeType') + final String mimeType; + @override + @JsonKey(name: 'filesize') + final int filesize; + @override + @JsonKey(name: 'width') + final int width; + @override + @JsonKey(name: 'height') + final int height; + @override + @JsonKey(name: 'sizes') + final NavApiDocsItemImageSizesData sizes; + + @override + String toString() { + return 'NavApiDocsItemImageData(id: $id, createdBy: $createdBy, title: $title, original: $original, credit: $credit, source: $source, license: $license, caption: $caption, updatedAt: $updatedAt, createdAt: $createdAt, url: $url, filename: $filename, mimeType: $mimeType, filesize: $filesize, width: $width, height: $height, sizes: $sizes)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NavApiDocsItemImageDataImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.createdBy, createdBy) || + other.createdBy == createdBy) && + (identical(other.title, title) || other.title == title) && + (identical(other.original, original) || + other.original == original) && + (identical(other.credit, credit) || other.credit == credit) && + (identical(other.source, source) || other.source == source) && + (identical(other.license, license) || other.license == license) && + const DeepCollectionEquality().equals(other.caption, caption) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.url, url) || other.url == url) && + (identical(other.filename, filename) || + other.filename == filename) && + (identical(other.mimeType, mimeType) || + other.mimeType == mimeType) && + (identical(other.filesize, filesize) || + other.filesize == filesize) && + (identical(other.width, width) || other.width == width) && + (identical(other.height, height) || other.height == height) && + (identical(other.sizes, sizes) || other.sizes == sizes)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + id, + createdBy, + title, + original, + credit, + source, + license, + const DeepCollectionEquality().hash(caption), + updatedAt, + createdAt, + url, + filename, + mimeType, + filesize, + width, + height, + sizes); + + /// Create a copy of NavApiDocsItemImageData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$NavApiDocsItemImageDataImplCopyWith<_$NavApiDocsItemImageDataImpl> + get copyWith => __$$NavApiDocsItemImageDataImplCopyWithImpl< + _$NavApiDocsItemImageDataImpl>(this, _$identity); + + @override + Map toJson() { + return _$$NavApiDocsItemImageDataImplToJson( + this, + ); + } +} + +abstract class _NavApiDocsItemImageData extends NavApiDocsItemImageData { + const factory _NavApiDocsItemImageData( + {@JsonKey(name: 'id') final String id, + @JsonKey(name: 'createdBy') + final NavApiDocsItemImageCreatedByData createdBy, + @JsonKey(name: 'title') final String title, + @JsonKey(name: 'original') final bool original, + @JsonKey(name: 'credit') final String credit, + @JsonKey(name: 'source') final String source, + @JsonKey(name: 'license') final String license, + @JsonKey(name: 'caption') final dynamic caption, + @JsonKey(name: 'updatedAt') final String updatedAt, + @JsonKey(name: 'createdAt') final String createdAt, + @JsonKey(name: 'url') final String url, + @JsonKey(name: 'filename') final String filename, + @JsonKey(name: 'mimeType') final String mimeType, + @JsonKey(name: 'filesize') final int filesize, + @JsonKey(name: 'width') final int width, + @JsonKey(name: 'height') final int height, + @JsonKey(name: 'sizes') final NavApiDocsItemImageSizesData sizes}) = + _$NavApiDocsItemImageDataImpl; + const _NavApiDocsItemImageData._() : super._(); + + factory _NavApiDocsItemImageData.fromJson(Map json) = + _$NavApiDocsItemImageDataImpl.fromJson; + + @override + @JsonKey(name: 'id') + String get id; + @override + @JsonKey(name: 'createdBy') + NavApiDocsItemImageCreatedByData get createdBy; + @override + @JsonKey(name: 'title') + String get title; + @override + @JsonKey(name: 'original') + bool get original; + @override + @JsonKey(name: 'credit') + String get credit; + @override + @JsonKey(name: 'source') + String get source; + @override + @JsonKey(name: 'license') + String get license; + @override + @JsonKey(name: 'caption') + dynamic get caption; + @override + @JsonKey(name: 'updatedAt') + String get updatedAt; + @override + @JsonKey(name: 'createdAt') + String get createdAt; + @override + @JsonKey(name: 'url') + String get url; + @override + @JsonKey(name: 'filename') + String get filename; + @override + @JsonKey(name: 'mimeType') + String get mimeType; + @override + @JsonKey(name: 'filesize') + int get filesize; + @override + @JsonKey(name: 'width') + int get width; + @override + @JsonKey(name: 'height') + int get height; + @override + @JsonKey(name: 'sizes') + NavApiDocsItemImageSizesData get sizes; + + /// Create a copy of NavApiDocsItemImageData + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$NavApiDocsItemImageDataImplCopyWith<_$NavApiDocsItemImageDataImpl> + get copyWith => throw _privateConstructorUsedError; +} + +NavApiDocsItemImageCreatedByData _$NavApiDocsItemImageCreatedByDataFromJson( + Map json) { + return _NavApiDocsItemImageCreatedByData.fromJson(json); +} + +/// @nodoc +mixin _$NavApiDocsItemImageCreatedByData { + @JsonKey(name: 'id') + String get id => throw _privateConstructorUsedError; + @JsonKey(name: 'sub') + String get sub => throw _privateConstructorUsedError; + @JsonKey(name: 'external_provider') + String get externalProvider => throw _privateConstructorUsedError; + @JsonKey(name: 'username') + String get username => throw _privateConstructorUsedError; + @JsonKey(name: 'name') + String get name => throw _privateConstructorUsedError; + @JsonKey(name: 'roles') + List get roles => throw _privateConstructorUsedError; + @JsonKey(name: 'avatar_url') + String get avatarUrl => throw _privateConstructorUsedError; + @JsonKey(name: 'updatedAt') + String get updatedAt => throw _privateConstructorUsedError; + @JsonKey(name: 'createdAt') + String get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: 'email') + String get email => throw _privateConstructorUsedError; + @JsonKey(name: 'loginAttempts') + int get loginAttempts => throw _privateConstructorUsedError; + @JsonKey(name: 'avatar') + String get avatar => throw _privateConstructorUsedError; + + /// Serializes this NavApiDocsItemImageCreatedByData to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of NavApiDocsItemImageCreatedByData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $NavApiDocsItemImageCreatedByDataCopyWith + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $NavApiDocsItemImageCreatedByDataCopyWith<$Res> { + factory $NavApiDocsItemImageCreatedByDataCopyWith( + NavApiDocsItemImageCreatedByData value, + $Res Function(NavApiDocsItemImageCreatedByData) then) = + _$NavApiDocsItemImageCreatedByDataCopyWithImpl<$Res, + NavApiDocsItemImageCreatedByData>; + @useResult + $Res call( + {@JsonKey(name: 'id') String id, + @JsonKey(name: 'sub') String sub, + @JsonKey(name: 'external_provider') String externalProvider, + @JsonKey(name: 'username') String username, + @JsonKey(name: 'name') String name, + @JsonKey(name: 'roles') List roles, + @JsonKey(name: 'avatar_url') String avatarUrl, + @JsonKey(name: 'updatedAt') String updatedAt, + @JsonKey(name: 'createdAt') String createdAt, + @JsonKey(name: 'email') String email, + @JsonKey(name: 'loginAttempts') int loginAttempts, + @JsonKey(name: 'avatar') String avatar}); +} + +/// @nodoc +class _$NavApiDocsItemImageCreatedByDataCopyWithImpl<$Res, + $Val extends NavApiDocsItemImageCreatedByData> + implements $NavApiDocsItemImageCreatedByDataCopyWith<$Res> { + _$NavApiDocsItemImageCreatedByDataCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of NavApiDocsItemImageCreatedByData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? sub = null, + Object? externalProvider = null, + Object? username = null, + Object? name = null, + Object? roles = null, + Object? avatarUrl = null, + Object? updatedAt = null, + Object? createdAt = null, + Object? email = null, + Object? loginAttempts = null, + Object? avatar = null, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + sub: null == sub + ? _value.sub + : sub // ignore: cast_nullable_to_non_nullable + as String, + externalProvider: null == externalProvider + ? _value.externalProvider + : externalProvider // ignore: cast_nullable_to_non_nullable + as String, + username: null == username + ? _value.username + : username // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + roles: null == roles + ? _value.roles + : roles // ignore: cast_nullable_to_non_nullable + as List, + avatarUrl: null == avatarUrl + ? _value.avatarUrl + : avatarUrl // ignore: cast_nullable_to_non_nullable + as String, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as String, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as String, + email: null == email + ? _value.email + : email // ignore: cast_nullable_to_non_nullable + as String, + loginAttempts: null == loginAttempts + ? _value.loginAttempts + : loginAttempts // ignore: cast_nullable_to_non_nullable + as int, + avatar: null == avatar + ? _value.avatar + : avatar // ignore: cast_nullable_to_non_nullable + as String, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$NavApiDocsItemImageCreatedByDataImplCopyWith<$Res> + implements $NavApiDocsItemImageCreatedByDataCopyWith<$Res> { + factory _$$NavApiDocsItemImageCreatedByDataImplCopyWith( + _$NavApiDocsItemImageCreatedByDataImpl value, + $Res Function(_$NavApiDocsItemImageCreatedByDataImpl) then) = + __$$NavApiDocsItemImageCreatedByDataImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: 'id') String id, + @JsonKey(name: 'sub') String sub, + @JsonKey(name: 'external_provider') String externalProvider, + @JsonKey(name: 'username') String username, + @JsonKey(name: 'name') String name, + @JsonKey(name: 'roles') List roles, + @JsonKey(name: 'avatar_url') String avatarUrl, + @JsonKey(name: 'updatedAt') String updatedAt, + @JsonKey(name: 'createdAt') String createdAt, + @JsonKey(name: 'email') String email, + @JsonKey(name: 'loginAttempts') int loginAttempts, + @JsonKey(name: 'avatar') String avatar}); +} + +/// @nodoc +class __$$NavApiDocsItemImageCreatedByDataImplCopyWithImpl<$Res> + extends _$NavApiDocsItemImageCreatedByDataCopyWithImpl<$Res, + _$NavApiDocsItemImageCreatedByDataImpl> + implements _$$NavApiDocsItemImageCreatedByDataImplCopyWith<$Res> { + __$$NavApiDocsItemImageCreatedByDataImplCopyWithImpl( + _$NavApiDocsItemImageCreatedByDataImpl _value, + $Res Function(_$NavApiDocsItemImageCreatedByDataImpl) _then) + : super(_value, _then); + + /// Create a copy of NavApiDocsItemImageCreatedByData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? sub = null, + Object? externalProvider = null, + Object? username = null, + Object? name = null, + Object? roles = null, + Object? avatarUrl = null, + Object? updatedAt = null, + Object? createdAt = null, + Object? email = null, + Object? loginAttempts = null, + Object? avatar = null, + }) { + return _then(_$NavApiDocsItemImageCreatedByDataImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + sub: null == sub + ? _value.sub + : sub // ignore: cast_nullable_to_non_nullable + as String, + externalProvider: null == externalProvider + ? _value.externalProvider + : externalProvider // ignore: cast_nullable_to_non_nullable + as String, + username: null == username + ? _value.username + : username // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + roles: null == roles + ? _value._roles + : roles // ignore: cast_nullable_to_non_nullable + as List, + avatarUrl: null == avatarUrl + ? _value.avatarUrl + : avatarUrl // ignore: cast_nullable_to_non_nullable + as String, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as String, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as String, + email: null == email + ? _value.email + : email // ignore: cast_nullable_to_non_nullable + as String, + loginAttempts: null == loginAttempts + ? _value.loginAttempts + : loginAttempts // ignore: cast_nullable_to_non_nullable + as int, + avatar: null == avatar + ? _value.avatar + : avatar // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$NavApiDocsItemImageCreatedByDataImpl + extends _NavApiDocsItemImageCreatedByData { + const _$NavApiDocsItemImageCreatedByDataImpl( + {@JsonKey(name: 'id') this.id = '', + @JsonKey(name: 'sub') this.sub = '', + @JsonKey(name: 'external_provider') this.externalProvider = '', + @JsonKey(name: 'username') this.username = '', + @JsonKey(name: 'name') this.name = '', + @JsonKey(name: 'roles') final List roles = const [], + @JsonKey(name: 'avatar_url') this.avatarUrl = '', + @JsonKey(name: 'updatedAt') this.updatedAt = '', + @JsonKey(name: 'createdAt') this.createdAt = '', + @JsonKey(name: 'email') this.email = '', + @JsonKey(name: 'loginAttempts') this.loginAttempts = 0, + @JsonKey(name: 'avatar') this.avatar = ''}) + : _roles = roles, + super._(); + + factory _$NavApiDocsItemImageCreatedByDataImpl.fromJson( + Map json) => + _$$NavApiDocsItemImageCreatedByDataImplFromJson(json); + + @override + @JsonKey(name: 'id') + final String id; + @override + @JsonKey(name: 'sub') + final String sub; + @override + @JsonKey(name: 'external_provider') + final String externalProvider; + @override + @JsonKey(name: 'username') + final String username; + @override + @JsonKey(name: 'name') + final String name; + final List _roles; + @override + @JsonKey(name: 'roles') + List get roles { + if (_roles is EqualUnmodifiableListView) return _roles; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_roles); + } + + @override + @JsonKey(name: 'avatar_url') + final String avatarUrl; + @override + @JsonKey(name: 'updatedAt') + final String updatedAt; + @override + @JsonKey(name: 'createdAt') + final String createdAt; + @override + @JsonKey(name: 'email') + final String email; + @override + @JsonKey(name: 'loginAttempts') + final int loginAttempts; + @override + @JsonKey(name: 'avatar') + final String avatar; + + @override + String toString() { + return 'NavApiDocsItemImageCreatedByData(id: $id, sub: $sub, externalProvider: $externalProvider, username: $username, name: $name, roles: $roles, avatarUrl: $avatarUrl, updatedAt: $updatedAt, createdAt: $createdAt, email: $email, loginAttempts: $loginAttempts, avatar: $avatar)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NavApiDocsItemImageCreatedByDataImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.sub, sub) || other.sub == sub) && + (identical(other.externalProvider, externalProvider) || + other.externalProvider == externalProvider) && + (identical(other.username, username) || + other.username == username) && + (identical(other.name, name) || other.name == name) && + const DeepCollectionEquality().equals(other._roles, _roles) && + (identical(other.avatarUrl, avatarUrl) || + other.avatarUrl == avatarUrl) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.email, email) || other.email == email) && + (identical(other.loginAttempts, loginAttempts) || + other.loginAttempts == loginAttempts) && + (identical(other.avatar, avatar) || other.avatar == avatar)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + id, + sub, + externalProvider, + username, + name, + const DeepCollectionEquality().hash(_roles), + avatarUrl, + updatedAt, + createdAt, + email, + loginAttempts, + avatar); + + /// Create a copy of NavApiDocsItemImageCreatedByData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$NavApiDocsItemImageCreatedByDataImplCopyWith< + _$NavApiDocsItemImageCreatedByDataImpl> + get copyWith => __$$NavApiDocsItemImageCreatedByDataImplCopyWithImpl< + _$NavApiDocsItemImageCreatedByDataImpl>(this, _$identity); + + @override + Map toJson() { + return _$$NavApiDocsItemImageCreatedByDataImplToJson( + this, + ); + } +} + +abstract class _NavApiDocsItemImageCreatedByData + extends NavApiDocsItemImageCreatedByData { + const factory _NavApiDocsItemImageCreatedByData( + {@JsonKey(name: 'id') final String id, + @JsonKey(name: 'sub') final String sub, + @JsonKey(name: 'external_provider') final String externalProvider, + @JsonKey(name: 'username') final String username, + @JsonKey(name: 'name') final String name, + @JsonKey(name: 'roles') final List roles, + @JsonKey(name: 'avatar_url') final String avatarUrl, + @JsonKey(name: 'updatedAt') final String updatedAt, + @JsonKey(name: 'createdAt') final String createdAt, + @JsonKey(name: 'email') final String email, + @JsonKey(name: 'loginAttempts') final int loginAttempts, + @JsonKey(name: 'avatar') final String avatar}) = + _$NavApiDocsItemImageCreatedByDataImpl; + const _NavApiDocsItemImageCreatedByData._() : super._(); + + factory _NavApiDocsItemImageCreatedByData.fromJson( + Map json) = + _$NavApiDocsItemImageCreatedByDataImpl.fromJson; + + @override + @JsonKey(name: 'id') + String get id; + @override + @JsonKey(name: 'sub') + String get sub; + @override + @JsonKey(name: 'external_provider') + String get externalProvider; + @override + @JsonKey(name: 'username') + String get username; + @override + @JsonKey(name: 'name') + String get name; + @override + @JsonKey(name: 'roles') + List get roles; + @override + @JsonKey(name: 'avatar_url') + String get avatarUrl; + @override + @JsonKey(name: 'updatedAt') + String get updatedAt; + @override + @JsonKey(name: 'createdAt') + String get createdAt; + @override + @JsonKey(name: 'email') + String get email; + @override + @JsonKey(name: 'loginAttempts') + int get loginAttempts; + @override + @JsonKey(name: 'avatar') + String get avatar; + + /// Create a copy of NavApiDocsItemImageCreatedByData + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$NavApiDocsItemImageCreatedByDataImplCopyWith< + _$NavApiDocsItemImageCreatedByDataImpl> + get copyWith => throw _privateConstructorUsedError; +} + +NavApiDocsItemImageSizesThumbnailData + _$NavApiDocsItemImageSizesThumbnailDataFromJson(Map json) { + return _NavApiDocsItemImageSizesThumbnailData.fromJson(json); +} + +/// @nodoc +mixin _$NavApiDocsItemImageSizesThumbnailData { + @JsonKey(name: 'url') + String get url => throw _privateConstructorUsedError; + @JsonKey(name: 'width') + int get width => throw _privateConstructorUsedError; + @JsonKey(name: 'height') + int get height => throw _privateConstructorUsedError; + @JsonKey(name: 'mimeType') + String get mimeType => throw _privateConstructorUsedError; + @JsonKey(name: 'filesize') + int get filesize => throw _privateConstructorUsedError; + @JsonKey(name: 'filename') + String get filename => throw _privateConstructorUsedError; + + /// Serializes this NavApiDocsItemImageSizesThumbnailData to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of NavApiDocsItemImageSizesThumbnailData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $NavApiDocsItemImageSizesThumbnailDataCopyWith< + NavApiDocsItemImageSizesThumbnailData> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $NavApiDocsItemImageSizesThumbnailDataCopyWith<$Res> { + factory $NavApiDocsItemImageSizesThumbnailDataCopyWith( + NavApiDocsItemImageSizesThumbnailData value, + $Res Function(NavApiDocsItemImageSizesThumbnailData) then) = + _$NavApiDocsItemImageSizesThumbnailDataCopyWithImpl<$Res, + NavApiDocsItemImageSizesThumbnailData>; + @useResult + $Res call( + {@JsonKey(name: 'url') String url, + @JsonKey(name: 'width') int width, + @JsonKey(name: 'height') int height, + @JsonKey(name: 'mimeType') String mimeType, + @JsonKey(name: 'filesize') int filesize, + @JsonKey(name: 'filename') String filename}); +} + +/// @nodoc +class _$NavApiDocsItemImageSizesThumbnailDataCopyWithImpl<$Res, + $Val extends NavApiDocsItemImageSizesThumbnailData> + implements $NavApiDocsItemImageSizesThumbnailDataCopyWith<$Res> { + _$NavApiDocsItemImageSizesThumbnailDataCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of NavApiDocsItemImageSizesThumbnailData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? url = null, + Object? width = null, + Object? height = null, + Object? mimeType = null, + Object? filesize = null, + Object? filename = null, + }) { + return _then(_value.copyWith( + url: null == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String, + width: null == width + ? _value.width + : width // ignore: cast_nullable_to_non_nullable + as int, + height: null == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as int, + mimeType: null == mimeType + ? _value.mimeType + : mimeType // ignore: cast_nullable_to_non_nullable + as String, + filesize: null == filesize + ? _value.filesize + : filesize // ignore: cast_nullable_to_non_nullable + as int, + filename: null == filename + ? _value.filename + : filename // ignore: cast_nullable_to_non_nullable + as String, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$NavApiDocsItemImageSizesThumbnailDataImplCopyWith<$Res> + implements $NavApiDocsItemImageSizesThumbnailDataCopyWith<$Res> { + factory _$$NavApiDocsItemImageSizesThumbnailDataImplCopyWith( + _$NavApiDocsItemImageSizesThumbnailDataImpl value, + $Res Function(_$NavApiDocsItemImageSizesThumbnailDataImpl) then) = + __$$NavApiDocsItemImageSizesThumbnailDataImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: 'url') String url, + @JsonKey(name: 'width') int width, + @JsonKey(name: 'height') int height, + @JsonKey(name: 'mimeType') String mimeType, + @JsonKey(name: 'filesize') int filesize, + @JsonKey(name: 'filename') String filename}); +} + +/// @nodoc +class __$$NavApiDocsItemImageSizesThumbnailDataImplCopyWithImpl<$Res> + extends _$NavApiDocsItemImageSizesThumbnailDataCopyWithImpl<$Res, + _$NavApiDocsItemImageSizesThumbnailDataImpl> + implements _$$NavApiDocsItemImageSizesThumbnailDataImplCopyWith<$Res> { + __$$NavApiDocsItemImageSizesThumbnailDataImplCopyWithImpl( + _$NavApiDocsItemImageSizesThumbnailDataImpl _value, + $Res Function(_$NavApiDocsItemImageSizesThumbnailDataImpl) _then) + : super(_value, _then); + + /// Create a copy of NavApiDocsItemImageSizesThumbnailData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? url = null, + Object? width = null, + Object? height = null, + Object? mimeType = null, + Object? filesize = null, + Object? filename = null, + }) { + return _then(_$NavApiDocsItemImageSizesThumbnailDataImpl( + url: null == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String, + width: null == width + ? _value.width + : width // ignore: cast_nullable_to_non_nullable + as int, + height: null == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as int, + mimeType: null == mimeType + ? _value.mimeType + : mimeType // ignore: cast_nullable_to_non_nullable + as String, + filesize: null == filesize + ? _value.filesize + : filesize // ignore: cast_nullable_to_non_nullable + as int, + filename: null == filename + ? _value.filename + : filename // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$NavApiDocsItemImageSizesThumbnailDataImpl + extends _NavApiDocsItemImageSizesThumbnailData { + const _$NavApiDocsItemImageSizesThumbnailDataImpl( + {@JsonKey(name: 'url') this.url = '', + @JsonKey(name: 'width') this.width = 0, + @JsonKey(name: 'height') this.height = 0, + @JsonKey(name: 'mimeType') this.mimeType = '', + @JsonKey(name: 'filesize') this.filesize = 0, + @JsonKey(name: 'filename') this.filename = ''}) + : super._(); + + factory _$NavApiDocsItemImageSizesThumbnailDataImpl.fromJson( + Map json) => + _$$NavApiDocsItemImageSizesThumbnailDataImplFromJson(json); + + @override + @JsonKey(name: 'url') + final String url; + @override + @JsonKey(name: 'width') + final int width; + @override + @JsonKey(name: 'height') + final int height; + @override + @JsonKey(name: 'mimeType') + final String mimeType; + @override + @JsonKey(name: 'filesize') + final int filesize; + @override + @JsonKey(name: 'filename') + final String filename; + + @override + String toString() { + return 'NavApiDocsItemImageSizesThumbnailData(url: $url, width: $width, height: $height, mimeType: $mimeType, filesize: $filesize, filename: $filename)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NavApiDocsItemImageSizesThumbnailDataImpl && + (identical(other.url, url) || other.url == url) && + (identical(other.width, width) || other.width == width) && + (identical(other.height, height) || other.height == height) && + (identical(other.mimeType, mimeType) || + other.mimeType == mimeType) && + (identical(other.filesize, filesize) || + other.filesize == filesize) && + (identical(other.filename, filename) || + other.filename == filename)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, url, width, height, mimeType, filesize, filename); + + /// Create a copy of NavApiDocsItemImageSizesThumbnailData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$NavApiDocsItemImageSizesThumbnailDataImplCopyWith< + _$NavApiDocsItemImageSizesThumbnailDataImpl> + get copyWith => __$$NavApiDocsItemImageSizesThumbnailDataImplCopyWithImpl< + _$NavApiDocsItemImageSizesThumbnailDataImpl>(this, _$identity); + + @override + Map toJson() { + return _$$NavApiDocsItemImageSizesThumbnailDataImplToJson( + this, + ); + } +} + +abstract class _NavApiDocsItemImageSizesThumbnailData + extends NavApiDocsItemImageSizesThumbnailData { + const factory _NavApiDocsItemImageSizesThumbnailData( + {@JsonKey(name: 'url') final String url, + @JsonKey(name: 'width') final int width, + @JsonKey(name: 'height') final int height, + @JsonKey(name: 'mimeType') final String mimeType, + @JsonKey(name: 'filesize') final int filesize, + @JsonKey(name: 'filename') final String filename}) = + _$NavApiDocsItemImageSizesThumbnailDataImpl; + const _NavApiDocsItemImageSizesThumbnailData._() : super._(); + + factory _NavApiDocsItemImageSizesThumbnailData.fromJson( + Map json) = + _$NavApiDocsItemImageSizesThumbnailDataImpl.fromJson; + + @override + @JsonKey(name: 'url') + String get url; + @override + @JsonKey(name: 'width') + int get width; + @override + @JsonKey(name: 'height') + int get height; + @override + @JsonKey(name: 'mimeType') + String get mimeType; + @override + @JsonKey(name: 'filesize') + int get filesize; + @override + @JsonKey(name: 'filename') + String get filename; + + /// Create a copy of NavApiDocsItemImageSizesThumbnailData + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$NavApiDocsItemImageSizesThumbnailDataImplCopyWith< + _$NavApiDocsItemImageSizesThumbnailDataImpl> + get copyWith => throw _privateConstructorUsedError; +} + +NavApiDocsItemImageSizesData _$NavApiDocsItemImageSizesDataFromJson( + Map json) { + return _NavApiDocsItemImageSizesData.fromJson(json); +} + +/// @nodoc +mixin _$NavApiDocsItemImageSizesData { + @JsonKey(name: 'thumbnail') + NavApiDocsItemImageSizesThumbnailData get thumbnail => + throw _privateConstructorUsedError; + @JsonKey(name: 'preload') + NavApiDocsItemImageSizesPreloadData get preload => + throw _privateConstructorUsedError; + @JsonKey(name: 'card') + NavApiDocsItemImageSizesCardData get card => + throw _privateConstructorUsedError; + @JsonKey(name: 'tablet') + NavApiDocsItemImageSizesTabletData get tablet => + throw _privateConstructorUsedError; + @JsonKey(name: 'avatar') + NavApiDocsItemImageSizesAvatarData get avatar => + throw _privateConstructorUsedError; + + /// Serializes this NavApiDocsItemImageSizesData to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of NavApiDocsItemImageSizesData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $NavApiDocsItemImageSizesDataCopyWith + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $NavApiDocsItemImageSizesDataCopyWith<$Res> { + factory $NavApiDocsItemImageSizesDataCopyWith( + NavApiDocsItemImageSizesData value, + $Res Function(NavApiDocsItemImageSizesData) then) = + _$NavApiDocsItemImageSizesDataCopyWithImpl<$Res, + NavApiDocsItemImageSizesData>; + @useResult + $Res call( + {@JsonKey(name: 'thumbnail') + NavApiDocsItemImageSizesThumbnailData thumbnail, + @JsonKey(name: 'preload') NavApiDocsItemImageSizesPreloadData preload, + @JsonKey(name: 'card') NavApiDocsItemImageSizesCardData card, + @JsonKey(name: 'tablet') NavApiDocsItemImageSizesTabletData tablet, + @JsonKey(name: 'avatar') NavApiDocsItemImageSizesAvatarData avatar}); + + $NavApiDocsItemImageSizesThumbnailDataCopyWith<$Res> get thumbnail; + $NavApiDocsItemImageSizesPreloadDataCopyWith<$Res> get preload; + $NavApiDocsItemImageSizesCardDataCopyWith<$Res> get card; + $NavApiDocsItemImageSizesTabletDataCopyWith<$Res> get tablet; + $NavApiDocsItemImageSizesAvatarDataCopyWith<$Res> get avatar; +} + +/// @nodoc +class _$NavApiDocsItemImageSizesDataCopyWithImpl<$Res, + $Val extends NavApiDocsItemImageSizesData> + implements $NavApiDocsItemImageSizesDataCopyWith<$Res> { + _$NavApiDocsItemImageSizesDataCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of NavApiDocsItemImageSizesData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? thumbnail = null, + Object? preload = null, + Object? card = null, + Object? tablet = null, + Object? avatar = null, + }) { + return _then(_value.copyWith( + thumbnail: null == thumbnail + ? _value.thumbnail + : thumbnail // ignore: cast_nullable_to_non_nullable + as NavApiDocsItemImageSizesThumbnailData, + preload: null == preload + ? _value.preload + : preload // ignore: cast_nullable_to_non_nullable + as NavApiDocsItemImageSizesPreloadData, + card: null == card + ? _value.card + : card // ignore: cast_nullable_to_non_nullable + as NavApiDocsItemImageSizesCardData, + tablet: null == tablet + ? _value.tablet + : tablet // ignore: cast_nullable_to_non_nullable + as NavApiDocsItemImageSizesTabletData, + avatar: null == avatar + ? _value.avatar + : avatar // ignore: cast_nullable_to_non_nullable + as NavApiDocsItemImageSizesAvatarData, + ) as $Val); + } + + /// Create a copy of NavApiDocsItemImageSizesData + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $NavApiDocsItemImageSizesThumbnailDataCopyWith<$Res> get thumbnail { + return $NavApiDocsItemImageSizesThumbnailDataCopyWith<$Res>( + _value.thumbnail, (value) { + return _then(_value.copyWith(thumbnail: value) as $Val); + }); + } + + /// Create a copy of NavApiDocsItemImageSizesData + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $NavApiDocsItemImageSizesPreloadDataCopyWith<$Res> get preload { + return $NavApiDocsItemImageSizesPreloadDataCopyWith<$Res>(_value.preload, + (value) { + return _then(_value.copyWith(preload: value) as $Val); + }); + } + + /// Create a copy of NavApiDocsItemImageSizesData + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $NavApiDocsItemImageSizesCardDataCopyWith<$Res> get card { + return $NavApiDocsItemImageSizesCardDataCopyWith<$Res>(_value.card, + (value) { + return _then(_value.copyWith(card: value) as $Val); + }); + } + + /// Create a copy of NavApiDocsItemImageSizesData + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $NavApiDocsItemImageSizesTabletDataCopyWith<$Res> get tablet { + return $NavApiDocsItemImageSizesTabletDataCopyWith<$Res>(_value.tablet, + (value) { + return _then(_value.copyWith(tablet: value) as $Val); + }); + } + + /// Create a copy of NavApiDocsItemImageSizesData + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $NavApiDocsItemImageSizesAvatarDataCopyWith<$Res> get avatar { + return $NavApiDocsItemImageSizesAvatarDataCopyWith<$Res>(_value.avatar, + (value) { + return _then(_value.copyWith(avatar: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$NavApiDocsItemImageSizesDataImplCopyWith<$Res> + implements $NavApiDocsItemImageSizesDataCopyWith<$Res> { + factory _$$NavApiDocsItemImageSizesDataImplCopyWith( + _$NavApiDocsItemImageSizesDataImpl value, + $Res Function(_$NavApiDocsItemImageSizesDataImpl) then) = + __$$NavApiDocsItemImageSizesDataImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: 'thumbnail') + NavApiDocsItemImageSizesThumbnailData thumbnail, + @JsonKey(name: 'preload') NavApiDocsItemImageSizesPreloadData preload, + @JsonKey(name: 'card') NavApiDocsItemImageSizesCardData card, + @JsonKey(name: 'tablet') NavApiDocsItemImageSizesTabletData tablet, + @JsonKey(name: 'avatar') NavApiDocsItemImageSizesAvatarData avatar}); + + @override + $NavApiDocsItemImageSizesThumbnailDataCopyWith<$Res> get thumbnail; + @override + $NavApiDocsItemImageSizesPreloadDataCopyWith<$Res> get preload; + @override + $NavApiDocsItemImageSizesCardDataCopyWith<$Res> get card; + @override + $NavApiDocsItemImageSizesTabletDataCopyWith<$Res> get tablet; + @override + $NavApiDocsItemImageSizesAvatarDataCopyWith<$Res> get avatar; +} + +/// @nodoc +class __$$NavApiDocsItemImageSizesDataImplCopyWithImpl<$Res> + extends _$NavApiDocsItemImageSizesDataCopyWithImpl<$Res, + _$NavApiDocsItemImageSizesDataImpl> + implements _$$NavApiDocsItemImageSizesDataImplCopyWith<$Res> { + __$$NavApiDocsItemImageSizesDataImplCopyWithImpl( + _$NavApiDocsItemImageSizesDataImpl _value, + $Res Function(_$NavApiDocsItemImageSizesDataImpl) _then) + : super(_value, _then); + + /// Create a copy of NavApiDocsItemImageSizesData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? thumbnail = null, + Object? preload = null, + Object? card = null, + Object? tablet = null, + Object? avatar = null, + }) { + return _then(_$NavApiDocsItemImageSizesDataImpl( + thumbnail: null == thumbnail + ? _value.thumbnail + : thumbnail // ignore: cast_nullable_to_non_nullable + as NavApiDocsItemImageSizesThumbnailData, + preload: null == preload + ? _value.preload + : preload // ignore: cast_nullable_to_non_nullable + as NavApiDocsItemImageSizesPreloadData, + card: null == card + ? _value.card + : card // ignore: cast_nullable_to_non_nullable + as NavApiDocsItemImageSizesCardData, + tablet: null == tablet + ? _value.tablet + : tablet // ignore: cast_nullable_to_non_nullable + as NavApiDocsItemImageSizesTabletData, + avatar: null == avatar + ? _value.avatar + : avatar // ignore: cast_nullable_to_non_nullable + as NavApiDocsItemImageSizesAvatarData, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$NavApiDocsItemImageSizesDataImpl extends _NavApiDocsItemImageSizesData { + const _$NavApiDocsItemImageSizesDataImpl( + {@JsonKey(name: 'thumbnail') + this.thumbnail = const NavApiDocsItemImageSizesThumbnailData(), + @JsonKey(name: 'preload') + this.preload = const NavApiDocsItemImageSizesPreloadData(), + @JsonKey(name: 'card') + this.card = const NavApiDocsItemImageSizesCardData(), + @JsonKey(name: 'tablet') + this.tablet = const NavApiDocsItemImageSizesTabletData(), + @JsonKey(name: 'avatar') + this.avatar = const NavApiDocsItemImageSizesAvatarData()}) + : super._(); + + factory _$NavApiDocsItemImageSizesDataImpl.fromJson( + Map json) => + _$$NavApiDocsItemImageSizesDataImplFromJson(json); + + @override + @JsonKey(name: 'thumbnail') + final NavApiDocsItemImageSizesThumbnailData thumbnail; + @override + @JsonKey(name: 'preload') + final NavApiDocsItemImageSizesPreloadData preload; + @override + @JsonKey(name: 'card') + final NavApiDocsItemImageSizesCardData card; + @override + @JsonKey(name: 'tablet') + final NavApiDocsItemImageSizesTabletData tablet; + @override + @JsonKey(name: 'avatar') + final NavApiDocsItemImageSizesAvatarData avatar; + + @override + String toString() { + return 'NavApiDocsItemImageSizesData(thumbnail: $thumbnail, preload: $preload, card: $card, tablet: $tablet, avatar: $avatar)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NavApiDocsItemImageSizesDataImpl && + (identical(other.thumbnail, thumbnail) || + other.thumbnail == thumbnail) && + (identical(other.preload, preload) || other.preload == preload) && + (identical(other.card, card) || other.card == card) && + (identical(other.tablet, tablet) || other.tablet == tablet) && + (identical(other.avatar, avatar) || other.avatar == avatar)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, thumbnail, preload, card, tablet, avatar); + + /// Create a copy of NavApiDocsItemImageSizesData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$NavApiDocsItemImageSizesDataImplCopyWith< + _$NavApiDocsItemImageSizesDataImpl> + get copyWith => __$$NavApiDocsItemImageSizesDataImplCopyWithImpl< + _$NavApiDocsItemImageSizesDataImpl>(this, _$identity); + + @override + Map toJson() { + return _$$NavApiDocsItemImageSizesDataImplToJson( + this, + ); + } +} + +abstract class _NavApiDocsItemImageSizesData + extends NavApiDocsItemImageSizesData { + const factory _NavApiDocsItemImageSizesData( + {@JsonKey(name: 'thumbnail') + final NavApiDocsItemImageSizesThumbnailData thumbnail, + @JsonKey(name: 'preload') + final NavApiDocsItemImageSizesPreloadData preload, + @JsonKey(name: 'card') final NavApiDocsItemImageSizesCardData card, + @JsonKey(name: 'tablet') final NavApiDocsItemImageSizesTabletData tablet, + @JsonKey(name: 'avatar') + final NavApiDocsItemImageSizesAvatarData + avatar}) = _$NavApiDocsItemImageSizesDataImpl; + const _NavApiDocsItemImageSizesData._() : super._(); + + factory _NavApiDocsItemImageSizesData.fromJson(Map json) = + _$NavApiDocsItemImageSizesDataImpl.fromJson; + + @override + @JsonKey(name: 'thumbnail') + NavApiDocsItemImageSizesThumbnailData get thumbnail; + @override + @JsonKey(name: 'preload') + NavApiDocsItemImageSizesPreloadData get preload; + @override + @JsonKey(name: 'card') + NavApiDocsItemImageSizesCardData get card; + @override + @JsonKey(name: 'tablet') + NavApiDocsItemImageSizesTabletData get tablet; + @override + @JsonKey(name: 'avatar') + NavApiDocsItemImageSizesAvatarData get avatar; + + /// Create a copy of NavApiDocsItemImageSizesData + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$NavApiDocsItemImageSizesDataImplCopyWith< + _$NavApiDocsItemImageSizesDataImpl> + get copyWith => throw _privateConstructorUsedError; +} + +NavApiDocsItemImageSizesPreloadData + _$NavApiDocsItemImageSizesPreloadDataFromJson(Map json) { + return _NavApiDocsItemImageSizesPreloadData.fromJson(json); +} + +/// @nodoc +mixin _$NavApiDocsItemImageSizesPreloadData { + @JsonKey(name: 'url') + dynamic get url => throw _privateConstructorUsedError; + @JsonKey(name: 'width') + dynamic get width => throw _privateConstructorUsedError; + @JsonKey(name: 'height') + dynamic get height => throw _privateConstructorUsedError; + @JsonKey(name: 'mimeType') + dynamic get mimeType => throw _privateConstructorUsedError; + @JsonKey(name: 'filesize') + dynamic get filesize => throw _privateConstructorUsedError; + @JsonKey(name: 'filename') + dynamic get filename => throw _privateConstructorUsedError; + + /// Serializes this NavApiDocsItemImageSizesPreloadData to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of NavApiDocsItemImageSizesPreloadData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $NavApiDocsItemImageSizesPreloadDataCopyWith< + NavApiDocsItemImageSizesPreloadData> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $NavApiDocsItemImageSizesPreloadDataCopyWith<$Res> { + factory $NavApiDocsItemImageSizesPreloadDataCopyWith( + NavApiDocsItemImageSizesPreloadData value, + $Res Function(NavApiDocsItemImageSizesPreloadData) then) = + _$NavApiDocsItemImageSizesPreloadDataCopyWithImpl<$Res, + NavApiDocsItemImageSizesPreloadData>; + @useResult + $Res call( + {@JsonKey(name: 'url') dynamic url, + @JsonKey(name: 'width') dynamic width, + @JsonKey(name: 'height') dynamic height, + @JsonKey(name: 'mimeType') dynamic mimeType, + @JsonKey(name: 'filesize') dynamic filesize, + @JsonKey(name: 'filename') dynamic filename}); +} + +/// @nodoc +class _$NavApiDocsItemImageSizesPreloadDataCopyWithImpl<$Res, + $Val extends NavApiDocsItemImageSizesPreloadData> + implements $NavApiDocsItemImageSizesPreloadDataCopyWith<$Res> { + _$NavApiDocsItemImageSizesPreloadDataCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of NavApiDocsItemImageSizesPreloadData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? url = freezed, + Object? width = freezed, + Object? height = freezed, + Object? mimeType = freezed, + Object? filesize = freezed, + Object? filename = freezed, + }) { + return _then(_value.copyWith( + url: freezed == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as dynamic, + width: freezed == width + ? _value.width + : width // ignore: cast_nullable_to_non_nullable + as dynamic, + height: freezed == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as dynamic, + mimeType: freezed == mimeType + ? _value.mimeType + : mimeType // ignore: cast_nullable_to_non_nullable + as dynamic, + filesize: freezed == filesize + ? _value.filesize + : filesize // ignore: cast_nullable_to_non_nullable + as dynamic, + filename: freezed == filename + ? _value.filename + : filename // ignore: cast_nullable_to_non_nullable + as dynamic, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$NavApiDocsItemImageSizesPreloadDataImplCopyWith<$Res> + implements $NavApiDocsItemImageSizesPreloadDataCopyWith<$Res> { + factory _$$NavApiDocsItemImageSizesPreloadDataImplCopyWith( + _$NavApiDocsItemImageSizesPreloadDataImpl value, + $Res Function(_$NavApiDocsItemImageSizesPreloadDataImpl) then) = + __$$NavApiDocsItemImageSizesPreloadDataImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: 'url') dynamic url, + @JsonKey(name: 'width') dynamic width, + @JsonKey(name: 'height') dynamic height, + @JsonKey(name: 'mimeType') dynamic mimeType, + @JsonKey(name: 'filesize') dynamic filesize, + @JsonKey(name: 'filename') dynamic filename}); +} + +/// @nodoc +class __$$NavApiDocsItemImageSizesPreloadDataImplCopyWithImpl<$Res> + extends _$NavApiDocsItemImageSizesPreloadDataCopyWithImpl<$Res, + _$NavApiDocsItemImageSizesPreloadDataImpl> + implements _$$NavApiDocsItemImageSizesPreloadDataImplCopyWith<$Res> { + __$$NavApiDocsItemImageSizesPreloadDataImplCopyWithImpl( + _$NavApiDocsItemImageSizesPreloadDataImpl _value, + $Res Function(_$NavApiDocsItemImageSizesPreloadDataImpl) _then) + : super(_value, _then); + + /// Create a copy of NavApiDocsItemImageSizesPreloadData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? url = freezed, + Object? width = freezed, + Object? height = freezed, + Object? mimeType = freezed, + Object? filesize = freezed, + Object? filename = freezed, + }) { + return _then(_$NavApiDocsItemImageSizesPreloadDataImpl( + url: freezed == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as dynamic, + width: freezed == width + ? _value.width + : width // ignore: cast_nullable_to_non_nullable + as dynamic, + height: freezed == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as dynamic, + mimeType: freezed == mimeType + ? _value.mimeType + : mimeType // ignore: cast_nullable_to_non_nullable + as dynamic, + filesize: freezed == filesize + ? _value.filesize + : filesize // ignore: cast_nullable_to_non_nullable + as dynamic, + filename: freezed == filename + ? _value.filename + : filename // ignore: cast_nullable_to_non_nullable + as dynamic, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$NavApiDocsItemImageSizesPreloadDataImpl + extends _NavApiDocsItemImageSizesPreloadData { + const _$NavApiDocsItemImageSizesPreloadDataImpl( + {@JsonKey(name: 'url') this.url, + @JsonKey(name: 'width') this.width, + @JsonKey(name: 'height') this.height, + @JsonKey(name: 'mimeType') this.mimeType, + @JsonKey(name: 'filesize') this.filesize, + @JsonKey(name: 'filename') this.filename}) + : super._(); + + factory _$NavApiDocsItemImageSizesPreloadDataImpl.fromJson( + Map json) => + _$$NavApiDocsItemImageSizesPreloadDataImplFromJson(json); + + @override + @JsonKey(name: 'url') + final dynamic url; + @override + @JsonKey(name: 'width') + final dynamic width; + @override + @JsonKey(name: 'height') + final dynamic height; + @override + @JsonKey(name: 'mimeType') + final dynamic mimeType; + @override + @JsonKey(name: 'filesize') + final dynamic filesize; + @override + @JsonKey(name: 'filename') + final dynamic filename; + + @override + String toString() { + return 'NavApiDocsItemImageSizesPreloadData(url: $url, width: $width, height: $height, mimeType: $mimeType, filesize: $filesize, filename: $filename)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NavApiDocsItemImageSizesPreloadDataImpl && + const DeepCollectionEquality().equals(other.url, url) && + const DeepCollectionEquality().equals(other.width, width) && + const DeepCollectionEquality().equals(other.height, height) && + const DeepCollectionEquality().equals(other.mimeType, mimeType) && + const DeepCollectionEquality().equals(other.filesize, filesize) && + const DeepCollectionEquality().equals(other.filename, filename)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(url), + const DeepCollectionEquality().hash(width), + const DeepCollectionEquality().hash(height), + const DeepCollectionEquality().hash(mimeType), + const DeepCollectionEquality().hash(filesize), + const DeepCollectionEquality().hash(filename)); + + /// Create a copy of NavApiDocsItemImageSizesPreloadData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$NavApiDocsItemImageSizesPreloadDataImplCopyWith< + _$NavApiDocsItemImageSizesPreloadDataImpl> + get copyWith => __$$NavApiDocsItemImageSizesPreloadDataImplCopyWithImpl< + _$NavApiDocsItemImageSizesPreloadDataImpl>(this, _$identity); + + @override + Map toJson() { + return _$$NavApiDocsItemImageSizesPreloadDataImplToJson( + this, + ); + } +} + +abstract class _NavApiDocsItemImageSizesPreloadData + extends NavApiDocsItemImageSizesPreloadData { + const factory _NavApiDocsItemImageSizesPreloadData( + {@JsonKey(name: 'url') final dynamic url, + @JsonKey(name: 'width') final dynamic width, + @JsonKey(name: 'height') final dynamic height, + @JsonKey(name: 'mimeType') final dynamic mimeType, + @JsonKey(name: 'filesize') final dynamic filesize, + @JsonKey(name: 'filename') final dynamic filename}) = + _$NavApiDocsItemImageSizesPreloadDataImpl; + const _NavApiDocsItemImageSizesPreloadData._() : super._(); + + factory _NavApiDocsItemImageSizesPreloadData.fromJson( + Map json) = + _$NavApiDocsItemImageSizesPreloadDataImpl.fromJson; + + @override + @JsonKey(name: 'url') + dynamic get url; + @override + @JsonKey(name: 'width') + dynamic get width; + @override + @JsonKey(name: 'height') + dynamic get height; + @override + @JsonKey(name: 'mimeType') + dynamic get mimeType; + @override + @JsonKey(name: 'filesize') + dynamic get filesize; + @override + @JsonKey(name: 'filename') + dynamic get filename; + + /// Create a copy of NavApiDocsItemImageSizesPreloadData + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$NavApiDocsItemImageSizesPreloadDataImplCopyWith< + _$NavApiDocsItemImageSizesPreloadDataImpl> + get copyWith => throw _privateConstructorUsedError; +} + +NavApiDocsItemImageSizesCardData _$NavApiDocsItemImageSizesCardDataFromJson( + Map json) { + return _NavApiDocsItemImageSizesCardData.fromJson(json); +} + +/// @nodoc +mixin _$NavApiDocsItemImageSizesCardData { + @JsonKey(name: 'url') + String get url => throw _privateConstructorUsedError; + @JsonKey(name: 'width') + int get width => throw _privateConstructorUsedError; + @JsonKey(name: 'height') + int get height => throw _privateConstructorUsedError; + @JsonKey(name: 'mimeType') + String get mimeType => throw _privateConstructorUsedError; + @JsonKey(name: 'filesize') + int get filesize => throw _privateConstructorUsedError; + @JsonKey(name: 'filename') + String get filename => throw _privateConstructorUsedError; + + /// Serializes this NavApiDocsItemImageSizesCardData to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of NavApiDocsItemImageSizesCardData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $NavApiDocsItemImageSizesCardDataCopyWith + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $NavApiDocsItemImageSizesCardDataCopyWith<$Res> { + factory $NavApiDocsItemImageSizesCardDataCopyWith( + NavApiDocsItemImageSizesCardData value, + $Res Function(NavApiDocsItemImageSizesCardData) then) = + _$NavApiDocsItemImageSizesCardDataCopyWithImpl<$Res, + NavApiDocsItemImageSizesCardData>; + @useResult + $Res call( + {@JsonKey(name: 'url') String url, + @JsonKey(name: 'width') int width, + @JsonKey(name: 'height') int height, + @JsonKey(name: 'mimeType') String mimeType, + @JsonKey(name: 'filesize') int filesize, + @JsonKey(name: 'filename') String filename}); +} + +/// @nodoc +class _$NavApiDocsItemImageSizesCardDataCopyWithImpl<$Res, + $Val extends NavApiDocsItemImageSizesCardData> + implements $NavApiDocsItemImageSizesCardDataCopyWith<$Res> { + _$NavApiDocsItemImageSizesCardDataCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of NavApiDocsItemImageSizesCardData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? url = null, + Object? width = null, + Object? height = null, + Object? mimeType = null, + Object? filesize = null, + Object? filename = null, + }) { + return _then(_value.copyWith( + url: null == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String, + width: null == width + ? _value.width + : width // ignore: cast_nullable_to_non_nullable + as int, + height: null == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as int, + mimeType: null == mimeType + ? _value.mimeType + : mimeType // ignore: cast_nullable_to_non_nullable + as String, + filesize: null == filesize + ? _value.filesize + : filesize // ignore: cast_nullable_to_non_nullable + as int, + filename: null == filename + ? _value.filename + : filename // ignore: cast_nullable_to_non_nullable + as String, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$NavApiDocsItemImageSizesCardDataImplCopyWith<$Res> + implements $NavApiDocsItemImageSizesCardDataCopyWith<$Res> { + factory _$$NavApiDocsItemImageSizesCardDataImplCopyWith( + _$NavApiDocsItemImageSizesCardDataImpl value, + $Res Function(_$NavApiDocsItemImageSizesCardDataImpl) then) = + __$$NavApiDocsItemImageSizesCardDataImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: 'url') String url, + @JsonKey(name: 'width') int width, + @JsonKey(name: 'height') int height, + @JsonKey(name: 'mimeType') String mimeType, + @JsonKey(name: 'filesize') int filesize, + @JsonKey(name: 'filename') String filename}); +} + +/// @nodoc +class __$$NavApiDocsItemImageSizesCardDataImplCopyWithImpl<$Res> + extends _$NavApiDocsItemImageSizesCardDataCopyWithImpl<$Res, + _$NavApiDocsItemImageSizesCardDataImpl> + implements _$$NavApiDocsItemImageSizesCardDataImplCopyWith<$Res> { + __$$NavApiDocsItemImageSizesCardDataImplCopyWithImpl( + _$NavApiDocsItemImageSizesCardDataImpl _value, + $Res Function(_$NavApiDocsItemImageSizesCardDataImpl) _then) + : super(_value, _then); + + /// Create a copy of NavApiDocsItemImageSizesCardData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? url = null, + Object? width = null, + Object? height = null, + Object? mimeType = null, + Object? filesize = null, + Object? filename = null, + }) { + return _then(_$NavApiDocsItemImageSizesCardDataImpl( + url: null == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String, + width: null == width + ? _value.width + : width // ignore: cast_nullable_to_non_nullable + as int, + height: null == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as int, + mimeType: null == mimeType + ? _value.mimeType + : mimeType // ignore: cast_nullable_to_non_nullable + as String, + filesize: null == filesize + ? _value.filesize + : filesize // ignore: cast_nullable_to_non_nullable + as int, + filename: null == filename + ? _value.filename + : filename // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$NavApiDocsItemImageSizesCardDataImpl + extends _NavApiDocsItemImageSizesCardData { + const _$NavApiDocsItemImageSizesCardDataImpl( + {@JsonKey(name: 'url') this.url = '', + @JsonKey(name: 'width') this.width = 0, + @JsonKey(name: 'height') this.height = 0, + @JsonKey(name: 'mimeType') this.mimeType = '', + @JsonKey(name: 'filesize') this.filesize = 0, + @JsonKey(name: 'filename') this.filename = ''}) + : super._(); + + factory _$NavApiDocsItemImageSizesCardDataImpl.fromJson( + Map json) => + _$$NavApiDocsItemImageSizesCardDataImplFromJson(json); + + @override + @JsonKey(name: 'url') + final String url; + @override + @JsonKey(name: 'width') + final int width; + @override + @JsonKey(name: 'height') + final int height; + @override + @JsonKey(name: 'mimeType') + final String mimeType; + @override + @JsonKey(name: 'filesize') + final int filesize; + @override + @JsonKey(name: 'filename') + final String filename; + + @override + String toString() { + return 'NavApiDocsItemImageSizesCardData(url: $url, width: $width, height: $height, mimeType: $mimeType, filesize: $filesize, filename: $filename)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NavApiDocsItemImageSizesCardDataImpl && + (identical(other.url, url) || other.url == url) && + (identical(other.width, width) || other.width == width) && + (identical(other.height, height) || other.height == height) && + (identical(other.mimeType, mimeType) || + other.mimeType == mimeType) && + (identical(other.filesize, filesize) || + other.filesize == filesize) && + (identical(other.filename, filename) || + other.filename == filename)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, url, width, height, mimeType, filesize, filename); + + /// Create a copy of NavApiDocsItemImageSizesCardData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$NavApiDocsItemImageSizesCardDataImplCopyWith< + _$NavApiDocsItemImageSizesCardDataImpl> + get copyWith => __$$NavApiDocsItemImageSizesCardDataImplCopyWithImpl< + _$NavApiDocsItemImageSizesCardDataImpl>(this, _$identity); + + @override + Map toJson() { + return _$$NavApiDocsItemImageSizesCardDataImplToJson( + this, + ); + } +} + +abstract class _NavApiDocsItemImageSizesCardData + extends NavApiDocsItemImageSizesCardData { + const factory _NavApiDocsItemImageSizesCardData( + {@JsonKey(name: 'url') final String url, + @JsonKey(name: 'width') final int width, + @JsonKey(name: 'height') final int height, + @JsonKey(name: 'mimeType') final String mimeType, + @JsonKey(name: 'filesize') final int filesize, + @JsonKey(name: 'filename') final String filename}) = + _$NavApiDocsItemImageSizesCardDataImpl; + const _NavApiDocsItemImageSizesCardData._() : super._(); + + factory _NavApiDocsItemImageSizesCardData.fromJson( + Map json) = + _$NavApiDocsItemImageSizesCardDataImpl.fromJson; + + @override + @JsonKey(name: 'url') + String get url; + @override + @JsonKey(name: 'width') + int get width; + @override + @JsonKey(name: 'height') + int get height; + @override + @JsonKey(name: 'mimeType') + String get mimeType; + @override + @JsonKey(name: 'filesize') + int get filesize; + @override + @JsonKey(name: 'filename') + String get filename; + + /// Create a copy of NavApiDocsItemImageSizesCardData + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$NavApiDocsItemImageSizesCardDataImplCopyWith< + _$NavApiDocsItemImageSizesCardDataImpl> + get copyWith => throw _privateConstructorUsedError; +} + +NavApiDocsItemImageSizesTabletData _$NavApiDocsItemImageSizesTabletDataFromJson( + Map json) { + return _NavApiDocsItemImageSizesTabletData.fromJson(json); +} + +/// @nodoc +mixin _$NavApiDocsItemImageSizesTabletData { + @JsonKey(name: 'url') + String get url => throw _privateConstructorUsedError; + @JsonKey(name: 'width') + int get width => throw _privateConstructorUsedError; + @JsonKey(name: 'height') + int get height => throw _privateConstructorUsedError; + @JsonKey(name: 'mimeType') + String get mimeType => throw _privateConstructorUsedError; + @JsonKey(name: 'filesize') + int get filesize => throw _privateConstructorUsedError; + @JsonKey(name: 'filename') + String get filename => throw _privateConstructorUsedError; + + /// Serializes this NavApiDocsItemImageSizesTabletData to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of NavApiDocsItemImageSizesTabletData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $NavApiDocsItemImageSizesTabletDataCopyWith< + NavApiDocsItemImageSizesTabletData> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $NavApiDocsItemImageSizesTabletDataCopyWith<$Res> { + factory $NavApiDocsItemImageSizesTabletDataCopyWith( + NavApiDocsItemImageSizesTabletData value, + $Res Function(NavApiDocsItemImageSizesTabletData) then) = + _$NavApiDocsItemImageSizesTabletDataCopyWithImpl<$Res, + NavApiDocsItemImageSizesTabletData>; + @useResult + $Res call( + {@JsonKey(name: 'url') String url, + @JsonKey(name: 'width') int width, + @JsonKey(name: 'height') int height, + @JsonKey(name: 'mimeType') String mimeType, + @JsonKey(name: 'filesize') int filesize, + @JsonKey(name: 'filename') String filename}); +} + +/// @nodoc +class _$NavApiDocsItemImageSizesTabletDataCopyWithImpl<$Res, + $Val extends NavApiDocsItemImageSizesTabletData> + implements $NavApiDocsItemImageSizesTabletDataCopyWith<$Res> { + _$NavApiDocsItemImageSizesTabletDataCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of NavApiDocsItemImageSizesTabletData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? url = null, + Object? width = null, + Object? height = null, + Object? mimeType = null, + Object? filesize = null, + Object? filename = null, + }) { + return _then(_value.copyWith( + url: null == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String, + width: null == width + ? _value.width + : width // ignore: cast_nullable_to_non_nullable + as int, + height: null == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as int, + mimeType: null == mimeType + ? _value.mimeType + : mimeType // ignore: cast_nullable_to_non_nullable + as String, + filesize: null == filesize + ? _value.filesize + : filesize // ignore: cast_nullable_to_non_nullable + as int, + filename: null == filename + ? _value.filename + : filename // ignore: cast_nullable_to_non_nullable + as String, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$NavApiDocsItemImageSizesTabletDataImplCopyWith<$Res> + implements $NavApiDocsItemImageSizesTabletDataCopyWith<$Res> { + factory _$$NavApiDocsItemImageSizesTabletDataImplCopyWith( + _$NavApiDocsItemImageSizesTabletDataImpl value, + $Res Function(_$NavApiDocsItemImageSizesTabletDataImpl) then) = + __$$NavApiDocsItemImageSizesTabletDataImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: 'url') String url, + @JsonKey(name: 'width') int width, + @JsonKey(name: 'height') int height, + @JsonKey(name: 'mimeType') String mimeType, + @JsonKey(name: 'filesize') int filesize, + @JsonKey(name: 'filename') String filename}); +} + +/// @nodoc +class __$$NavApiDocsItemImageSizesTabletDataImplCopyWithImpl<$Res> + extends _$NavApiDocsItemImageSizesTabletDataCopyWithImpl<$Res, + _$NavApiDocsItemImageSizesTabletDataImpl> + implements _$$NavApiDocsItemImageSizesTabletDataImplCopyWith<$Res> { + __$$NavApiDocsItemImageSizesTabletDataImplCopyWithImpl( + _$NavApiDocsItemImageSizesTabletDataImpl _value, + $Res Function(_$NavApiDocsItemImageSizesTabletDataImpl) _then) + : super(_value, _then); + + /// Create a copy of NavApiDocsItemImageSizesTabletData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? url = null, + Object? width = null, + Object? height = null, + Object? mimeType = null, + Object? filesize = null, + Object? filename = null, + }) { + return _then(_$NavApiDocsItemImageSizesTabletDataImpl( + url: null == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String, + width: null == width + ? _value.width + : width // ignore: cast_nullable_to_non_nullable + as int, + height: null == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as int, + mimeType: null == mimeType + ? _value.mimeType + : mimeType // ignore: cast_nullable_to_non_nullable + as String, + filesize: null == filesize + ? _value.filesize + : filesize // ignore: cast_nullable_to_non_nullable + as int, + filename: null == filename + ? _value.filename + : filename // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$NavApiDocsItemImageSizesTabletDataImpl + extends _NavApiDocsItemImageSizesTabletData { + const _$NavApiDocsItemImageSizesTabletDataImpl( + {@JsonKey(name: 'url') this.url = '', + @JsonKey(name: 'width') this.width = 0, + @JsonKey(name: 'height') this.height = 0, + @JsonKey(name: 'mimeType') this.mimeType = '', + @JsonKey(name: 'filesize') this.filesize = 0, + @JsonKey(name: 'filename') this.filename = ''}) + : super._(); + + factory _$NavApiDocsItemImageSizesTabletDataImpl.fromJson( + Map json) => + _$$NavApiDocsItemImageSizesTabletDataImplFromJson(json); + + @override + @JsonKey(name: 'url') + final String url; + @override + @JsonKey(name: 'width') + final int width; + @override + @JsonKey(name: 'height') + final int height; + @override + @JsonKey(name: 'mimeType') + final String mimeType; + @override + @JsonKey(name: 'filesize') + final int filesize; + @override + @JsonKey(name: 'filename') + final String filename; + + @override + String toString() { + return 'NavApiDocsItemImageSizesTabletData(url: $url, width: $width, height: $height, mimeType: $mimeType, filesize: $filesize, filename: $filename)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NavApiDocsItemImageSizesTabletDataImpl && + (identical(other.url, url) || other.url == url) && + (identical(other.width, width) || other.width == width) && + (identical(other.height, height) || other.height == height) && + (identical(other.mimeType, mimeType) || + other.mimeType == mimeType) && + (identical(other.filesize, filesize) || + other.filesize == filesize) && + (identical(other.filename, filename) || + other.filename == filename)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, url, width, height, mimeType, filesize, filename); + + /// Create a copy of NavApiDocsItemImageSizesTabletData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$NavApiDocsItemImageSizesTabletDataImplCopyWith< + _$NavApiDocsItemImageSizesTabletDataImpl> + get copyWith => __$$NavApiDocsItemImageSizesTabletDataImplCopyWithImpl< + _$NavApiDocsItemImageSizesTabletDataImpl>(this, _$identity); + + @override + Map toJson() { + return _$$NavApiDocsItemImageSizesTabletDataImplToJson( + this, + ); + } +} + +abstract class _NavApiDocsItemImageSizesTabletData + extends NavApiDocsItemImageSizesTabletData { + const factory _NavApiDocsItemImageSizesTabletData( + {@JsonKey(name: 'url') final String url, + @JsonKey(name: 'width') final int width, + @JsonKey(name: 'height') final int height, + @JsonKey(name: 'mimeType') final String mimeType, + @JsonKey(name: 'filesize') final int filesize, + @JsonKey(name: 'filename') final String filename}) = + _$NavApiDocsItemImageSizesTabletDataImpl; + const _NavApiDocsItemImageSizesTabletData._() : super._(); + + factory _NavApiDocsItemImageSizesTabletData.fromJson( + Map json) = + _$NavApiDocsItemImageSizesTabletDataImpl.fromJson; + + @override + @JsonKey(name: 'url') + String get url; + @override + @JsonKey(name: 'width') + int get width; + @override + @JsonKey(name: 'height') + int get height; + @override + @JsonKey(name: 'mimeType') + String get mimeType; + @override + @JsonKey(name: 'filesize') + int get filesize; + @override + @JsonKey(name: 'filename') + String get filename; + + /// Create a copy of NavApiDocsItemImageSizesTabletData + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$NavApiDocsItemImageSizesTabletDataImplCopyWith< + _$NavApiDocsItemImageSizesTabletDataImpl> + get copyWith => throw _privateConstructorUsedError; +} + +NavApiDocsItemImageSizesAvatarData _$NavApiDocsItemImageSizesAvatarDataFromJson( + Map json) { + return _NavApiDocsItemImageSizesAvatarData.fromJson(json); +} + +/// @nodoc +mixin _$NavApiDocsItemImageSizesAvatarData { + @JsonKey(name: 'url') + String get url => throw _privateConstructorUsedError; + @JsonKey(name: 'width') + int get width => throw _privateConstructorUsedError; + @JsonKey(name: 'height') + int get height => throw _privateConstructorUsedError; + @JsonKey(name: 'mimeType') + String get mimeType => throw _privateConstructorUsedError; + @JsonKey(name: 'filesize') + int get filesize => throw _privateConstructorUsedError; + @JsonKey(name: 'filename') + String get filename => throw _privateConstructorUsedError; + + /// Serializes this NavApiDocsItemImageSizesAvatarData to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of NavApiDocsItemImageSizesAvatarData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $NavApiDocsItemImageSizesAvatarDataCopyWith< + NavApiDocsItemImageSizesAvatarData> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $NavApiDocsItemImageSizesAvatarDataCopyWith<$Res> { + factory $NavApiDocsItemImageSizesAvatarDataCopyWith( + NavApiDocsItemImageSizesAvatarData value, + $Res Function(NavApiDocsItemImageSizesAvatarData) then) = + _$NavApiDocsItemImageSizesAvatarDataCopyWithImpl<$Res, + NavApiDocsItemImageSizesAvatarData>; + @useResult + $Res call( + {@JsonKey(name: 'url') String url, + @JsonKey(name: 'width') int width, + @JsonKey(name: 'height') int height, + @JsonKey(name: 'mimeType') String mimeType, + @JsonKey(name: 'filesize') int filesize, + @JsonKey(name: 'filename') String filename}); +} + +/// @nodoc +class _$NavApiDocsItemImageSizesAvatarDataCopyWithImpl<$Res, + $Val extends NavApiDocsItemImageSizesAvatarData> + implements $NavApiDocsItemImageSizesAvatarDataCopyWith<$Res> { + _$NavApiDocsItemImageSizesAvatarDataCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of NavApiDocsItemImageSizesAvatarData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? url = null, + Object? width = null, + Object? height = null, + Object? mimeType = null, + Object? filesize = null, + Object? filename = null, + }) { + return _then(_value.copyWith( + url: null == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String, + width: null == width + ? _value.width + : width // ignore: cast_nullable_to_non_nullable + as int, + height: null == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as int, + mimeType: null == mimeType + ? _value.mimeType + : mimeType // ignore: cast_nullable_to_non_nullable + as String, + filesize: null == filesize + ? _value.filesize + : filesize // ignore: cast_nullable_to_non_nullable + as int, + filename: null == filename + ? _value.filename + : filename // ignore: cast_nullable_to_non_nullable + as String, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$NavApiDocsItemImageSizesAvatarDataImplCopyWith<$Res> + implements $NavApiDocsItemImageSizesAvatarDataCopyWith<$Res> { + factory _$$NavApiDocsItemImageSizesAvatarDataImplCopyWith( + _$NavApiDocsItemImageSizesAvatarDataImpl value, + $Res Function(_$NavApiDocsItemImageSizesAvatarDataImpl) then) = + __$$NavApiDocsItemImageSizesAvatarDataImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: 'url') String url, + @JsonKey(name: 'width') int width, + @JsonKey(name: 'height') int height, + @JsonKey(name: 'mimeType') String mimeType, + @JsonKey(name: 'filesize') int filesize, + @JsonKey(name: 'filename') String filename}); +} + +/// @nodoc +class __$$NavApiDocsItemImageSizesAvatarDataImplCopyWithImpl<$Res> + extends _$NavApiDocsItemImageSizesAvatarDataCopyWithImpl<$Res, + _$NavApiDocsItemImageSizesAvatarDataImpl> + implements _$$NavApiDocsItemImageSizesAvatarDataImplCopyWith<$Res> { + __$$NavApiDocsItemImageSizesAvatarDataImplCopyWithImpl( + _$NavApiDocsItemImageSizesAvatarDataImpl _value, + $Res Function(_$NavApiDocsItemImageSizesAvatarDataImpl) _then) + : super(_value, _then); + + /// Create a copy of NavApiDocsItemImageSizesAvatarData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? url = null, + Object? width = null, + Object? height = null, + Object? mimeType = null, + Object? filesize = null, + Object? filename = null, + }) { + return _then(_$NavApiDocsItemImageSizesAvatarDataImpl( + url: null == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String, + width: null == width + ? _value.width + : width // ignore: cast_nullable_to_non_nullable + as int, + height: null == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as int, + mimeType: null == mimeType + ? _value.mimeType + : mimeType // ignore: cast_nullable_to_non_nullable + as String, + filesize: null == filesize + ? _value.filesize + : filesize // ignore: cast_nullable_to_non_nullable + as int, + filename: null == filename + ? _value.filename + : filename // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$NavApiDocsItemImageSizesAvatarDataImpl + extends _NavApiDocsItemImageSizesAvatarData { + const _$NavApiDocsItemImageSizesAvatarDataImpl( + {@JsonKey(name: 'url') this.url = '', + @JsonKey(name: 'width') this.width = 0, + @JsonKey(name: 'height') this.height = 0, + @JsonKey(name: 'mimeType') this.mimeType = '', + @JsonKey(name: 'filesize') this.filesize = 0, + @JsonKey(name: 'filename') this.filename = ''}) + : super._(); + + factory _$NavApiDocsItemImageSizesAvatarDataImpl.fromJson( + Map json) => + _$$NavApiDocsItemImageSizesAvatarDataImplFromJson(json); + + @override + @JsonKey(name: 'url') + final String url; + @override + @JsonKey(name: 'width') + final int width; + @override + @JsonKey(name: 'height') + final int height; + @override + @JsonKey(name: 'mimeType') + final String mimeType; + @override + @JsonKey(name: 'filesize') + final int filesize; + @override + @JsonKey(name: 'filename') + final String filename; + + @override + String toString() { + return 'NavApiDocsItemImageSizesAvatarData(url: $url, width: $width, height: $height, mimeType: $mimeType, filesize: $filesize, filename: $filename)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NavApiDocsItemImageSizesAvatarDataImpl && + (identical(other.url, url) || other.url == url) && + (identical(other.width, width) || other.width == width) && + (identical(other.height, height) || other.height == height) && + (identical(other.mimeType, mimeType) || + other.mimeType == mimeType) && + (identical(other.filesize, filesize) || + other.filesize == filesize) && + (identical(other.filename, filename) || + other.filename == filename)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, url, width, height, mimeType, filesize, filename); + + /// Create a copy of NavApiDocsItemImageSizesAvatarData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$NavApiDocsItemImageSizesAvatarDataImplCopyWith< + _$NavApiDocsItemImageSizesAvatarDataImpl> + get copyWith => __$$NavApiDocsItemImageSizesAvatarDataImplCopyWithImpl< + _$NavApiDocsItemImageSizesAvatarDataImpl>(this, _$identity); + + @override + Map toJson() { + return _$$NavApiDocsItemImageSizesAvatarDataImplToJson( + this, + ); + } +} + +abstract class _NavApiDocsItemImageSizesAvatarData + extends NavApiDocsItemImageSizesAvatarData { + const factory _NavApiDocsItemImageSizesAvatarData( + {@JsonKey(name: 'url') final String url, + @JsonKey(name: 'width') final int width, + @JsonKey(name: 'height') final int height, + @JsonKey(name: 'mimeType') final String mimeType, + @JsonKey(name: 'filesize') final int filesize, + @JsonKey(name: 'filename') final String filename}) = + _$NavApiDocsItemImageSizesAvatarDataImpl; + const _NavApiDocsItemImageSizesAvatarData._() : super._(); + + factory _NavApiDocsItemImageSizesAvatarData.fromJson( + Map json) = + _$NavApiDocsItemImageSizesAvatarDataImpl.fromJson; + + @override + @JsonKey(name: 'url') + String get url; + @override + @JsonKey(name: 'width') + int get width; + @override + @JsonKey(name: 'height') + int get height; + @override + @JsonKey(name: 'mimeType') + String get mimeType; + @override + @JsonKey(name: 'filesize') + int get filesize; + @override + @JsonKey(name: 'filename') + String get filename; + + /// Create a copy of NavApiDocsItemImageSizesAvatarData + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$NavApiDocsItemImageSizesAvatarDataImplCopyWith< + _$NavApiDocsItemImageSizesAvatarDataImpl> + get copyWith => throw _privateConstructorUsedError; +} + +NavApiDocsItemTagsItemData _$NavApiDocsItemTagsItemDataFromJson( + Map json) { + return _NavApiDocsItemTagsItemData.fromJson(json); +} + +/// @nodoc +mixin _$NavApiDocsItemTagsItemData { + @JsonKey(name: 'id') + String get id => throw _privateConstructorUsedError; + @JsonKey(name: 'name') + String get name => throw _privateConstructorUsedError; + @JsonKey(name: 'slug') + String get slug => throw _privateConstructorUsedError; + @JsonKey(name: 'updatedAt') + String get updatedAt => throw _privateConstructorUsedError; + @JsonKey(name: 'createdAt') + String get createdAt => throw _privateConstructorUsedError; + + /// Serializes this NavApiDocsItemTagsItemData to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of NavApiDocsItemTagsItemData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $NavApiDocsItemTagsItemDataCopyWith + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $NavApiDocsItemTagsItemDataCopyWith<$Res> { + factory $NavApiDocsItemTagsItemDataCopyWith(NavApiDocsItemTagsItemData value, + $Res Function(NavApiDocsItemTagsItemData) then) = + _$NavApiDocsItemTagsItemDataCopyWithImpl<$Res, + NavApiDocsItemTagsItemData>; + @useResult + $Res call( + {@JsonKey(name: 'id') String id, + @JsonKey(name: 'name') String name, + @JsonKey(name: 'slug') String slug, + @JsonKey(name: 'updatedAt') String updatedAt, + @JsonKey(name: 'createdAt') String createdAt}); +} + +/// @nodoc +class _$NavApiDocsItemTagsItemDataCopyWithImpl<$Res, + $Val extends NavApiDocsItemTagsItemData> + implements $NavApiDocsItemTagsItemDataCopyWith<$Res> { + _$NavApiDocsItemTagsItemDataCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of NavApiDocsItemTagsItemData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? slug = null, + Object? updatedAt = null, + Object? createdAt = null, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + slug: null == slug + ? _value.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as String, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as String, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$NavApiDocsItemTagsItemDataImplCopyWith<$Res> + implements $NavApiDocsItemTagsItemDataCopyWith<$Res> { + factory _$$NavApiDocsItemTagsItemDataImplCopyWith( + _$NavApiDocsItemTagsItemDataImpl value, + $Res Function(_$NavApiDocsItemTagsItemDataImpl) then) = + __$$NavApiDocsItemTagsItemDataImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: 'id') String id, + @JsonKey(name: 'name') String name, + @JsonKey(name: 'slug') String slug, + @JsonKey(name: 'updatedAt') String updatedAt, + @JsonKey(name: 'createdAt') String createdAt}); +} + +/// @nodoc +class __$$NavApiDocsItemTagsItemDataImplCopyWithImpl<$Res> + extends _$NavApiDocsItemTagsItemDataCopyWithImpl<$Res, + _$NavApiDocsItemTagsItemDataImpl> + implements _$$NavApiDocsItemTagsItemDataImplCopyWith<$Res> { + __$$NavApiDocsItemTagsItemDataImplCopyWithImpl( + _$NavApiDocsItemTagsItemDataImpl _value, + $Res Function(_$NavApiDocsItemTagsItemDataImpl) _then) + : super(_value, _then); + + /// Create a copy of NavApiDocsItemTagsItemData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? slug = null, + Object? updatedAt = null, + Object? createdAt = null, + }) { + return _then(_$NavApiDocsItemTagsItemDataImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + slug: null == slug + ? _value.slug + : slug // ignore: cast_nullable_to_non_nullable + as String, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as String, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$NavApiDocsItemTagsItemDataImpl extends _NavApiDocsItemTagsItemData { + const _$NavApiDocsItemTagsItemDataImpl( + {@JsonKey(name: 'id') this.id = '', + @JsonKey(name: 'name') this.name = '', + @JsonKey(name: 'slug') this.slug = '', + @JsonKey(name: 'updatedAt') this.updatedAt = '', + @JsonKey(name: 'createdAt') this.createdAt = ''}) + : super._(); + + factory _$NavApiDocsItemTagsItemDataImpl.fromJson( + Map json) => + _$$NavApiDocsItemTagsItemDataImplFromJson(json); + + @override + @JsonKey(name: 'id') + final String id; + @override + @JsonKey(name: 'name') + final String name; + @override + @JsonKey(name: 'slug') + final String slug; + @override + @JsonKey(name: 'updatedAt') + final String updatedAt; + @override + @JsonKey(name: 'createdAt') + final String createdAt; + + @override + String toString() { + return 'NavApiDocsItemTagsItemData(id: $id, name: $name, slug: $slug, updatedAt: $updatedAt, createdAt: $createdAt)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NavApiDocsItemTagsItemDataImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.name, name) || other.name == name) && + (identical(other.slug, slug) || other.slug == slug) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, id, name, slug, updatedAt, createdAt); + + /// Create a copy of NavApiDocsItemTagsItemData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$NavApiDocsItemTagsItemDataImplCopyWith<_$NavApiDocsItemTagsItemDataImpl> + get copyWith => __$$NavApiDocsItemTagsItemDataImplCopyWithImpl< + _$NavApiDocsItemTagsItemDataImpl>(this, _$identity); + + @override + Map toJson() { + return _$$NavApiDocsItemTagsItemDataImplToJson( + this, + ); + } +} + +abstract class _NavApiDocsItemTagsItemData extends NavApiDocsItemTagsItemData { + const factory _NavApiDocsItemTagsItemData( + {@JsonKey(name: 'id') final String id, + @JsonKey(name: 'name') final String name, + @JsonKey(name: 'slug') final String slug, + @JsonKey(name: 'updatedAt') final String updatedAt, + @JsonKey(name: 'createdAt') final String createdAt}) = + _$NavApiDocsItemTagsItemDataImpl; + const _NavApiDocsItemTagsItemData._() : super._(); + + factory _NavApiDocsItemTagsItemData.fromJson(Map json) = + _$NavApiDocsItemTagsItemDataImpl.fromJson; + + @override + @JsonKey(name: 'id') + String get id; + @override + @JsonKey(name: 'name') + String get name; + @override + @JsonKey(name: 'slug') + String get slug; + @override + @JsonKey(name: 'updatedAt') + String get updatedAt; + @override + @JsonKey(name: 'createdAt') + String get createdAt; + + /// Create a copy of NavApiDocsItemTagsItemData + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$NavApiDocsItemTagsItemDataImplCopyWith<_$NavApiDocsItemTagsItemDataImpl> + get copyWith => throw _privateConstructorUsedError; +} + +NavApiData _$NavApiDataFromJson(Map json) { + return _NavApiData.fromJson(json); +} + +/// @nodoc +mixin _$NavApiData { + @JsonKey(name: 'docs') + List get docs => throw _privateConstructorUsedError; + @JsonKey(name: 'hasNextPage') + bool get hasNextPage => throw _privateConstructorUsedError; + @JsonKey(name: 'hasPrevPage') + bool get hasPrevPage => throw _privateConstructorUsedError; + @JsonKey(name: 'limit') + int get limit => throw _privateConstructorUsedError; + @JsonKey(name: 'nextPage') + dynamic get nextPage => throw _privateConstructorUsedError; + @JsonKey(name: 'page') + int get page => throw _privateConstructorUsedError; + @JsonKey(name: 'pagingCounter') + int get pagingCounter => throw _privateConstructorUsedError; + @JsonKey(name: 'prevPage') + dynamic get prevPage => throw _privateConstructorUsedError; + @JsonKey(name: 'totalDocs') + int get totalDocs => throw _privateConstructorUsedError; + @JsonKey(name: 'totalPages') + int get totalPages => throw _privateConstructorUsedError; + + /// Serializes this NavApiData to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of NavApiData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $NavApiDataCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $NavApiDataCopyWith<$Res> { + factory $NavApiDataCopyWith( + NavApiData value, $Res Function(NavApiData) then) = + _$NavApiDataCopyWithImpl<$Res, NavApiData>; + @useResult + $Res call( + {@JsonKey(name: 'docs') List docs, + @JsonKey(name: 'hasNextPage') bool hasNextPage, + @JsonKey(name: 'hasPrevPage') bool hasPrevPage, + @JsonKey(name: 'limit') int limit, + @JsonKey(name: 'nextPage') dynamic nextPage, + @JsonKey(name: 'page') int page, + @JsonKey(name: 'pagingCounter') int pagingCounter, + @JsonKey(name: 'prevPage') dynamic prevPage, + @JsonKey(name: 'totalDocs') int totalDocs, + @JsonKey(name: 'totalPages') int totalPages}); +} + +/// @nodoc +class _$NavApiDataCopyWithImpl<$Res, $Val extends NavApiData> + implements $NavApiDataCopyWith<$Res> { + _$NavApiDataCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of NavApiData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? docs = null, + Object? hasNextPage = null, + Object? hasPrevPage = null, + Object? limit = null, + Object? nextPage = freezed, + Object? page = null, + Object? pagingCounter = null, + Object? prevPage = freezed, + Object? totalDocs = null, + Object? totalPages = null, + }) { + return _then(_value.copyWith( + docs: null == docs + ? _value.docs + : docs // ignore: cast_nullable_to_non_nullable + as List, + hasNextPage: null == hasNextPage + ? _value.hasNextPage + : hasNextPage // ignore: cast_nullable_to_non_nullable + as bool, + hasPrevPage: null == hasPrevPage + ? _value.hasPrevPage + : hasPrevPage // ignore: cast_nullable_to_non_nullable + as bool, + limit: null == limit + ? _value.limit + : limit // ignore: cast_nullable_to_non_nullable + as int, + nextPage: freezed == nextPage + ? _value.nextPage + : nextPage // ignore: cast_nullable_to_non_nullable + as dynamic, + page: null == page + ? _value.page + : page // ignore: cast_nullable_to_non_nullable + as int, + pagingCounter: null == pagingCounter + ? _value.pagingCounter + : pagingCounter // ignore: cast_nullable_to_non_nullable + as int, + prevPage: freezed == prevPage + ? _value.prevPage + : prevPage // ignore: cast_nullable_to_non_nullable + as dynamic, + totalDocs: null == totalDocs + ? _value.totalDocs + : totalDocs // ignore: cast_nullable_to_non_nullable + as int, + totalPages: null == totalPages + ? _value.totalPages + : totalPages // ignore: cast_nullable_to_non_nullable + as int, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$NavApiDataImplCopyWith<$Res> + implements $NavApiDataCopyWith<$Res> { + factory _$$NavApiDataImplCopyWith( + _$NavApiDataImpl value, $Res Function(_$NavApiDataImpl) then) = + __$$NavApiDataImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: 'docs') List docs, + @JsonKey(name: 'hasNextPage') bool hasNextPage, + @JsonKey(name: 'hasPrevPage') bool hasPrevPage, + @JsonKey(name: 'limit') int limit, + @JsonKey(name: 'nextPage') dynamic nextPage, + @JsonKey(name: 'page') int page, + @JsonKey(name: 'pagingCounter') int pagingCounter, + @JsonKey(name: 'prevPage') dynamic prevPage, + @JsonKey(name: 'totalDocs') int totalDocs, + @JsonKey(name: 'totalPages') int totalPages}); +} + +/// @nodoc +class __$$NavApiDataImplCopyWithImpl<$Res> + extends _$NavApiDataCopyWithImpl<$Res, _$NavApiDataImpl> + implements _$$NavApiDataImplCopyWith<$Res> { + __$$NavApiDataImplCopyWithImpl( + _$NavApiDataImpl _value, $Res Function(_$NavApiDataImpl) _then) + : super(_value, _then); + + /// Create a copy of NavApiData + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? docs = null, + Object? hasNextPage = null, + Object? hasPrevPage = null, + Object? limit = null, + Object? nextPage = freezed, + Object? page = null, + Object? pagingCounter = null, + Object? prevPage = freezed, + Object? totalDocs = null, + Object? totalPages = null, + }) { + return _then(_$NavApiDataImpl( + docs: null == docs + ? _value._docs + : docs // ignore: cast_nullable_to_non_nullable + as List, + hasNextPage: null == hasNextPage + ? _value.hasNextPage + : hasNextPage // ignore: cast_nullable_to_non_nullable + as bool, + hasPrevPage: null == hasPrevPage + ? _value.hasPrevPage + : hasPrevPage // ignore: cast_nullable_to_non_nullable + as bool, + limit: null == limit + ? _value.limit + : limit // ignore: cast_nullable_to_non_nullable + as int, + nextPage: freezed == nextPage + ? _value.nextPage + : nextPage // ignore: cast_nullable_to_non_nullable + as dynamic, + page: null == page + ? _value.page + : page // ignore: cast_nullable_to_non_nullable + as int, + pagingCounter: null == pagingCounter + ? _value.pagingCounter + : pagingCounter // ignore: cast_nullable_to_non_nullable + as int, + prevPage: freezed == prevPage + ? _value.prevPage + : prevPage // ignore: cast_nullable_to_non_nullable + as dynamic, + totalDocs: null == totalDocs + ? _value.totalDocs + : totalDocs // ignore: cast_nullable_to_non_nullable + as int, + totalPages: null == totalPages + ? _value.totalPages + : totalPages // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$NavApiDataImpl extends _NavApiData { + const _$NavApiDataImpl( + {@JsonKey(name: 'docs') + final List docs = const [], + @JsonKey(name: 'hasNextPage') this.hasNextPage = false, + @JsonKey(name: 'hasPrevPage') this.hasPrevPage = false, + @JsonKey(name: 'limit') this.limit = 0, + @JsonKey(name: 'nextPage') this.nextPage, + @JsonKey(name: 'page') this.page = 0, + @JsonKey(name: 'pagingCounter') this.pagingCounter = 0, + @JsonKey(name: 'prevPage') this.prevPage, + @JsonKey(name: 'totalDocs') this.totalDocs = 0, + @JsonKey(name: 'totalPages') this.totalPages = 0}) + : _docs = docs, + super._(); + + factory _$NavApiDataImpl.fromJson(Map json) => + _$$NavApiDataImplFromJson(json); + + final List _docs; + @override + @JsonKey(name: 'docs') + List get docs { + if (_docs is EqualUnmodifiableListView) return _docs; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_docs); + } + + @override + @JsonKey(name: 'hasNextPage') + final bool hasNextPage; + @override + @JsonKey(name: 'hasPrevPage') + final bool hasPrevPage; + @override + @JsonKey(name: 'limit') + final int limit; + @override + @JsonKey(name: 'nextPage') + final dynamic nextPage; + @override + @JsonKey(name: 'page') + final int page; + @override + @JsonKey(name: 'pagingCounter') + final int pagingCounter; + @override + @JsonKey(name: 'prevPage') + final dynamic prevPage; + @override + @JsonKey(name: 'totalDocs') + final int totalDocs; + @override + @JsonKey(name: 'totalPages') + final int totalPages; + + @override + String toString() { + return 'NavApiData(docs: $docs, hasNextPage: $hasNextPage, hasPrevPage: $hasPrevPage, limit: $limit, nextPage: $nextPage, page: $page, pagingCounter: $pagingCounter, prevPage: $prevPage, totalDocs: $totalDocs, totalPages: $totalPages)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NavApiDataImpl && + const DeepCollectionEquality().equals(other._docs, _docs) && + (identical(other.hasNextPage, hasNextPage) || + other.hasNextPage == hasNextPage) && + (identical(other.hasPrevPage, hasPrevPage) || + other.hasPrevPage == hasPrevPage) && + (identical(other.limit, limit) || other.limit == limit) && + const DeepCollectionEquality().equals(other.nextPage, nextPage) && + (identical(other.page, page) || other.page == page) && + (identical(other.pagingCounter, pagingCounter) || + other.pagingCounter == pagingCounter) && + const DeepCollectionEquality().equals(other.prevPage, prevPage) && + (identical(other.totalDocs, totalDocs) || + other.totalDocs == totalDocs) && + (identical(other.totalPages, totalPages) || + other.totalPages == totalPages)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(_docs), + hasNextPage, + hasPrevPage, + limit, + const DeepCollectionEquality().hash(nextPage), + page, + pagingCounter, + const DeepCollectionEquality().hash(prevPage), + totalDocs, + totalPages); + + /// Create a copy of NavApiData + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$NavApiDataImplCopyWith<_$NavApiDataImpl> get copyWith => + __$$NavApiDataImplCopyWithImpl<_$NavApiDataImpl>(this, _$identity); + + @override + Map toJson() { + return _$$NavApiDataImplToJson( + this, + ); + } +} + +abstract class _NavApiData extends NavApiData { + const factory _NavApiData( + {@JsonKey(name: 'docs') final List docs, + @JsonKey(name: 'hasNextPage') final bool hasNextPage, + @JsonKey(name: 'hasPrevPage') final bool hasPrevPage, + @JsonKey(name: 'limit') final int limit, + @JsonKey(name: 'nextPage') final dynamic nextPage, + @JsonKey(name: 'page') final int page, + @JsonKey(name: 'pagingCounter') final int pagingCounter, + @JsonKey(name: 'prevPage') final dynamic prevPage, + @JsonKey(name: 'totalDocs') final int totalDocs, + @JsonKey(name: 'totalPages') final int totalPages}) = _$NavApiDataImpl; + const _NavApiData._() : super._(); + + factory _NavApiData.fromJson(Map json) = + _$NavApiDataImpl.fromJson; + + @override + @JsonKey(name: 'docs') + List get docs; + @override + @JsonKey(name: 'hasNextPage') + bool get hasNextPage; + @override + @JsonKey(name: 'hasPrevPage') + bool get hasPrevPage; + @override + @JsonKey(name: 'limit') + int get limit; + @override + @JsonKey(name: 'nextPage') + dynamic get nextPage; + @override + @JsonKey(name: 'page') + int get page; + @override + @JsonKey(name: 'pagingCounter') + int get pagingCounter; + @override + @JsonKey(name: 'prevPage') + dynamic get prevPage; + @override + @JsonKey(name: 'totalDocs') + int get totalDocs; + @override + @JsonKey(name: 'totalPages') + int get totalPages; + + /// Create a copy of NavApiData + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$NavApiDataImplCopyWith<_$NavApiDataImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/data/nav_api_data.g.dart b/lib/data/nav_api_data.g.dart new file mode 100644 index 0000000..1119e7b --- /dev/null +++ b/lib/data/nav_api_data.g.dart @@ -0,0 +1,336 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'nav_api_data.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$NavApiDocsItemDataImpl _$$NavApiDocsItemDataImplFromJson( + Map json) => + _$NavApiDocsItemDataImpl( + id: json['id'] as String? ?? '', + name: json['name'] as String? ?? '', + slug: json['slug'] as String? ?? '', + abstract_: json['abstract'] as String? ?? '', + description: json['description'] as String? ?? '', + image: json['image'] == null + ? const NavApiDocsItemImageData() + : NavApiDocsItemImageData.fromJson( + json['image'] as Map), + link: json['link'] as String? ?? '', + isSponsored: json['is_sponsored'] as bool? ?? false, + tags: (json['tags'] as List?) + ?.map((e) => NavApiDocsItemTagsItemData.fromJson( + e as Map)) + .toList() ?? + const [], + updatedAt: json['updatedAt'] as String? ?? '', + createdAt: json['createdAt'] as String? ?? '', + ); + +Map _$$NavApiDocsItemDataImplToJson( + _$NavApiDocsItemDataImpl instance) => + { + 'id': instance.id, + 'name': instance.name, + 'slug': instance.slug, + 'abstract': instance.abstract_, + 'description': instance.description, + 'image': instance.image, + 'link': instance.link, + 'is_sponsored': instance.isSponsored, + 'tags': instance.tags, + 'updatedAt': instance.updatedAt, + 'createdAt': instance.createdAt, + }; + +_$NavApiDocsItemImageDataImpl _$$NavApiDocsItemImageDataImplFromJson( + Map json) => + _$NavApiDocsItemImageDataImpl( + id: json['id'] as String? ?? '', + createdBy: json['createdBy'] == null + ? const NavApiDocsItemImageCreatedByData() + : NavApiDocsItemImageCreatedByData.fromJson( + json['createdBy'] as Map), + title: json['title'] as String? ?? '', + original: json['original'] as bool? ?? false, + credit: json['credit'] as String? ?? '', + source: json['source'] as String? ?? '', + license: json['license'] as String? ?? '', + caption: json['caption'], + updatedAt: json['updatedAt'] as String? ?? '', + createdAt: json['createdAt'] as String? ?? '', + url: json['url'] as String? ?? '', + filename: json['filename'] as String? ?? '', + mimeType: json['mimeType'] as String? ?? '', + filesize: (json['filesize'] as num?)?.toInt() ?? 0, + width: (json['width'] as num?)?.toInt() ?? 0, + height: (json['height'] as num?)?.toInt() ?? 0, + sizes: json['sizes'] == null + ? const NavApiDocsItemImageSizesData() + : NavApiDocsItemImageSizesData.fromJson( + json['sizes'] as Map), + ); + +Map _$$NavApiDocsItemImageDataImplToJson( + _$NavApiDocsItemImageDataImpl instance) => + { + 'id': instance.id, + 'createdBy': instance.createdBy, + 'title': instance.title, + 'original': instance.original, + 'credit': instance.credit, + 'source': instance.source, + 'license': instance.license, + 'caption': instance.caption, + 'updatedAt': instance.updatedAt, + 'createdAt': instance.createdAt, + 'url': instance.url, + 'filename': instance.filename, + 'mimeType': instance.mimeType, + 'filesize': instance.filesize, + 'width': instance.width, + 'height': instance.height, + 'sizes': instance.sizes, + }; + +_$NavApiDocsItemImageCreatedByDataImpl + _$$NavApiDocsItemImageCreatedByDataImplFromJson( + Map json) => + _$NavApiDocsItemImageCreatedByDataImpl( + id: json['id'] as String? ?? '', + sub: json['sub'] as String? ?? '', + externalProvider: json['external_provider'] as String? ?? '', + username: json['username'] as String? ?? '', + name: json['name'] as String? ?? '', + roles: (json['roles'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], + avatarUrl: json['avatar_url'] as String? ?? '', + updatedAt: json['updatedAt'] as String? ?? '', + createdAt: json['createdAt'] as String? ?? '', + email: json['email'] as String? ?? '', + loginAttempts: (json['loginAttempts'] as num?)?.toInt() ?? 0, + avatar: json['avatar'] as String? ?? '', + ); + +Map _$$NavApiDocsItemImageCreatedByDataImplToJson( + _$NavApiDocsItemImageCreatedByDataImpl instance) => + { + 'id': instance.id, + 'sub': instance.sub, + 'external_provider': instance.externalProvider, + 'username': instance.username, + 'name': instance.name, + 'roles': instance.roles, + 'avatar_url': instance.avatarUrl, + 'updatedAt': instance.updatedAt, + 'createdAt': instance.createdAt, + 'email': instance.email, + 'loginAttempts': instance.loginAttempts, + 'avatar': instance.avatar, + }; + +_$NavApiDocsItemImageSizesThumbnailDataImpl + _$$NavApiDocsItemImageSizesThumbnailDataImplFromJson( + Map json) => + _$NavApiDocsItemImageSizesThumbnailDataImpl( + url: json['url'] as String? ?? '', + width: (json['width'] as num?)?.toInt() ?? 0, + height: (json['height'] as num?)?.toInt() ?? 0, + mimeType: json['mimeType'] as String? ?? '', + filesize: (json['filesize'] as num?)?.toInt() ?? 0, + filename: json['filename'] as String? ?? '', + ); + +Map _$$NavApiDocsItemImageSizesThumbnailDataImplToJson( + _$NavApiDocsItemImageSizesThumbnailDataImpl instance) => + { + 'url': instance.url, + 'width': instance.width, + 'height': instance.height, + 'mimeType': instance.mimeType, + 'filesize': instance.filesize, + 'filename': instance.filename, + }; + +_$NavApiDocsItemImageSizesDataImpl _$$NavApiDocsItemImageSizesDataImplFromJson( + Map json) => + _$NavApiDocsItemImageSizesDataImpl( + thumbnail: json['thumbnail'] == null + ? const NavApiDocsItemImageSizesThumbnailData() + : NavApiDocsItemImageSizesThumbnailData.fromJson( + json['thumbnail'] as Map), + preload: json['preload'] == null + ? const NavApiDocsItemImageSizesPreloadData() + : NavApiDocsItemImageSizesPreloadData.fromJson( + json['preload'] as Map), + card: json['card'] == null + ? const NavApiDocsItemImageSizesCardData() + : NavApiDocsItemImageSizesCardData.fromJson( + json['card'] as Map), + tablet: json['tablet'] == null + ? const NavApiDocsItemImageSizesTabletData() + : NavApiDocsItemImageSizesTabletData.fromJson( + json['tablet'] as Map), + avatar: json['avatar'] == null + ? const NavApiDocsItemImageSizesAvatarData() + : NavApiDocsItemImageSizesAvatarData.fromJson( + json['avatar'] as Map), + ); + +Map _$$NavApiDocsItemImageSizesDataImplToJson( + _$NavApiDocsItemImageSizesDataImpl instance) => + { + 'thumbnail': instance.thumbnail, + 'preload': instance.preload, + 'card': instance.card, + 'tablet': instance.tablet, + 'avatar': instance.avatar, + }; + +_$NavApiDocsItemImageSizesPreloadDataImpl + _$$NavApiDocsItemImageSizesPreloadDataImplFromJson( + Map json) => + _$NavApiDocsItemImageSizesPreloadDataImpl( + url: json['url'], + width: json['width'], + height: json['height'], + mimeType: json['mimeType'], + filesize: json['filesize'], + filename: json['filename'], + ); + +Map _$$NavApiDocsItemImageSizesPreloadDataImplToJson( + _$NavApiDocsItemImageSizesPreloadDataImpl instance) => + { + 'url': instance.url, + 'width': instance.width, + 'height': instance.height, + 'mimeType': instance.mimeType, + 'filesize': instance.filesize, + 'filename': instance.filename, + }; + +_$NavApiDocsItemImageSizesCardDataImpl + _$$NavApiDocsItemImageSizesCardDataImplFromJson( + Map json) => + _$NavApiDocsItemImageSizesCardDataImpl( + url: json['url'] as String? ?? '', + width: (json['width'] as num?)?.toInt() ?? 0, + height: (json['height'] as num?)?.toInt() ?? 0, + mimeType: json['mimeType'] as String? ?? '', + filesize: (json['filesize'] as num?)?.toInt() ?? 0, + filename: json['filename'] as String? ?? '', + ); + +Map _$$NavApiDocsItemImageSizesCardDataImplToJson( + _$NavApiDocsItemImageSizesCardDataImpl instance) => + { + 'url': instance.url, + 'width': instance.width, + 'height': instance.height, + 'mimeType': instance.mimeType, + 'filesize': instance.filesize, + 'filename': instance.filename, + }; + +_$NavApiDocsItemImageSizesTabletDataImpl + _$$NavApiDocsItemImageSizesTabletDataImplFromJson( + Map json) => + _$NavApiDocsItemImageSizesTabletDataImpl( + url: json['url'] as String? ?? '', + width: (json['width'] as num?)?.toInt() ?? 0, + height: (json['height'] as num?)?.toInt() ?? 0, + mimeType: json['mimeType'] as String? ?? '', + filesize: (json['filesize'] as num?)?.toInt() ?? 0, + filename: json['filename'] as String? ?? '', + ); + +Map _$$NavApiDocsItemImageSizesTabletDataImplToJson( + _$NavApiDocsItemImageSizesTabletDataImpl instance) => + { + 'url': instance.url, + 'width': instance.width, + 'height': instance.height, + 'mimeType': instance.mimeType, + 'filesize': instance.filesize, + 'filename': instance.filename, + }; + +_$NavApiDocsItemImageSizesAvatarDataImpl + _$$NavApiDocsItemImageSizesAvatarDataImplFromJson( + Map json) => + _$NavApiDocsItemImageSizesAvatarDataImpl( + url: json['url'] as String? ?? '', + width: (json['width'] as num?)?.toInt() ?? 0, + height: (json['height'] as num?)?.toInt() ?? 0, + mimeType: json['mimeType'] as String? ?? '', + filesize: (json['filesize'] as num?)?.toInt() ?? 0, + filename: json['filename'] as String? ?? '', + ); + +Map _$$NavApiDocsItemImageSizesAvatarDataImplToJson( + _$NavApiDocsItemImageSizesAvatarDataImpl instance) => + { + 'url': instance.url, + 'width': instance.width, + 'height': instance.height, + 'mimeType': instance.mimeType, + 'filesize': instance.filesize, + 'filename': instance.filename, + }; + +_$NavApiDocsItemTagsItemDataImpl _$$NavApiDocsItemTagsItemDataImplFromJson( + Map json) => + _$NavApiDocsItemTagsItemDataImpl( + id: json['id'] as String? ?? '', + name: json['name'] as String? ?? '', + slug: json['slug'] as String? ?? '', + updatedAt: json['updatedAt'] as String? ?? '', + createdAt: json['createdAt'] as String? ?? '', + ); + +Map _$$NavApiDocsItemTagsItemDataImplToJson( + _$NavApiDocsItemTagsItemDataImpl instance) => + { + 'id': instance.id, + 'name': instance.name, + 'slug': instance.slug, + 'updatedAt': instance.updatedAt, + 'createdAt': instance.createdAt, + }; + +_$NavApiDataImpl _$$NavApiDataImplFromJson(Map json) => + _$NavApiDataImpl( + docs: (json['docs'] as List?) + ?.map( + (e) => NavApiDocsItemData.fromJson(e as Map)) + .toList() ?? + const [], + hasNextPage: json['hasNextPage'] as bool? ?? false, + hasPrevPage: json['hasPrevPage'] as bool? ?? false, + limit: (json['limit'] as num?)?.toInt() ?? 0, + nextPage: json['nextPage'], + page: (json['page'] as num?)?.toInt() ?? 0, + pagingCounter: (json['pagingCounter'] as num?)?.toInt() ?? 0, + prevPage: json['prevPage'], + totalDocs: (json['totalDocs'] as num?)?.toInt() ?? 0, + totalPages: (json['totalPages'] as num?)?.toInt() ?? 0, + ); + +Map _$$NavApiDataImplToJson(_$NavApiDataImpl instance) => + { + 'docs': instance.docs, + 'hasNextPage': instance.hasNextPage, + 'hasPrevPage': instance.hasPrevPage, + 'limit': instance.limit, + 'nextPage': instance.nextPage, + 'page': instance.page, + 'pagingCounter': instance.pagingCounter, + 'prevPage': instance.prevPage, + 'totalDocs': instance.totalDocs, + 'totalPages': instance.totalPages, + }; diff --git a/lib/ui/about/about_ui.dart b/lib/ui/about/about_ui.dart index 8025f09..18adf86 100644 --- a/lib/ui/about/about_ui.dart +++ b/lib/ui/about/about_ui.dart @@ -30,8 +30,7 @@ class AboutUI extends HookConsumerWidget { ); } - Widget _makeAbout(BuildContext context, WidgetRef ref, - ValueNotifier isTipTextCn, PageController pageCtrl) { + Widget _makeAbout(BuildContext context, WidgetRef ref, ValueNotifier isTipTextCn, PageController pageCtrl) { return Stack( children: [ Center( @@ -42,9 +41,7 @@ class AboutUI extends HookConsumerWidget { const SizedBox(height: 32), Image.asset("assets/app_logo.png", width: 128, height: 128), const SizedBox(height: 6), - Text( - S.current.app_index_version_info( - ConstConf.appVersion, ConstConf.isMSE ? "" : " Dev"), + Text(S.current.app_index_version_info(ConstConf.appVersion, ConstConf.isMSE ? "" : " Dev"), style: const TextStyle(fontSize: 18)), const SizedBox(height: 12), Button( @@ -56,18 +53,15 @@ class AboutUI extends HookConsumerWidget { const SizedBox(height: 32), Container( margin: const EdgeInsets.all(24), - decoration: BoxDecoration( - color: FluentTheme.of(context).cardColor, - borderRadius: BorderRadius.circular(12)), + decoration: + BoxDecoration(color: FluentTheme.of(context).cardColor, borderRadius: BorderRadius.circular(12)), child: Padding( padding: const EdgeInsets.all(24), child: Column( children: [ Text( S.current.about_app_description, - style: TextStyle( - fontSize: 14, - color: Colors.white.withValues(alpha: .9)), + style: TextStyle(fontSize: 14, color: Colors.white.withValues(alpha: .9)), ), ], ), @@ -86,9 +80,7 @@ class AboutUI extends HookConsumerWidget { child: Container( width: MediaQuery.of(context).size.width * .35, decoration: BoxDecoration( - color: FluentTheme.of(context) - .cardColor - .withValues(alpha: .06), + color: FluentTheme.of(context).cardColor.withValues(alpha: .06), borderRadius: BorderRadius.circular(12)), child: IconButton( icon: Padding( @@ -96,9 +88,7 @@ class AboutUI extends HookConsumerWidget { child: Text( isTipTextCn.value ? tipTextCN : tipTextEN, textAlign: TextAlign.start, - style: TextStyle( - fontSize: 12, - color: Colors.white.withValues(alpha: .9)), + style: TextStyle(fontSize: 12, color: Colors.white.withValues(alpha: .9)), ), ), onPressed: () { @@ -126,8 +116,7 @@ class AboutUI extends HookConsumerWidget { ); } - Widget _makeDonate( - BuildContext context, WidgetRef ref, PageController pageCtrl) { + Widget _makeDonate(BuildContext context, WidgetRef ref, PageController pageCtrl) { final donationTypeNotifier = useState('alipay'); final bubbleMessages = [ S.current.support_dev_thanks_message, @@ -171,8 +160,7 @@ class AboutUI extends HookConsumerWidget { for (var i = 0; i < bubbleMessages.length; i++) Padding( padding: const EdgeInsets.only(bottom: 8), - child: SelectionArea( - child: ChatBubble(message: bubbleMessages[i])), + child: SelectionArea(child: ChatBubble(message: bubbleMessages[i])), ), ], ), @@ -261,14 +249,10 @@ class AboutUI extends HookConsumerWidget { padding: const EdgeInsets.symmetric(horizontal: 8), child: Button( style: ButtonStyle( - backgroundColor: WidgetStateProperty.resolveWith((states) => - isSelected - ? ButtonThemeData.buttonColor(context, states) - .withAlpha((255.0 * 0.08).round()) - : ButtonThemeData.buttonColor(context, states) - .withAlpha((255.0 * 0.005).round())), - padding: WidgetStateProperty.all( - EdgeInsets.symmetric(horizontal: 16, vertical: 8)), + backgroundColor: WidgetStateProperty.resolveWith((states) => isSelected + ? ButtonThemeData.buttonColor(context, states).withAlpha((255.0 * 0.08).round()) + : ButtonThemeData.buttonColor(context, states).withAlpha((255.0 * 0.005).round())), + padding: WidgetStateProperty.all(EdgeInsets.symmetric(horizontal: 16, vertical: 8)), ), onPressed: onTap, child: Column( @@ -328,16 +312,13 @@ class AboutUI extends HookConsumerWidget { Container( padding: const EdgeInsets.all(16), decoration: BoxDecoration( - color: FluentTheme.of(context) - .cardColor - .withAlpha((255 * .1).round()), + color: FluentTheme.of(context).cardColor.withAlpha((255 * .1).round()), borderRadius: BorderRadius.circular(8), ), child: Row( mainAxisSize: MainAxisSize.min, children: [ - Text(S.current.support_dev_in_game_id, - style: TextStyle(fontSize: 16)), + Text(S.current.support_dev_in_game_id, style: TextStyle(fontSize: 16)), const SizedBox(width: 12), Button( onPressed: () { @@ -386,8 +367,7 @@ class AboutUI extends HookConsumerWidget { return Column( key: ValueKey(type), children: [ - Text(title, - style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)), + Text(title, style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)), const SizedBox(height: 16), Container( width: 200, @@ -413,19 +393,13 @@ class AboutUI extends HookConsumerWidget { icon: Row( mainAxisSize: MainAxisSize.min, children: [ - Icon( - pageIndex == 0 - ? FluentIcons.chevron_up - : FluentIcons.chevron_down, - size: 12), + Icon(pageIndex == 0 ? FluentIcons.chevron_up : FluentIcons.chevron_down, size: 12), SizedBox(width: 8), - Text(pageIndex == 0 - ? S.current.support_dev_back_button - : S.current.support_dev_scroll_hint), + Text(pageIndex == 0 ? S.current.support_dev_back_button : S.current.support_dev_scroll_hint), ], ), - onPressed: () => pageCtrl.animateToPage(pageIndex, - duration: const Duration(milliseconds: 300), curve: Curves.ease), + onPressed: () => + pageCtrl.animateToPage(pageIndex, duration: const Duration(milliseconds: 300), curve: Curves.ease), ); } @@ -440,8 +414,7 @@ class AboutUI extends HookConsumerWidget { const SizedBox(width: 8), Text( S.current.about_action_btn_faq, - style: TextStyle( - fontSize: 14, color: Colors.white.withValues(alpha: .6)), + style: TextStyle(fontSize: 14, color: Colors.white.withValues(alpha: .6)), ), ], ), @@ -457,8 +430,7 @@ class AboutUI extends HookConsumerWidget { const SizedBox(width: 8), Text( S.current.about_online_feedback, - style: TextStyle( - fontSize: 14, color: Colors.white.withValues(alpha: .6)), + style: TextStyle(fontSize: 14, color: Colors.white.withValues(alpha: .6)), ), ], ), @@ -474,8 +446,7 @@ class AboutUI extends HookConsumerWidget { const SizedBox(width: 8), Text( S.current.about_action_qq_group, - style: TextStyle( - fontSize: 14, color: Colors.white.withValues(alpha: .6)), + style: TextStyle(fontSize: 14, color: Colors.white.withValues(alpha: .6)), ), ], ), @@ -492,8 +463,7 @@ class AboutUI extends HookConsumerWidget { const SizedBox(width: 8), Text( S.current.about_action_email, - style: TextStyle( - fontSize: 14, color: Colors.white.withValues(alpha: .6)), + style: TextStyle(fontSize: 14, color: Colors.white.withValues(alpha: .6)), ), ], ), @@ -509,8 +479,7 @@ class AboutUI extends HookConsumerWidget { const SizedBox(width: 8), Text( S.current.about_action_open_source, - style: TextStyle( - fontSize: 14, color: Colors.white.withValues(alpha: .6)), + style: TextStyle(fontSize: 14, color: Colors.white.withValues(alpha: .6)), ), ], ), @@ -528,6 +497,7 @@ class AboutUI extends HookConsumerWidget { static String get tipTextCN => S.current.about_disclaimer; Widget makeAnalyticsWidget(BuildContext context) { + var buildIndex = 0; return LoadingWidget( onLoadData: AnalyticsApi.getAnalyticsData, autoRefreshDuration: const Duration(seconds: 60), @@ -547,20 +517,18 @@ class AboutUI extends HookConsumerWidget { "performance_apply", "p4k_download", ].contains(item["Type"])) - makeAnalyticsItem( - context: context, - name: item["Type"] as String, - value: item["Count"] as int) + GridItemAnimator( + index: buildIndex++, + child: makeAnalyticsItem( + context: context, name: item["Type"] as String, value: item["Count"] as int), + ) ], ); }, ); } - Widget makeAnalyticsItem( - {required BuildContext context, - required String name, - required int value}) { + Widget makeAnalyticsItem({required BuildContext context, required String name, required int value}) { final names = { "launch": S.current.about_analytics_launch, "gameLaunch": S.current.about_analytics_launch_game, @@ -573,14 +541,12 @@ class AboutUI extends HookConsumerWidget { padding: const EdgeInsets.all(12), margin: const EdgeInsets.only(left: 18, right: 18), decoration: BoxDecoration( - color: FluentTheme.of(context).cardColor.withValues(alpha: .06), - borderRadius: BorderRadius.circular(12)), + color: FluentTheme.of(context).cardColor.withValues(alpha: .06), borderRadius: BorderRadius.circular(12)), child: Column( children: [ Text( names[name] ?? name, - style: TextStyle( - fontSize: 13, color: Colors.white.withValues(alpha: .6)), + style: TextStyle(fontSize: 13, color: Colors.white.withValues(alpha: .6)), ), const SizedBox(height: 4), Row( @@ -606,8 +572,7 @@ class AboutUI extends HookConsumerWidget { launchUrlString("ms-windows-store://pdp/?productid=9NF3SWFWNKL1"); return; } else { - final hasUpdate = - await ref.read(appGlobalModelProvider.notifier).checkUpdate(context); + final hasUpdate = await ref.read(appGlobalModelProvider.notifier).checkUpdate(context); if (!hasUpdate) { if (!context.mounted) return; showToast(context, S.current.about_info_latest_version); @@ -626,8 +591,7 @@ class ChatBubble extends StatelessWidget { return Container( padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10), decoration: BoxDecoration( - color: - FluentTheme.of(context).accentColor.withAlpha((255.0 * .2).round()), + color: FluentTheme.of(context).accentColor.withAlpha((255.0 * .2).round()), borderRadius: BorderRadius.only( topLeft: Radius.circular(4), topRight: Radius.circular(18), @@ -645,8 +609,7 @@ class ChatBubble extends StatelessWidget { class DonationQrCodeData { static const alipay = "https://qr.alipay.com/tsx16308c4uai0ticmz4j96"; - static const wechat = - "wxp://f2f0J40rTCX7Vt79yooWNbiqH3U6UmwGJkqjcAYnrv9OZVzKyS5_W6trp8mo3KP-CTQ5"; + static const wechat = "wxp://f2f0J40rTCX7Vt79yooWNbiqH3U6UmwGJkqjcAYnrv9OZVzKyS5_W6trp8mo3KP-CTQ5"; static const qq = "https://i.qianbao.qq.com/wallet/sqrcode.htm?m=tenpay&f=wallet&a=1&u=3334969096&n=xkeyC&ac=CAEQiK6etgwY8ZuKvgYyGOa1geWKqOaRiuS9jee7j-iQpeaUtuasvjgBQiAzY2Y4NWY3MDI1MWUxYWEwMGYyN2Q0OTM4Y2U2ODFlMw%3D%3D_xxx_sign"; } diff --git a/lib/ui/home/localization/advanced_localization_ui.dart b/lib/ui/home/localization/advanced_localization_ui.dart index 6236734..4899332 100644 --- a/lib/ui/home/localization/advanced_localization_ui.dart +++ b/lib/ui/home/localization/advanced_localization_ui.dart @@ -28,8 +28,7 @@ class AdvancedLocalizationUI extends HookConsumerWidget { onSwitchFile() async { final sb = await showDialog( context: context, - builder: (BuildContext context) => - const LocalizationFromFileDialogUI(isInAdvancedMode: true), + builder: (BuildContext context) => const LocalizationFromFileDialogUI(isInAdvancedMode: true), ); if (sb is (StringBuffer, bool)) { model.setCustomizeGlobalIni(sb.$1.toString()); @@ -42,8 +41,7 @@ class AdvancedLocalizationUI extends HookConsumerWidget { }, const []); return makeDefaultPage( - title: S.current.home_localization_advanced_title( - homeUIState.scInstalledPath ?? "-"), + title: S.current.home_localization_advanced_title(homeUIState.scInstalledPath ?? "-"), context, content: state.workingText.isNotEmpty ? Center( @@ -71,15 +69,13 @@ class AdvancedLocalizationUI extends HookConsumerWidget { children: [ Text( S.current.home_localization_advanced_msg_version( - state.apiLocalizationData?.versionName ?? - "-"), + state.apiLocalizationData?.versionName ?? "-"), ), const SizedBox(width: 12), Button( onPressed: onSwitchFile, child: const Padding( - padding: EdgeInsets.symmetric( - horizontal: 6, vertical: 3), + padding: EdgeInsets.symmetric(horizontal: 6, vertical: 3), child: Icon(FluentIcons.switch_widget), )), if (state.customizeGlobalIni != null) ...[ @@ -89,23 +85,19 @@ class AdvancedLocalizationUI extends HookConsumerWidget { model.setCustomizeGlobalIni(null); }, child: const Padding( - padding: EdgeInsets.symmetric( - horizontal: 6, vertical: 3), + padding: EdgeInsets.symmetric(horizontal: 6, vertical: 3), child: Icon(FluentIcons.delete), )), ] ], )), - Text(S.current.home_localization_advanced_title_msg( - state.serverGlobalIniLines, - state.p4kGlobalIniLines)), + Text(S.current + .home_localization_advanced_title_msg(state.serverGlobalIniLines, state.p4kGlobalIniLines)), const SizedBox(width: 32), Button( child: Padding( - padding: const EdgeInsets.only( - left: 12, right: 12, top: 4, bottom: 4), - child: Text(S.current - .home_localization_advanced_action_install), + padding: const EdgeInsets.only(left: 12, right: 12, top: 4, bottom: 4), + child: Text(S.current.home_localization_advanced_action_install), ), onPressed: () { model.onInstall(context); @@ -113,19 +105,13 @@ class AdvancedLocalizationUI extends HookConsumerWidget { const SizedBox(width: 12), ], ), - Expanded( - child: - _makeBody(context, homeUIState, state, ref, model)), + Expanded(child: _makeBody(context, homeUIState, state, ref, model)), ] ], )); } - Widget _makeBody( - BuildContext context, - HomeUIModelState homeUIState, - AdvancedLocalizationUIState state, - WidgetRef ref, + Widget _makeBody(BuildContext context, HomeUIModelState homeUIState, AdvancedLocalizationUIState state, WidgetRef ref, AdvancedLocalizationUIModel model) { return AlignedGridView.count( crossAxisCount: 4, @@ -134,109 +120,104 @@ class AdvancedLocalizationUI extends HookConsumerWidget { padding: const EdgeInsets.all(12), itemBuilder: (BuildContext context, int index) { final item = state.classMap!.values.elementAt(index); - return Container( - padding: const EdgeInsets.only(top: 6, bottom: 12), - decoration: BoxDecoration( - color: Colors.white.withValues(alpha: .05), - borderRadius: BorderRadius.circular(4), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - IconButton( - onPressed: - item.isWorking ? null : () => _showContent(context, item), - icon: Padding( - padding: const EdgeInsets.only(left: 12, right: 12), - child: Row( - children: [ - Expanded( - child: Text( - "${item.className}", - style: const TextStyle( - fontSize: 16, fontWeight: FontWeight.bold), - textAlign: TextAlign.start, - )), - Text( - "${item.valuesMap.length}", - style: TextStyle( - fontSize: 14, - color: Colors.white.withValues(alpha: .6), - ), - ), - const SizedBox(width: 6), - Icon( - FluentIcons.chevron_right, - color: Colors.white.withValues(alpha: .6), - size: 16, - ), - ], - ), - ), - ), - Container( - margin: const EdgeInsets.only(top: 6, bottom: 12), - width: MediaQuery.of(context).size.width, - height: 1, - color: Colors.white.withValues(alpha: .1), - ), - if (item.isWorking) - Column( - children: [ - makeLoading(context), - const SizedBox(height: 6), - Text( - S.current.home_localization_advanced_action_mod_change), - ], - ) - else ...[ - Padding( - padding: const EdgeInsets.only(left: 12, right: 12), - child: Row( - children: [ - Expanded( - child: Text(S - .current.home_localization_advanced_action_mode)), - ComboBox( - value: item.mode, - items: [ - for (final type - in AppAdvancedLocalizationClassKeysDataMode - .values) - ComboBoxItem( - value: type, - child: Text(state.typeNames[type] ?? "-"), - ), - ], - onChanged: item.lockMod - ? null - : (v) => model.onChangeMod(item, - v as AppAdvancedLocalizationClassKeysDataMode), - ), - ], - ), - ), - const SizedBox(height: 6), - SizedBox( - height: 180, - child: SuperListView.builder( - itemCount: item.valuesMap.length, + return GridItemAnimator( + index: index, + child: Container( + padding: const EdgeInsets.only(top: 6, bottom: 12), + decoration: BoxDecoration( + color: Colors.white.withValues(alpha: .05), + borderRadius: BorderRadius.circular(4), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + IconButton( + onPressed: item.isWorking ? null : () => _showContent(context, item), + icon: Padding( padding: const EdgeInsets.only(left: 12, right: 12), - itemBuilder: (BuildContext context, int index) { - final itemKey = item.valuesMap.keys.elementAt(index); - return Text( - "${item.valuesMap[itemKey]}", - maxLines: 1, - style: const TextStyle( - fontSize: 12, - overflow: TextOverflow.ellipsis, + child: Row( + children: [ + Expanded( + child: Text( + "${item.className}", + style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold), + textAlign: TextAlign.start, + )), + Text( + "${item.valuesMap.length}", + style: TextStyle( + fontSize: 14, + color: Colors.white.withValues(alpha: .6), + ), ), - ); - }, + const SizedBox(width: 6), + Icon( + FluentIcons.chevron_right, + color: Colors.white.withValues(alpha: .6), + size: 16, + ), + ], + ), ), ), + Container( + margin: const EdgeInsets.only(top: 6, bottom: 12), + width: MediaQuery.of(context).size.width, + height: 1, + color: Colors.white.withValues(alpha: .1), + ), + if (item.isWorking) + Column( + children: [ + makeLoading(context), + const SizedBox(height: 6), + Text(S.current.home_localization_advanced_action_mod_change), + ], + ) + else ...[ + Padding( + padding: const EdgeInsets.only(left: 12, right: 12), + child: Row( + children: [ + Expanded(child: Text(S.current.home_localization_advanced_action_mode)), + ComboBox( + value: item.mode, + items: [ + for (final type in AppAdvancedLocalizationClassKeysDataMode.values) + ComboBoxItem( + value: type, + child: Text(state.typeNames[type] ?? "-"), + ), + ], + onChanged: item.lockMod + ? null + : (v) => model.onChangeMod(item, v as AppAdvancedLocalizationClassKeysDataMode), + ), + ], + ), + ), + const SizedBox(height: 6), + SizedBox( + height: 180, + child: SuperListView.builder( + itemCount: item.valuesMap.length, + padding: const EdgeInsets.only(left: 12, right: 12), + itemBuilder: (BuildContext context, int index) { + final itemKey = item.valuesMap.keys.elementAt(index); + return Text( + "${item.valuesMap[itemKey]}", + maxLines: 1, + style: const TextStyle( + fontSize: 12, + overflow: TextOverflow.ellipsis, + ), + ); + }, + ), + ), + ], ], - ], + ), ), ); }, @@ -244,8 +225,7 @@ class AdvancedLocalizationUI extends HookConsumerWidget { ); } - _showContent( - BuildContext context, AppAdvancedLocalizationClassKeysData item) { + _showContent(BuildContext context, AppAdvancedLocalizationClassKeysData item) { showDialog( context: context, builder: (BuildContext context) { @@ -282,8 +262,7 @@ class AdvancedLocalizationUI extends HookConsumerWidget { const SizedBox( width: 24, ), - Text(S.current.home_localization_advanced_title_preview( - item.className ?? "-")), + Text(S.current.home_localization_advanced_title_preview(item.className ?? "-")), ], ), content: textData.value.isEmpty @@ -295,13 +274,10 @@ class AdvancedLocalizationUI extends HookConsumerWidget { ), child: CodeEditor( readOnly: true, - controller: - CodeLineEditingController.fromText(textData.value), + controller: CodeLineEditingController.fromText(textData.value), style: CodeEditorStyle( codeTheme: CodeHighlightTheme( - languages: { - 'ini': CodeHighlightThemeMode(mode: langIni) - }, + languages: {'ini': CodeHighlightThemeMode(mode: langIni)}, theme: vs2015Theme, ), ), diff --git a/lib/ui/home/localization/localization_dialog_ui.dart b/lib/ui/home/localization/localization_dialog_ui.dart index 4196769..ca39c35 100644 --- a/lib/ui/home/localization/localization_dialog_ui.dart +++ b/lib/ui/home/localization/localization_dialog_ui.dart @@ -30,8 +30,7 @@ class LocalizationDialogUI extends HookConsumerWidget { return ContentDialog( title: makeTitle(context, model, state), constraints: BoxConstraints( - maxWidth: MediaQuery.of(context).size.width * .7, - minHeight: MediaQuery.of(context).size.height * .9), + maxWidth: MediaQuery.of(context).size.width * .7, minHeight: MediaQuery.of(context).size.height * .9), content: Padding( padding: const EdgeInsets.only(left: 12, right: 12, top: 12), child: SingleChildScrollView( @@ -40,18 +39,15 @@ class LocalizationDialogUI extends HookConsumerWidget { AnimatedSize( duration: const Duration(milliseconds: 130), child: state.patchStatus?.key == true && - state.patchStatus?.value == - S.current.home_action_info_game_built_in + state.patchStatus?.value == S.current.home_action_info_game_built_in ? Padding( padding: const EdgeInsets.only(bottom: 12), child: InfoBar( title: Text(S.current.home_action_info_warning), - content: Text(S.current - .localization_info_machine_translation_warning), + content: Text(S.current.localization_info_machine_translation_warning), severity: InfoBarSeverity.info, style: InfoBarThemeData(decoration: (severity) { - return const BoxDecoration( - color: Color.fromRGBO(155, 7, 7, 1.0)); + return const BoxDecoration(color: Color.fromRGBO(155, 7, 7, 1.0)); }, iconColor: (severity) { return Colors.white; }), @@ -65,10 +61,8 @@ class LocalizationDialogUI extends HookConsumerWidget { Padding( padding: const EdgeInsets.only(bottom: 12), child: InfoBar( - title: Text(S.current - .home_localization_ptu_advanced_localization_tip_title), - content: Text(S.current - .home_localization_ptu_advanced_localization_tip_title_info), + title: Text(S.current.home_localization_ptu_advanced_localization_tip_title), + content: Text(S.current.home_localization_ptu_advanced_localization_tip_title_info), severity: InfoBarSeverity.info, style: InfoBarThemeData(decoration: (severity) { return BoxDecoration(color: Colors.orange); @@ -89,9 +83,7 @@ class LocalizationDialogUI extends HookConsumerWidget { children: [ Center( child: Text(S.current.localization_info_enabled( - LocalizationUIModel.languageSupport[ - state.selectedLanguage] ?? - "")), + LocalizationUIModel.languageSupport[state.selectedLanguage] ?? "")), ), const Spacer(), ToggleSwitch( @@ -109,20 +101,15 @@ class LocalizationDialogUI extends HookConsumerWidget { Text(S.current.localization_info_installed_version( "${state.patchStatus?.value ?? ""} ${(state.isInstalledAdvanced ?? false) ? S.current.home_localization_msg_version_advanced : ""}")), SizedBox(width: 24), - if (state - .installedCommunityInputMethodSupportVersion != - null) + if (state.installedCommunityInputMethodSupportVersion != null) Text( - S.current - .input_method_community_input_method_support_version( - state.installedCommunityInputMethodSupportVersion ?? - "?"), + S.current.input_method_community_input_method_support_version( + state.installedCommunityInputMethodSupportVersion ?? "?"), ) ], ), ), - if (state.patchStatus?.value != - S.current.home_action_info_game_built_in) + if (state.patchStatus?.value != S.current.home_action_info_game_built_in) Row( children: [ Button( @@ -133,8 +120,7 @@ class LocalizationDialogUI extends HookConsumerWidget { children: [ const Icon(FluentIcons.feedback), const SizedBox(width: 6), - Text(S.current - .localization_action_translation_feedback), + Text(S.current.localization_action_translation_feedback), ], ), )), @@ -147,8 +133,7 @@ class LocalizationDialogUI extends HookConsumerWidget { children: [ const Icon(FluentIcons.delete), const SizedBox(width: 6), - Text(S.current - .localization_action_uninstall_translation), + Text(S.current.localization_action_uninstall_translation), ], ), )), @@ -167,11 +152,8 @@ class LocalizationDialogUI extends HookConsumerWidget { else if (state.apiLocalizationData!.isEmpty) Center( child: Text( - S.current - .localization_info_no_translation_available, - style: TextStyle( - fontSize: 13, - color: Colors.white.withValues(alpha: .8)), + S.current.localization_info_no_translation_available, + style: TextStyle(fontSize: 13, color: Colors.white.withValues(alpha: .8)), ), ) else @@ -180,9 +162,8 @@ class LocalizationDialogUI extends HookConsumerWidget { crossAxisSpacing: 12, mainAxisSpacing: 12, itemBuilder: (BuildContext context, int index) { - final item = state.apiLocalizationData!.entries - .elementAt(index); - return makeRemoteList(context, model, item, state); + final item = state.apiLocalizationData!.entries.elementAt(index); + return makeRemoteList(context, model, item, state, index); }, shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), @@ -198,136 +179,124 @@ class LocalizationDialogUI extends HookConsumerWidget { ); } - Widget makeRemoteList(BuildContext context, LocalizationUIModel model, - MapEntry item, LocalizationUIState state) { + Widget makeRemoteList(BuildContext context, LocalizationUIModel model, MapEntry item, + LocalizationUIState state, int index) { final isWorking = state.workingVersion.isNotEmpty; final isMineWorking = state.workingVersion == item.key; final isInstalled = state.patchStatus?.value == item.key; final isItemEnabled = ((item.value.enable ?? false)); - final tapDisabled = - isInstalled || isWorking || !isItemEnabled || isMineWorking; - return Tilt( - shadowConfig: const ShadowConfig(maxIntensity: .3), - borderRadius: BorderRadius.circular(7), - disable: tapDisabled, - child: GestureDetector( - onTap: tapDisabled - ? null - : () => model.onRemoteInsTall(context, item, state), - child: Container( - padding: const EdgeInsets.all(12), - decoration: BoxDecoration( - color: Colors.white.withValues(alpha: tapDisabled ? .03 : .05), - borderRadius: BorderRadius.circular(7), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "${item.value.info}", - style: const TextStyle(fontSize: 19), - ), - const SizedBox(height: 4), - Text( - S.current.localization_info_version_number( - item.value.versionName ?? ""), - style: TextStyle( - color: Colors.white.withValues(alpha: .6)), - ), - const SizedBox(height: 4), - Text( - S.current.localization_info_channel( - item.value.gameChannel ?? ""), - style: TextStyle( - color: Colors.white.withValues(alpha: .6)), - ), - const SizedBox(height: 4), - Text( - S.current.localization_info_update_time( - item.value.updateAt ?? ""), - style: TextStyle( - color: Colors.white.withValues(alpha: .6)), - ), - ], - ), - ), - if (isMineWorking) - const Padding( - padding: EdgeInsets.only(right: 12), - child: ProgressRing(), - ) - else ...[ - Icon( - isInstalled - ? FluentIcons.check_mark - : isItemEnabled - ? FluentIcons.download - : FluentIcons.disable_updates, - color: Colors.white.withValues(alpha: .8), - size: 18, - ), - const SizedBox(width: 6), - Text( - isInstalled - ? S.current.localization_info_installed - : (isItemEnabled - ? S.current.localization_action_install - : S.current.localization_info_unavailable), - style: TextStyle( - color: Colors.white.withValues(alpha: .8), + final tapDisabled = isInstalled || isWorking || !isItemEnabled || isMineWorking; + return GridItemAnimator( + index: index, + child: Tilt( + shadowConfig: const ShadowConfig(maxIntensity: .3), + borderRadius: BorderRadius.circular(7), + disable: tapDisabled, + child: GestureDetector( + onTap: tapDisabled ? null : () => model.onRemoteInsTall(context, item, state), + child: Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: Colors.white.withValues(alpha: tapDisabled ? .03 : .05), + borderRadius: BorderRadius.circular(7), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "${item.value.info}", + style: const TextStyle(fontSize: 19), + ), + const SizedBox(height: 4), + Text( + S.current.localization_info_version_number(item.value.versionName ?? ""), + style: TextStyle(color: Colors.white.withValues(alpha: .6)), + ), + const SizedBox(height: 4), + Text( + S.current.localization_info_channel(item.value.gameChannel ?? ""), + style: TextStyle(color: Colors.white.withValues(alpha: .6)), + ), + const SizedBox(height: 4), + Text( + S.current.localization_info_update_time(item.value.updateAt ?? ""), + style: TextStyle(color: Colors.white.withValues(alpha: .6)), + ), + ], ), ), - const SizedBox(width: 6), - if ((!isInstalled) && isItemEnabled) - Icon( - FluentIcons.chevron_right, - size: 14, - color: Colors.white.withValues(alpha: .6), + if (isMineWorking) + const Padding( + padding: EdgeInsets.only(right: 12), + child: ProgressRing(), ) - ] - ], - ), - if (item.value.note != null) ...[ - const SizedBox(height: 6), - Text( - "${item.value.note}", - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Colors.white.withValues(alpha: .4), - fontSize: 13, - ), + else ...[ + Icon( + isInstalled + ? FluentIcons.check_mark + : isItemEnabled + ? FluentIcons.download + : FluentIcons.disable_updates, + color: Colors.white.withValues(alpha: .8), + size: 18, + ), + const SizedBox(width: 6), + Text( + isInstalled + ? S.current.localization_info_installed + : (isItemEnabled + ? S.current.localization_action_install + : S.current.localization_info_unavailable), + style: TextStyle( + color: Colors.white.withValues(alpha: .8), + ), + ), + const SizedBox(width: 6), + if ((!isInstalled) && isItemEnabled) + Icon( + FluentIcons.chevron_right, + size: 14, + color: Colors.white.withValues(alpha: .6), + ) + ] + ], ), + if (item.value.note != null) ...[ + const SizedBox(height: 6), + Text( + "${item.value.note}", + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Colors.white.withValues(alpha: .4), + fontSize: 13, + ), + ), + ], ], - ], + ), ), ), ), ); } - Widget makeListContainer( - String title, List children, BuildContext context, - {List actions = const [], - bool gridViewMode = false, - int gridViewCrossAxisCount = 2}) { + Widget makeListContainer(String title, List children, BuildContext context, + {List actions = const [], bool gridViewMode = false, int gridViewCrossAxisCount = 2}) { return Padding( padding: const EdgeInsets.only(bottom: 12), child: AnimatedSize( duration: const Duration(milliseconds: 130), child: Container( - decoration: BoxDecoration( - color: FluentTheme.of(context).cardColor, - borderRadius: BorderRadius.circular(7)), + decoration: BoxDecoration(color: FluentTheme.of(context).cardColor, borderRadius: BorderRadius.circular(7)), child: Padding( - padding: - const EdgeInsets.only(top: 12, bottom: 12, left: 24, right: 24), + padding: const EdgeInsets.only(top: 12, bottom: 12, left: 24, right: 24), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -371,8 +340,7 @@ class LocalizationDialogUI extends HookConsumerWidget { ); } - Widget makeTitle(BuildContext context, LocalizationUIModel model, - LocalizationUIState state) { + Widget makeTitle(BuildContext context, LocalizationUIModel model, LocalizationUIState state) { return Row( children: [ IconButton( @@ -401,8 +369,7 @@ class LocalizationDialogUI extends HookConsumerWidget { ComboBox( value: state.selectedLanguage, items: [ - for (final lang - in LocalizationUIModel.languageSupport.entries) + for (final lang in LocalizationUIModel.languageSupport.entries) ComboBoxItem( value: lang.key, child: Text(lang.value), @@ -429,8 +396,7 @@ class LocalizationDialogUI extends HookConsumerWidget { ); } - Widget makeToolsListContainer(BuildContext context, LocalizationUIModel model, - LocalizationUIState state) { + Widget makeToolsListContainer(BuildContext context, LocalizationUIModel model, LocalizationUIState state) { final toolsMenu = { "launcher_mod": ( const Icon(FluentIcons.c_plus_plus, size: 24), @@ -469,8 +435,7 @@ class LocalizationDialogUI extends HookConsumerWidget { case "custom_files": final sb = await showDialog( context: context, - builder: (BuildContext context) => - const LocalizationFromFileDialogUI(), + builder: (BuildContext context) => const LocalizationFromFileDialogUI(), ); if (sb is (StringBuffer, bool)) { await model.installFormString( diff --git a/lib/ui/index_ui.dart b/lib/ui/index_ui.dart index db1eae5..5d60fea 100644 --- a/lib/ui/index_ui.dart +++ b/lib/ui/index_ui.dart @@ -12,6 +12,7 @@ import 'package:window_manager/window_manager.dart'; import 'about/about_ui.dart'; import 'home/home_ui.dart'; +import 'nav/nav_ui.dart'; import 'settings/settings_ui.dart'; import 'tools/tools_ui.dart'; @@ -42,8 +43,7 @@ class IndexUI extends HookConsumerWidget { fit: BoxFit.cover, ), const SizedBox(width: 12), - Text(S.current.app_index_version_info( - ConstConf.appVersion, ConstConf.isMSE ? "" : " Dev")), + Text(S.current.app_index_version_info(ConstConf.appVersion, ConstConf.isMSE ? "" : " Dev")), ], ), ), @@ -77,8 +77,7 @@ class IndexUI extends HookConsumerWidget { key: Key("NavigationPane_${S.current.app_language_code}"), selected: curIndex.value, items: getNavigationPaneItems(curIndex), - size: NavigationPaneSize( - openWidth: S.current.app_language_code.startsWith("zh") ? 64 : 74), + size: NavigationPaneSize(openWidth: S.current.app_language_code.startsWith("zh") ? 64 : 74), ), paneBodyBuilder: (item, child) { return item!.body; @@ -95,18 +94,15 @@ class IndexUI extends HookConsumerWidget { S.current.app_index_menu_tools, const ToolsUI(), ), - FluentIcons.settings: ( - S.current.app_index_menu_settings, - const SettingsUI() - ), + FluentIcons.power_apps: ("导航", const NavUI()), + FluentIcons.settings: (S.current.app_index_menu_settings, const SettingsUI()), FluentIcons.info: ( S.current.app_index_menu_about, const AboutUI(), ), }; - List getNavigationPaneItems( - ValueNotifier curIndexState) { + List getNavigationPaneItems(ValueNotifier curIndexState) { // width = 64 return [ for (final kv in pageMenus.entries) @@ -136,8 +132,7 @@ class IndexUI extends HookConsumerWidget { } void _onTapIndexMenu(String value, ValueNotifier curIndexState) { - final pageIndex = - pageMenus.values.toList().indexWhere((element) => element.$1 == value); + final pageIndex = pageMenus.values.toList().indexWhere((element) => element.$1 == value); curIndexState.value = pageIndex; } @@ -156,8 +151,7 @@ class IndexUI extends HookConsumerWidget { color: Colors.red, borderRadius: BorderRadius.circular(12), ), - padding: const EdgeInsets.only( - left: 6, right: 6, bottom: 1.5, top: 1.5), + padding: const EdgeInsets.only(left: 6, right: 6, bottom: 1.5, top: 1.5), child: Text( "${aria2cState.aria2TotalTaskNum}", style: const TextStyle( diff --git a/lib/ui/nav/nav_state.dart b/lib/ui/nav/nav_state.dart new file mode 100644 index 0000000..ecdbc22 --- /dev/null +++ b/lib/ui/nav/nav_state.dart @@ -0,0 +1,41 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:riverpod_annotation/riverpod_annotation.dart'; +import 'package:starcitizen_doctor/api/udb.dart'; +import 'package:starcitizen_doctor/data/nav_api_data.dart'; + +part 'nav_state.freezed.dart'; + +part 'nav_state.g.dart'; + +@freezed +class NavState with _$NavState { + const factory NavState({ + List? items, + @Default("") String errorInfo, + }) = _NavState; +} + +@riverpod +class Nav extends _$Nav { + bool _mounted = true; + + @override + NavState build() { + state = NavState(); + loadData(1); + ref.onDispose(() { + _mounted = false; + }); + return state; + } + + void loadData(int pageNo) async { + if (!_mounted) return; + try { + final r = await UDBNavApi.getNavItems(pageNo: pageNo); + state = state.copyWith(items: r.docs, errorInfo: ""); + } catch (e) { + state = state.copyWith(errorInfo: e.toString()); + } + } +} diff --git a/lib/ui/nav/nav_state.freezed.dart b/lib/ui/nav/nav_state.freezed.dart new file mode 100644 index 0000000..65545dc --- /dev/null +++ b/lib/ui/nav/nav_state.freezed.dart @@ -0,0 +1,173 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// 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 'nav_state.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +/// @nodoc +mixin _$NavState { + List? get items => throw _privateConstructorUsedError; + String get errorInfo => throw _privateConstructorUsedError; + + /// Create a copy of NavState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $NavStateCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $NavStateCopyWith<$Res> { + factory $NavStateCopyWith(NavState value, $Res Function(NavState) then) = + _$NavStateCopyWithImpl<$Res, NavState>; + @useResult + $Res call({List? items, String errorInfo}); +} + +/// @nodoc +class _$NavStateCopyWithImpl<$Res, $Val extends NavState> + implements $NavStateCopyWith<$Res> { + _$NavStateCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of NavState + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? items = freezed, + Object? errorInfo = null, + }) { + return _then(_value.copyWith( + items: freezed == items + ? _value.items + : items // ignore: cast_nullable_to_non_nullable + as List?, + errorInfo: null == errorInfo + ? _value.errorInfo + : errorInfo // ignore: cast_nullable_to_non_nullable + as String, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$NavStateImplCopyWith<$Res> + implements $NavStateCopyWith<$Res> { + factory _$$NavStateImplCopyWith( + _$NavStateImpl value, $Res Function(_$NavStateImpl) then) = + __$$NavStateImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({List? items, String errorInfo}); +} + +/// @nodoc +class __$$NavStateImplCopyWithImpl<$Res> + extends _$NavStateCopyWithImpl<$Res, _$NavStateImpl> + implements _$$NavStateImplCopyWith<$Res> { + __$$NavStateImplCopyWithImpl( + _$NavStateImpl _value, $Res Function(_$NavStateImpl) _then) + : super(_value, _then); + + /// Create a copy of NavState + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? items = freezed, + Object? errorInfo = null, + }) { + return _then(_$NavStateImpl( + items: freezed == items + ? _value._items + : items // ignore: cast_nullable_to_non_nullable + as List?, + errorInfo: null == errorInfo + ? _value.errorInfo + : errorInfo // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$NavStateImpl implements _NavState { + const _$NavStateImpl( + {final List? items, this.errorInfo = ""}) + : _items = items; + + final List? _items; + @override + List? get items { + final value = _items; + if (value == null) return null; + if (_items is EqualUnmodifiableListView) return _items; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); + } + + @override + @JsonKey() + final String errorInfo; + + @override + String toString() { + return 'NavState(items: $items, errorInfo: $errorInfo)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NavStateImpl && + const DeepCollectionEquality().equals(other._items, _items) && + (identical(other.errorInfo, errorInfo) || + other.errorInfo == errorInfo)); + } + + @override + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_items), errorInfo); + + /// Create a copy of NavState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$NavStateImplCopyWith<_$NavStateImpl> get copyWith => + __$$NavStateImplCopyWithImpl<_$NavStateImpl>(this, _$identity); +} + +abstract class _NavState implements NavState { + const factory _NavState( + {final List? items, + final String errorInfo}) = _$NavStateImpl; + + @override + List? get items; + @override + String get errorInfo; + + /// Create a copy of NavState + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$NavStateImplCopyWith<_$NavStateImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/ui/nav/nav_state.g.dart b/lib/ui/nav/nav_state.g.dart new file mode 100644 index 0000000..d6da236 --- /dev/null +++ b/lib/ui/nav/nav_state.g.dart @@ -0,0 +1,24 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'nav_state.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +String _$navHash() => r'2019b3f675fbaec4be794049d900bf2dcc8d5e37'; + +/// See also [Nav]. +@ProviderFor(Nav) +final navProvider = AutoDisposeNotifierProvider.internal( + Nav.new, + name: r'navProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') ? null : _$navHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef _$Nav = AutoDisposeNotifier; +// ignore_for_file: type=lint +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/ui/nav/nav_ui.dart b/lib/ui/nav/nav_ui.dart new file mode 100644 index 0000000..3719816 --- /dev/null +++ b/lib/ui/nav/nav_ui.dart @@ -0,0 +1,203 @@ +import 'dart:ui'; + +import 'package:fluent_ui/fluent_ui.dart'; +import 'package:flutter/gestures.dart' show TapGestureRecognizer; +import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; +import 'package:flutter_tilt/flutter_tilt.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:starcitizen_doctor/ui/nav/nav_state.dart'; +import 'package:url_launcher/url_launcher_string.dart'; + +import 'package:starcitizen_doctor/widgets/widgets.dart'; + +class NavUI extends HookConsumerWidget { + const NavUI({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 12), + child: Column( + children: [ + Expanded( + child: buildBody(context, ref), + ), + SizedBox(height: 6), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text.rich( + TextSpan(children: [ + TextSpan(text: "*对应链接指向的服务由第三方提供,我们不对其做任何担保,请用户自行判断使用风险 | "), + TextSpan(text: "网站导航数据由"), + TextSpan( + text: " 42kit ", + style: TextStyle( + color: Colors.white, + decoration: TextDecoration.underline, + ), + recognizer: TapGestureRecognizer() + ..onTap = () { + launchUrlString("https://42kit.citizenwiki.cn/nav"); + }, + ), + TextSpan(text: "提供"), + ]), + style: TextStyle( + fontSize: 13, + color: Colors.white.withValues(alpha: .6), + ), + ), + SizedBox(width: 12), + ], + ), + ], + ), + ); + } + + Widget buildBody(BuildContext context, WidgetRef ref) { + final data = ref.watch(navProvider); + if (data.errorInfo.isNotEmpty) { + return Center( + child: Text( + data.errorInfo, + style: TextStyle(color: Colors.red), + ), + ); + } + if (data.items == null) { + return const Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + ProgressRing(), + SizedBox(height: 12), + Text("正在获取数据..."), + ], + )); + } + return MasonryGridView.count( + crossAxisCount: 3, + mainAxisSpacing: 12, + crossAxisSpacing: 12, + itemCount: data.items!.length, + padding: EdgeInsets.only(left: 12, right: 12, bottom: 12), + itemBuilder: (BuildContext context, int index) { + const itemHeight = 160.0; + + final item = data.items![index]; + final itemName = item.name; + final itemImage = item.image.url; + return GridItemAnimator( + index: index, + child: GestureDetector( + onTap: () { + launchUrlString(item.link); + }, + child: Tilt( + shadowConfig: const ShadowConfig(maxIntensity: .3), + borderRadius: BorderRadius.circular(12), + clipBehavior: Clip.hardEdge, + child: SizedBox( + height: itemHeight, + width: double.infinity, + child: ClipRRect( + borderRadius: BorderRadius.circular(12), + clipBehavior: Clip.hardEdge, + child: Stack( + children: [ + Center( + child: CacheNetImage( + height: itemHeight, + width: double.infinity, + url: itemImage, + fit: BoxFit.fitWidth, + ), + ), + Container( + decoration: BoxDecoration( + color: Colors.black.withValues(alpha: .55), + ), + ), + ClipRect( + clipBehavior: Clip.hardEdge, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 15.0, sigmaY: 15.0), + blendMode: BlendMode.srcOver, + child: SizedBox( + width: double.infinity, + height: itemHeight, + ), + ), + ), + Container( + decoration: BoxDecoration(), + padding: const EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(12), + child: CacheNetImage( + url: itemImage, + height: 48, + width: 48, + fit: BoxFit.cover, + ), + ), + SizedBox(width: 12), + Flexible( + child: Text( + itemName, + style: TextStyle( + fontSize: 18, + ), + ), + ), + ], + ), + SizedBox(height: 12), + Expanded( + child: Text( + item.abstract_, + maxLines: 3, + overflow: TextOverflow.ellipsis, + style: TextStyle(color: Colors.white.withValues(alpha: .75)), + ), + ), + Row( + children: [ + for (var value in item.tags) + Container( + decoration: BoxDecoration( + color: Colors.blue.withValues(alpha: .6), + borderRadius: BorderRadius.circular(12)), + padding: EdgeInsets.symmetric(horizontal: 12, vertical: 3), + margin: EdgeInsets.only(right: 6), + child: Text( + value.name, + style: TextStyle( + fontSize: 13, + color: Colors.white, + ), + ), + ) + ], + ) + ], + ), + ), + ], + ), + ), + ), + ), + ), + ); + }, + ); + } +} diff --git a/lib/ui/tools/tools_ui.dart b/lib/ui/tools/tools_ui.dart index a34cfc7..c8423db 100644 --- a/lib/ui/tools/tools_ui.dart +++ b/lib/ui/tools/tools_ui.dart @@ -40,13 +40,9 @@ class ToolsUI extends HookConsumerWidget { ), const SizedBox(width: 12), Button( - onPressed: state.working - ? null - : () => - model.loadToolsCard(context, skipPathScan: false), + onPressed: state.working ? null : () => model.loadToolsCard(context, skipPathScan: false), child: const Padding( - padding: EdgeInsets.only( - top: 30, bottom: 30, left: 12, right: 12), + padding: EdgeInsets.only(top: 30, bottom: 30, left: 12, right: 12), child: Icon(FluentIcons.refresh), ), ), @@ -75,90 +71,86 @@ class ToolsUI extends HookConsumerWidget { crossAxisCount: 3, mainAxisSpacing: 12, crossAxisSpacing: 12, - itemCount: (state.isItemLoading) - ? state.items.length + 1 - : state.items.length, + itemCount: (state.isItemLoading) ? state.items.length + 1 : state.items.length, shrinkWrap: true, itemBuilder: (context, index) { if (index == state.items.length) { - return Container( - width: 300, - height: 200, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: FluentTheme.of(context).cardColor, - ), - child: makeLoading(context)); + return GridItemAnimator( + index: index, + child: Container( + width: 300, + height: 160, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: FluentTheme.of(context).cardColor, + ), + child: makeLoading(context)), + ); } final item = state.items[index]; - return Container( - width: 300, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: FluentTheme.of(context).cardColor, - ), - child: Padding( - padding: const EdgeInsets.all(12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - decoration: BoxDecoration( - color: - Colors.white.withValues(alpha: .2), - borderRadius: - BorderRadius.circular(1000)), - child: Padding( - padding: const EdgeInsets.all(12), - child: item.icon, + return GridItemAnimator( + index: index, + child: Container( + width: 300, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: FluentTheme.of(context).cardColor, + ), + child: Padding( + padding: const EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + decoration: BoxDecoration( + color: Colors.white.withValues(alpha: .2), + borderRadius: BorderRadius.circular(1000)), + child: Padding( + padding: const EdgeInsets.all(12), + child: item.icon, + ), ), - ), - const SizedBox(width: 8), - Expanded( - child: Text( - item.name, - style: const TextStyle(fontSize: 16), - )), - const SizedBox(width: 12), - ], - ), - const SizedBox(height: 12), - Text( - item.infoString, - style: TextStyle( - fontSize: 14, - color: Colors.white.withValues(alpha: .6)), - ), - const SizedBox(height: 12), - Row( - children: [ - const Spacer(), - Button( - onPressed: state.working - ? null - : item.onTap == null - ? null - : () { - try { - item.onTap?.call(); - } catch (e) { - showToast( - context, - S.current - .tools_info_processing_failed( - e)); - } - }, - child: const Padding( - padding: EdgeInsets.all(6), - child: Icon(FluentIcons.play), + const SizedBox(width: 8), + Expanded( + child: Text( + item.name, + style: const TextStyle(fontSize: 16), + )), + const SizedBox(width: 12), + ], + ), + const SizedBox(height: 12), + Text( + item.infoString, + style: TextStyle(fontSize: 14, color: Colors.white.withValues(alpha: .6)), + ), + const SizedBox(height: 12), + Row( + children: [ + const Spacer(), + Button( + onPressed: state.working + ? null + : item.onTap == null + ? null + : () { + try { + item.onTap?.call(); + } catch (e) { + showToast(context, S.current.tools_info_processing_failed(e)); + } + }, + child: const Padding( + padding: EdgeInsets.all(6), + child: Icon(FluentIcons.play), + ), ), - ), - ], - ) - ], + ], + ) + ], + ), ), ), ); @@ -188,8 +180,7 @@ class ToolsUI extends HookConsumerWidget { ); } - Widget makeGamePathSelect( - BuildContext context, ToolsUIModel model, ToolsUIState state) { + Widget makeGamePathSelect(BuildContext context, ToolsUIModel model, ToolsUIState state) { return Row( mainAxisSize: MainAxisSize.min, children: [ @@ -223,8 +214,7 @@ class ToolsUI extends HookConsumerWidget { ), onPressed: () { if (state.scInstalledPath.trim().isEmpty) { - showToast(context, - S.current.tools_action_info_star_citizen_not_found); + showToast(context, S.current.tools_action_info_star_citizen_not_found); return; } model.openDir(state.scInstalledPath); @@ -233,8 +223,7 @@ class ToolsUI extends HookConsumerWidget { ); } - Widget makeGameLauncherPathSelect( - BuildContext context, ToolsUIModel model, ToolsUIState state) { + Widget makeGameLauncherPathSelect(BuildContext context, ToolsUIModel model, ToolsUIState state) { return Row( mainAxisSize: MainAxisSize.min, children: [ @@ -268,10 +257,7 @@ class ToolsUI extends HookConsumerWidget { ), onPressed: () { if (state.scInstalledPath.trim().isEmpty) { - showToast( - context, - S.current - .tools_rsi_launcher_enhance_msg_error_launcher_notfound); + showToast(context, S.current.tools_rsi_launcher_enhance_msg_error_launcher_notfound); return; } model.openDir(state.rsiLauncherInstalledPath); diff --git a/lib/ui/tools/tools_ui_model.g.dart b/lib/ui/tools/tools_ui_model.g.dart index 789b826..c00a9b0 100644 --- a/lib/ui/tools/tools_ui_model.g.dart +++ b/lib/ui/tools/tools_ui_model.g.dart @@ -6,7 +6,7 @@ part of 'tools_ui_model.dart'; // RiverpodGenerator // ************************************************************************** -String _$toolsUIModelHash() => r'cd72f7833fa5696baf9022d16d10d7951387df7e'; +String _$toolsUIModelHash() => r'c8830e26df6c0ee572dd5e78c4ccef3317f8b4e6'; /// See also [ToolsUIModel]. @ProviderFor(ToolsUIModel) diff --git a/lib/widgets/src/cache_image.dart b/lib/widgets/src/cache_image.dart index 5cc350a..661b64f 100644 --- a/lib/widgets/src/cache_image.dart +++ b/lib/widgets/src/cache_image.dart @@ -1,5 +1,8 @@ import 'package:extended_image/extended_image.dart'; import 'package:fluent_ui/fluent_ui.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +import 'cache_svg_image.dart'; class CacheNetImage extends StatelessWidget { final String url; @@ -7,11 +10,18 @@ class CacheNetImage extends StatelessWidget { final double? height; final BoxFit? fit; - const CacheNetImage( - {super.key, required this.url, this.width, this.height, this.fit}); + const CacheNetImage({super.key, required this.url, this.width, this.height, this.fit}); @override Widget build(BuildContext context) { + if (url.endsWith(".svg")) { + return CachedSvgImage( + url, + width: width, + height: height, + fit: fit ?? BoxFit.contain, + ); + } return ExtendedImage.network( url, width: width, @@ -20,14 +30,11 @@ class CacheNetImage extends StatelessWidget { loadStateChanged: (ExtendedImageState state) { switch (state.extendedImageLoadState) { case LoadState.loading: - return const Center( - child: Padding( - padding: EdgeInsets.all(8.0), - child: Column( - children: [ - ProgressRing(), - ], - ), + return SizedBox( + width: width, + height: height, + child: Center( + child: ProgressRing(), ), ); case LoadState.failed: diff --git a/lib/widgets/src/cache_svg_image.dart b/lib/widgets/src/cache_svg_image.dart new file mode 100644 index 0000000..0e4148c --- /dev/null +++ b/lib/widgets/src/cache_svg_image.dart @@ -0,0 +1,64 @@ +import 'dart:io'; + +import 'package:fluent_ui/fluent_ui.dart'; +import 'package:flutter_hooks/flutter_hooks.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:starcitizen_doctor/common/utils/file_cache_utils.dart'; + +class CachedSvgImage extends HookWidget { + final String url; + final double? width; + final double? height; + final BoxFit? fit; + + const CachedSvgImage(this.url, {super.key, this.width, this.height, this.fit}); + + @override + Widget build(BuildContext context) { + final cachedFile = useState(null); + final errorInfo = useState(null); + + useEffect( + () { + () async { + try { + cachedFile.value = await FileCacheUtils.getFile(url); + } catch (e) { + debugPrint("Error loading SVG: $e"); + errorInfo.value = "Error loading SVG: $e"; + } + }(); + return null; + }, + [url], + ); + + if (errorInfo.value != null) { + return SizedBox( + width: width, + height: height, + child: Center( + child: Text( + errorInfo.value!, + style: TextStyle(color: Colors.red), + ), + ), + ); + } + + return cachedFile.value != null + ? SvgPicture.file( + cachedFile.value!, + width: width, + height: height, + fit: fit ?? BoxFit.contain, + ) + : SizedBox( + width: width, + height: height, + child: Center( + child: ProgressRing(), + ), + ); + } +} diff --git a/lib/widgets/src/grid_item_animator.dart b/lib/widgets/src/grid_item_animator.dart new file mode 100644 index 0000000..bb4c2c6 --- /dev/null +++ b/lib/widgets/src/grid_item_animator.dart @@ -0,0 +1,71 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter_hooks/flutter_hooks.dart'; + +class GridItemAnimator extends HookWidget { + final Widget child; // 要添加动画效果的子组件 + final int index; // 条目在网格中的索引位置 + final Duration duration; // 动画持续时间 + final Duration delayPerItem; // 每个条目之间的延迟时间 + final double slideOffset; // 上移的偏移量(像素) + + const GridItemAnimator({ + super.key, + required this.child, + required this.index, + this.duration = const Duration(milliseconds: 230), + this.delayPerItem = const Duration(milliseconds: 50), + this.slideOffset = 20.0, + }); + + @override + Widget build(BuildContext context) { + // 创建动画控制器 + final animationController = useAnimationController( + duration: duration, + ); + + // 创建不透明度动画 + final opacityAnimation = useAnimation( + Tween( + begin: 0.0, // 开始时完全透明 + end: 1.0, // 结束时完全不透明 + ).animate(CurvedAnimation( + parent: animationController, + curve: Curves.easeOut, + )), + ); + + // 创建位移动画 + final slideAnimation = useAnimation( + Tween( + begin: 1.0, // 开始位置 + end: 0.0, // 结束位置 + ).animate(CurvedAnimation( + parent: animationController, + curve: Curves.easeOutCubic, + )), + ); + + // 组件挂载后启动动画 + useEffect(() { + // 根据索引计算延迟时间,实现逐个条目入场 + final delay = delayPerItem * index; + + Future.delayed(delay, () { + if (animationController.status != AnimationStatus.completed) { + animationController.forward(); + } + }); + return null; + }, const []); + + // 应用动画效果 + return Opacity( + opacity: opacityAnimation, + child: Transform.translate( + offset: Offset(0, slideOffset * slideAnimation), // 向上平移动画 + child: child, + ), + ); + } +} diff --git a/lib/widgets/widgets.dart b/lib/widgets/widgets.dart index 28dde4a..15d27e6 100644 --- a/lib/widgets/widgets.dart +++ b/lib/widgets/widgets.dart @@ -15,6 +15,9 @@ import 'dart:ui' as ui; export 'src/cache_image.dart'; export 'src/countdown_time_text.dart'; +export 'src/cache_svg_image.dart'; +export 'src/grid_item_animator.dart'; + export '../common/utils/async.dart'; export '../common/utils/base_utils.dart'; export 'package:starcitizen_doctor/generated/l10n.dart'; @@ -137,14 +140,13 @@ ColorFilter makeSvgColor(Color color) { return ui.ColorFilter.mode(color, ui.BlendMode.srcIn); } -CustomTransitionPage myPageBuilder( - BuildContext context, GoRouterState state, Widget child) { +CustomTransitionPage myPageBuilder(BuildContext context, GoRouterState state, Widget child) { return CustomTransitionPage( child: child, transitionDuration: const Duration(milliseconds: 150), reverseTransitionDuration: const Duration(milliseconds: 150), - transitionsBuilder: (BuildContext context, Animation animation, - Animation secondaryAnimation, Widget child) { + transitionsBuilder: + (BuildContext context, Animation animation, Animation secondaryAnimation, Widget child) { return SlideTransition( position: Tween( begin: const Offset(0.0, 1.0), @@ -164,12 +166,7 @@ class LoadingWidget extends HookConsumerWidget { final Widget Function(BuildContext context, T data) childBuilder; final Duration? autoRefreshDuration; - const LoadingWidget( - {super.key, - this.data, - required this.childBuilder, - this.onLoadData, - this.autoRefreshDuration}); + const LoadingWidget({super.key, this.data, required this.childBuilder, this.onLoadData, this.autoRefreshDuration}); @override Widget build(BuildContext context, WidgetRef ref) { @@ -204,8 +201,7 @@ class LoadingWidget extends HookConsumerWidget { return childBuilder(context, (data ?? dataState.value) as T); } - void _loadData( - ValueNotifier dataState, ValueNotifier errorMsg) async { + void _loadData(ValueNotifier dataState, ValueNotifier errorMsg) async { errorMsg.value = ""; try { final r = await onLoadData!(); diff --git a/pubspec.lock b/pubspec.lock index 68c6c83..a594fe2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -232,7 +232,7 @@ packages: source: hosted version: "0.3.4+2" crypto: - dependency: transitive + dependency: "direct main" description: name: crypto sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" @@ -916,7 +916,7 @@ packages: source: hosted version: "2.2.0" path: - dependency: transitive + dependency: "direct main" description: name: path sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" diff --git a/pubspec.yaml b/pubspec.yaml index f9578a8..29c8584 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -68,6 +68,8 @@ dependencies: qr_flutter: ^4.1.0 desktop_multi_window: ^0.2.1 watcher: ^1.1.1 + path: ^1.9.1 + crypto: ^3.0.6 dependency_overrides: http: ^1.1.2