From 073b5b146ffaf118c585accebe0b7fb9ffd1da46 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 24 Mar 2024 20:52:30 +0000 Subject: [PATCH 01/13] chore(deps): bump bloc from 8.1.3 to 8.1.4 Bumps [bloc](https://github.com/felangel/bloc/tree/master/packages) from 8.1.3 to 8.1.4. - [Release notes](https://github.com/felangel/bloc/releases) - [Commits](https://github.com/felangel/bloc/commits/bloc-v8.1.4/packages) --- updated-dependencies: - dependency-name: bloc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index de7a3c58..97721c19 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -107,10 +107,10 @@ packages: dependency: "direct main" description: name: bloc - sha256: f53a110e3b48dcd78136c10daa5d51512443cea5e1348c9d80a320095fa2db9e + sha256: "106842ad6569f0b60297619e9e0b1885c2fb9bf84812935490e6c5275777804e" url: "https://pub.dev" source: hosted - version: "8.1.3" + version: "8.1.4" bloc_concurrency: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index df013b15..035e6c18 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ dependencies: app_ui: path: packages/app_ui async: ^2.11.0 - bloc: ^8.1.3 + bloc: ^8.1.4 cached_memory_image: ^1.5.0 cached_network_image: ^3.3.1 carousel_slider: ^4.2.1 From ce6aa23d82d726499d64a301f5e58f1d04a96a5d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 11:19:24 +0000 Subject: [PATCH 02/13] chore(deps): bump flutter_bloc from 8.1.4 to 8.1.5 Bumps [flutter_bloc](https://github.com/felangel/bloc/tree/master/packages) from 8.1.4 to 8.1.5. - [Release notes](https://github.com/felangel/bloc/releases) - [Commits](https://github.com/felangel/bloc/commits/flutter_bloc-v8.1.5/packages) --- updated-dependencies: - dependency-name: flutter_bloc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index d14b0f78..b5e6f277 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -691,10 +691,10 @@ packages: dependency: "direct main" description: name: flutter_bloc - sha256: "87325da1ac757fcc4813e6b34ed5dd61169973871fdf181d6c2109dd6935ece1" + sha256: f0ecf6e6eb955193ca60af2d5ca39565a86b8a142452c5b24d96fb477428f4d2 url: "https://pub.dev" source: hosted - version: "8.1.4" + version: "8.1.5" flutter_blurhash: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 72a6e9a4..8020b7dc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -34,7 +34,7 @@ dependencies: flutter: sdk: flutter flutter_animate: ^4.5.0 - flutter_bloc: ^8.1.4 + flutter_bloc: ^8.1.5 flutter_localizations: sdk: flutter flutter_markdown: ">=0.6.20 <0.7.0" From 117b0d008290f6a41e2748f30d1bbf027c0b07b0 Mon Sep 17 00:00:00 2001 From: Emil Date: Mon, 25 Mar 2024 18:24:40 +0500 Subject: [PATCH 03/13] chore: don't ignore generated files --- ...flutter_instagram_offline_first_clone.yaml | 3 +- .gitignore | 3 - ios/Podfile | 61 +- ios/Podfile.lock | 2 +- lib/chats/chat/bloc/chat_bloc.g.dart | 38 + lib/comments/bloc/comments_bloc.g.dart | 39 + lib/comments/comment/bloc/comment_bloc.g.dart | 67 ++ lib/feed/post/bloc/post_bloc.g.dart | 64 ++ lib/feed/post/bloc/reel_bloc.g.dart | 64 ++ lib/l10n/slang/translations.g.dart | 230 ++++++ .../bloc/user_stories_bloc.g.dart | 36 + packages/app_ui/lib/src/generated/.gitkeep | 0 .../app_ui/lib/src/generated/assets.gen.dart | 260 +++++++ .../app_ui/lib/src/generated/fonts.gen.dart | 18 + packages/insta_blocks/.gitignore | 3 - .../insta_blocks/lib/src/block_action.g.dart | 88 +++ .../lib/src/divider_horizontal_block.g.dart | 29 + .../lib/src/models/feed_page.g.dart | 34 + .../lib/src/models/post_author.g.dart | 36 + .../lib/src/post_large_block.g.dart | 71 ++ .../lib/src/post_reel_block.g.dart | 59 ++ .../lib/src/post_small_block.g.dart | 59 ++ .../lib/src/post_sponsored_block.g.dart | 59 ++ .../lib/src/section_header_block.g.dart | 49 ++ .../insta_blocks/lib/src/unknown_block.g.dart | 27 + packages/shared/.gitignore | 4 - .../src/models/attachment_file.freezed.dart | 714 ++++++++++++++++++ .../lib/src/models/attachment_file.g.dart | 86 +++ packages/shared/lib/src/models/comment.g.dart | 54 ++ packages/shared/lib/src/models/image.g.dart | 68 ++ packages/shared/lib/src/models/post.g.dart | 52 ++ .../models/post_options_settings.freezed.dart | 345 +++++++++ packages/shared/lib/src/models/video.g.dart | 49 ++ tool/coverage.sh | 4 +- 34 files changed, 2758 insertions(+), 17 deletions(-) create mode 100644 lib/chats/chat/bloc/chat_bloc.g.dart create mode 100644 lib/comments/bloc/comments_bloc.g.dart create mode 100644 lib/comments/comment/bloc/comment_bloc.g.dart create mode 100644 lib/feed/post/bloc/post_bloc.g.dart create mode 100644 lib/feed/post/bloc/reel_bloc.g.dart create mode 100644 lib/l10n/slang/translations.g.dart create mode 100644 lib/stories/user_stories/bloc/user_stories_bloc.g.dart create mode 100644 packages/app_ui/lib/src/generated/.gitkeep create mode 100644 packages/app_ui/lib/src/generated/assets.gen.dart create mode 100644 packages/app_ui/lib/src/generated/fonts.gen.dart create mode 100644 packages/insta_blocks/lib/src/block_action.g.dart create mode 100644 packages/insta_blocks/lib/src/divider_horizontal_block.g.dart create mode 100644 packages/insta_blocks/lib/src/models/feed_page.g.dart create mode 100644 packages/insta_blocks/lib/src/models/post_author.g.dart create mode 100644 packages/insta_blocks/lib/src/post_large_block.g.dart create mode 100644 packages/insta_blocks/lib/src/post_reel_block.g.dart create mode 100644 packages/insta_blocks/lib/src/post_small_block.g.dart create mode 100644 packages/insta_blocks/lib/src/post_sponsored_block.g.dart create mode 100644 packages/insta_blocks/lib/src/section_header_block.g.dart create mode 100644 packages/insta_blocks/lib/src/unknown_block.g.dart create mode 100644 packages/shared/lib/src/models/attachment_file.freezed.dart create mode 100644 packages/shared/lib/src/models/attachment_file.g.dart create mode 100644 packages/shared/lib/src/models/comment.g.dart create mode 100644 packages/shared/lib/src/models/image.g.dart create mode 100644 packages/shared/lib/src/models/post.g.dart create mode 100644 packages/shared/lib/src/models/post_options_settings.freezed.dart create mode 100644 packages/shared/lib/src/models/video.g.dart diff --git a/.github/workflows/flutter_instagram_offline_first_clone.yaml b/.github/workflows/flutter_instagram_offline_first_clone.yaml index 8ab1d4f7..916552b4 100644 --- a/.github/workflows/flutter_instagram_offline_first_clone.yaml +++ b/.github/workflows/flutter_instagram_offline_first_clone.yaml @@ -31,12 +31,13 @@ jobs: - uses: subosito/flutter-action@v2.14.0 with: channel: ${{matrix.channel}} - flutter-version: "3.16.9" + flutter-version: 3.10.2 cache: false - name: Install Dependencies run: | flutter pub global activate very_good_cli + very_good --analytics false very_good packages get --recursive - name: Format diff --git a/.gitignore b/.gitignore index ccd64e39..204dbd87 100644 --- a/.gitignore +++ b/.gitignore @@ -15,9 +15,6 @@ migrate_working_dir/ # Generated files lib/l10n/generated/* ./generated -**/*.gen.dart -**/*.g.dart -**/*.freezed.dart # IntelliJ related *.iml diff --git a/ios/Podfile b/ios/Podfile index eea7da85..bc2796bc 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -32,13 +32,68 @@ target 'Runner' do use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) - # target 'RunnerTests' do - # inherit! :search_paths - # end end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) + target.build_configurations.each do |build_configuration| + # GoogleSignIn does not support arm64 simulators. + # https://github.com/flutter/flutter/issues/85713 + build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386' + + # You can enable the permissions needed here. For example to enable camera + # permission, just remove the `#` character in front so it looks like this: + # + # ## dart: PermissionGroup.camera + # 'PERMISSION_CAMERA=1' + # + # Preprocessor definitions can be found in: https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler/ios/Classes/PermissionHandlerEnums.h + build_configuration.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ + '$(inherited)', + + ## dart: PermissionGroup.calendar + # 'PERMISSION_EVENTS=1', + + ## dart: PermissionGroup.reminders + # 'PERMISSION_REMINDERS=1', + + ## dart: PermissionGroup.contacts + # 'PERMISSION_CONTACTS=1', + + ## dart: PermissionGroup.camera + 'PERMISSION_CAMERA=1', + + ## dart: PermissionGroup.microphone + 'PERMISSION_MICROPHONE=1', + + ## dart: PermissionGroup.speech + # 'PERMISSION_SPEECH_RECOGNIZER=1', + + ## dart: PermissionGroup.photos + 'PERMISSION_PHOTOS=1', + + ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse] + # 'PERMISSION_LOCATION=1', + + ## dart: PermissionGroup.notification + 'PERMISSION_NOTIFICATIONS=1', + + ## dart: PermissionGroup.mediaLibrary + 'PERMISSION_MEDIA_LIBRARY=1', + + ## dart: PermissionGroup.sensors + # 'PERMISSION_SENSORS=1', + + ## dart: PermissionGroup.bluetooth + # 'PERMISSION_BLUETOOTH=1', + + ## dart: PermissionGroup.appTrackingTransparency + # 'PERMISSION_APP_TRACKING_TRANSPARENCY=1', + + ## dart: PermissionGroup.criticalAlerts + # 'PERMISSION_CRITICAL_ALERTS=1' + ] + end end end diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 7eb7bdec..2dc3ff5c 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -328,6 +328,6 @@ SPEC CHECKSUMS: video_player_avfoundation: 02011213dab73ae3687df27ce441fbbcc82b5579 video_thumbnail: c4e2a3c539e247d4de13cd545344fd2d26ffafd1 -PODFILE CHECKSUM: 0805b11bfb13bd44fc55fe52946ce14f22a2998e +PODFILE CHECKSUM: 6911766df20237427d192c20bd5899ff864b093a COCOAPODS: 1.13.0 diff --git a/lib/chats/chat/bloc/chat_bloc.g.dart b/lib/chats/chat/bloc/chat_bloc.g.dart new file mode 100644 index 00000000..b28a036d --- /dev/null +++ b/lib/chats/chat/bloc/chat_bloc.g.dart @@ -0,0 +1,38 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'chat_bloc.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ChatState _$ChatStateFromJson(Map json) => $checkedCreate( + 'ChatState', + json, + ($checkedConvert) { + final val = ChatState( + status: $checkedConvert( + 'status', (v) => $enumDecode(_$ChatStatusEnumMap, v)), + messages: $checkedConvert( + 'messages', + (v) => (v as List) + .map((e) => Message.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$ChatStateToJson(ChatState instance) => { + 'status': _$ChatStatusEnumMap[instance.status]!, + 'messages': instance.messages.map((e) => e.toJson()).toList(), + }; + +const _$ChatStatusEnumMap = { + ChatStatus.initial: 'initial', + ChatStatus.loading: 'loading', + ChatStatus.success: 'success', + ChatStatus.failure: 'failure', +}; diff --git a/lib/comments/bloc/comments_bloc.g.dart b/lib/comments/bloc/comments_bloc.g.dart new file mode 100644 index 00000000..1c4f71f9 --- /dev/null +++ b/lib/comments/bloc/comments_bloc.g.dart @@ -0,0 +1,39 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'comments_bloc.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +CommentsState _$CommentsStateFromJson(Map json) => + $checkedCreate( + 'CommentsState', + json, + ($checkedConvert) { + final val = CommentsState( + status: $checkedConvert( + 'status', (v) => $enumDecode(_$CommentsStatusEnumMap, v)), + comments: $checkedConvert( + 'comments', + (v) => (v as List) + .map((e) => Comment.fromJson(e as Map)) + .toList()), + ); + return val; + }, + ); + +Map _$CommentsStateToJson(CommentsState instance) => + { + 'status': _$CommentsStatusEnumMap[instance.status]!, + 'comments': instance.comments.map((e) => e.toJson()).toList(), + }; + +const _$CommentsStatusEnumMap = { + CommentsStatus.initial: 'initial', + CommentsStatus.populated: 'populated', + CommentsStatus.error: 'error', +}; diff --git a/lib/comments/comment/bloc/comment_bloc.g.dart b/lib/comments/comment/bloc/comment_bloc.g.dart new file mode 100644 index 00000000..1d099c5d --- /dev/null +++ b/lib/comments/comment/bloc/comment_bloc.g.dart @@ -0,0 +1,67 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'comment_bloc.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +CommentState _$CommentStateFromJson(Map json) => + $checkedCreate( + 'CommentState', + json, + ($checkedConvert) { + final val = CommentState( + status: $checkedConvert( + 'status', (v) => $enumDecode(_$CommentStatusEnumMap, v)), + likes: $checkedConvert('likes', (v) => v as int), + comments: $checkedConvert('comments', (v) => v as int), + isLiked: $checkedConvert('is_liked', (v) => v as bool), + isOwner: $checkedConvert('is_owner', (v) => v as bool), + isLikedByOwner: + $checkedConvert('is_liked_by_owner', (v) => v as bool), + repliedComments: $checkedConvert( + 'replied_comments', + (v) => (v as List?) + ?.map((e) => Comment.fromJson(e as Map)) + .toList()), + ); + return val; + }, + fieldKeyMap: const { + 'isLiked': 'is_liked', + 'isOwner': 'is_owner', + 'isLikedByOwner': 'is_liked_by_owner', + 'repliedComments': 'replied_comments' + }, + ); + +Map _$CommentStateToJson(CommentState instance) { + final val = { + 'status': _$CommentStatusEnumMap[instance.status]!, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('replied_comments', + instance.repliedComments?.map((e) => e.toJson()).toList()); + val['likes'] = instance.likes; + val['comments'] = instance.comments; + val['is_liked'] = instance.isLiked; + val['is_owner'] = instance.isOwner; + val['is_liked_by_owner'] = instance.isLikedByOwner; + return val; +} + +const _$CommentStatusEnumMap = { + CommentStatus.initial: 'initial', + CommentStatus.loading: 'loading', + CommentStatus.success: 'success', + CommentStatus.failure: 'failure', +}; diff --git a/lib/feed/post/bloc/post_bloc.g.dart b/lib/feed/post/bloc/post_bloc.g.dart new file mode 100644 index 00000000..6086a0f5 --- /dev/null +++ b/lib/feed/post/bloc/post_bloc.g.dart @@ -0,0 +1,64 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'post_bloc.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PostState _$PostStateFromJson(Map json) => $checkedCreate( + 'PostState', + json, + ($checkedConvert) { + final val = PostState( + status: $checkedConvert( + 'status', (v) => $enumDecode(_$PostStatusEnumMap, v)), + likes: $checkedConvert('likes', (v) => v as int), + likers: $checkedConvert( + 'likers', + (v) => (v as List) + .map((e) => User.fromJson(e as Map)) + .toList()), + commentsCount: $checkedConvert('comments_count', (v) => v as int), + isLiked: $checkedConvert('is_liked', (v) => v as bool), + isOwner: $checkedConvert('is_owner', (v) => v as bool), + isFollowed: $checkedConvert('is_followed', (v) => v as bool?), + ); + return val; + }, + fieldKeyMap: const { + 'commentsCount': 'comments_count', + 'isLiked': 'is_liked', + 'isOwner': 'is_owner', + 'isFollowed': 'is_followed' + }, + ); + +Map _$PostStateToJson(PostState instance) { + final val = { + 'status': _$PostStatusEnumMap[instance.status]!, + 'likes': instance.likes, + 'likers': instance.likers.map((e) => e.toJson()).toList(), + 'comments_count': instance.commentsCount, + 'is_liked': instance.isLiked, + 'is_owner': instance.isOwner, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('is_followed', instance.isFollowed); + return val; +} + +const _$PostStatusEnumMap = { + PostStatus.initial: 'initial', + PostStatus.loading: 'loading', + PostStatus.success: 'success', + PostStatus.failure: 'failure', +}; diff --git a/lib/feed/post/bloc/reel_bloc.g.dart b/lib/feed/post/bloc/reel_bloc.g.dart new file mode 100644 index 00000000..5e437553 --- /dev/null +++ b/lib/feed/post/bloc/reel_bloc.g.dart @@ -0,0 +1,64 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'reel_bloc.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ReelState _$ReelStateFromJson(Map json) => $checkedCreate( + 'ReelState', + json, + ($checkedConvert) { + final val = ReelState( + status: $checkedConvert( + 'status', (v) => $enumDecode(_$ReelStatusEnumMap, v)), + likes: $checkedConvert('likes', (v) => v as int), + likers: $checkedConvert( + 'likers', + (v) => (v as List) + .map((e) => User.fromJson(e as Map)) + .toList()), + commentsCount: $checkedConvert('comments_count', (v) => v as int), + isLiked: $checkedConvert('is_liked', (v) => v as bool), + isOwner: $checkedConvert('is_owner', (v) => v as bool), + isFollowed: $checkedConvert('is_followed', (v) => v as bool?), + ); + return val; + }, + fieldKeyMap: const { + 'commentsCount': 'comments_count', + 'isLiked': 'is_liked', + 'isOwner': 'is_owner', + 'isFollowed': 'is_followed' + }, + ); + +Map _$ReelStateToJson(ReelState instance) { + final val = { + 'status': _$ReelStatusEnumMap[instance.status]!, + 'likes': instance.likes, + 'likers': instance.likers.map((e) => e.toJson()).toList(), + 'comments_count': instance.commentsCount, + 'is_liked': instance.isLiked, + 'is_owner': instance.isOwner, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('is_followed', instance.isFollowed); + return val; +} + +const _$ReelStatusEnumMap = { + ReelStatus.initial: 'initial', + ReelStatus.loading: 'loading', + ReelStatus.success: 'success', + ReelStatus.failure: 'failure', +}; diff --git a/lib/l10n/slang/translations.g.dart b/lib/l10n/slang/translations.g.dart new file mode 100644 index 00000000..3602fef6 --- /dev/null +++ b/lib/l10n/slang/translations.g.dart @@ -0,0 +1,230 @@ +/// Generated file. Do not edit. +/// +/// Original: lib/l10n/slang +/// To regenerate, run: `dart run slang` +/// +/// Locales: 2 +/// Strings: 2 (1 per locale) +/// +/// Built on 2024-03-07 at 08:46 UTC + +// coverage:ignore-file +// ignore_for_file: type=lint + +import 'package:flutter/widgets.dart'; +import 'package:slang/builder/model/node.dart'; +import 'package:slang_flutter/slang_flutter.dart'; +export 'package:slang_flutter/slang_flutter.dart'; + +const AppLocale _baseLocale = AppLocale.en; + +/// Supported locales, see extension methods below. +/// +/// Usage: +/// - LocaleSettings.setLocale(AppLocale.en) // set locale +/// - Locale locale = AppLocale.en.flutterLocale // get flutter locale from enum +/// - if (LocaleSettings.currentLocale == AppLocale.en) // locale check +enum AppLocale with BaseAppLocale { + en(languageCode: 'en', build: Translations.build), + ru(languageCode: 'ru', build: _TranslationsRu.build); + + const AppLocale({required this.languageCode, this.scriptCode, this.countryCode, required this.build}); // ignore: unused_element + + @override final String languageCode; + @override final String? scriptCode; + @override final String? countryCode; + @override final TranslationBuilder build; + + /// Gets current instance managed by [LocaleSettings]. + Translations get translations => LocaleSettings.instance.translationMap[this]!; +} + +/// Method A: Simple +/// +/// No rebuild after locale change. +/// Translation happens during initialization of the widget (call of t). +/// Configurable via 'translate_var'. +/// +/// Usage: +/// String a = t.someKey.anotherKey; +/// String b = t['someKey.anotherKey']; // Only for edge cases! +Translations get t => LocaleSettings.instance.currentTranslations; + +/// Method B: Advanced +/// +/// All widgets using this method will trigger a rebuild when locale changes. +/// Use this if you have e.g. a settings page where the user can select the locale during runtime. +/// +/// Step 1: +/// wrap your App with +/// TranslationProvider( +/// child: MyApp() +/// ); +/// +/// Step 2: +/// final t = Translations.of(context); // Get t variable. +/// String a = t.someKey.anotherKey; // Use t variable. +/// String b = t['someKey.anotherKey']; // Only for edge cases! +class TranslationProvider extends BaseTranslationProvider { + TranslationProvider({required super.child}) : super(settings: LocaleSettings.instance); + + static InheritedLocaleData of(BuildContext context) => InheritedLocaleData.of(context); +} + +/// Method B shorthand via [BuildContext] extension method. +/// Configurable via 'translate_var'. +/// +/// Usage (e.g. in a widget's build method): +/// context.t.someKey.anotherKey +extension BuildContextTranslationsExtension on BuildContext { + Translations get t => TranslationProvider.of(this).translations; +} + +/// Manages all translation instances and the current locale +class LocaleSettings extends BaseFlutterLocaleSettings { + LocaleSettings._() : super(utils: AppLocaleUtils.instance); + + static final instance = LocaleSettings._(); + + // static aliases (checkout base methods for documentation) + static AppLocale get currentLocale => instance.currentLocale; + static Stream getLocaleStream() => instance.getLocaleStream(); + static AppLocale setLocale(AppLocale locale, {bool? listenToDeviceLocale = false}) => instance.setLocale(locale, listenToDeviceLocale: listenToDeviceLocale); + static AppLocale setLocaleRaw(String rawLocale, {bool? listenToDeviceLocale = false}) => instance.setLocaleRaw(rawLocale, listenToDeviceLocale: listenToDeviceLocale); + static AppLocale useDeviceLocale() => instance.useDeviceLocale(); + @Deprecated('Use [AppLocaleUtils.supportedLocales]') static List get supportedLocales => instance.supportedLocales; + @Deprecated('Use [AppLocaleUtils.supportedLocalesRaw]') static List get supportedLocalesRaw => instance.supportedLocalesRaw; + static void setPluralResolver({String? language, AppLocale? locale, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) => instance.setPluralResolver( + language: language, + locale: locale, + cardinalResolver: cardinalResolver, + ordinalResolver: ordinalResolver, + ); +} + +/// Provides utility functions without any side effects. +class AppLocaleUtils extends BaseAppLocaleUtils { + AppLocaleUtils._() : super(baseLocale: _baseLocale, locales: AppLocale.values); + + static final instance = AppLocaleUtils._(); + + // static aliases (checkout base methods for documentation) + static AppLocale parse(String rawLocale) => instance.parse(rawLocale); + static AppLocale parseLocaleParts({required String languageCode, String? scriptCode, String? countryCode}) => instance.parseLocaleParts(languageCode: languageCode, scriptCode: scriptCode, countryCode: countryCode); + static AppLocale findDeviceLocale() => instance.findDeviceLocale(); + static List get supportedLocales => instance.supportedLocales; + static List get supportedLocalesRaw => instance.supportedLocalesRaw; +} + +// translations + +// Path: +class Translations implements BaseTranslations { + /// Returns the current translations of the given [context]. + /// + /// Usage: + /// final t = Translations.of(context); + static Translations of(BuildContext context) => InheritedLocaleData.of(context).translations; + + /// You can call this constructor and build your own translation instance of this locale. + /// Constructing via the enum [AppLocale.build] is preferred. + Translations.build({Map? overrides, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) + : assert(overrides == null, 'Set "translation_overrides: true" in order to enable this feature.'), + $meta = TranslationMetadata( + locale: AppLocale.en, + overrides: overrides ?? {}, + cardinalResolver: cardinalResolver, + ordinalResolver: ordinalResolver, + ) { + $meta.setFlatMapFunction(_flatMapFunction); + } + + /// Metadata for the translations of . + @override final TranslationMetadata $meta; + + /// Access flat map + dynamic operator[](String key) => $meta.getTranslation(key); + + late final Translations _root = this; // ignore: unused_field + + // Translations + TextSpan likedBy({required InlineSpan name, required InlineSpan and, required InlineSpan others}) => TextSpan(children: [ + const TextSpan(text: 'Liked by '), + name, + const TextSpan(text: ' '), + and, + const TextSpan(text: ' '), + others, + ]); +} + +// Path: +class _TranslationsRu extends Translations { + /// You can call this constructor and build your own translation instance of this locale. + /// Constructing via the enum [AppLocale.build] is preferred. + _TranslationsRu.build({Map? overrides, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) + : assert(overrides == null, 'Set "translation_overrides: true" in order to enable this feature.'), + $meta = TranslationMetadata( + locale: AppLocale.ru, + overrides: overrides ?? {}, + cardinalResolver: cardinalResolver, + ordinalResolver: ordinalResolver, + ), + super.build(cardinalResolver: cardinalResolver, ordinalResolver: ordinalResolver) { + super.$meta.setFlatMapFunction($meta.getTranslation); // copy base translations to super.$meta + $meta.setFlatMapFunction(_flatMapFunction); + } + + /// Metadata for the translations of . + @override final TranslationMetadata $meta; + + /// Access flat map + @override dynamic operator[](String key) => $meta.getTranslation(key) ?? super.$meta.getTranslation(key); + + @override late final _TranslationsRu _root = this; // ignore: unused_field + + // Translations + @override TextSpan likedBy({required InlineSpan name, required InlineSpan and, required InlineSpan others}) => TextSpan(children: [ + const TextSpan(text: 'Нравится '), + name, + const TextSpan(text: ' '), + and, + const TextSpan(text: ' '), + others, + ]); +} + +/// Flat map(s) containing all translations. +/// Only for edge cases! For simple maps, use the map function of this library. + +extension on Translations { + dynamic _flatMapFunction(String path) { + switch (path) { + case 'likedBy': return ({required InlineSpan name, required InlineSpan and, required InlineSpan others}) => TextSpan(children: [ + const TextSpan(text: 'Liked by '), + name, + const TextSpan(text: ' '), + and, + const TextSpan(text: ' '), + others, + ]); + default: return null; + } + } +} + +extension on _TranslationsRu { + dynamic _flatMapFunction(String path) { + switch (path) { + case 'likedBy': return ({required InlineSpan name, required InlineSpan and, required InlineSpan others}) => TextSpan(children: [ + const TextSpan(text: 'Нравится '), + name, + const TextSpan(text: ' '), + and, + const TextSpan(text: ' '), + others, + ]); + default: return null; + } + } +} diff --git a/lib/stories/user_stories/bloc/user_stories_bloc.g.dart b/lib/stories/user_stories/bloc/user_stories_bloc.g.dart new file mode 100644 index 00000000..abab6b9f --- /dev/null +++ b/lib/stories/user_stories/bloc/user_stories_bloc.g.dart @@ -0,0 +1,36 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'user_stories_bloc.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +UserStoriesState _$UserStoriesStateFromJson(Map json) => + $checkedCreate( + 'UserStoriesState', + json, + ($checkedConvert) { + final val = UserStoriesState( + author: $checkedConvert( + 'author', (v) => User.fromJson(v as Map)), + stories: $checkedConvert( + 'stories', + (v) => (v as List) + .map((e) => Story.fromJson(e as Map)) + .toList()), + showStories: $checkedConvert('show_stories', (v) => v as bool), + ); + return val; + }, + fieldKeyMap: const {'showStories': 'show_stories'}, + ); + +Map _$UserStoriesStateToJson(UserStoriesState instance) => + { + 'author': instance.author.toJson(), + 'stories': instance.stories.map((e) => e.toJson()).toList(), + 'show_stories': instance.showStories, + }; diff --git a/packages/app_ui/lib/src/generated/.gitkeep b/packages/app_ui/lib/src/generated/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/packages/app_ui/lib/src/generated/assets.gen.dart b/packages/app_ui/lib/src/generated/assets.gen.dart new file mode 100644 index 00000000..f6370175 --- /dev/null +++ b/packages/app_ui/lib/src/generated/assets.gen.dart @@ -0,0 +1,260 @@ +/// GENERATED CODE - DO NOT MODIFY BY HAND +/// ***************************************************** +/// FlutterGen +/// ***************************************************** + +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use + +import 'package:flutter/widgets.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:flutter/services.dart'; + +class $AssetsAnimationsGen { + const $AssetsAnimationsGen(); + + /// File path: assets/animations/checked-animation.json + String get checkedAnimation => + 'packages/app_ui/assets/animations/checked-animation.json'; + + /// List of all assets + List get values => [checkedAnimation]; +} + +class $AssetsIconsGen { + const $AssetsIconsGen(); + + /// File path: assets/icons/add-button.svg + SvgGenImage get addButton => const SvgGenImage('assets/icons/add-button.svg'); + + /// File path: assets/icons/chat_circle.svg + SvgGenImage get chatCircle => + const SvgGenImage('assets/icons/chat_circle.svg'); + + /// File path: assets/icons/check.svg + SvgGenImage get check => const SvgGenImage('assets/icons/check.svg'); + + /// File path: assets/icons/github.svg + SvgGenImage get github => const SvgGenImage('assets/icons/github.svg'); + + /// File path: assets/icons/google.svg + SvgGenImage get google => const SvgGenImage('assets/icons/google.svg'); + + /// File path: assets/icons/instagram-reel.svg + SvgGenImage get instagramReel => + const SvgGenImage('assets/icons/instagram-reel.svg'); + + /// File path: assets/icons/search.svg + SvgGenImage get search => const SvgGenImage('assets/icons/search.svg'); + + /// File path: assets/icons/setting.svg + SvgGenImage get setting => const SvgGenImage('assets/icons/setting.svg'); + + /// File path: assets/icons/trash.svg + SvgGenImage get trash => const SvgGenImage('assets/icons/trash.svg'); + + /// File path: assets/icons/user.svg + SvgGenImage get user => const SvgGenImage('assets/icons/user.svg'); + + /// File path: assets/icons/verified_user.svg + SvgGenImage get verifiedUser => + const SvgGenImage('assets/icons/verified_user.svg'); + + /// List of all assets + List get values => [ + addButton, + chatCircle, + check, + github, + google, + instagramReel, + search, + setting, + trash, + user, + verifiedUser + ]; +} + +class $AssetsImagesGen { + const $AssetsImagesGen(); + + /// File path: assets/images/chat-background_light_mask.png + AssetGenImage get chatBackgroundLightMask => + const AssetGenImage('assets/images/chat-background_light_mask.png'); + + /// File path: assets/images/chat_background_dark_mask.jpeg + AssetGenImage get chatBackgroundDarkMask => + const AssetGenImage('assets/images/chat_background_dark_mask.jpeg'); + + /// File path: assets/images/chat_background_light_overlay.png + AssetGenImage get chatBackgroundLightOverlay => + const AssetGenImage('assets/images/chat_background_light_overlay.png'); + + /// File path: assets/images/instagram_text_logo.svg + SvgGenImage get instagramTextLogo => + const SvgGenImage('assets/images/instagram_text_logo.svg'); + + /// File path: assets/images/placeholder.png + AssetGenImage get placeholder => + const AssetGenImage('assets/images/placeholder.png'); + + /// File path: assets/images/profile_photo.png + AssetGenImage get profilePhoto => + const AssetGenImage('assets/images/profile_photo.png'); + + /// List of all assets + List get values => [ + chatBackgroundLightMask, + chatBackgroundDarkMask, + chatBackgroundLightOverlay, + instagramTextLogo, + placeholder, + profilePhoto + ]; +} + +class Assets { + Assets._(); + + static const String package = 'app_ui'; + + static const $AssetsAnimationsGen animations = $AssetsAnimationsGen(); + static const $AssetsIconsGen icons = $AssetsIconsGen(); + static const $AssetsImagesGen images = $AssetsImagesGen(); +} + +class AssetGenImage { + const AssetGenImage(this._assetName); + + final String _assetName; + + static const String package = 'app_ui'; + + Image image({ + Key? key, + AssetBundle? bundle, + ImageFrameBuilder? frameBuilder, + ImageErrorWidgetBuilder? errorBuilder, + String? semanticLabel, + bool excludeFromSemantics = false, + double? scale, + double? width, + double? height, + Color? color, + Animation? opacity, + BlendMode? colorBlendMode, + BoxFit? fit, + AlignmentGeometry alignment = Alignment.center, + ImageRepeat repeat = ImageRepeat.noRepeat, + Rect? centerSlice, + bool matchTextDirection = false, + bool gaplessPlayback = false, + bool isAntiAlias = false, + @Deprecated('Do not specify package for a generated library asset') + String? package = package, + FilterQuality filterQuality = FilterQuality.low, + int? cacheWidth, + int? cacheHeight, + }) { + return Image.asset( + _assetName, + key: key, + bundle: bundle, + frameBuilder: frameBuilder, + errorBuilder: errorBuilder, + semanticLabel: semanticLabel, + excludeFromSemantics: excludeFromSemantics, + scale: scale, + width: width, + height: height, + color: color, + opacity: opacity, + colorBlendMode: colorBlendMode, + fit: fit, + alignment: alignment, + repeat: repeat, + centerSlice: centerSlice, + matchTextDirection: matchTextDirection, + gaplessPlayback: gaplessPlayback, + isAntiAlias: isAntiAlias, + package: package, + filterQuality: filterQuality, + cacheWidth: cacheWidth, + cacheHeight: cacheHeight, + ); + } + + ImageProvider provider({ + AssetBundle? bundle, + @Deprecated('Do not specify package for a generated library asset') + String? package = package, + }) { + return AssetImage( + _assetName, + bundle: bundle, + package: package, + ); + } + + String get path => _assetName; + + String get keyName => 'packages/app_ui/$_assetName'; +} + +class SvgGenImage { + const SvgGenImage(this._assetName); + + final String _assetName; + + static const String package = 'app_ui'; + + SvgPicture svg({ + Key? key, + bool matchTextDirection = false, + AssetBundle? bundle, + @Deprecated('Do not specify package for a generated library asset') + String? package = package, + double? width, + double? height, + BoxFit fit = BoxFit.contain, + AlignmentGeometry alignment = Alignment.center, + bool allowDrawingOutsideViewBox = false, + WidgetBuilder? placeholderBuilder, + String? semanticsLabel, + bool excludeFromSemantics = false, + SvgTheme theme = const SvgTheme(), + ColorFilter? colorFilter, + Clip clipBehavior = Clip.hardEdge, + @deprecated Color? color, + @deprecated BlendMode colorBlendMode = BlendMode.srcIn, + @deprecated bool cacheColorFilter = false, + }) { + return SvgPicture.asset( + _assetName, + key: key, + matchTextDirection: matchTextDirection, + bundle: bundle, + package: package, + width: width, + height: height, + fit: fit, + alignment: alignment, + allowDrawingOutsideViewBox: allowDrawingOutsideViewBox, + placeholderBuilder: placeholderBuilder, + semanticsLabel: semanticsLabel, + excludeFromSemantics: excludeFromSemantics, + theme: theme, + colorFilter: colorFilter, + color: color, + colorBlendMode: colorBlendMode, + clipBehavior: clipBehavior, + cacheColorFilter: cacheColorFilter, + ); + } + + String get path => _assetName; + + String get keyName => 'packages/app_ui/$_assetName'; +} diff --git a/packages/app_ui/lib/src/generated/fonts.gen.dart b/packages/app_ui/lib/src/generated/fonts.gen.dart new file mode 100644 index 00000000..f18fc14c --- /dev/null +++ b/packages/app_ui/lib/src/generated/fonts.gen.dart @@ -0,0 +1,18 @@ +/// GENERATED CODE - DO NOT MODIFY BY HAND +/// ***************************************************** +/// FlutterGen +/// ***************************************************** + +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use + +class FontFamily { + FontFamily._(); + + /// Font family: Inter + static const String inter = 'Inter'; + + /// Font family: Montserrat + static const String montserrat = 'Montserrat'; +} diff --git a/packages/insta_blocks/.gitignore b/packages/insta_blocks/.gitignore index bf9344ae..06ef8e61 100644 --- a/packages/insta_blocks/.gitignore +++ b/packages/insta_blocks/.gitignore @@ -16,9 +16,6 @@ migrate_working_dir/ *.iws .idea/ -# Generated -**/*.g.dart - # VSCode related .vscode/* diff --git a/packages/insta_blocks/lib/src/block_action.g.dart b/packages/insta_blocks/lib/src/block_action.g.dart new file mode 100644 index 00000000..a03a6e29 --- /dev/null +++ b/packages/insta_blocks/lib/src/block_action.g.dart @@ -0,0 +1,88 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'block_action.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +NavigateToPostAuthorProfileAction _$NavigateToPostAuthorProfileActionFromJson( + Map json) => + $checkedCreate( + 'NavigateToPostAuthorProfileAction', + json, + ($checkedConvert) { + final val = NavigateToPostAuthorProfileAction( + authorId: $checkedConvert('author_id', (v) => v as String), + type: $checkedConvert( + 'type', + (v) => + v as String? ?? NavigateToPostAuthorProfileAction.identifier), + ); + return val; + }, + fieldKeyMap: const {'authorId': 'author_id'}, + ); + +Map _$NavigateToPostAuthorProfileActionToJson( + NavigateToPostAuthorProfileAction instance) => + { + 'author_id': instance.authorId, + 'type': instance.type, + }; + +NavigateToSponsoredPostAuthorProfileAction + _$NavigateToSponsoredPostAuthorProfileActionFromJson( + Map json) => + $checkedCreate( + 'NavigateToSponsoredPostAuthorProfileAction', + json, + ($checkedConvert) { + final val = NavigateToSponsoredPostAuthorProfileAction( + authorId: $checkedConvert('author_id', (v) => v as String), + promoPreviewImageUrl: $checkedConvert( + 'promo_preview_image_url', (v) => v as String), + promoUrl: $checkedConvert('promo_url', (v) => v as String), + type: $checkedConvert( + 'type', + (v) => + v as String? ?? + NavigateToSponsoredPostAuthorProfileAction.identifier), + ); + return val; + }, + fieldKeyMap: const { + 'authorId': 'author_id', + 'promoPreviewImageUrl': 'promo_preview_image_url', + 'promoUrl': 'promo_url' + }, + ); + +Map _$NavigateToSponsoredPostAuthorProfileActionToJson( + NavigateToSponsoredPostAuthorProfileAction instance) => + { + 'author_id': instance.authorId, + 'promo_preview_image_url': instance.promoPreviewImageUrl, + 'promo_url': instance.promoUrl, + 'type': instance.type, + }; + +UnknownBlockAction _$UnknownBlockActionFromJson(Map json) => + $checkedCreate( + 'UnknownBlockAction', + json, + ($checkedConvert) { + final val = UnknownBlockAction( + type: $checkedConvert( + 'type', (v) => v as String? ?? UnknownBlockAction.identifier), + ); + return val; + }, + ); + +Map _$UnknownBlockActionToJson(UnknownBlockAction instance) => + { + 'type': instance.type, + }; diff --git a/packages/insta_blocks/lib/src/divider_horizontal_block.g.dart b/packages/insta_blocks/lib/src/divider_horizontal_block.g.dart new file mode 100644 index 00000000..f041f3e8 --- /dev/null +++ b/packages/insta_blocks/lib/src/divider_horizontal_block.g.dart @@ -0,0 +1,29 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'divider_horizontal_block.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +DividerHorizontalBlock _$DividerHorizontalBlockFromJson( + Map json) => + $checkedCreate( + 'DividerHorizontalBlock', + json, + ($checkedConvert) { + final val = DividerHorizontalBlock( + type: $checkedConvert( + 'type', (v) => v as String? ?? DividerHorizontalBlock.identifier), + ); + return val; + }, + ); + +Map _$DividerHorizontalBlockToJson( + DividerHorizontalBlock instance) => + { + 'type': instance.type, + }; diff --git a/packages/insta_blocks/lib/src/models/feed_page.g.dart b/packages/insta_blocks/lib/src/models/feed_page.g.dart new file mode 100644 index 00000000..53431bcf --- /dev/null +++ b/packages/insta_blocks/lib/src/models/feed_page.g.dart @@ -0,0 +1,34 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'feed_page.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +FeedPage _$FeedPageFromJson(Map json) => $checkedCreate( + 'FeedPage', + json, + ($checkedConvert) { + final val = FeedPage( + blocks: $checkedConvert( + 'blocks', + (v) => const InstaBlocksConverter() + .fromJson(v as List>)), + totalBlocks: $checkedConvert('total_blocks', (v) => v as int), + page: $checkedConvert('page', (v) => v as int), + hasMore: $checkedConvert('has_more', (v) => v as bool), + ); + return val; + }, + fieldKeyMap: const {'totalBlocks': 'total_blocks', 'hasMore': 'has_more'}, + ); + +Map _$FeedPageToJson(FeedPage instance) => { + 'blocks': const InstaBlocksConverter().toJson(instance.blocks), + 'total_blocks': instance.totalBlocks, + 'page': instance.page, + 'has_more': instance.hasMore, + }; diff --git a/packages/insta_blocks/lib/src/models/post_author.g.dart b/packages/insta_blocks/lib/src/models/post_author.g.dart new file mode 100644 index 00000000..1f132a7f --- /dev/null +++ b/packages/insta_blocks/lib/src/models/post_author.g.dart @@ -0,0 +1,36 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'post_author.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PostAuthor _$PostAuthorFromJson(Map json) => $checkedCreate( + 'PostAuthor', + json, + ($checkedConvert) { + final val = PostAuthor( + id: $checkedConvert('id', (v) => v as String), + avatarUrl: $checkedConvert('avatar_url', (v) => v as String), + username: $checkedConvert('username', (v) => v as String), + isConfirmed: + $checkedConvert('is_confirmed', (v) => v as bool? ?? false), + ); + return val; + }, + fieldKeyMap: const { + 'avatarUrl': 'avatar_url', + 'isConfirmed': 'is_confirmed' + }, + ); + +Map _$PostAuthorToJson(PostAuthor instance) => + { + 'id': instance.id, + 'username': instance.username, + 'avatar_url': instance.avatarUrl, + 'is_confirmed': instance.isConfirmed, + }; diff --git a/packages/insta_blocks/lib/src/post_large_block.g.dart b/packages/insta_blocks/lib/src/post_large_block.g.dart new file mode 100644 index 00000000..859964b4 --- /dev/null +++ b/packages/insta_blocks/lib/src/post_large_block.g.dart @@ -0,0 +1,71 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'post_large_block.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PostLargeBlock _$PostLargeBlockFromJson(Map json) => + $checkedCreate( + 'PostLargeBlock', + json, + ($checkedConvert) { + final val = PostLargeBlock( + id: $checkedConvert('id', (v) => v as String), + author: $checkedConvert( + 'author', + (v) => const PostAuthorConverter() + .fromJson(v as Map)), + createdAt: + $checkedConvert('created_at', (v) => DateTime.parse(v as String)), + media: $checkedConvert( + 'media', + (v) => const ListMediaConverterFromRemoteConfig() + .fromJson(v as List)), + caption: $checkedConvert('caption', (v) => v as String), + likersInFollowings: $checkedConvert( + 'likers_in_followings', + (v) => + (v as List?) + ?.map((e) => User.fromJson(e as Map)) + .toList() ?? + const []), + action: $checkedConvert( + 'action', + (v) => const BlockActionConverter() + .fromJson(v as Map?)), + type: $checkedConvert( + 'type', (v) => v as String? ?? PostLargeBlock.identifier), + ); + return val; + }, + fieldKeyMap: const { + 'createdAt': 'created_at', + 'likersInFollowings': 'likers_in_followings' + }, + ); + +Map _$PostLargeBlockToJson(PostLargeBlock instance) { + final val = { + 'type': instance.type, + 'author': const PostAuthorConverter().toJson(instance.author), + 'id': instance.id, + 'created_at': instance.createdAt.toIso8601String(), + 'media': const ListMediaConverterFromRemoteConfig().toJson(instance.media), + 'caption': instance.caption, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('action', const BlockActionConverter().toJson(instance.action)); + val['likers_in_followings'] = + instance.likersInFollowings.map((e) => e.toJson()).toList(); + return val; +} diff --git a/packages/insta_blocks/lib/src/post_reel_block.g.dart b/packages/insta_blocks/lib/src/post_reel_block.g.dart new file mode 100644 index 00000000..898318bc --- /dev/null +++ b/packages/insta_blocks/lib/src/post_reel_block.g.dart @@ -0,0 +1,59 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'post_reel_block.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PostReelBlock _$PostReelBlockFromJson(Map json) => + $checkedCreate( + 'PostReelBlock', + json, + ($checkedConvert) { + final val = PostReelBlock( + id: $checkedConvert('id', (v) => v as String), + author: $checkedConvert( + 'author', + (v) => const PostAuthorConverter() + .fromJson(v as Map)), + createdAt: + $checkedConvert('created_at', (v) => DateTime.parse(v as String)), + media: $checkedConvert( + 'media', + (v) => const ListMediaConverterFromRemoteConfig() + .fromJson(v as List)), + caption: $checkedConvert('caption', (v) => v as String), + action: $checkedConvert( + 'action', + (v) => const BlockActionConverter() + .fromJson(v as Map?)), + type: $checkedConvert( + 'type', (v) => v as String? ?? PostReelBlock.identifier), + ); + return val; + }, + fieldKeyMap: const {'createdAt': 'created_at'}, + ); + +Map _$PostReelBlockToJson(PostReelBlock instance) { + final val = { + 'type': instance.type, + 'author': const PostAuthorConverter().toJson(instance.author), + 'id': instance.id, + 'created_at': instance.createdAt.toIso8601String(), + 'media': const ListMediaConverterFromRemoteConfig().toJson(instance.media), + 'caption': instance.caption, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('action', const BlockActionConverter().toJson(instance.action)); + return val; +} diff --git a/packages/insta_blocks/lib/src/post_small_block.g.dart b/packages/insta_blocks/lib/src/post_small_block.g.dart new file mode 100644 index 00000000..d60af820 --- /dev/null +++ b/packages/insta_blocks/lib/src/post_small_block.g.dart @@ -0,0 +1,59 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'post_small_block.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PostSmallBlock _$PostSmallBlockFromJson(Map json) => + $checkedCreate( + 'PostSmallBlock', + json, + ($checkedConvert) { + final val = PostSmallBlock( + id: $checkedConvert('id', (v) => v as String), + author: $checkedConvert( + 'author', + (v) => const PostAuthorConverter() + .fromJson(v as Map)), + createdAt: + $checkedConvert('created_at', (v) => DateTime.parse(v as String)), + media: $checkedConvert( + 'media', + (v) => const ListMediaConverterFromRemoteConfig() + .fromJson(v as List)), + caption: $checkedConvert('caption', (v) => v as String), + action: $checkedConvert( + 'action', + (v) => const BlockActionConverter() + .fromJson(v as Map?)), + type: $checkedConvert( + 'type', (v) => v as String? ?? PostSmallBlock.identifier), + ); + return val; + }, + fieldKeyMap: const {'createdAt': 'created_at'}, + ); + +Map _$PostSmallBlockToJson(PostSmallBlock instance) { + final val = { + 'type': instance.type, + 'author': const PostAuthorConverter().toJson(instance.author), + 'id': instance.id, + 'created_at': instance.createdAt.toIso8601String(), + 'media': const ListMediaConverterFromRemoteConfig().toJson(instance.media), + 'caption': instance.caption, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('action', const BlockActionConverter().toJson(instance.action)); + return val; +} diff --git a/packages/insta_blocks/lib/src/post_sponsored_block.g.dart b/packages/insta_blocks/lib/src/post_sponsored_block.g.dart new file mode 100644 index 00000000..2944404f --- /dev/null +++ b/packages/insta_blocks/lib/src/post_sponsored_block.g.dart @@ -0,0 +1,59 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'post_sponsored_block.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PostSponsoredBlock _$PostSponsoredBlockFromJson(Map json) => + $checkedCreate( + 'PostSponsoredBlock', + json, + ($checkedConvert) { + final val = PostSponsoredBlock( + id: $checkedConvert('id', (v) => v as String), + author: $checkedConvert( + 'author', + (v) => const PostAuthorConverter() + .fromJson(v as Map)), + createdAt: + $checkedConvert('created_at', (v) => DateTime.parse(v as String)), + media: $checkedConvert( + 'media', + (v) => const ListMediaConverterFromRemoteConfig() + .fromJson(v as List)), + caption: $checkedConvert('caption', (v) => v as String), + action: $checkedConvert( + 'action', + (v) => const BlockActionConverter() + .fromJson(v as Map?)), + type: $checkedConvert( + 'type', (v) => v as String? ?? PostSponsoredBlock.identifier), + ); + return val; + }, + fieldKeyMap: const {'createdAt': 'created_at'}, + ); + +Map _$PostSponsoredBlockToJson(PostSponsoredBlock instance) { + final val = { + 'type': instance.type, + 'author': const PostAuthorConverter().toJson(instance.author), + 'id': instance.id, + 'created_at': instance.createdAt.toIso8601String(), + 'media': const ListMediaConverterFromRemoteConfig().toJson(instance.media), + 'caption': instance.caption, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('action', const BlockActionConverter().toJson(instance.action)); + return val; +} diff --git a/packages/insta_blocks/lib/src/section_header_block.g.dart b/packages/insta_blocks/lib/src/section_header_block.g.dart new file mode 100644 index 00000000..997d8acb --- /dev/null +++ b/packages/insta_blocks/lib/src/section_header_block.g.dart @@ -0,0 +1,49 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'section_header_block.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SectionHeaderBlock _$SectionHeaderBlockFromJson(Map json) => + $checkedCreate( + 'SectionHeaderBlock', + json, + ($checkedConvert) { + final val = SectionHeaderBlock( + sectionType: $checkedConvert('section_type', + (v) => $enumDecode(_$SectionHeaderBlockTypeEnumMap, v)), + action: $checkedConvert( + 'action', + (v) => const BlockActionConverter() + .fromJson(v as Map?)), + type: $checkedConvert( + 'type', (v) => v as String? ?? SectionHeaderBlock.identifier), + ); + return val; + }, + fieldKeyMap: const {'sectionType': 'section_type'}, + ); + +Map _$SectionHeaderBlockToJson(SectionHeaderBlock instance) { + final val = { + 'type': instance.type, + 'section_type': _$SectionHeaderBlockTypeEnumMap[instance.sectionType]!, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('action', const BlockActionConverter().toJson(instance.action)); + return val; +} + +const _$SectionHeaderBlockTypeEnumMap = { + SectionHeaderBlockType.suggested: 'suggested', +}; diff --git a/packages/insta_blocks/lib/src/unknown_block.g.dart b/packages/insta_blocks/lib/src/unknown_block.g.dart new file mode 100644 index 00000000..caf4afa9 --- /dev/null +++ b/packages/insta_blocks/lib/src/unknown_block.g.dart @@ -0,0 +1,27 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'unknown_block.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +UnknownBlock _$UnknownBlockFromJson(Map json) => + $checkedCreate( + 'UnknownBlock', + json, + ($checkedConvert) { + final val = UnknownBlock( + type: $checkedConvert( + 'type', (v) => v as String? ?? UnknownBlock.identifier), + ); + return val; + }, + ); + +Map _$UnknownBlockToJson(UnknownBlock instance) => + { + 'type': instance.type, + }; diff --git a/packages/shared/.gitignore b/packages/shared/.gitignore index 54ec2c16..06ef8e61 100644 --- a/packages/shared/.gitignore +++ b/packages/shared/.gitignore @@ -16,10 +16,6 @@ migrate_working_dir/ *.iws .idea/ -# Code gen -*.g.dart -*.freezed.dart - # VSCode related .vscode/* diff --git a/packages/shared/lib/src/models/attachment_file.freezed.dart b/packages/shared/lib/src/models/attachment_file.freezed.dart new file mode 100644 index 00000000..8d198cb3 --- /dev/null +++ b/packages/shared/lib/src/models/attachment_file.freezed.dart @@ -0,0 +1,714 @@ +// 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 'attachment_file.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'); + +UploadState _$UploadStateFromJson(Map json) { + switch (json['runtimeType']) { + case 'preparing': + return Preparing.fromJson(json); + case 'inProgress': + return InProgress.fromJson(json); + case 'success': + return Success.fromJson(json); + case 'failed': + return Failed.fromJson(json); + + default: + throw CheckedFromJsonException(json, 'runtimeType', 'UploadState', + 'Invalid union type "${json['runtimeType']}"!'); + } +} + +/// @nodoc +mixin _$UploadState { + @optionalTypeArgs + TResult when({ + required TResult Function() preparing, + required TResult Function(int uploaded, int total) inProgress, + required TResult Function() success, + required TResult Function(String error) failed, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? preparing, + TResult? Function(int uploaded, int total)? inProgress, + TResult? Function()? success, + TResult? Function(String error)? failed, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? preparing, + TResult Function(int uploaded, int total)? inProgress, + TResult Function()? success, + TResult Function(String error)? failed, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(Preparing value) preparing, + required TResult Function(InProgress value) inProgress, + required TResult Function(Success value) success, + required TResult Function(Failed value) failed, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Preparing value)? preparing, + TResult? Function(InProgress value)? inProgress, + TResult? Function(Success value)? success, + TResult? Function(Failed value)? failed, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Preparing value)? preparing, + TResult Function(InProgress value)? inProgress, + TResult Function(Success value)? success, + TResult Function(Failed value)? failed, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + Map toJson() => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $UploadStateCopyWith<$Res> { + factory $UploadStateCopyWith( + UploadState value, $Res Function(UploadState) then) = + _$UploadStateCopyWithImpl<$Res, UploadState>; +} + +/// @nodoc +class _$UploadStateCopyWithImpl<$Res, $Val extends UploadState> + implements $UploadStateCopyWith<$Res> { + _$UploadStateCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$PreparingImplCopyWith<$Res> { + factory _$$PreparingImplCopyWith( + _$PreparingImpl value, $Res Function(_$PreparingImpl) then) = + __$$PreparingImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$PreparingImplCopyWithImpl<$Res> + extends _$UploadStateCopyWithImpl<$Res, _$PreparingImpl> + implements _$$PreparingImplCopyWith<$Res> { + __$$PreparingImplCopyWithImpl( + _$PreparingImpl _value, $Res Function(_$PreparingImpl) _then) + : super(_value, _then); +} + +/// @nodoc +@JsonSerializable() +class _$PreparingImpl extends Preparing { + const _$PreparingImpl({final String? $type}) + : $type = $type ?? 'preparing', + super._(); + + factory _$PreparingImpl.fromJson(Map json) => + _$$PreparingImplFromJson(json); + + @JsonKey(name: 'runtimeType') + final String $type; + + @override + String toString() { + return 'UploadState.preparing()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$PreparingImpl); + } + + @JsonKey(ignore: true) + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() preparing, + required TResult Function(int uploaded, int total) inProgress, + required TResult Function() success, + required TResult Function(String error) failed, + }) { + return preparing(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? preparing, + TResult? Function(int uploaded, int total)? inProgress, + TResult? Function()? success, + TResult? Function(String error)? failed, + }) { + return preparing?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? preparing, + TResult Function(int uploaded, int total)? inProgress, + TResult Function()? success, + TResult Function(String error)? failed, + required TResult orElse(), + }) { + if (preparing != null) { + return preparing(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Preparing value) preparing, + required TResult Function(InProgress value) inProgress, + required TResult Function(Success value) success, + required TResult Function(Failed value) failed, + }) { + return preparing(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Preparing value)? preparing, + TResult? Function(InProgress value)? inProgress, + TResult? Function(Success value)? success, + TResult? Function(Failed value)? failed, + }) { + return preparing?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Preparing value)? preparing, + TResult Function(InProgress value)? inProgress, + TResult Function(Success value)? success, + TResult Function(Failed value)? failed, + required TResult orElse(), + }) { + if (preparing != null) { + return preparing(this); + } + return orElse(); + } + + @override + Map toJson() { + return _$$PreparingImplToJson( + this, + ); + } +} + +abstract class Preparing extends UploadState { + const factory Preparing() = _$PreparingImpl; + const Preparing._() : super._(); + + factory Preparing.fromJson(Map json) = + _$PreparingImpl.fromJson; +} + +/// @nodoc +abstract class _$$InProgressImplCopyWith<$Res> { + factory _$$InProgressImplCopyWith( + _$InProgressImpl value, $Res Function(_$InProgressImpl) then) = + __$$InProgressImplCopyWithImpl<$Res>; + @useResult + $Res call({int uploaded, int total}); +} + +/// @nodoc +class __$$InProgressImplCopyWithImpl<$Res> + extends _$UploadStateCopyWithImpl<$Res, _$InProgressImpl> + implements _$$InProgressImplCopyWith<$Res> { + __$$InProgressImplCopyWithImpl( + _$InProgressImpl _value, $Res Function(_$InProgressImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? uploaded = null, + Object? total = null, + }) { + return _then(_$InProgressImpl( + uploaded: null == uploaded + ? _value.uploaded + : uploaded // ignore: cast_nullable_to_non_nullable + as int, + total: null == total + ? _value.total + : total // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$InProgressImpl extends InProgress { + const _$InProgressImpl( + {required this.uploaded, required this.total, final String? $type}) + : $type = $type ?? 'inProgress', + super._(); + + factory _$InProgressImpl.fromJson(Map json) => + _$$InProgressImplFromJson(json); + + @override + final int uploaded; + @override + final int total; + + @JsonKey(name: 'runtimeType') + final String $type; + + @override + String toString() { + return 'UploadState.inProgress(uploaded: $uploaded, total: $total)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$InProgressImpl && + (identical(other.uploaded, uploaded) || + other.uploaded == uploaded) && + (identical(other.total, total) || other.total == total)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, uploaded, total); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$InProgressImplCopyWith<_$InProgressImpl> get copyWith => + __$$InProgressImplCopyWithImpl<_$InProgressImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() preparing, + required TResult Function(int uploaded, int total) inProgress, + required TResult Function() success, + required TResult Function(String error) failed, + }) { + return inProgress(uploaded, total); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? preparing, + TResult? Function(int uploaded, int total)? inProgress, + TResult? Function()? success, + TResult? Function(String error)? failed, + }) { + return inProgress?.call(uploaded, total); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? preparing, + TResult Function(int uploaded, int total)? inProgress, + TResult Function()? success, + TResult Function(String error)? failed, + required TResult orElse(), + }) { + if (inProgress != null) { + return inProgress(uploaded, total); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Preparing value) preparing, + required TResult Function(InProgress value) inProgress, + required TResult Function(Success value) success, + required TResult Function(Failed value) failed, + }) { + return inProgress(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Preparing value)? preparing, + TResult? Function(InProgress value)? inProgress, + TResult? Function(Success value)? success, + TResult? Function(Failed value)? failed, + }) { + return inProgress?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Preparing value)? preparing, + TResult Function(InProgress value)? inProgress, + TResult Function(Success value)? success, + TResult Function(Failed value)? failed, + required TResult orElse(), + }) { + if (inProgress != null) { + return inProgress(this); + } + return orElse(); + } + + @override + Map toJson() { + return _$$InProgressImplToJson( + this, + ); + } +} + +abstract class InProgress extends UploadState { + const factory InProgress( + {required final int uploaded, + required final int total}) = _$InProgressImpl; + const InProgress._() : super._(); + + factory InProgress.fromJson(Map json) = + _$InProgressImpl.fromJson; + + int get uploaded; + int get total; + @JsonKey(ignore: true) + _$$InProgressImplCopyWith<_$InProgressImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$SuccessImplCopyWith<$Res> { + factory _$$SuccessImplCopyWith( + _$SuccessImpl value, $Res Function(_$SuccessImpl) then) = + __$$SuccessImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$SuccessImplCopyWithImpl<$Res> + extends _$UploadStateCopyWithImpl<$Res, _$SuccessImpl> + implements _$$SuccessImplCopyWith<$Res> { + __$$SuccessImplCopyWithImpl( + _$SuccessImpl _value, $Res Function(_$SuccessImpl) _then) + : super(_value, _then); +} + +/// @nodoc +@JsonSerializable() +class _$SuccessImpl extends Success { + const _$SuccessImpl({final String? $type}) + : $type = $type ?? 'success', + super._(); + + factory _$SuccessImpl.fromJson(Map json) => + _$$SuccessImplFromJson(json); + + @JsonKey(name: 'runtimeType') + final String $type; + + @override + String toString() { + return 'UploadState.success()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$SuccessImpl); + } + + @JsonKey(ignore: true) + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() preparing, + required TResult Function(int uploaded, int total) inProgress, + required TResult Function() success, + required TResult Function(String error) failed, + }) { + return success(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? preparing, + TResult? Function(int uploaded, int total)? inProgress, + TResult? Function()? success, + TResult? Function(String error)? failed, + }) { + return success?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? preparing, + TResult Function(int uploaded, int total)? inProgress, + TResult Function()? success, + TResult Function(String error)? failed, + required TResult orElse(), + }) { + if (success != null) { + return success(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Preparing value) preparing, + required TResult Function(InProgress value) inProgress, + required TResult Function(Success value) success, + required TResult Function(Failed value) failed, + }) { + return success(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Preparing value)? preparing, + TResult? Function(InProgress value)? inProgress, + TResult? Function(Success value)? success, + TResult? Function(Failed value)? failed, + }) { + return success?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Preparing value)? preparing, + TResult Function(InProgress value)? inProgress, + TResult Function(Success value)? success, + TResult Function(Failed value)? failed, + required TResult orElse(), + }) { + if (success != null) { + return success(this); + } + return orElse(); + } + + @override + Map toJson() { + return _$$SuccessImplToJson( + this, + ); + } +} + +abstract class Success extends UploadState { + const factory Success() = _$SuccessImpl; + const Success._() : super._(); + + factory Success.fromJson(Map json) = _$SuccessImpl.fromJson; +} + +/// @nodoc +abstract class _$$FailedImplCopyWith<$Res> { + factory _$$FailedImplCopyWith( + _$FailedImpl value, $Res Function(_$FailedImpl) then) = + __$$FailedImplCopyWithImpl<$Res>; + @useResult + $Res call({String error}); +} + +/// @nodoc +class __$$FailedImplCopyWithImpl<$Res> + extends _$UploadStateCopyWithImpl<$Res, _$FailedImpl> + implements _$$FailedImplCopyWith<$Res> { + __$$FailedImplCopyWithImpl( + _$FailedImpl _value, $Res Function(_$FailedImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? error = null, + }) { + return _then(_$FailedImpl( + error: null == error + ? _value.error + : error // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$FailedImpl extends Failed { + const _$FailedImpl({required this.error, final String? $type}) + : $type = $type ?? 'failed', + super._(); + + factory _$FailedImpl.fromJson(Map json) => + _$$FailedImplFromJson(json); + + @override + final String error; + + @JsonKey(name: 'runtimeType') + final String $type; + + @override + String toString() { + return 'UploadState.failed(error: $error)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$FailedImpl && + (identical(other.error, error) || other.error == error)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, error); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$FailedImplCopyWith<_$FailedImpl> get copyWith => + __$$FailedImplCopyWithImpl<_$FailedImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() preparing, + required TResult Function(int uploaded, int total) inProgress, + required TResult Function() success, + required TResult Function(String error) failed, + }) { + return failed(error); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function()? preparing, + TResult? Function(int uploaded, int total)? inProgress, + TResult? Function()? success, + TResult? Function(String error)? failed, + }) { + return failed?.call(error); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? preparing, + TResult Function(int uploaded, int total)? inProgress, + TResult Function()? success, + TResult Function(String error)? failed, + required TResult orElse(), + }) { + if (failed != null) { + return failed(error); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Preparing value) preparing, + required TResult Function(InProgress value) inProgress, + required TResult Function(Success value) success, + required TResult Function(Failed value) failed, + }) { + return failed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Preparing value)? preparing, + TResult? Function(InProgress value)? inProgress, + TResult? Function(Success value)? success, + TResult? Function(Failed value)? failed, + }) { + return failed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Preparing value)? preparing, + TResult Function(InProgress value)? inProgress, + TResult Function(Success value)? success, + TResult Function(Failed value)? failed, + required TResult orElse(), + }) { + if (failed != null) { + return failed(this); + } + return orElse(); + } + + @override + Map toJson() { + return _$$FailedImplToJson( + this, + ); + } +} + +abstract class Failed extends UploadState { + const factory Failed({required final String error}) = _$FailedImpl; + const Failed._() : super._(); + + factory Failed.fromJson(Map json) = _$FailedImpl.fromJson; + + String get error; + @JsonKey(ignore: true) + _$$FailedImplCopyWith<_$FailedImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/packages/shared/lib/src/models/attachment_file.g.dart b/packages/shared/lib/src/models/attachment_file.g.dart new file mode 100644 index 00000000..ea4d1f80 --- /dev/null +++ b/packages/shared/lib/src/models/attachment_file.g.dart @@ -0,0 +1,86 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'attachment_file.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$PreparingImpl _$$PreparingImplFromJson(Map json) => + $checkedCreate( + r'_$PreparingImpl', + json, + ($checkedConvert) { + final val = _$PreparingImpl( + $type: $checkedConvert('runtimeType', (v) => v as String?), + ); + return val; + }, + fieldKeyMap: const {r'$type': 'runtimeType'}, + ); + +Map _$$PreparingImplToJson(_$PreparingImpl instance) => + { + 'runtimeType': instance.$type, + }; + +_$InProgressImpl _$$InProgressImplFromJson(Map json) => + $checkedCreate( + r'_$InProgressImpl', + json, + ($checkedConvert) { + final val = _$InProgressImpl( + uploaded: $checkedConvert('uploaded', (v) => v as int), + total: $checkedConvert('total', (v) => v as int), + $type: $checkedConvert('runtimeType', (v) => v as String?), + ); + return val; + }, + fieldKeyMap: const {r'$type': 'runtimeType'}, + ); + +Map _$$InProgressImplToJson(_$InProgressImpl instance) => + { + 'uploaded': instance.uploaded, + 'total': instance.total, + 'runtimeType': instance.$type, + }; + +_$SuccessImpl _$$SuccessImplFromJson(Map json) => + $checkedCreate( + r'_$SuccessImpl', + json, + ($checkedConvert) { + final val = _$SuccessImpl( + $type: $checkedConvert('runtimeType', (v) => v as String?), + ); + return val; + }, + fieldKeyMap: const {r'$type': 'runtimeType'}, + ); + +Map _$$SuccessImplToJson(_$SuccessImpl instance) => + { + 'runtimeType': instance.$type, + }; + +_$FailedImpl _$$FailedImplFromJson(Map json) => $checkedCreate( + r'_$FailedImpl', + json, + ($checkedConvert) { + final val = _$FailedImpl( + error: $checkedConvert('error', (v) => v as String), + $type: $checkedConvert('runtimeType', (v) => v as String?), + ); + return val; + }, + fieldKeyMap: const {r'$type': 'runtimeType'}, + ); + +Map _$$FailedImplToJson(_$FailedImpl instance) => + { + 'error': instance.error, + 'runtimeType': instance.$type, + }; diff --git a/packages/shared/lib/src/models/comment.g.dart b/packages/shared/lib/src/models/comment.g.dart new file mode 100644 index 00000000..7b0dbb5b --- /dev/null +++ b/packages/shared/lib/src/models/comment.g.dart @@ -0,0 +1,54 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'comment.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Comment _$CommentFromJson(Map json) => $checkedCreate( + 'Comment', + json, + ($checkedConvert) { + final val = Comment( + id: $checkedConvert('id', (v) => v as String), + postId: $checkedConvert('post_id', (v) => v as String), + author: $checkedConvert( + 'author', (v) => PostAuthor.fromJson(v as Map)), + content: $checkedConvert('content', (v) => v as String), + createdAt: + $checkedConvert('created_at', (v) => DateTime.parse(v as String)), + repliedToCommentId: + $checkedConvert('replied_to_comment_id', (v) => v as String?), + replies: $checkedConvert('replies', (v) => v as int?), + ); + return val; + }, + fieldKeyMap: const { + 'postId': 'post_id', + 'createdAt': 'created_at', + 'repliedToCommentId': 'replied_to_comment_id' + }, + ); + +Map _$CommentToJson(Comment instance) { + final val = { + 'id': instance.id, + 'post_id': instance.postId, + 'author': instance.author.toJson(), + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('replied_to_comment_id', instance.repliedToCommentId); + writeNotNull('replies', instance.replies); + val['content'] = instance.content; + val['created_at'] = instance.createdAt.toIso8601String(); + return val; +} diff --git a/packages/shared/lib/src/models/image.g.dart b/packages/shared/lib/src/models/image.g.dart new file mode 100644 index 00000000..7b419036 --- /dev/null +++ b/packages/shared/lib/src/models/image.g.dart @@ -0,0 +1,68 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'image.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ImageMedia _$ImageMediaFromJson(Map json) => $checkedCreate( + 'ImageMedia', + json, + ($checkedConvert) { + final val = ImageMedia( + id: $checkedConvert('media_id', (v) => v as String), + url: $checkedConvert('url', (v) => v as String), + blurHash: $checkedConvert('blur_hash', (v) => v as String?), + type: $checkedConvert( + 'type', (v) => v as String? ?? ImageMedia.identifier), + ); + return val; + }, + fieldKeyMap: const {'id': 'media_id', 'blurHash': 'blur_hash'}, + ); + +Map _$ImageMediaToJson(ImageMedia instance) { + final val = { + 'media_id': instance.id, + 'url': instance.url, + 'type': instance.type, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('blur_hash', instance.blurHash); + return val; +} + +MemoryImageMedia _$MemoryImageMediaFromJson(Map json) => + $checkedCreate( + 'MemoryImageMedia', + json, + ($checkedConvert) { + final val = MemoryImageMedia( + bytes: $checkedConvert( + 'bytes', (v) => const UintConverter().fromJson(v as List)), + id: $checkedConvert('media_id', (v) => v as String), + url: $checkedConvert('url', (v) => v as String? ?? ''), + type: $checkedConvert( + 'type', (v) => v as String? ?? MemoryImageMedia.identifier), + ); + return val; + }, + fieldKeyMap: const {'id': 'media_id'}, + ); + +Map _$MemoryImageMediaToJson(MemoryImageMedia instance) => + { + 'media_id': instance.id, + 'url': instance.url, + 'type': instance.type, + 'bytes': const UintConverter().toJson(instance.bytes), + }; diff --git a/packages/shared/lib/src/models/post.g.dart b/packages/shared/lib/src/models/post.g.dart new file mode 100644 index 00000000..c9bfee2d --- /dev/null +++ b/packages/shared/lib/src/models/post.g.dart @@ -0,0 +1,52 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'post.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Post _$PostFromJson(Map json) => $checkedCreate( + 'Post', + json, + ($checkedConvert) { + final val = Post( + id: $checkedConvert('id', (v) => v as String), + author: $checkedConvert('author', + (v) => const UserConverter().fromJson(v as Map)), + caption: $checkedConvert('caption', (v) => v as String), + createdAt: + $checkedConvert('created_at', (v) => DateTime.parse(v as String)), + media: $checkedConvert( + 'media', + (v) => v == null + ? const [] + : const ListMediaConverterFromDb().fromJson(v as String)), + updatedAt: $checkedConvert('updated_at', + (v) => v == null ? null : DateTime.parse(v as String)), + ); + return val; + }, + fieldKeyMap: const {'createdAt': 'created_at', 'updatedAt': 'updated_at'}, + ); + +Map _$PostToJson(Post instance) { + final val = { + 'id': instance.id, + 'author': const UserConverter().toJson(instance.author), + 'caption': instance.caption, + 'created_at': instance.createdAt.toIso8601String(), + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('updated_at', instance.updatedAt?.toIso8601String()); + val['media'] = const ListMediaConverterFromDb().toJson(instance.media); + return val; +} diff --git a/packages/shared/lib/src/models/post_options_settings.freezed.dart b/packages/shared/lib/src/models/post_options_settings.freezed.dart new file mode 100644 index 00000000..c216a04f --- /dev/null +++ b/packages/shared/lib/src/models/post_options_settings.freezed.dart @@ -0,0 +1,345 @@ +// 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 'post_options_settings.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 _$PostOptionsSettings { + @optionalTypeArgs + TResult when({ + required TResult Function( + ValueSetter onPostDelete, ValueSetter onPostEdit) + owner, + required TResult Function() viewer, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ValueSetter onPostDelete, + ValueSetter onPostEdit)? + owner, + TResult? Function()? viewer, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ValueSetter onPostDelete, + ValueSetter onPostEdit)? + owner, + TResult Function()? viewer, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(Owner value) owner, + required TResult Function(Viewer value) viewer, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Owner value)? owner, + TResult? Function(Viewer value)? viewer, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Owner value)? owner, + TResult Function(Viewer value)? viewer, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $PostOptionsSettingsCopyWith<$Res> { + factory $PostOptionsSettingsCopyWith( + PostOptionsSettings value, $Res Function(PostOptionsSettings) then) = + _$PostOptionsSettingsCopyWithImpl<$Res, PostOptionsSettings>; +} + +/// @nodoc +class _$PostOptionsSettingsCopyWithImpl<$Res, $Val extends PostOptionsSettings> + implements $PostOptionsSettingsCopyWith<$Res> { + _$PostOptionsSettingsCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$OwnerImplCopyWith<$Res> { + factory _$$OwnerImplCopyWith( + _$OwnerImpl value, $Res Function(_$OwnerImpl) then) = + __$$OwnerImplCopyWithImpl<$Res>; + @useResult + $Res call( + {ValueSetter onPostDelete, ValueSetter onPostEdit}); +} + +/// @nodoc +class __$$OwnerImplCopyWithImpl<$Res> + extends _$PostOptionsSettingsCopyWithImpl<$Res, _$OwnerImpl> + implements _$$OwnerImplCopyWith<$Res> { + __$$OwnerImplCopyWithImpl( + _$OwnerImpl _value, $Res Function(_$OwnerImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? onPostDelete = null, + Object? onPostEdit = null, + }) { + return _then(_$OwnerImpl( + onPostDelete: null == onPostDelete + ? _value.onPostDelete + : onPostDelete // ignore: cast_nullable_to_non_nullable + as ValueSetter, + onPostEdit: null == onPostEdit + ? _value.onPostEdit + : onPostEdit // ignore: cast_nullable_to_non_nullable + as ValueSetter, + )); + } +} + +/// @nodoc + +class _$OwnerImpl extends Owner { + const _$OwnerImpl({required this.onPostDelete, required this.onPostEdit}) + : super._(); + + @override + final ValueSetter onPostDelete; + @override + final ValueSetter onPostEdit; + + @override + String toString() { + return 'PostOptionsSettings.owner(onPostDelete: $onPostDelete, onPostEdit: $onPostEdit)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$OwnerImpl && + (identical(other.onPostDelete, onPostDelete) || + other.onPostDelete == onPostDelete) && + (identical(other.onPostEdit, onPostEdit) || + other.onPostEdit == onPostEdit)); + } + + @override + int get hashCode => Object.hash(runtimeType, onPostDelete, onPostEdit); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$OwnerImplCopyWith<_$OwnerImpl> get copyWith => + __$$OwnerImplCopyWithImpl<_$OwnerImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function( + ValueSetter onPostDelete, ValueSetter onPostEdit) + owner, + required TResult Function() viewer, + }) { + return owner(onPostDelete, onPostEdit); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ValueSetter onPostDelete, + ValueSetter onPostEdit)? + owner, + TResult? Function()? viewer, + }) { + return owner?.call(onPostDelete, onPostEdit); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ValueSetter onPostDelete, + ValueSetter onPostEdit)? + owner, + TResult Function()? viewer, + required TResult orElse(), + }) { + if (owner != null) { + return owner(onPostDelete, onPostEdit); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Owner value) owner, + required TResult Function(Viewer value) viewer, + }) { + return owner(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Owner value)? owner, + TResult? Function(Viewer value)? viewer, + }) { + return owner?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Owner value)? owner, + TResult Function(Viewer value)? viewer, + required TResult orElse(), + }) { + if (owner != null) { + return owner(this); + } + return orElse(); + } +} + +abstract class Owner extends PostOptionsSettings { + const factory Owner( + {required final ValueSetter onPostDelete, + required final ValueSetter onPostEdit}) = _$OwnerImpl; + const Owner._() : super._(); + + ValueSetter get onPostDelete; + ValueSetter get onPostEdit; + @JsonKey(ignore: true) + _$$OwnerImplCopyWith<_$OwnerImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$ViewerImplCopyWith<$Res> { + factory _$$ViewerImplCopyWith( + _$ViewerImpl value, $Res Function(_$ViewerImpl) then) = + __$$ViewerImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$ViewerImplCopyWithImpl<$Res> + extends _$PostOptionsSettingsCopyWithImpl<$Res, _$ViewerImpl> + implements _$$ViewerImplCopyWith<$Res> { + __$$ViewerImplCopyWithImpl( + _$ViewerImpl _value, $Res Function(_$ViewerImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$ViewerImpl extends Viewer { + const _$ViewerImpl() : super._(); + + @override + String toString() { + return 'PostOptionsSettings.viewer()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$ViewerImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function( + ValueSetter onPostDelete, ValueSetter onPostEdit) + owner, + required TResult Function() viewer, + }) { + return viewer(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(ValueSetter onPostDelete, + ValueSetter onPostEdit)? + owner, + TResult? Function()? viewer, + }) { + return viewer?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(ValueSetter onPostDelete, + ValueSetter onPostEdit)? + owner, + TResult Function()? viewer, + required TResult orElse(), + }) { + if (viewer != null) { + return viewer(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Owner value) owner, + required TResult Function(Viewer value) viewer, + }) { + return viewer(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(Owner value)? owner, + TResult? Function(Viewer value)? viewer, + }) { + return viewer?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Owner value)? owner, + TResult Function(Viewer value)? viewer, + required TResult orElse(), + }) { + if (viewer != null) { + return viewer(this); + } + return orElse(); + } +} + +abstract class Viewer extends PostOptionsSettings { + const factory Viewer() = _$ViewerImpl; + const Viewer._() : super._(); +} diff --git a/packages/shared/lib/src/models/video.g.dart b/packages/shared/lib/src/models/video.g.dart new file mode 100644 index 00000000..e1cfba5b --- /dev/null +++ b/packages/shared/lib/src/models/video.g.dart @@ -0,0 +1,49 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: cast_nullable_to_non_nullable, implicit_dynamic_parameter, lines_longer_than_80_chars, prefer_const_constructors, require_trailing_commas + +part of 'video.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +VideoMedia _$VideoMediaFromJson(Map json) => $checkedCreate( + 'VideoMedia', + json, + ($checkedConvert) { + final val = VideoMedia( + id: $checkedConvert('media_id', (v) => v as String), + url: $checkedConvert('url', (v) => v as String), + firstFrameUrl: + $checkedConvert('first_frame_url', (v) => v as String? ?? ''), + blurHash: $checkedConvert('blur_hash', (v) => v as String?), + type: $checkedConvert( + 'type', (v) => v as String? ?? VideoMedia.identifier), + ); + return val; + }, + fieldKeyMap: const { + 'id': 'media_id', + 'firstFrameUrl': 'first_frame_url', + 'blurHash': 'blur_hash' + }, + ); + +Map _$VideoMediaToJson(VideoMedia instance) { + final val = { + 'media_id': instance.id, + 'url': instance.url, + 'type': instance.type, + }; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('blur_hash', instance.blurHash); + val['first_frame_url'] = instance.firstFrameUrl; + return val; +} diff --git a/tool/coverage.sh b/tool/coverage.sh index b7301c10..b6f53288 100755 --- a/tool/coverage.sh +++ b/tool/coverage.sh @@ -19,14 +19,14 @@ cd ${PROJECT_PATH} rm -rf coverage fvm flutter --version -very_good test --coverage --exclude-coverage "**/*.g.dart **/*.freezed.dart **/*.gen.dart **/l10n/*.dart **/l10n/**/*.dart **/main/bootstrap.dart" --exclude-tags 'presubmit-only' --test-randomize-ordering-seed random +very_good test --coverage --exclude-coverage "**/*.g.dart **/*.freezed.dart **/*.gen.dart **/l10n/*.dart **/l10n/**/*.dart **/bootstrap.dart" --exclude-tags 'presubmit-only' --test-randomize-ordering-seed random lcov --remove ${PROJECT_COVERAGE} -o ${PROJECT_COVERAGE} \ '**/*.g.dart' \ '**/*.freezed.dart' \ '**/l10n/*.dart' \ '**/l10n/**/*.dart' \ - '**/main/bootstrap.dart' \ + '**/bootstrap.dart' \ '**/*.gen.dart' genhtml ${PROJECT_COVERAGE} -o coverage | tee ./coverage/output.txt From 43cbd3d38e1945475078d50232e9f57194e933d5 Mon Sep 17 00:00:00 2001 From: Emil Date: Mon, 25 Mar 2024 18:27:46 +0500 Subject: [PATCH 04/13] chore: removed `FirebaseOptions` --- .gitignore | 3 --- lib/bootstrap.dart | 13 ++++--------- lib/main_development.dart | 2 -- lib/main_production.dart | 2 -- lib/main_staging.dart | 2 -- 5 files changed, 4 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 204dbd87..834308f2 100644 --- a/.gitignore +++ b/.gitignore @@ -35,9 +35,6 @@ pubspec.lock # Firebase related .firebase/ -lib/firebase_options_dev.dart -lib/firebase_options_prod.dart -lib/firebase_options_stg.dart # Localization l10n_error.json diff --git a/lib/bootstrap.dart b/lib/bootstrap.dart index 3bfe3c39..d886e30f 100644 --- a/lib/bootstrap.dart +++ b/lib/bootstrap.dart @@ -33,11 +33,8 @@ class AppBlocObserver extends BlocObserver { } @pragma('vm:entry-point') -Future _firebaseMessagingBackgroundHandler( - RemoteMessage message, { - required FirebaseOptions options, -}) async { - await Firebase.initializeApp(options: options); +Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async { + await Firebase.initializeApp(); logD('Handling a background message: ${message.toMap()}'); } @@ -45,7 +42,6 @@ Future _firebaseMessagingBackgroundHandler( Future bootstrap( AppBuilder builder, { required AppFlavor appFlavor, - required FirebaseOptions options, }) async { FlutterError.onError = (details) { logE(details.exceptionAsString(), stackTrace: details.stack); @@ -59,7 +55,7 @@ Future bootstrap( setupDi(appFlavor: appFlavor); - await Firebase.initializeApp(options: options); + await Firebase.initializeApp(); HydratedBloc.storage = await HydratedStorage.build( storageDirectory: kIsWeb @@ -72,8 +68,7 @@ Future bootstrap( final firebaseMessaging = FirebaseMessaging.instance; FirebaseMessaging.onBackgroundMessage( - (message) => - _firebaseMessagingBackgroundHandler(message, options: options), + _firebaseMessagingBackgroundHandler, ); final sharedPreferences = await SharedPreferences.getInstance(); diff --git a/lib/main_development.dart b/lib/main_development.dart index 0322c452..439e9ffd 100644 --- a/lib/main_development.dart +++ b/lib/main_development.dart @@ -4,7 +4,6 @@ import 'package:env/env.dart'; import 'package:firebase_notifications_client/firebase_notifications_client.dart'; import 'package:flutter_instagram_offline_first_clone/app/app.dart'; import 'package:flutter_instagram_offline_first_clone/bootstrap.dart'; -import 'package:flutter_instagram_offline_first_clone/firebase_options_dev.dart'; import 'package:google_sign_in/google_sign_in.dart'; import 'package:notifications_repository/notifications_repository.dart'; import 'package:persistent_storage/persistent_storage.dart'; @@ -80,6 +79,5 @@ void main() { ); }, appFlavor: AppFlavor.development(), - options: DefaultFirebaseOptions.currentPlatform, ); } diff --git a/lib/main_production.dart b/lib/main_production.dart index b26ef855..f404a4a1 100644 --- a/lib/main_production.dart +++ b/lib/main_production.dart @@ -4,7 +4,6 @@ import 'package:env/env.dart'; import 'package:firebase_notifications_client/firebase_notifications_client.dart'; import 'package:flutter_instagram_offline_first_clone/app/app.dart'; import 'package:flutter_instagram_offline_first_clone/bootstrap.dart'; -import 'package:flutter_instagram_offline_first_clone/firebase_options_prod.dart'; import 'package:google_sign_in/google_sign_in.dart'; import 'package:notifications_repository/notifications_repository.dart'; import 'package:persistent_storage/persistent_storage.dart'; @@ -80,6 +79,5 @@ void main() { ); }, appFlavor: AppFlavor.production(), - options: DefaultFirebaseOptions.currentPlatform, ); } diff --git a/lib/main_staging.dart b/lib/main_staging.dart index 21145102..42beb5b0 100644 --- a/lib/main_staging.dart +++ b/lib/main_staging.dart @@ -4,7 +4,6 @@ import 'package:env/env.dart'; import 'package:firebase_notifications_client/firebase_notifications_client.dart'; import 'package:flutter_instagram_offline_first_clone/app/app.dart'; import 'package:flutter_instagram_offline_first_clone/bootstrap.dart'; -import 'package:flutter_instagram_offline_first_clone/firebase_options_stg.dart'; import 'package:google_sign_in/google_sign_in.dart'; import 'package:notifications_repository/notifications_repository.dart'; import 'package:persistent_storage/persistent_storage.dart'; @@ -80,6 +79,5 @@ void main() { ); }, appFlavor: AppFlavor.staging(), - options: DefaultFirebaseOptions.currentPlatform, ); } From bc4e54f98aed35b51745d836ad3a836b6df438dd Mon Sep 17 00:00:00 2001 From: Emil Date: Mon, 25 Mar 2024 18:37:13 +0500 Subject: [PATCH 05/13] chore: removed `l10n/generated` from `.gitignore` --- .gitignore | 1 - lib/l10n/generated/app_localizations.dart | 1159 ++++++++++++++++++ lib/l10n/generated/app_localizations_en.dart | 662 ++++++++++ lib/l10n/generated/app_localizations_ru.dart | 677 ++++++++++ lib/l10n/generated/generated.dart | 1 + 5 files changed, 2499 insertions(+), 1 deletion(-) create mode 100644 lib/l10n/generated/app_localizations.dart create mode 100644 lib/l10n/generated/app_localizations_en.dart create mode 100644 lib/l10n/generated/app_localizations_ru.dart create mode 100644 lib/l10n/generated/generated.dart diff --git a/.gitignore b/.gitignore index 834308f2..5fee32dc 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,6 @@ migrate_working_dir/ # Generated files -lib/l10n/generated/* ./generated # IntelliJ related diff --git a/lib/l10n/generated/app_localizations.dart b/lib/l10n/generated/app_localizations.dart new file mode 100644 index 00000000..fabac152 --- /dev/null +++ b/lib/l10n/generated/app_localizations.dart @@ -0,0 +1,1159 @@ +import 'dart:async'; + +import 'package:flutter/foundation.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:intl/intl.dart' as intl; + +import 'app_localizations_en.dart'; +import 'app_localizations_ru.dart'; + +/// Callers can lookup localized strings with an instance of AppLocalizations +/// returned by `AppLocalizations.of(context)`. +/// +/// Applications need to include `AppLocalizations.delegate()` in their app's +/// `localizationDelegates` list, and the locales they support in the app's +/// `supportedLocales` list. For example: +/// +/// ```dart +/// import 'generated/app_localizations.dart'; +/// +/// return MaterialApp( +/// localizationsDelegates: AppLocalizations.localizationsDelegates, +/// supportedLocales: AppLocalizations.supportedLocales, +/// home: MyApplicationHome(), +/// ); +/// ``` +/// +/// ## Update pubspec.yaml +/// +/// Please make sure to update your pubspec.yaml to include the following +/// packages: +/// +/// ```yaml +/// dependencies: +/// # Internationalization support. +/// flutter_localizations: +/// sdk: flutter +/// intl: any # Use the pinned version from flutter_localizations +/// +/// # Rest of dependencies +/// ``` +/// +/// ## iOS Applications +/// +/// iOS applications define key application metadata, including supported +/// locales, in an Info.plist file that is built into the application bundle. +/// To configure the locales supported by your app, you’ll need to edit this +/// file. +/// +/// First, open your project’s ios/Runner.xcworkspace Xcode workspace file. +/// Then, in the Project Navigator, open the Info.plist file under the Runner +/// project’s Runner folder. +/// +/// Next, select the Information Property List item, select Add Item from the +/// Editor menu, then select Localizations from the pop-up menu. +/// +/// Select and expand the newly-created Localizations item then, for each +/// locale your application supports, add a new item and select the locale +/// you wish to add from the pop-up menu in the Value field. This list should +/// be consistent with the languages listed in the AppLocalizations.supportedLocales +/// property. +abstract class AppLocalizations { + AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString()); + + final String localeName; + + static AppLocalizations of(BuildContext context) { + return Localizations.of(context, AppLocalizations)!; + } + + static const LocalizationsDelegate delegate = _AppLocalizationsDelegate(); + + /// A list of this localizations delegate along with the default localizations + /// delegates. + /// + /// Returns a list of localizations delegates containing this delegate along with + /// GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, + /// and GlobalWidgetsLocalizations.delegate. + /// + /// Additional delegates can be added by appending to this list in + /// MaterialApp. This list does not have to be used at all if a custom list + /// of delegates is preferred or required. + static const List> localizationsDelegates = >[ + delegate, + GlobalMaterialLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + ]; + + /// A list of this localizations delegate's supported locales. + static const List supportedLocales = [ + Locale('en'), + Locale('ru') + ]; + + /// Text shown in the Feed screen in the AppBar + /// + /// In en, this message translates to: + /// **'Feed'** + String get feedAppBarTitle; + + /// Home navigation bar item tooltip + /// + /// In en, this message translates to: + /// **'Home'** + String get homeNavBarItemLabel; + + /// Search navigation bar item tooltip + /// + /// In en, this message translates to: + /// **'Search'** + String get searchNavBarItemLabel; + + /// Create media navigation bar item tooltip + /// + /// In en, this message translates to: + /// **'Create media'** + String get createMediaNavBarItemLabel; + + /// Reels navigation bar item tooltip + /// + /// In en, this message translates to: + /// **'Reels'** + String get reelsNavBarItemLabel; + + /// Profile navigation bar item tooltip + /// + /// In en, this message translates to: + /// **'Profile'** + String get profileNavBarItemLabel; + + /// Text displaying statis Likes text + /// + /// In en, this message translates to: + /// **'Likes'** + String get likesText; + + /// Text shown in post footer section that display count of likes + /// + /// In en, this message translates to: + /// **'{count, plural, =1{{count} like} other{{count} likes}}'** + String likesCountText(int count); + + /// No description provided for @likedByText. + /// + /// In en, this message translates to: + /// **'Liked by {userName} and {count, plural, =1{{count} other} other{{count} others}}'** + String likedByText(String userName, int count); + + /// No description provided for @likeText. + /// + /// In en, this message translates to: + /// **'Like'** + String get likeText; + + /// No description provided for @unlikeText. + /// + /// In en, this message translates to: + /// **'Unlike'** + String get unlikeText; + + /// Text shown in post footer section that display short count of likes + /// + /// In en, this message translates to: + /// **'{count}'** + String likesCountTextShort(int count); + + /// No description provided for @originalAudioText. + /// + /// In en, this message translates to: + /// **'Original audio'** + String get originalAudioText; + + /// No description provided for @discardEditsText. + /// + /// In en, this message translates to: + /// **'Discard Edits'** + String get discardEditsText; + + /// No description provided for @discardText. + /// + /// In en, this message translates to: + /// **'Discard'** + String get discardText; + + /// No description provided for @doneText. + /// + /// In en, this message translates to: + /// **'Done'** + String get doneText; + + /// No description provided for @draftEmpty. + /// + /// In en, this message translates to: + /// **'Draft empty'** + String get draftEmpty; + + /// No description provided for @errorText. + /// + /// In en, this message translates to: + /// **'Error'** + String get errorText; + + /// No description provided for @uploadText. + /// + /// In en, this message translates to: + /// **'Upload'** + String get uploadText; + + /// No description provided for @loseAllEditsText. + /// + /// In en, this message translates to: + /// **'If you go back now, you\'ll loose all the edits you\'ve made.'** + String get loseAllEditsText; + + /// No description provided for @saveDraft. + /// + /// In en, this message translates to: + /// **'Save Draft'** + String get saveDraft; + + /// No description provided for @successfullySavedText. + /// + /// In en, this message translates to: + /// **'Successfully saved'** + String get successfullySavedText; + + /// No description provided for @tapToTypeText. + /// + /// In en, this message translates to: + /// **'Tap to type...'** + String get tapToTypeText; + + /// No description provided for @noPostsText. + /// + /// In en, this message translates to: + /// **'No Posts Yet!'** + String get noPostsText; + + /// No description provided for @noPostFoundText. + /// + /// In en, this message translates to: + /// **'No post found!'** + String get noPostFoundText; + + /// No description provided for @addCommentText. + /// + /// In en, this message translates to: + /// **'Add a comment'** + String get addCommentText; + + /// No description provided for @noChatsText. + /// + /// In en, this message translates to: + /// **'No chats yet!'** + String get noChatsText; + + /// No description provided for @startChatText. + /// + /// In en, this message translates to: + /// **'Start a chat'** + String get startChatText; + + /// No description provided for @deleteCommentText. + /// + /// In en, this message translates to: + /// **'Delete comment'** + String get deleteCommentText; + + /// No description provided for @commentDeleteConfirmationText. + /// + /// In en, this message translates to: + /// **'Are you sure you want to delete this comment?'** + String get commentDeleteConfirmationText; + + /// No description provided for @deleteMessageText. + /// + /// In en, this message translates to: + /// **'Delete message'** + String get deleteMessageText; + + /// No description provided for @messageDeleteConfirmationText. + /// + /// In en, this message translates to: + /// **'Are you sure you want to delete this message?'** + String get messageDeleteConfirmationText; + + /// No description provided for @deleteChatText. + /// + /// In en, this message translates to: + /// **'Delete chat'** + String get deleteChatText; + + /// No description provided for @chatDeleteConfirmationText. + /// + /// In en, this message translates to: + /// **'Are you sure you want to delete this chat?'** + String get chatDeleteConfirmationText; + + /// No description provided for @deleteReelText. + /// + /// In en, this message translates to: + /// **'Delete Reel'** + String get deleteReelText; + + /// No description provided for @reelDeleteConfirmationText. + /// + /// In en, this message translates to: + /// **'Are you sure you want to delete this Reel?'** + String get reelDeleteConfirmationText; + + /// No description provided for @deleteStoryText. + /// + /// In en, this message translates to: + /// **'Delete story'** + String get deleteStoryText; + + /// No description provided for @storyDeleteConfirmationText. + /// + /// In en, this message translates to: + /// **'Are you sure you want to delete this story?'** + String get storyDeleteConfirmationText; + + /// No description provided for @commentText. + /// + /// In en, this message translates to: + /// **'Comment'** + String get commentText; + + /// No description provided for @commentsText. + /// + /// In en, this message translates to: + /// **'Comments'** + String get commentsText; + + /// No description provided for @noCommentsText. + /// + /// In en, this message translates to: + /// **'No comments'** + String get noCommentsText; + + /// Text shown under the post caption + /// + /// In en, this message translates to: + /// **'View all {count} comments'** + String seeAllComments(int count); + + /// Text shown under the first storie in stories list view marked as your story + /// + /// In en, this message translates to: + /// **'Your story'** + String get yourStoryLabel; + + /// Text displaying static Posts text + /// + /// In en, this message translates to: + /// **'Posts'** + String get postsText; + + /// No description provided for @followUser. + /// + /// In en, this message translates to: + /// **'Follow'** + String get followUser; + + /// No description provided for @followingUser. + /// + /// In en, this message translates to: + /// **'Following'** + String get followingUser; + + /// Text displaying static Followers text + /// + /// In en, this message translates to: + /// **'Followers'** + String get followersText; + + /// Text displaying static Following text + /// + /// In en, this message translates to: + /// **'Following'** + String get followingsText; + + /// No description provided for @followersCountText. + /// + /// In en, this message translates to: + /// **'{count, plural, =1{{count} follower} other{{count} followers}}'** + String followersCountText(int count); + + /// No description provided for @followingsCountText. + /// + /// In en, this message translates to: + /// **'{count, plural, other{{count} following}}'** + String followingsCountText(int count); + + /// Text describing the count of posts + /// + /// In en, this message translates to: + /// **'{count, plural, =1{Post} other{Posts}}'** + String postsCount(int count); + + /// Text shown in app bar in user's all posts screen + /// + /// In en, this message translates to: + /// **'Posts'** + String get profilePostsAppBarTitle; + + /// Text describing the count of posts + /// + /// In en, this message translates to: + /// **'{count, plural, =1{Follower} other{Followers}}'** + String followersCount(int count); + + /// Text describing the count of user followings + /// + /// In en, this message translates to: + /// **'{count, plural, =1{Following} other{Followings}}'** + String followingsCount(int count); + + /// No description provided for @optionsText. + /// + /// In en, this message translates to: + /// **'Options'** + String get optionsText; + + /// No description provided for @viewProfileText. + /// + /// In en, this message translates to: + /// **'View profile'** + String get viewProfileText; + + /// Text shown in account view to edit profile + /// + /// In en, this message translates to: + /// **'Edit profile'** + String get editProfileText; + + /// No description provided for @editingText. + /// + /// In en, this message translates to: + /// **'Editing'** + String get editingText; + + /// Text shown in post edit view to edit post + /// + /// In en, this message translates to: + /// **'Edit post'** + String get editPostText; + + /// Text shown in account view to share profile + /// + /// In en, this message translates to: + /// **'Share profile'** + String get shareProfileText; + + /// Tooltip text shown in post popup to share post + /// + /// In en, this message translates to: + /// **'Share'** + String get sharePostText; + + /// No description provided for @sharePostCaptionHintText. + /// + /// In en, this message translates to: + /// **'Add a message...'** + String get sharePostCaptionHintText; + + /// No description provided for @sendText. + /// + /// In en, this message translates to: + /// **'Send'** + String get sendText; + + /// No description provided for @sendSeparatelyText. + /// + /// In en, this message translates to: + /// **'Send separately'** + String get sendSeparatelyText; + + /// Text shown in account view to add new story + /// + /// In en, this message translates to: + /// **'New'** + String get addStoryText; + + /// Text shown on sponsored post indicating that the post is sponsored by author + /// + /// In en, this message translates to: + /// **'Sponsored'** + String get sponsoredPostText; + + /// Text shown on sponsored post telling that this action will navigate user to author's instagram profile + /// + /// In en, this message translates to: + /// **'Visit Instagram Profile'** + String get visitSponsoredInstagramProfile; + + /// Text shown on sponsored post telling that this action will navigate user to author profile + /// + /// In en, this message translates to: + /// **'Visit Instagram Profile'** + String get visitSponsoredPostAuthorProfileText; + + /// Text shown in a floating action promo in user profile when was navigated from sponsored post + /// + /// In en, this message translates to: + /// **'Learn more'** + String get learnMoreAboutUserPromoText; + + /// Text shown in a floating action promo in user profile when was navigated from sponsored post + /// + /// In en, this message translates to: + /// **'Go to website'** + String get visitUserPromoWebsiteText; + + /// Text shown in modal bottom sheet to cancel current following to user + /// + /// In en, this message translates to: + /// **'Unfollow'** + String get cancelFollowingText; + + /// Header text shown in divider block when user have seen all recent posts + /// + /// In en, this message translates to: + /// **'You\'\'re all caught up'** + String get haveSeenAllRecentPosts; + + /// Body text shown in divider block when user have seen all recent posts in past 3 days + /// + /// In en, this message translates to: + /// **'You\'\'ve seen all new posts from the past 3 days.'** + String get haveSeenAllRecentPostsInPast3Days; + + /// Text shown in a suggested section block. + /// + /// In en, this message translates to: + /// **'Suggested for you'** + String get suggestedForYouText; + + /// No description provided for @andText. + /// + /// In en, this message translates to: + /// **'and'** + String get andText; + + /// No description provided for @othersText. + /// + /// In en, this message translates to: + /// **'{count, plural, =0{} =1{{count} other} other{{count} others}}'** + String othersText(int count); + + /// No description provided for @newPostText. + /// + /// In en, this message translates to: + /// **'New post'** + String get newPostText; + + /// No description provided for @newAvatarImageText. + /// + /// In en, this message translates to: + /// **'New avatar image'** + String get newAvatarImageText; + + /// No description provided for @writeCaptionText. + /// + /// In en, this message translates to: + /// **'Write caption...'** + String get writeCaptionText; + + /// No description provided for @logOutText. + /// + /// In en, this message translates to: + /// **'Log out'** + String get logOutText; + + /// No description provided for @logOutConfirmationText. + /// + /// In en, this message translates to: + /// **'Are you sure you want to log out?'** + String get logOutConfirmationText; + + /// No description provided for @notShowAgainText. + /// + /// In en, this message translates to: + /// **'Dont\'\'t show again'** + String get notShowAgainText; + + /// No description provided for @blockPostAuthorText. + /// + /// In en, this message translates to: + /// **'Block post author'** + String get blockPostAuthorText; + + /// No description provided for @blockAuthorText. + /// + /// In en, this message translates to: + /// **'Block author'** + String get blockAuthorText; + + /// No description provided for @blockAuthorConfirmationText. + /// + /// In en, this message translates to: + /// **'Are you sure you want to block this author?'** + String get blockAuthorConfirmationText; + + /// No description provided for @blockText. + /// + /// In en, this message translates to: + /// **'Block'** + String get blockText; + + /// No description provided for @refreshText. + /// + /// In en, this message translates to: + /// **'Refresh'** + String get refreshText; + + /// No description provided for @noReelsFoundText. + /// + /// In en, this message translates to: + /// **'No Reels Yet'** + String get noReelsFoundText; + + /// No description provided for @publishText. + /// + /// In en, this message translates to: + /// **'Publish'** + String get publishText; + + /// No description provided for @searchText. + /// + /// In en, this message translates to: + /// **'Search'** + String get searchText; + + /// No description provided for @addMessageText. + /// + /// In en, this message translates to: + /// **'Add message'** + String get addMessageText; + + /// No description provided for @messageText. + /// + /// In en, this message translates to: + /// **'Message'** + String get messageText; + + /// No description provided for @editPictureText. + /// + /// In en, this message translates to: + /// **'Edit picture'** + String get editPictureText; + + /// No description provided for @requiredFieldText. + /// + /// In en, this message translates to: + /// **'This field is required'** + String get requiredFieldText; + + /// No description provided for @passwordLengthErrorText. + /// + /// In en, this message translates to: + /// **'Password should contain at least {count} characters'** + String passwordLengthErrorText(int characters, num count); + + /// No description provided for @changeText. + /// + /// In en, this message translates to: + /// **'Change'** + String get changeText; + + /// No description provided for @changePhotoText. + /// + /// In en, this message translates to: + /// **'Change photo'** + String get changePhotoText; + + /// No description provided for @fullNameEditDescription. + /// + /// In en, this message translates to: + /// **'Help people discover your account by using the name yor\'\'re known by: either your full name, nickname, or business name.\n\nYou can only change your name twice within 14 days.'** + String get fullNameEditDescription; + + /// No description provided for @usernameEditDescription. + /// + /// In en, this message translates to: + /// **'You\'\'ll be able to change your username back to {username} for another 14 days'** + String usernameEditDescription(String username); + + /// No description provided for @profileInfoEditConfirmationText. + /// + /// In en, this message translates to: + /// **'Are you sure you want to change your {changeType} to {newUsername} ?'** + String profileInfoEditConfirmationText(String newUsername, String changeType); + + /// No description provided for @profileInfoChangePeriodText. + /// + /// In en, this message translates to: + /// **'You can change your {changeType} only twice in {count} days '** + String profileInfoChangePeriodText(String changeType, int count); + + /// No description provided for @forgotPasswordText. + /// + /// In en, this message translates to: + /// **'Forgot password?'** + String get forgotPasswordText; + + /// No description provided for @recoveryPasswordText. + /// + /// In en, this message translates to: + /// **'Password recovery'** + String get recoveryPasswordText; + + /// No description provided for @orText. + /// + /// In en, this message translates to: + /// **'Or'** + String get orText; + + /// No description provided for @signInWithText. + /// + /// In en, this message translates to: + /// **'Sign in with {provider}'** + String signInWithText(String provider); + + /// No description provided for @goBackConfirmationText. + /// + /// In en, this message translates to: + /// **'Are you sure you want to go back?'** + String get goBackConfirmationText; + + /// No description provided for @goBackText. + /// + /// In en, this message translates to: + /// **'Go back'** + String get goBackText; + + /// No description provided for @furtherText. + /// + /// In en, this message translates to: + /// **'Furhter'** + String get furtherText; + + /// No description provided for @somethingWentWrongText. + /// + /// In en, this message translates to: + /// **'Something went wrong!'** + String get somethingWentWrongText; + + /// No description provided for @failedToCreateStoryText. + /// + /// In en, this message translates to: + /// **'Failed to create story'** + String get failedToCreateStoryText; + + /// No description provided for @successfullyCreatedStoryText. + /// + /// In en, this message translates to: + /// **'Successfully created story!'** + String get successfullyCreatedStoryText; + + /// No description provided for @createText. + /// + /// In en, this message translates to: + /// **'Create'** + String get createText; + + /// No description provided for @reelText. + /// + /// In en, this message translates to: + /// **'Reel'** + String get reelText; + + /// No description provided for @postText. + /// + /// In en, this message translates to: + /// **'Post'** + String get postText; + + /// No description provided for @storyText. + /// + /// In en, this message translates to: + /// **'Story'** + String get storyText; + + /// No description provided for @removeText. + /// + /// In en, this message translates to: + /// **'Remove'** + String get removeText; + + /// No description provided for @removeFollowerText. + /// + /// In en, this message translates to: + /// **'Remove follower'** + String get removeFollowerText; + + /// No description provided for @removeFollowerConfirmationText. + /// + /// In en, this message translates to: + /// **'Are you sure you want to remove follower?'** + String get removeFollowerConfirmationText; + + /// No description provided for @deletePostText. + /// + /// In en, this message translates to: + /// **'Delete post'** + String get deletePostText; + + /// No description provided for @deletePostConfirmationText. + /// + /// In en, this message translates to: + /// **'Are you sure you want to delete this post?'** + String get deletePostConfirmationText; + + /// No description provided for @cancelText. + /// + /// In en, this message translates to: + /// **'Cancel'** + String get cancelText; + + /// No description provided for @captionText. + /// + /// In en, this message translates to: + /// **'Caption'** + String get captionText; + + /// No description provided for @noCameraFoundText. + /// + /// In en, this message translates to: + /// **'No camera found!'** + String get noCameraFoundText; + + /// No description provided for @videoText. + /// + /// In en, this message translates to: + /// **'VIDEO'** + String get videoText; + + /// No description provided for @photoText. + /// + /// In en, this message translates to: + /// **'PHOTO'** + String get photoText; + + /// No description provided for @clearImagesText. + /// + /// In en, this message translates to: + /// **'Clear selected images'** + String get clearImagesText; + + /// No description provided for @galleryText. + /// + /// In en, this message translates to: + /// **'GALLERY'** + String get galleryText; + + /// No description provided for @deletingText. + /// + /// In en, this message translates to: + /// **'DELETE'** + String get deletingText; + + /// No description provided for @notFoundingCameraText. + /// + /// In en, this message translates to: + /// **'No secondary camera found'** + String get notFoundingCameraText; + + /// No description provided for @holdButtonText. + /// + /// In en, this message translates to: + /// **'Press and hold to record'** + String get holdButtonText; + + /// No description provided for @noImagesFoundedText. + /// + /// In en, this message translates to: + /// **'There is no images'** + String get noImagesFoundedText; + + /// No description provided for @acceptAllPermissionsText. + /// + /// In en, this message translates to: + /// **'Failed! accept all access permissions.'** + String get acceptAllPermissionsText; + + /// No description provided for @noLastMessagesText. + /// + /// In en, this message translates to: + /// **'No last messages'** + String get noLastMessagesText; + + /// No description provided for @onlineText. + /// + /// In en, this message translates to: + /// **'online'** + String get onlineText; + + /// No description provided for @moreText. + /// + /// In en, this message translates to: + /// **'More'** + String get moreText; + + /// No description provided for @noAccountText. + /// + /// In en, this message translates to: + /// **'Don\'\'t have an account?'** + String get noAccountText; + + /// No description provided for @alreadyHaveAccountText. + /// + /// In en, this message translates to: + /// **'Already have an account?'** + String get alreadyHaveAccountText; + + /// No description provided for @nameText. + /// + /// In en, this message translates to: + /// **'Name'** + String get nameText; + + /// No description provided for @usernameText. + /// + /// In en, this message translates to: + /// **'Username'** + String get usernameText; + + /// No description provided for @forgotPasswordEmailConfirmationText. + /// + /// In en, this message translates to: + /// **'Email verification'** + String get forgotPasswordEmailConfirmationText; + + /// No description provided for @verificationTokenSentText. + /// + /// In en, this message translates to: + /// **'Verification token sent to {email}'** + String verificationTokenSentText(String email); + + /// No description provided for @emailText. + /// + /// In en, this message translates to: + /// **'Email'** + String get emailText; + + /// No description provided for @otpText. + /// + /// In en, this message translates to: + /// **'Reset token'** + String get otpText; + + /// No description provided for @changePasswordText. + /// + /// In en, this message translates to: + /// **'Change password'** + String get changePasswordText; + + /// No description provided for @passwordText. + /// + /// In en, this message translates to: + /// **'Password'** + String get passwordText; + + /// No description provided for @newPasswordText. + /// + /// In en, this message translates to: + /// **'New password'** + String get newPasswordText; + + /// No description provided for @loginText. + /// + /// In en, this message translates to: + /// **'Login'** + String get loginText; + + /// No description provided for @signUpText. + /// + /// In en, this message translates to: + /// **'Sign up'** + String get signUpText; + + /// No description provided for @bioText. + /// + /// In en, this message translates to: + /// **'Bio'** + String get bioText; + + /// No description provided for @postUnavailableText. + /// + /// In en, this message translates to: + /// **'Post unavailable'** + String get postUnavailableText; + + /// No description provided for @postUnavailableDescriptionText. + /// + /// In en, this message translates to: + /// **'This post is unavailable'** + String get postUnavailableDescriptionText; + + /// No description provided for @editText. + /// + /// In en, this message translates to: + /// **'Edit'** + String get editText; + + /// No description provided for @editedText. + /// + /// In en, this message translates to: + /// **'edited'** + String get editedText; + + /// No description provided for @deleteText. + /// + /// In en, this message translates to: + /// **'Delete'** + String get deleteText; + + /// No description provided for @replyText. + /// + /// In en, this message translates to: + /// **'Reply'** + String get replyText; + + /// No description provided for @replyToText. + /// + /// In en, this message translates to: + /// **'Reply to {username}'** + String replyToText(Object username); + + /// No description provided for @themeText. + /// + /// In en, this message translates to: + /// **'Theme'** + String get themeText; + + /// The option to use system-wide theme in the theme selector menu + /// + /// In en, this message translates to: + /// **'System'** + String get systemOption; + + /// The option for light mode in the theme selector menu + /// + /// In en, this message translates to: + /// **'Light'** + String get lightModeOption; + + /// The option for dark mode in the theme selector menu + /// + /// In en, this message translates to: + /// **'Dark'** + String get darkModeOption; + + /// No description provided for @languageText. + /// + /// In en, this message translates to: + /// **'Language'** + String get languageText; + + /// No description provided for @ruOptionText. + /// + /// In en, this message translates to: + /// **'Russian'** + String get ruOptionText; + + /// No description provided for @enOptionText. + /// + /// In en, this message translates to: + /// **'English'** + String get enOptionText; + + /// Represents a text of seconds ago + /// + /// In en, this message translates to: + /// **'{seconds, plural, =1{1 second ago} other{{seconds} seconds ago}}'** + String secondsAgo(int seconds); + + /// Represents a text of minutes ago + /// + /// In en, this message translates to: + /// **'{minutes, plural, =1{1 minute ago} other{{minutes} minutes ago}}'** + String minutesAgo(int minutes); + + /// Represents a text of hours ago + /// + /// In en, this message translates to: + /// **'{hours, plural, =1{1 hour ago} other{{hours} hours ago}}'** + String hoursAgo(int hours); + + /// Represents a text of days ago + /// + /// In en, this message translates to: + /// **'{days, plural, =1{1 day ago} other{{days} days ago}}'** + String daysAgo(int days); + + /// Represents a text of weeks ago + /// + /// In en, this message translates to: + /// **'{weeks, plural, =1{1 week ago} other{{weeks} weeks ago}}'** + String weeksAgo(int weeks); + + /// Represents a text of months ago + /// + /// In en, this message translates to: + /// **'{months, plural, =1{1 month ago} other{{months} months ago}}'** + String monthsAgo(int months); + + /// Represents a text of years ago + /// + /// In en, this message translates to: + /// **'{years, plural, =1{1 year ago} other{{years} years ago}}'** + String yearsAgo(int years); + + /// Text displayed when a network error occurs. + /// + /// In en, this message translates to: + /// **'A network error has occurred.\nCheck your connection and try again.'** + String get networkError; + + /// Text displayed on the refresh button when a network error occurs. + /// + /// In en, this message translates to: + /// **'Try Again'** + String get networkErrorButton; +} + +class _AppLocalizationsDelegate extends LocalizationsDelegate { + const _AppLocalizationsDelegate(); + + @override + Future load(Locale locale) { + return SynchronousFuture(lookupAppLocalizations(locale)); + } + + @override + bool isSupported(Locale locale) => ['en', 'ru'].contains(locale.languageCode); + + @override + bool shouldReload(_AppLocalizationsDelegate old) => false; +} + +AppLocalizations lookupAppLocalizations(Locale locale) { + + + // Lookup logic when only language code is specified. + switch (locale.languageCode) { + case 'en': return AppLocalizationsEn(); + case 'ru': return AppLocalizationsRu(); + } + + throw FlutterError( + 'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' + 'an issue with the localizations generation tool. Please file an issue ' + 'on GitHub with a reproducible sample app and the gen-l10n configuration ' + 'that was used.' + ); +} diff --git a/lib/l10n/generated/app_localizations_en.dart b/lib/l10n/generated/app_localizations_en.dart new file mode 100644 index 00000000..4c012801 --- /dev/null +++ b/lib/l10n/generated/app_localizations_en.dart @@ -0,0 +1,662 @@ +import 'package:intl/intl.dart' as intl; + +import 'app_localizations.dart'; + +/// The translations for English (`en`). +class AppLocalizationsEn extends AppLocalizations { + AppLocalizationsEn([String locale = 'en']) : super(locale); + + @override + String get feedAppBarTitle => 'Feed'; + + @override + String get homeNavBarItemLabel => 'Home'; + + @override + String get searchNavBarItemLabel => 'Search'; + + @override + String get createMediaNavBarItemLabel => 'Create media'; + + @override + String get reelsNavBarItemLabel => 'Reels'; + + @override + String get profileNavBarItemLabel => 'Profile'; + + @override + String get likesText => 'Likes'; + + @override + String likesCountText(int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: '$count likes', + one: '$count like', + ); + return '$_temp0'; + } + + @override + String likedByText(String userName, int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: '$count others', + one: '$count other', + ); + return 'Liked by $userName and $_temp0'; + } + + @override + String get likeText => 'Like'; + + @override + String get unlikeText => 'Unlike'; + + @override + String likesCountTextShort(int count) { + return '$count'; + } + + @override + String get originalAudioText => 'Original audio'; + + @override + String get discardEditsText => 'Discard Edits'; + + @override + String get discardText => 'Discard'; + + @override + String get doneText => 'Done'; + + @override + String get draftEmpty => 'Draft empty'; + + @override + String get errorText => 'Error'; + + @override + String get uploadText => 'Upload'; + + @override + String get loseAllEditsText => 'If you go back now, youll loose all the edits youve made.'; + + @override + String get saveDraft => 'Save Draft'; + + @override + String get successfullySavedText => 'Successfully saved'; + + @override + String get tapToTypeText => 'Tap to type...'; + + @override + String get noPostsText => 'No Posts Yet!'; + + @override + String get noPostFoundText => 'No post found!'; + + @override + String get addCommentText => 'Add a comment'; + + @override + String get noChatsText => 'No chats yet!'; + + @override + String get startChatText => 'Start a chat'; + + @override + String get deleteCommentText => 'Delete comment'; + + @override + String get commentDeleteConfirmationText => 'Are you sure you want to delete this comment?'; + + @override + String get deleteMessageText => 'Delete message'; + + @override + String get messageDeleteConfirmationText => 'Are you sure you want to delete this message?'; + + @override + String get deleteChatText => 'Delete chat'; + + @override + String get chatDeleteConfirmationText => 'Are you sure you want to delete this chat?'; + + @override + String get deleteReelText => 'Delete Reel'; + + @override + String get reelDeleteConfirmationText => 'Are you sure you want to delete this Reel?'; + + @override + String get deleteStoryText => 'Delete story'; + + @override + String get storyDeleteConfirmationText => 'Are you sure you want to delete this story?'; + + @override + String get commentText => 'Comment'; + + @override + String get commentsText => 'Comments'; + + @override + String get noCommentsText => 'No comments'; + + @override + String seeAllComments(int count) { + return 'View all $count comments'; + } + + @override + String get yourStoryLabel => 'Your story'; + + @override + String get postsText => 'Posts'; + + @override + String get followUser => 'Follow'; + + @override + String get followingUser => 'Following'; + + @override + String get followersText => 'Followers'; + + @override + String get followingsText => 'Following'; + + @override + String followersCountText(int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: '$count followers', + one: '$count follower', + ); + return '$_temp0'; + } + + @override + String followingsCountText(int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: '$count following', + ); + return '$_temp0'; + } + + @override + String postsCount(int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: 'Posts', + one: 'Post', + ); + return '$_temp0'; + } + + @override + String get profilePostsAppBarTitle => 'Posts'; + + @override + String followersCount(int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: 'Followers', + one: 'Follower', + ); + return '$_temp0'; + } + + @override + String followingsCount(int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: 'Followings', + one: 'Following', + ); + return '$_temp0'; + } + + @override + String get optionsText => 'Options'; + + @override + String get viewProfileText => 'View profile'; + + @override + String get editProfileText => 'Edit profile'; + + @override + String get editingText => 'Editing'; + + @override + String get editPostText => 'Edit post'; + + @override + String get shareProfileText => 'Share profile'; + + @override + String get sharePostText => 'Share'; + + @override + String get sharePostCaptionHintText => 'Add a message...'; + + @override + String get sendText => 'Send'; + + @override + String get sendSeparatelyText => 'Send separately'; + + @override + String get addStoryText => 'New'; + + @override + String get sponsoredPostText => 'Sponsored'; + + @override + String get visitSponsoredInstagramProfile => 'Visit Instagram Profile'; + + @override + String get visitSponsoredPostAuthorProfileText => 'Visit Instagram Profile'; + + @override + String get learnMoreAboutUserPromoText => 'Learn more'; + + @override + String get visitUserPromoWebsiteText => 'Go to website'; + + @override + String get cancelFollowingText => 'Unfollow'; + + @override + String get haveSeenAllRecentPosts => 'You\'re all caught up'; + + @override + String get haveSeenAllRecentPostsInPast3Days => 'You\'ve seen all new posts from the past 3 days.'; + + @override + String get suggestedForYouText => 'Suggested for you'; + + @override + String get andText => 'and'; + + @override + String othersText(int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: '$count others', + one: '$count other', + zero: '', + ); + return '$_temp0'; + } + + @override + String get newPostText => 'New post'; + + @override + String get newAvatarImageText => 'New avatar image'; + + @override + String get writeCaptionText => 'Write caption...'; + + @override + String get logOutText => 'Log out'; + + @override + String get logOutConfirmationText => 'Are you sure you want to log out?'; + + @override + String get notShowAgainText => 'Dont\'t show again'; + + @override + String get blockPostAuthorText => 'Block post author'; + + @override + String get blockAuthorText => 'Block author'; + + @override + String get blockAuthorConfirmationText => 'Are you sure you want to block this author?'; + + @override + String get blockText => 'Block'; + + @override + String get refreshText => 'Refresh'; + + @override + String get noReelsFoundText => 'No Reels Yet'; + + @override + String get publishText => 'Publish'; + + @override + String get searchText => 'Search'; + + @override + String get addMessageText => 'Add message'; + + @override + String get messageText => 'Message'; + + @override + String get editPictureText => 'Edit picture'; + + @override + String get requiredFieldText => 'This field is required'; + + @override + String passwordLengthErrorText(int characters, num count) { + return 'Password should contain at least $count characters'; + } + + @override + String get changeText => 'Change'; + + @override + String get changePhotoText => 'Change photo'; + + @override + String get fullNameEditDescription => 'Help people discover your account by using the name yor\'re known by: either your full name, nickname, or business name.\n\nYou can only change your name twice within 14 days.'; + + @override + String usernameEditDescription(String username) { + return 'You\'ll be able to change your username back to $username for another 14 days'; + } + + @override + String profileInfoEditConfirmationText(String newUsername, String changeType) { + return 'Are you sure you want to change your $changeType to $newUsername ?'; + } + + @override + String profileInfoChangePeriodText(String changeType, int count) { + return 'You can change your $changeType only twice in $count days '; + } + + @override + String get forgotPasswordText => 'Forgot password?'; + + @override + String get recoveryPasswordText => 'Password recovery'; + + @override + String get orText => 'Or'; + + @override + String signInWithText(String provider) { + return 'Sign in with $provider'; + } + + @override + String get goBackConfirmationText => 'Are you sure you want to go back?'; + + @override + String get goBackText => 'Go back'; + + @override + String get furtherText => 'Furhter'; + + @override + String get somethingWentWrongText => 'Something went wrong!'; + + @override + String get failedToCreateStoryText => 'Failed to create story'; + + @override + String get successfullyCreatedStoryText => 'Successfully created story!'; + + @override + String get createText => 'Create'; + + @override + String get reelText => 'Reel'; + + @override + String get postText => 'Post'; + + @override + String get storyText => 'Story'; + + @override + String get removeText => 'Remove'; + + @override + String get removeFollowerText => 'Remove follower'; + + @override + String get removeFollowerConfirmationText => 'Are you sure you want to remove follower?'; + + @override + String get deletePostText => 'Delete post'; + + @override + String get deletePostConfirmationText => 'Are you sure you want to delete this post?'; + + @override + String get cancelText => 'Cancel'; + + @override + String get captionText => 'Caption'; + + @override + String get noCameraFoundText => 'No camera found!'; + + @override + String get videoText => 'VIDEO'; + + @override + String get photoText => 'PHOTO'; + + @override + String get clearImagesText => 'Clear selected images'; + + @override + String get galleryText => 'GALLERY'; + + @override + String get deletingText => 'DELETE'; + + @override + String get notFoundingCameraText => 'No secondary camera found'; + + @override + String get holdButtonText => 'Press and hold to record'; + + @override + String get noImagesFoundedText => 'There is no images'; + + @override + String get acceptAllPermissionsText => 'Failed! accept all access permissions.'; + + @override + String get noLastMessagesText => 'No last messages'; + + @override + String get onlineText => 'online'; + + @override + String get moreText => 'More'; + + @override + String get noAccountText => 'Don\'t have an account?'; + + @override + String get alreadyHaveAccountText => 'Already have an account?'; + + @override + String get nameText => 'Name'; + + @override + String get usernameText => 'Username'; + + @override + String get forgotPasswordEmailConfirmationText => 'Email verification'; + + @override + String verificationTokenSentText(String email) { + return 'Verification token sent to $email'; + } + + @override + String get emailText => 'Email'; + + @override + String get otpText => 'Reset token'; + + @override + String get changePasswordText => 'Change password'; + + @override + String get passwordText => 'Password'; + + @override + String get newPasswordText => 'New password'; + + @override + String get loginText => 'Login'; + + @override + String get signUpText => 'Sign up'; + + @override + String get bioText => 'Bio'; + + @override + String get postUnavailableText => 'Post unavailable'; + + @override + String get postUnavailableDescriptionText => 'This post is unavailable'; + + @override + String get editText => 'Edit'; + + @override + String get editedText => 'edited'; + + @override + String get deleteText => 'Delete'; + + @override + String get replyText => 'Reply'; + + @override + String replyToText(Object username) { + return 'Reply to $username'; + } + + @override + String get themeText => 'Theme'; + + @override + String get systemOption => 'System'; + + @override + String get lightModeOption => 'Light'; + + @override + String get darkModeOption => 'Dark'; + + @override + String get languageText => 'Language'; + + @override + String get ruOptionText => 'Russian'; + + @override + String get enOptionText => 'English'; + + @override + String secondsAgo(int seconds) { + String _temp0 = intl.Intl.pluralLogic( + seconds, + locale: localeName, + other: '$seconds seconds ago', + one: '1 second ago', + ); + return '$_temp0'; + } + + @override + String minutesAgo(int minutes) { + String _temp0 = intl.Intl.pluralLogic( + minutes, + locale: localeName, + other: '$minutes minutes ago', + one: '1 minute ago', + ); + return '$_temp0'; + } + + @override + String hoursAgo(int hours) { + String _temp0 = intl.Intl.pluralLogic( + hours, + locale: localeName, + other: '$hours hours ago', + one: '1 hour ago', + ); + return '$_temp0'; + } + + @override + String daysAgo(int days) { + String _temp0 = intl.Intl.pluralLogic( + days, + locale: localeName, + other: '$days days ago', + one: '1 day ago', + ); + return '$_temp0'; + } + + @override + String weeksAgo(int weeks) { + String _temp0 = intl.Intl.pluralLogic( + weeks, + locale: localeName, + other: '$weeks weeks ago', + one: '1 week ago', + ); + return '$_temp0'; + } + + @override + String monthsAgo(int months) { + String _temp0 = intl.Intl.pluralLogic( + months, + locale: localeName, + other: '$months months ago', + one: '1 month ago', + ); + return '$_temp0'; + } + + @override + String yearsAgo(int years) { + String _temp0 = intl.Intl.pluralLogic( + years, + locale: localeName, + other: '$years years ago', + one: '1 year ago', + ); + return '$_temp0'; + } + + @override + String get networkError => 'A network error has occurred.\nCheck your connection and try again.'; + + @override + String get networkErrorButton => 'Try Again'; +} diff --git a/lib/l10n/generated/app_localizations_ru.dart b/lib/l10n/generated/app_localizations_ru.dart new file mode 100644 index 00000000..488037a9 --- /dev/null +++ b/lib/l10n/generated/app_localizations_ru.dart @@ -0,0 +1,677 @@ +import 'package:intl/intl.dart' as intl; + +import 'app_localizations.dart'; + +/// The translations for Russian (`ru`). +class AppLocalizationsRu extends AppLocalizations { + AppLocalizationsRu([String locale = 'ru']) : super(locale); + + @override + String get feedAppBarTitle => 'Просмотр ленты'; + + @override + String get homeNavBarItemLabel => 'Лента'; + + @override + String get searchNavBarItemLabel => 'Поиск'; + + @override + String get createMediaNavBarItemLabel => 'Создать медиа'; + + @override + String get reelsNavBarItemLabel => 'Рилс'; + + @override + String get profileNavBarItemLabel => 'Профиль'; + + @override + String get likesText => 'Нравится'; + + @override + String likesCountText(int count) { + return 'Нравится: $count'; + } + + @override + String likedByText(String userName, int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: 'и $count другим', + one: '', + ); + return 'Нравится $userName $_temp0'; + } + + @override + String get likeText => 'Нравится'; + + @override + String get unlikeText => 'Не нравится'; + + @override + String likesCountTextShort(int count) { + return '$count'; + } + + @override + String get originalAudioText => 'Оригинальное аудио'; + + @override + String get discardEditsText => 'Сбросить Изменения'; + + @override + String get discardText => 'Сбросить'; + + @override + String get doneText => 'Готово'; + + @override + String get draftEmpty => 'Черновик пустой'; + + @override + String get errorText => 'Ошибка'; + + @override + String get uploadText => 'Загрузить'; + + @override + String get loseAllEditsText => 'Если вы вернетесь сейчас, вы потеряете все внесенные вами изменения.'; + + @override + String get saveDraft => 'Сохранить черновик'; + + @override + String get successfullySavedText => 'Успешно сохранено'; + + @override + String get tapToTypeText => 'Нажмите, чтобы печатать...'; + + @override + String get noPostsText => 'Публикаций пока нет'; + + @override + String get noPostFoundText => 'Публикация не найдена!'; + + @override + String get addCommentText => 'Добавить комментарий'; + + @override + String get noChatsText => 'Нет чатов!'; + + @override + String get startChatText => 'Создать чат'; + + @override + String get deleteCommentText => 'Удалить комментарий'; + + @override + String get commentDeleteConfirmationText => 'Вы уверены что хотите удалить этот комментарий?'; + + @override + String get deleteMessageText => 'Удалить сообщение'; + + @override + String get messageDeleteConfirmationText => 'Вы уверены что хотите удалить это сообщение?'; + + @override + String get deleteChatText => 'Удалить чат'; + + @override + String get chatDeleteConfirmationText => 'Вы уверены что хотите удалить этот чат?'; + + @override + String get deleteReelText => 'Удалить видео Reels'; + + @override + String get reelDeleteConfirmationText => 'Вы уверены что хотите удалить это видео Reels?'; + + @override + String get deleteStoryText => 'Удалить историю'; + + @override + String get storyDeleteConfirmationText => 'Вы уверены что хотите удалить эту историю?'; + + @override + String get commentText => 'Комментарий'; + + @override + String get commentsText => 'Комментарии'; + + @override + String get noCommentsText => 'Нет комментариев'; + + @override + String seeAllComments(int count) { + return 'Смотреть все коментарии ($count)'; + } + + @override + String get yourStoryLabel => 'Твоя история'; + + @override + String get postsText => 'Публикаций'; + + @override + String get followUser => 'Подписаться'; + + @override + String get followingUser => 'Вы подписаны'; + + @override + String get followersText => 'Подписчики'; + + @override + String get followingsText => 'Подписки'; + + @override + String followersCountText(int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: 'Подписчики: $count', + ); + return '$_temp0'; + } + + @override + String followingsCountText(int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: 'Подписки: $count', + ); + return '$_temp0'; + } + + @override + String postsCount(int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: 'Публикаций', + few: 'Публикации', + one: 'Публикация', + ); + return '$_temp0'; + } + + @override + String get profilePostsAppBarTitle => 'Публикации'; + + @override + String followersCount(int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: 'Подписчиков', + few: 'Подписчика', + one: 'Подписчик', + ); + return '$_temp0'; + } + + @override + String followingsCount(int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: 'Подписок', + few: 'Подписки', + one: 'Подписка', + ); + return '$_temp0'; + } + + @override + String get optionsText => 'Настройки'; + + @override + String get viewProfileText => 'Посмотреть профиль'; + + @override + String get editProfileText => 'Редактировать профиль'; + + @override + String get editingText => 'Редактирование'; + + @override + String get editPostText => 'Редактировать публикацию'; + + @override + String get shareProfileText => 'Поделиться профилем'; + + @override + String get sharePostText => 'Поделиться'; + + @override + String get sharePostCaptionHintText => 'Добавить сообщение...'; + + @override + String get sendText => 'Отправить'; + + @override + String get sendSeparatelyText => 'Отправить отдельно'; + + @override + String get addStoryText => 'Добавить'; + + @override + String get sponsoredPostText => 'Реклама'; + + @override + String get visitSponsoredInstagramProfile => 'Посетить профиль Instagram'; + + @override + String get visitSponsoredPostAuthorProfileText => 'Открыть профиль Instagram'; + + @override + String get learnMoreAboutUserPromoText => 'Узнать больше'; + + @override + String get visitUserPromoWebsiteText => 'Посетить сайт'; + + @override + String get cancelFollowingText => 'Отменить подписку'; + + @override + String get haveSeenAllRecentPosts => 'Вы посмотрели все обновления'; + + @override + String get haveSeenAllRecentPostsInPast3Days => 'Вы посмотрели все новые публикации за последние 3 дн.'; + + @override + String get suggestedForYouText => 'Рекомендуемые публикации'; + + @override + String get andText => 'и'; + + @override + String othersText(int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: 'ещё $count', + zero: '', + ); + return '$_temp0'; + } + + @override + String get newPostText => 'Новая публикация'; + + @override + String get newAvatarImageText => 'Новое фото аватара'; + + @override + String get writeCaptionText => 'Добавить подпись...'; + + @override + String get logOutText => 'Выйти'; + + @override + String get logOutConfirmationText => 'Вы уверены что хотите выйти из аккаунта?'; + + @override + String get notShowAgainText => 'Не показывать снова'; + + @override + String get blockPostAuthorText => 'Заблокировать автора публикации'; + + @override + String get blockAuthorText => 'Заблокировать автора'; + + @override + String get blockAuthorConfirmationText => 'Вы уверены что хотите заблокировать этого автора?'; + + @override + String get blockText => 'Заблокировать'; + + @override + String get refreshText => 'Обновить'; + + @override + String get noReelsFoundText => 'Видео Reels пока нет'; + + @override + String get publishText => 'Отправить'; + + @override + String get searchText => 'Поиск'; + + @override + String get addMessageText => 'Сообщение'; + + @override + String get messageText => 'Сообщение'; + + @override + String get editPictureText => 'Изменить фото'; + + @override + String get requiredFieldText => 'Это поле обязательно'; + + @override + String passwordLengthErrorText(int characters, num count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: '$count символа', + one: '$count символ', + ); + return 'Пароль должен содержать минимум $_temp0'; + } + + @override + String get changeText => 'Изменить'; + + @override + String get changePhotoText => 'Изменить фото'; + + @override + String get fullNameEditDescription => 'Помогите людям найти вашу учетную запись, используя имя, под которым вы известны: полное имя, псевдоним или название компании.\n\nВы можете изменить свое имя только дважды в течение 14 дней.'; + + @override + String usernameEditDescription(String username) { + return 'Вы сможете изменить свое имя пользователя обратно на $username следующие 14 дней.'; + } + + @override + String profileInfoEditConfirmationText(String newUsername, String changeType) { + return 'Вы уверены что хотите сменить $changeType на $newUsername ?'; + } + + @override + String profileInfoChangePeriodText(String changeType, int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: '$count дней', + few: '$count дня', + one: 'день', + ); + return 'Вы можете изменять $changeType только дважды в $_temp0.'; + } + + @override + String get forgotPasswordText => 'Забыли пароль?'; + + @override + String get recoveryPasswordText => 'Восстановление пароля'; + + @override + String get orText => 'Или'; + + @override + String signInWithText(String provider) { + return 'Войти через $provider'; + } + + @override + String get goBackConfirmationText => 'Вы уверены что хотите вернуться назад?'; + + @override + String get goBackText => 'Вернуться назад'; + + @override + String get furtherText => 'Далее'; + + @override + String get somethingWentWrongText => 'Что-то пошло не так!'; + + @override + String get failedToCreateStoryText => 'Не удалось создать историю'; + + @override + String get successfullyCreatedStoryText => 'История успешно создана!'; + + @override + String get createText => 'Cоздать'; + + @override + String get reelText => 'Видео Reels'; + + @override + String get postText => 'Публикация'; + + @override + String get storyText => 'История'; + + @override + String get removeText => 'Удалить'; + + @override + String get removeFollowerText => 'Удалить подписчика'; + + @override + String get removeFollowerConfirmationText => 'Вы уверены что хотите удалить подписчика?'; + + @override + String get deletePostText => 'Удалить публикацию'; + + @override + String get deletePostConfirmationText => 'Вы уверены что хотите удальть эту публикацию?'; + + @override + String get cancelText => 'Отмена'; + + @override + String get captionText => 'Описание'; + + @override + String get noCameraFoundText => 'Камера не найдена!'; + + @override + String get videoText => 'ВИДЕО'; + + @override + String get photoText => 'ФОТО'; + + @override + String get clearImagesText => 'Очистить выбранные изображения'; + + @override + String get galleryText => 'ГАЛЕРЕЯ'; + + @override + String get deletingText => 'УДАЛИТЬ'; + + @override + String get notFoundingCameraText => 'Дополнительная камера не найдена'; + + @override + String get holdButtonText => 'Нажмите и удерживайте, чтобы записать'; + + @override + String get noImagesFoundedText => 'Нет изображений'; + + @override + String get acceptAllPermissionsText => 'Примите все необходимые разрешения!'; + + @override + String get noLastMessagesText => 'Нет последних сообщений'; + + @override + String get onlineText => 'онлайн'; + + @override + String get moreText => 'Ещё'; + + @override + String get noAccountText => 'Ещё нет аккаунта?'; + + @override + String get alreadyHaveAccountText => 'Уже есть аккаунт?'; + + @override + String get nameText => 'Имя'; + + @override + String get usernameText => 'Имя пользователя'; + + @override + String get forgotPasswordEmailConfirmationText => 'Подтверждение учётной записи'; + + @override + String verificationTokenSentText(String email) { + return 'Код подтверждения отправлени на почту $email'; + } + + @override + String get emailText => 'Почта'; + + @override + String get otpText => 'Код'; + + @override + String get changePasswordText => 'Поменять пароль'; + + @override + String get passwordText => 'Пароль'; + + @override + String get newPasswordText => 'Новый пароль'; + + @override + String get loginText => 'Войти'; + + @override + String get signUpText => 'Зарегестрироваться'; + + @override + String get bioText => 'Биография'; + + @override + String get postUnavailableText => 'Пост недоступен'; + + @override + String get postUnavailableDescriptionText => 'Этот пост недоступен'; + + @override + String get editText => 'Редактировать'; + + @override + String get editedText => 'изменено'; + + @override + String get deleteText => 'Удалить'; + + @override + String get replyText => 'Ответить'; + + @override + String replyToText(Object username) { + return 'В ответ $username'; + } + + @override + String get themeText => 'Тема'; + + @override + String get systemOption => 'Системная'; + + @override + String get lightModeOption => 'Светлая'; + + @override + String get darkModeOption => 'Тёмная'; + + @override + String get languageText => 'Язык'; + + @override + String get ruOptionText => 'Русский'; + + @override + String get enOptionText => 'Английский'; + + @override + String secondsAgo(int seconds) { + String _temp0 = intl.Intl.pluralLogic( + seconds, + locale: localeName, + other: '$seconds секунд назад', + few: '$seconds секунды назад', + one: '$seconds секунду назад', + ); + return '$_temp0'; + } + + @override + String minutesAgo(int minutes) { + String _temp0 = intl.Intl.pluralLogic( + minutes, + locale: localeName, + other: '$minutes минут назад', + few: '$minutes минуты назад', + one: '$minutes минуту назад', + ); + return '$_temp0'; + } + + @override + String hoursAgo(int hours) { + String _temp0 = intl.Intl.pluralLogic( + hours, + locale: localeName, + other: '$hours часов назад', + few: '$hours часа назад', + one: '$hours час назад', + ); + return '$_temp0'; + } + + @override + String daysAgo(int days) { + String _temp0 = intl.Intl.pluralLogic( + days, + locale: localeName, + other: '$days дней назад', + few: '$days дня назад', + one: '$days день назад', + ); + return '$_temp0'; + } + + @override + String weeksAgo(int weeks) { + String _temp0 = intl.Intl.pluralLogic( + weeks, + locale: localeName, + other: '$weeks недель назад', + few: '$weeks недели назад', + one: '$weeks неделю назад', + ); + return '$_temp0'; + } + + @override + String monthsAgo(int months) { + String _temp0 = intl.Intl.pluralLogic( + months, + locale: localeName, + other: '$months месяцев назад', + few: '$months месяца назад', + one: '$months месяц назад', + ); + return '$_temp0'; + } + + @override + String yearsAgo(int years) { + String _temp0 = intl.Intl.pluralLogic( + years, + locale: localeName, + other: '$years лет назад', + few: '$years года назад', + one: '$years год назад', + ); + return '$_temp0'; + } + + @override + String get networkError => 'Произошла сетевая ошибка.\nПроверьте подключение и повторите попытку.'; + + @override + String get networkErrorButton => 'Попробуйте ещё раз'; +} diff --git a/lib/l10n/generated/generated.dart b/lib/l10n/generated/generated.dart new file mode 100644 index 00000000..3b6a9edb --- /dev/null +++ b/lib/l10n/generated/generated.dart @@ -0,0 +1 @@ +export 'app_localizations.dart'; \ No newline at end of file From c74a48c3a0e103f538e9b8c2a44e5d77120341b5 Mon Sep 17 00:00:00 2001 From: Emil Date: Mon, 25 Mar 2024 18:38:05 +0500 Subject: [PATCH 06/13] chore: added `lib/l10n` to ignore for spell checker --- .vscode/cspell.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 45e0d4d7..0d30d3c8 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -206,6 +206,7 @@ "packages/shared/lib/src/config/tld.dart", "packages/shared/lib/src/config/utilities/extensions/string_extension.dart", "packages/shared/lib/src/config/utilities/utilities.dart", - "packages/stories_editor/**" + "packages/stories_editor/**", + "lib/l10n" ] } From 8c1b1fe0208fe0f2b295be79a25bce2b63094f01 Mon Sep 17 00:00:00 2001 From: Emil Date: Mon, 25 Mar 2024 18:39:59 +0500 Subject: [PATCH 07/13] chore: spell checker ignore * from `lib/l10n` --- .vscode/cspell.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 0d30d3c8..111ac714 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -207,6 +207,6 @@ "packages/shared/lib/src/config/utilities/extensions/string_extension.dart", "packages/shared/lib/src/config/utilities/utilities.dart", "packages/stories_editor/**", - "lib/l10n" + "lib/l10n/**" ] } From e5c231e6a5c4fc2b57adc8ddfaf1902fd7e4759f Mon Sep 17 00:00:00 2001 From: Emil Date: Mon, 25 Mar 2024 18:41:11 +0500 Subject: [PATCH 08/13] chore: spell checker ignore `nodoc` word --- .vscode/cspell.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 111ac714..16fea5b3 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -199,7 +199,8 @@ "prefetch", "giffy", "giphy", - "ccon" + "ccon", + "nodoc" ], "ignorePaths": [ ".github/workflows/**", From 62b582be3e8eb80b77c65490617a1e8995cf444e Mon Sep 17 00:00:00 2001 From: Emil Date: Mon, 25 Mar 2024 18:48:08 +0500 Subject: [PATCH 09/13] chore: bump flutter version to `3.16.9`. --- .github/workflows/flutter_instagram_offline_first_clone.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flutter_instagram_offline_first_clone.yaml b/.github/workflows/flutter_instagram_offline_first_clone.yaml index 916552b4..7e2cdc3e 100644 --- a/.github/workflows/flutter_instagram_offline_first_clone.yaml +++ b/.github/workflows/flutter_instagram_offline_first_clone.yaml @@ -31,7 +31,7 @@ jobs: - uses: subosito/flutter-action@v2.14.0 with: channel: ${{matrix.channel}} - flutter-version: 3.10.2 + flutter-version: "3.16.9" cache: false - name: Install Dependencies From f36650cc6fbfed29c66fe27f1a8fc82d13577747 Mon Sep 17 00:00:00 2001 From: Emil Date: Mon, 25 Mar 2024 18:53:00 +0500 Subject: [PATCH 10/13] chore: removed `very_good --analytics false` --- .github/workflows/flutter_instagram_offline_first_clone.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/flutter_instagram_offline_first_clone.yaml b/.github/workflows/flutter_instagram_offline_first_clone.yaml index 7e2cdc3e..8ab1d4f7 100644 --- a/.github/workflows/flutter_instagram_offline_first_clone.yaml +++ b/.github/workflows/flutter_instagram_offline_first_clone.yaml @@ -37,7 +37,6 @@ jobs: - name: Install Dependencies run: | flutter pub global activate very_good_cli - very_good --analytics false very_good packages get --recursive - name: Format From 3783f5e24f619aab522d339812a13d677d233470 Mon Sep 17 00:00:00 2001 From: Emil Date: Mon, 25 Mar 2024 19:01:02 +0500 Subject: [PATCH 11/13] chore: ignore formatting in `lib/l10n` --- .github/workflows/flutter_instagram_offline_first_clone.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/flutter_instagram_offline_first_clone.yaml b/.github/workflows/flutter_instagram_offline_first_clone.yaml index 8ab1d4f7..a8f2f39c 100644 --- a/.github/workflows/flutter_instagram_offline_first_clone.yaml +++ b/.github/workflows/flutter_instagram_offline_first_clone.yaml @@ -41,6 +41,9 @@ jobs: - name: Format run: dart format --set-exit-if-changed lib test + with: + exclude: "**/l10n/*.dart **/l10n/**/*.dart" + path: flutter_news_example/coverage/lcov.info - name: Analyze run: flutter analyze lib test From 404dbc74e7e0a35c912c0fc659aa3d0a139cd24e Mon Sep 17 00:00:00 2001 From: Emil Date: Mon, 25 Mar 2024 19:02:06 +0500 Subject: [PATCH 12/13] Revert "chore: ignore formatting in `lib/l10n`" --- .github/workflows/flutter_instagram_offline_first_clone.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/flutter_instagram_offline_first_clone.yaml b/.github/workflows/flutter_instagram_offline_first_clone.yaml index a8f2f39c..8ab1d4f7 100644 --- a/.github/workflows/flutter_instagram_offline_first_clone.yaml +++ b/.github/workflows/flutter_instagram_offline_first_clone.yaml @@ -41,9 +41,6 @@ jobs: - name: Format run: dart format --set-exit-if-changed lib test - with: - exclude: "**/l10n/*.dart **/l10n/**/*.dart" - path: flutter_news_example/coverage/lcov.info - name: Analyze run: flutter analyze lib test From 9fcddbafe04ff458cdc4b03b2a429ad8b7d7ba77 Mon Sep 17 00:00:00 2001 From: Emil Date: Mon, 25 Mar 2024 19:35:46 +0500 Subject: [PATCH 13/13] chore: dart format lib test --- ...flutter_instagram_offline_first_clone.yaml | 3 - lib/l10n/generated/app_localizations.dart | 32 +- lib/l10n/generated/app_localizations_en.dart | 42 ++- lib/l10n/generated/app_localizations_ru.dart | 45 ++- lib/l10n/generated/generated.dart | 2 +- lib/l10n/slang/translations.g.dart | 352 +++++++++++------- .../src/extensions/hex_color_extension.dart | 4 +- .../src/extensions/text_style_extension.dart | 2 +- .../app_ui/lib/src/generated/generated.dart | 2 +- .../supabase_authentication_client_test.dart | 1 + .../gallery_grid/thumbnail_widget.dart | 2 +- .../lib/image_picker_plus.dart | 2 +- .../src/entities/image_picker_display.dart | 2 +- .../src/entities/selected_image_details.dart | 2 +- .../lib/src/utilities/utilities.dart | 2 +- .../lib/src/better_stream_builder.dart | 3 +- .../lib/src/likes_count.dart | 3 +- .../lib/src/widgets/expandable_text.dart | 3 +- .../firebase_notifications_client_test.dart | 1 + .../src/notifications_repository_test.dart | 3 +- .../stories_editor/lib/res/i_font_res.dart | 3 +- .../presentation/utils/color_detection.dart | 2 +- .../presentation/utils/image_compress.dart | 2 +- .../widgets/scrollable_pageView.dart | 2 +- .../stories_editor/lib/stories_editor.dart | 3 +- 25 files changed, 311 insertions(+), 209 deletions(-) diff --git a/.github/workflows/flutter_instagram_offline_first_clone.yaml b/.github/workflows/flutter_instagram_offline_first_clone.yaml index a8f2f39c..8ab1d4f7 100644 --- a/.github/workflows/flutter_instagram_offline_first_clone.yaml +++ b/.github/workflows/flutter_instagram_offline_first_clone.yaml @@ -41,9 +41,6 @@ jobs: - name: Format run: dart format --set-exit-if-changed lib test - with: - exclude: "**/l10n/*.dart **/l10n/**/*.dart" - path: flutter_news_example/coverage/lcov.info - name: Analyze run: flutter analyze lib test diff --git a/lib/l10n/generated/app_localizations.dart b/lib/l10n/generated/app_localizations.dart index fabac152..e7a857a1 100644 --- a/lib/l10n/generated/app_localizations.dart +++ b/lib/l10n/generated/app_localizations.dart @@ -60,7 +60,8 @@ import 'app_localizations_ru.dart'; /// be consistent with the languages listed in the AppLocalizations.supportedLocales /// property. abstract class AppLocalizations { - AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString()); + AppLocalizations(String locale) + : localeName = intl.Intl.canonicalizedLocale(locale.toString()); final String localeName; @@ -68,7 +69,8 @@ abstract class AppLocalizations { return Localizations.of(context, AppLocalizations)!; } - static const LocalizationsDelegate delegate = _AppLocalizationsDelegate(); + static const LocalizationsDelegate delegate = + _AppLocalizationsDelegate(); /// A list of this localizations delegate along with the default localizations /// delegates. @@ -80,7 +82,8 @@ abstract class AppLocalizations { /// Additional delegates can be added by appending to this list in /// MaterialApp. This list does not have to be used at all if a custom list /// of delegates is preferred or required. - static const List> localizationsDelegates = >[ + static const List> localizationsDelegates = + >[ delegate, GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, @@ -1126,7 +1129,8 @@ abstract class AppLocalizations { String get networkErrorButton; } -class _AppLocalizationsDelegate extends LocalizationsDelegate { +class _AppLocalizationsDelegate + extends LocalizationsDelegate { const _AppLocalizationsDelegate(); @override @@ -1135,25 +1139,25 @@ class _AppLocalizationsDelegate extends LocalizationsDelegate } @override - bool isSupported(Locale locale) => ['en', 'ru'].contains(locale.languageCode); + bool isSupported(Locale locale) => + ['en', 'ru'].contains(locale.languageCode); @override bool shouldReload(_AppLocalizationsDelegate old) => false; } AppLocalizations lookupAppLocalizations(Locale locale) { - - // Lookup logic when only language code is specified. switch (locale.languageCode) { - case 'en': return AppLocalizationsEn(); - case 'ru': return AppLocalizationsRu(); + case 'en': + return AppLocalizationsEn(); + case 'ru': + return AppLocalizationsRu(); } throw FlutterError( - 'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' - 'an issue with the localizations generation tool. Please file an issue ' - 'on GitHub with a reproducible sample app and the gen-l10n configuration ' - 'that was used.' - ); + 'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' + 'an issue with the localizations generation tool. Please file an issue ' + 'on GitHub with a reproducible sample app and the gen-l10n configuration ' + 'that was used.'); } diff --git a/lib/l10n/generated/app_localizations_en.dart b/lib/l10n/generated/app_localizations_en.dart index 4c012801..15de5f1a 100644 --- a/lib/l10n/generated/app_localizations_en.dart +++ b/lib/l10n/generated/app_localizations_en.dart @@ -82,7 +82,8 @@ class AppLocalizationsEn extends AppLocalizations { String get uploadText => 'Upload'; @override - String get loseAllEditsText => 'If you go back now, youll loose all the edits youve made.'; + String get loseAllEditsText => + 'If you go back now, youll loose all the edits youve made.'; @override String get saveDraft => 'Save Draft'; @@ -112,31 +113,36 @@ class AppLocalizationsEn extends AppLocalizations { String get deleteCommentText => 'Delete comment'; @override - String get commentDeleteConfirmationText => 'Are you sure you want to delete this comment?'; + String get commentDeleteConfirmationText => + 'Are you sure you want to delete this comment?'; @override String get deleteMessageText => 'Delete message'; @override - String get messageDeleteConfirmationText => 'Are you sure you want to delete this message?'; + String get messageDeleteConfirmationText => + 'Are you sure you want to delete this message?'; @override String get deleteChatText => 'Delete chat'; @override - String get chatDeleteConfirmationText => 'Are you sure you want to delete this chat?'; + String get chatDeleteConfirmationText => + 'Are you sure you want to delete this chat?'; @override String get deleteReelText => 'Delete Reel'; @override - String get reelDeleteConfirmationText => 'Are you sure you want to delete this Reel?'; + String get reelDeleteConfirmationText => + 'Are you sure you want to delete this Reel?'; @override String get deleteStoryText => 'Delete story'; @override - String get storyDeleteConfirmationText => 'Are you sure you want to delete this story?'; + String get storyDeleteConfirmationText => + 'Are you sure you want to delete this story?'; @override String get commentText => 'Comment'; @@ -282,7 +288,8 @@ class AppLocalizationsEn extends AppLocalizations { String get haveSeenAllRecentPosts => 'You\'re all caught up'; @override - String get haveSeenAllRecentPostsInPast3Days => 'You\'ve seen all new posts from the past 3 days.'; + String get haveSeenAllRecentPostsInPast3Days => + 'You\'ve seen all new posts from the past 3 days.'; @override String get suggestedForYouText => 'Suggested for you'; @@ -327,7 +334,8 @@ class AppLocalizationsEn extends AppLocalizations { String get blockAuthorText => 'Block author'; @override - String get blockAuthorConfirmationText => 'Are you sure you want to block this author?'; + String get blockAuthorConfirmationText => + 'Are you sure you want to block this author?'; @override String get blockText => 'Block'; @@ -368,7 +376,8 @@ class AppLocalizationsEn extends AppLocalizations { String get changePhotoText => 'Change photo'; @override - String get fullNameEditDescription => 'Help people discover your account by using the name yor\'re known by: either your full name, nickname, or business name.\n\nYou can only change your name twice within 14 days.'; + String get fullNameEditDescription => + 'Help people discover your account by using the name yor\'re known by: either your full name, nickname, or business name.\n\nYou can only change your name twice within 14 days.'; @override String usernameEditDescription(String username) { @@ -376,7 +385,8 @@ class AppLocalizationsEn extends AppLocalizations { } @override - String profileInfoEditConfirmationText(String newUsername, String changeType) { + String profileInfoEditConfirmationText( + String newUsername, String changeType) { return 'Are you sure you want to change your $changeType to $newUsername ?'; } @@ -436,13 +446,15 @@ class AppLocalizationsEn extends AppLocalizations { String get removeFollowerText => 'Remove follower'; @override - String get removeFollowerConfirmationText => 'Are you sure you want to remove follower?'; + String get removeFollowerConfirmationText => + 'Are you sure you want to remove follower?'; @override String get deletePostText => 'Delete post'; @override - String get deletePostConfirmationText => 'Are you sure you want to delete this post?'; + String get deletePostConfirmationText => + 'Are you sure you want to delete this post?'; @override String get cancelText => 'Cancel'; @@ -478,7 +490,8 @@ class AppLocalizationsEn extends AppLocalizations { String get noImagesFoundedText => 'There is no images'; @override - String get acceptAllPermissionsText => 'Failed! accept all access permissions.'; + String get acceptAllPermissionsText => + 'Failed! accept all access permissions.'; @override String get noLastMessagesText => 'No last messages'; @@ -655,7 +668,8 @@ class AppLocalizationsEn extends AppLocalizations { } @override - String get networkError => 'A network error has occurred.\nCheck your connection and try again.'; + String get networkError => + 'A network error has occurred.\nCheck your connection and try again.'; @override String get networkErrorButton => 'Try Again'; diff --git a/lib/l10n/generated/app_localizations_ru.dart b/lib/l10n/generated/app_localizations_ru.dart index 488037a9..372df6ab 100644 --- a/lib/l10n/generated/app_localizations_ru.dart +++ b/lib/l10n/generated/app_localizations_ru.dart @@ -76,7 +76,8 @@ class AppLocalizationsRu extends AppLocalizations { String get uploadText => 'Загрузить'; @override - String get loseAllEditsText => 'Если вы вернетесь сейчас, вы потеряете все внесенные вами изменения.'; + String get loseAllEditsText => + 'Если вы вернетесь сейчас, вы потеряете все внесенные вами изменения.'; @override String get saveDraft => 'Сохранить черновик'; @@ -106,31 +107,36 @@ class AppLocalizationsRu extends AppLocalizations { String get deleteCommentText => 'Удалить комментарий'; @override - String get commentDeleteConfirmationText => 'Вы уверены что хотите удалить этот комментарий?'; + String get commentDeleteConfirmationText => + 'Вы уверены что хотите удалить этот комментарий?'; @override String get deleteMessageText => 'Удалить сообщение'; @override - String get messageDeleteConfirmationText => 'Вы уверены что хотите удалить это сообщение?'; + String get messageDeleteConfirmationText => + 'Вы уверены что хотите удалить это сообщение?'; @override String get deleteChatText => 'Удалить чат'; @override - String get chatDeleteConfirmationText => 'Вы уверены что хотите удалить этот чат?'; + String get chatDeleteConfirmationText => + 'Вы уверены что хотите удалить этот чат?'; @override String get deleteReelText => 'Удалить видео Reels'; @override - String get reelDeleteConfirmationText => 'Вы уверены что хотите удалить это видео Reels?'; + String get reelDeleteConfirmationText => + 'Вы уверены что хотите удалить это видео Reels?'; @override String get deleteStoryText => 'Удалить историю'; @override - String get storyDeleteConfirmationText => 'Вы уверены что хотите удалить эту историю?'; + String get storyDeleteConfirmationText => + 'Вы уверены что хотите удалить эту историю?'; @override String get commentText => 'Комментарий'; @@ -278,7 +284,8 @@ class AppLocalizationsRu extends AppLocalizations { String get haveSeenAllRecentPosts => 'Вы посмотрели все обновления'; @override - String get haveSeenAllRecentPostsInPast3Days => 'Вы посмотрели все новые публикации за последние 3 дн.'; + String get haveSeenAllRecentPostsInPast3Days => + 'Вы посмотрели все новые публикации за последние 3 дн.'; @override String get suggestedForYouText => 'Рекомендуемые публикации'; @@ -310,7 +317,8 @@ class AppLocalizationsRu extends AppLocalizations { String get logOutText => 'Выйти'; @override - String get logOutConfirmationText => 'Вы уверены что хотите выйти из аккаунта?'; + String get logOutConfirmationText => + 'Вы уверены что хотите выйти из аккаунта?'; @override String get notShowAgainText => 'Не показывать снова'; @@ -322,7 +330,8 @@ class AppLocalizationsRu extends AppLocalizations { String get blockAuthorText => 'Заблокировать автора'; @override - String get blockAuthorConfirmationText => 'Вы уверены что хотите заблокировать этого автора?'; + String get blockAuthorConfirmationText => + 'Вы уверены что хотите заблокировать этого автора?'; @override String get blockText => 'Заблокировать'; @@ -369,7 +378,8 @@ class AppLocalizationsRu extends AppLocalizations { String get changePhotoText => 'Изменить фото'; @override - String get fullNameEditDescription => 'Помогите людям найти вашу учетную запись, используя имя, под которым вы известны: полное имя, псевдоним или название компании.\n\nВы можете изменить свое имя только дважды в течение 14 дней.'; + String get fullNameEditDescription => + 'Помогите людям найти вашу учетную запись, используя имя, под которым вы известны: полное имя, псевдоним или название компании.\n\nВы можете изменить свое имя только дважды в течение 14 дней.'; @override String usernameEditDescription(String username) { @@ -377,7 +387,8 @@ class AppLocalizationsRu extends AppLocalizations { } @override - String profileInfoEditConfirmationText(String newUsername, String changeType) { + String profileInfoEditConfirmationText( + String newUsername, String changeType) { return 'Вы уверены что хотите сменить $changeType на $newUsername ?'; } @@ -444,13 +455,15 @@ class AppLocalizationsRu extends AppLocalizations { String get removeFollowerText => 'Удалить подписчика'; @override - String get removeFollowerConfirmationText => 'Вы уверены что хотите удалить подписчика?'; + String get removeFollowerConfirmationText => + 'Вы уверены что хотите удалить подписчика?'; @override String get deletePostText => 'Удалить публикацию'; @override - String get deletePostConfirmationText => 'Вы уверены что хотите удальть эту публикацию?'; + String get deletePostConfirmationText => + 'Вы уверены что хотите удальть эту публикацию?'; @override String get cancelText => 'Отмена'; @@ -510,7 +523,8 @@ class AppLocalizationsRu extends AppLocalizations { String get usernameText => 'Имя пользователя'; @override - String get forgotPasswordEmailConfirmationText => 'Подтверждение учётной записи'; + String get forgotPasswordEmailConfirmationText => + 'Подтверждение учётной записи'; @override String verificationTokenSentText(String email) { @@ -670,7 +684,8 @@ class AppLocalizationsRu extends AppLocalizations { } @override - String get networkError => 'Произошла сетевая ошибка.\nПроверьте подключение и повторите попытку.'; + String get networkError => + 'Произошла сетевая ошибка.\nПроверьте подключение и повторите попытку.'; @override String get networkErrorButton => 'Попробуйте ещё раз'; diff --git a/lib/l10n/generated/generated.dart b/lib/l10n/generated/generated.dart index 3b6a9edb..dd0c457c 100644 --- a/lib/l10n/generated/generated.dart +++ b/lib/l10n/generated/generated.dart @@ -1 +1 @@ -export 'app_localizations.dart'; \ No newline at end of file +export 'app_localizations.dart'; diff --git a/lib/l10n/slang/translations.g.dart b/lib/l10n/slang/translations.g.dart index 3602fef6..89387a89 100644 --- a/lib/l10n/slang/translations.g.dart +++ b/lib/l10n/slang/translations.g.dart @@ -25,18 +25,27 @@ const AppLocale _baseLocale = AppLocale.en; /// - Locale locale = AppLocale.en.flutterLocale // get flutter locale from enum /// - if (LocaleSettings.currentLocale == AppLocale.en) // locale check enum AppLocale with BaseAppLocale { - en(languageCode: 'en', build: Translations.build), - ru(languageCode: 'ru', build: _TranslationsRu.build); - - const AppLocale({required this.languageCode, this.scriptCode, this.countryCode, required this.build}); // ignore: unused_element - - @override final String languageCode; - @override final String? scriptCode; - @override final String? countryCode; - @override final TranslationBuilder build; - - /// Gets current instance managed by [LocaleSettings]. - Translations get translations => LocaleSettings.instance.translationMap[this]!; + en(languageCode: 'en', build: Translations.build), + ru(languageCode: 'ru', build: _TranslationsRu.build); + + const AppLocale( + {required this.languageCode, + this.scriptCode, + this.countryCode, + required this.build}); // ignore: unused_element + + @override + final String languageCode; + @override + final String? scriptCode; + @override + final String? countryCode; + @override + final TranslationBuilder build; + + /// Gets current instance managed by [LocaleSettings]. + Translations get translations => + LocaleSettings.instance.translationMap[this]!; } /// Method A: Simple @@ -65,10 +74,14 @@ Translations get t => LocaleSettings.instance.currentTranslations; /// final t = Translations.of(context); // Get t variable. /// String a = t.someKey.anotherKey; // Use t variable. /// String b = t['someKey.anotherKey']; // Only for edge cases! -class TranslationProvider extends BaseTranslationProvider { - TranslationProvider({required super.child}) : super(settings: LocaleSettings.instance); - - static InheritedLocaleData of(BuildContext context) => InheritedLocaleData.of(context); +class TranslationProvider + extends BaseTranslationProvider { + TranslationProvider({required super.child}) + : super(settings: LocaleSettings.instance); + + static InheritedLocaleData of( + BuildContext context) => + InheritedLocaleData.of(context); } /// Method B shorthand via [BuildContext] extension method. @@ -77,154 +90,213 @@ class TranslationProvider extends BaseTranslationProvider TranslationProvider.of(this).translations; + Translations get t => TranslationProvider.of(this).translations; } /// Manages all translation instances and the current locale -class LocaleSettings extends BaseFlutterLocaleSettings { - LocaleSettings._() : super(utils: AppLocaleUtils.instance); - - static final instance = LocaleSettings._(); - - // static aliases (checkout base methods for documentation) - static AppLocale get currentLocale => instance.currentLocale; - static Stream getLocaleStream() => instance.getLocaleStream(); - static AppLocale setLocale(AppLocale locale, {bool? listenToDeviceLocale = false}) => instance.setLocale(locale, listenToDeviceLocale: listenToDeviceLocale); - static AppLocale setLocaleRaw(String rawLocale, {bool? listenToDeviceLocale = false}) => instance.setLocaleRaw(rawLocale, listenToDeviceLocale: listenToDeviceLocale); - static AppLocale useDeviceLocale() => instance.useDeviceLocale(); - @Deprecated('Use [AppLocaleUtils.supportedLocales]') static List get supportedLocales => instance.supportedLocales; - @Deprecated('Use [AppLocaleUtils.supportedLocalesRaw]') static List get supportedLocalesRaw => instance.supportedLocalesRaw; - static void setPluralResolver({String? language, AppLocale? locale, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) => instance.setPluralResolver( - language: language, - locale: locale, - cardinalResolver: cardinalResolver, - ordinalResolver: ordinalResolver, - ); +class LocaleSettings + extends BaseFlutterLocaleSettings { + LocaleSettings._() : super(utils: AppLocaleUtils.instance); + + static final instance = LocaleSettings._(); + + // static aliases (checkout base methods for documentation) + static AppLocale get currentLocale => instance.currentLocale; + static Stream getLocaleStream() => instance.getLocaleStream(); + static AppLocale setLocale(AppLocale locale, + {bool? listenToDeviceLocale = false}) => + instance.setLocale(locale, listenToDeviceLocale: listenToDeviceLocale); + static AppLocale setLocaleRaw(String rawLocale, + {bool? listenToDeviceLocale = false}) => + instance.setLocaleRaw(rawLocale, + listenToDeviceLocale: listenToDeviceLocale); + static AppLocale useDeviceLocale() => instance.useDeviceLocale(); + @Deprecated('Use [AppLocaleUtils.supportedLocales]') + static List get supportedLocales => instance.supportedLocales; + @Deprecated('Use [AppLocaleUtils.supportedLocalesRaw]') + static List get supportedLocalesRaw => instance.supportedLocalesRaw; + static void setPluralResolver( + {String? language, + AppLocale? locale, + PluralResolver? cardinalResolver, + PluralResolver? ordinalResolver}) => + instance.setPluralResolver( + language: language, + locale: locale, + cardinalResolver: cardinalResolver, + ordinalResolver: ordinalResolver, + ); } /// Provides utility functions without any side effects. class AppLocaleUtils extends BaseAppLocaleUtils { - AppLocaleUtils._() : super(baseLocale: _baseLocale, locales: AppLocale.values); - - static final instance = AppLocaleUtils._(); - - // static aliases (checkout base methods for documentation) - static AppLocale parse(String rawLocale) => instance.parse(rawLocale); - static AppLocale parseLocaleParts({required String languageCode, String? scriptCode, String? countryCode}) => instance.parseLocaleParts(languageCode: languageCode, scriptCode: scriptCode, countryCode: countryCode); - static AppLocale findDeviceLocale() => instance.findDeviceLocale(); - static List get supportedLocales => instance.supportedLocales; - static List get supportedLocalesRaw => instance.supportedLocalesRaw; + AppLocaleUtils._() + : super(baseLocale: _baseLocale, locales: AppLocale.values); + + static final instance = AppLocaleUtils._(); + + // static aliases (checkout base methods for documentation) + static AppLocale parse(String rawLocale) => instance.parse(rawLocale); + static AppLocale parseLocaleParts( + {required String languageCode, + String? scriptCode, + String? countryCode}) => + instance.parseLocaleParts( + languageCode: languageCode, + scriptCode: scriptCode, + countryCode: countryCode); + static AppLocale findDeviceLocale() => instance.findDeviceLocale(); + static List get supportedLocales => instance.supportedLocales; + static List get supportedLocalesRaw => instance.supportedLocalesRaw; } // translations // Path: class Translations implements BaseTranslations { - /// Returns the current translations of the given [context]. - /// - /// Usage: - /// final t = Translations.of(context); - static Translations of(BuildContext context) => InheritedLocaleData.of(context).translations; - - /// You can call this constructor and build your own translation instance of this locale. - /// Constructing via the enum [AppLocale.build] is preferred. - Translations.build({Map? overrides, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) - : assert(overrides == null, 'Set "translation_overrides: true" in order to enable this feature.'), - $meta = TranslationMetadata( - locale: AppLocale.en, - overrides: overrides ?? {}, - cardinalResolver: cardinalResolver, - ordinalResolver: ordinalResolver, - ) { - $meta.setFlatMapFunction(_flatMapFunction); - } - - /// Metadata for the translations of . - @override final TranslationMetadata $meta; - - /// Access flat map - dynamic operator[](String key) => $meta.getTranslation(key); - - late final Translations _root = this; // ignore: unused_field - - // Translations - TextSpan likedBy({required InlineSpan name, required InlineSpan and, required InlineSpan others}) => TextSpan(children: [ - const TextSpan(text: 'Liked by '), - name, - const TextSpan(text: ' '), - and, - const TextSpan(text: ' '), - others, - ]); + /// Returns the current translations of the given [context]. + /// + /// Usage: + /// final t = Translations.of(context); + static Translations of(BuildContext context) => + InheritedLocaleData.of(context).translations; + + /// You can call this constructor and build your own translation instance of this locale. + /// Constructing via the enum [AppLocale.build] is preferred. + Translations.build( + {Map? overrides, + PluralResolver? cardinalResolver, + PluralResolver? ordinalResolver}) + : assert(overrides == null, + 'Set "translation_overrides: true" in order to enable this feature.'), + $meta = TranslationMetadata( + locale: AppLocale.en, + overrides: overrides ?? {}, + cardinalResolver: cardinalResolver, + ordinalResolver: ordinalResolver, + ) { + $meta.setFlatMapFunction(_flatMapFunction); + } + + /// Metadata for the translations of . + @override + final TranslationMetadata $meta; + + /// Access flat map + dynamic operator [](String key) => $meta.getTranslation(key); + + late final Translations _root = this; // ignore: unused_field + + // Translations + TextSpan likedBy( + {required InlineSpan name, + required InlineSpan and, + required InlineSpan others}) => + TextSpan(children: [ + const TextSpan(text: 'Liked by '), + name, + const TextSpan(text: ' '), + and, + const TextSpan(text: ' '), + others, + ]); } // Path: class _TranslationsRu extends Translations { - /// You can call this constructor and build your own translation instance of this locale. - /// Constructing via the enum [AppLocale.build] is preferred. - _TranslationsRu.build({Map? overrides, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) - : assert(overrides == null, 'Set "translation_overrides: true" in order to enable this feature.'), - $meta = TranslationMetadata( - locale: AppLocale.ru, - overrides: overrides ?? {}, - cardinalResolver: cardinalResolver, - ordinalResolver: ordinalResolver, - ), - super.build(cardinalResolver: cardinalResolver, ordinalResolver: ordinalResolver) { - super.$meta.setFlatMapFunction($meta.getTranslation); // copy base translations to super.$meta - $meta.setFlatMapFunction(_flatMapFunction); - } - - /// Metadata for the translations of . - @override final TranslationMetadata $meta; - - /// Access flat map - @override dynamic operator[](String key) => $meta.getTranslation(key) ?? super.$meta.getTranslation(key); - - @override late final _TranslationsRu _root = this; // ignore: unused_field - - // Translations - @override TextSpan likedBy({required InlineSpan name, required InlineSpan and, required InlineSpan others}) => TextSpan(children: [ - const TextSpan(text: 'Нравится '), - name, - const TextSpan(text: ' '), - and, - const TextSpan(text: ' '), - others, - ]); + /// You can call this constructor and build your own translation instance of this locale. + /// Constructing via the enum [AppLocale.build] is preferred. + _TranslationsRu.build( + {Map? overrides, + PluralResolver? cardinalResolver, + PluralResolver? ordinalResolver}) + : assert(overrides == null, + 'Set "translation_overrides: true" in order to enable this feature.'), + $meta = TranslationMetadata( + locale: AppLocale.ru, + overrides: overrides ?? {}, + cardinalResolver: cardinalResolver, + ordinalResolver: ordinalResolver, + ), + super.build( + cardinalResolver: cardinalResolver, + ordinalResolver: ordinalResolver) { + super.$meta.setFlatMapFunction( + $meta.getTranslation); // copy base translations to super.$meta + $meta.setFlatMapFunction(_flatMapFunction); + } + + /// Metadata for the translations of . + @override + final TranslationMetadata $meta; + + /// Access flat map + @override + dynamic operator [](String key) => + $meta.getTranslation(key) ?? super.$meta.getTranslation(key); + + @override + late final _TranslationsRu _root = this; // ignore: unused_field + + // Translations + @override + TextSpan likedBy( + {required InlineSpan name, + required InlineSpan and, + required InlineSpan others}) => + TextSpan(children: [ + const TextSpan(text: 'Нравится '), + name, + const TextSpan(text: ' '), + and, + const TextSpan(text: ' '), + others, + ]); } /// Flat map(s) containing all translations. /// Only for edge cases! For simple maps, use the map function of this library. extension on Translations { - dynamic _flatMapFunction(String path) { - switch (path) { - case 'likedBy': return ({required InlineSpan name, required InlineSpan and, required InlineSpan others}) => TextSpan(children: [ - const TextSpan(text: 'Liked by '), - name, - const TextSpan(text: ' '), - and, - const TextSpan(text: ' '), - others, - ]); - default: return null; - } - } + dynamic _flatMapFunction(String path) { + switch (path) { + case 'likedBy': + return ( + {required InlineSpan name, + required InlineSpan and, + required InlineSpan others}) => + TextSpan(children: [ + const TextSpan(text: 'Liked by '), + name, + const TextSpan(text: ' '), + and, + const TextSpan(text: ' '), + others, + ]); + default: + return null; + } + } } extension on _TranslationsRu { - dynamic _flatMapFunction(String path) { - switch (path) { - case 'likedBy': return ({required InlineSpan name, required InlineSpan and, required InlineSpan others}) => TextSpan(children: [ - const TextSpan(text: 'Нравится '), - name, - const TextSpan(text: ' '), - and, - const TextSpan(text: ' '), - others, - ]); - default: return null; - } - } + dynamic _flatMapFunction(String path) { + switch (path) { + case 'likedBy': + return ( + {required InlineSpan name, + required InlineSpan and, + required InlineSpan others}) => + TextSpan(children: [ + const TextSpan(text: 'Нравится '), + name, + const TextSpan(text: ' '), + and, + const TextSpan(text: ' '), + others, + ]); + default: + return null; + } + } } diff --git a/packages/app_ui/lib/src/extensions/hex_color_extension.dart b/packages/app_ui/lib/src/extensions/hex_color_extension.dart index 43b46b52..9fff2a9a 100644 --- a/packages/app_ui/lib/src/extensions/hex_color_extension.dart +++ b/packages/app_ui/lib/src/extensions/hex_color_extension.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart' show Color; /// Converts from a hex [String] to [Color]. Converts a [Color] to a hex /// [String]. extension HexColor on Color { - /// String is in the format "aabbcc" or "ffaabbcc" with an optional leading + /// String is in the format "aabbcc" or "ffaabbcc" with an optional leading /// "#". static Color fromHex(String hexString) { final buffer = StringBuffer(); @@ -12,7 +12,7 @@ extension HexColor on Color { return Color(int.parse(buffer.toString(), radix: 16)); } - /// Prefixes a hash sign if [leadingHashSign] is set to `true` (default is + /// Prefixes a hash sign if [leadingHashSign] is set to `true` (default is /// `true`). String toHex({bool leadingHashSign = true}) => '${leadingHashSign ? '#' : ''}' '${alpha.toRadixString(16).padLeft(2, '0')}' diff --git a/packages/app_ui/lib/src/extensions/text_style_extension.dart b/packages/app_ui/lib/src/extensions/text_style_extension.dart index 88e77ece..8efbe6dd 100644 --- a/packages/app_ui/lib/src/extensions/text_style_extension.dart +++ b/packages/app_ui/lib/src/extensions/text_style_extension.dart @@ -21,7 +21,7 @@ extension TextStyleExtension on BuildContext { /// Material display large text style. TextStyle? get displayLarge => textTheme.displayLarge; - + /// Material display medium text style. TextStyle? get displayMedium => textTheme.displayMedium; diff --git a/packages/app_ui/lib/src/generated/generated.dart b/packages/app_ui/lib/src/generated/generated.dart index bbf757a7..803fdae9 100644 --- a/packages/app_ui/lib/src/generated/generated.dart +++ b/packages/app_ui/lib/src/generated/generated.dart @@ -1,4 +1,4 @@ export 'assets.gen.dart'; export 'fonts.gen.dart'; -export 'package:flutter_svg/flutter_svg.dart'; \ No newline at end of file +export 'package:flutter_svg/flutter_svg.dart'; diff --git a/packages/authentication_client/supabase_authentication_client/test/src/supabase_authentication_client_test.dart b/packages/authentication_client/supabase_authentication_client/test/src/supabase_authentication_client_test.dart index e69de29b..8b137891 100644 --- a/packages/authentication_client/supabase_authentication_client/test/src/supabase_authentication_client_test.dart +++ b/packages/authentication_client/supabase_authentication_client/test/src/supabase_authentication_client_test.dart @@ -0,0 +1 @@ + diff --git a/packages/gallery_media_picker/lib/src/presentation/widgets/gallery_grid/thumbnail_widget.dart b/packages/gallery_media_picker/lib/src/presentation/widgets/gallery_grid/thumbnail_widget.dart index c2766e63..4a2cdc0a 100644 --- a/packages/gallery_media_picker/lib/src/presentation/widgets/gallery_grid/thumbnail_widget.dart +++ b/packages/gallery_media_picker/lib/src/presentation/widgets/gallery_grid/thumbnail_widget.dart @@ -14,7 +14,7 @@ class ThumbnailWidget extends StatelessWidget { /// image provider final GalleryMediaPickerController provider; - + const ThumbnailWidget({ super.key, required this.index, diff --git a/packages/image_picker_plus/lib/image_picker_plus.dart b/packages/image_picker_plus/lib/image_picker_plus.dart index 705c6d46..dd53472d 100644 --- a/packages/image_picker_plus/lib/image_picker_plus.dart +++ b/packages/image_picker_plus/lib/image_picker_plus.dart @@ -7,4 +7,4 @@ export 'src/entities/image_picker_display.dart'; export 'src/entities/selected_image_details.dart'; export 'src/entities/tabs_texts.dart'; export 'src/image_picker_plus.dart'; -export 'src/utilities/utilities.dart'; \ No newline at end of file +export 'src/utilities/utilities.dart'; diff --git a/packages/image_picker_plus/lib/src/entities/image_picker_display.dart b/packages/image_picker_plus/lib/src/entities/image_picker_display.dart index 9d715635..781611c6 100644 --- a/packages/image_picker_plus/lib/src/entities/image_picker_display.dart +++ b/packages/image_picker_plus/lib/src/entities/image_picker_display.dart @@ -13,7 +13,7 @@ class GalleryDisplaySettings { final bool cropImage; final bool pickAvatar; - const GalleryDisplaySettings({ + const GalleryDisplaySettings({ this.appTheme, this.tabsTexts, this.callbackFunction, diff --git a/packages/image_picker_plus/lib/src/entities/selected_image_details.dart b/packages/image_picker_plus/lib/src/entities/selected_image_details.dart index 0547842b..efc04a89 100644 --- a/packages/image_picker_plus/lib/src/entities/selected_image_details.dart +++ b/packages/image_picker_plus/lib/src/entities/selected_image_details.dart @@ -17,7 +17,7 @@ class SelectedImagesDetails { class SelectedByte { final File selectedFile; final Uint8List selectedByte; - + final bool isThatImage; SelectedByte({ diff --git a/packages/image_picker_plus/lib/src/utilities/utilities.dart b/packages/image_picker_plus/lib/src/utilities/utilities.dart index f33b2103..f87f8343 100644 --- a/packages/image_picker_plus/lib/src/utilities/utilities.dart +++ b/packages/image_picker_plus/lib/src/utilities/utilities.dart @@ -1,4 +1,4 @@ export 'extensions/extensions.dart'; export 'enum_image_source.dart'; export 'enum.dart'; -export 'typedef.dart'; \ No newline at end of file +export 'typedef.dart'; diff --git a/packages/instagram_blocks_ui/lib/src/better_stream_builder.dart b/packages/instagram_blocks_ui/lib/src/better_stream_builder.dart index de8cafb0..184c93af 100644 --- a/packages/instagram_blocks_ui/lib/src/better_stream_builder.dart +++ b/packages/instagram_blocks_ui/lib/src/better_stream_builder.dart @@ -57,8 +57,7 @@ class _BetterStreamBuilderState } final event = _lastEvent; return switch (event) { - null => - widget.noDataBuilder?.call(context) ?? const SizedBox.shrink(), + null => widget.noDataBuilder?.call(context) ?? const SizedBox.shrink(), _ => widget.builder(context, event), }; } diff --git a/packages/instagram_blocks_ui/lib/src/likes_count.dart b/packages/instagram_blocks_ui/lib/src/likes_count.dart index 2a678609..f5b531a0 100644 --- a/packages/instagram_blocks_ui/lib/src/likes_count.dart +++ b/packages/instagram_blocks_ui/lib/src/likes_count.dart @@ -42,8 +42,7 @@ class _LikesCountState extends State child: widget.textBuilder?.call(count != 0 ? count - 1 : 0) ?? Text( widget.short - ? BlockSettings().postTextDelegate - .likesCountShortText(count) + ? BlockSettings().postTextDelegate.likesCountShortText(count) : BlockSettings().postTextDelegate.likesCountText(count), style: context.titleMedium?.copyWith( color: widget.color, diff --git a/packages/instagram_blocks_ui/lib/src/widgets/expandable_text.dart b/packages/instagram_blocks_ui/lib/src/widgets/expandable_text.dart index 3b0139ee..2366f198 100644 --- a/packages/instagram_blocks_ui/lib/src/widgets/expandable_text.dart +++ b/packages/instagram_blocks_ui/lib/src/widgets/expandable_text.dart @@ -41,8 +41,7 @@ class ExpandableTextState extends State { // Layout and measure link final textPainter = TextPainter( text: link, - textDirection: TextDirection - .rtl, + textDirection: TextDirection.rtl, maxLines: widget.trimLines, ellipsis: '...', ); diff --git a/packages/notifications_client/firebase_notifications_client/test/src/firebase_notifications_client_test.dart b/packages/notifications_client/firebase_notifications_client/test/src/firebase_notifications_client_test.dart index e69de29b..8b137891 100644 --- a/packages/notifications_client/firebase_notifications_client/test/src/firebase_notifications_client_test.dart +++ b/packages/notifications_client/firebase_notifications_client/test/src/firebase_notifications_client_test.dart @@ -0,0 +1 @@ + diff --git a/packages/notifications_repository/test/src/notifications_repository_test.dart b/packages/notifications_repository/test/src/notifications_repository_test.dart index 12e9aee6..9c049bac 100644 --- a/packages/notifications_repository/test/src/notifications_repository_test.dart +++ b/packages/notifications_repository/test/src/notifications_repository_test.dart @@ -1,6 +1,5 @@ import 'package:test/test.dart'; void main() { - group('NotificationsRepository', () { - }); + group('NotificationsRepository', () {}); } diff --git a/packages/stories_editor/lib/res/i_font_res.dart b/packages/stories_editor/lib/res/i_font_res.dart index 95457a71..de23041b 100644 --- a/packages/stories_editor/lib/res/i_font_res.dart +++ b/packages/stories_editor/lib/res/i_font_res.dart @@ -5,7 +5,8 @@ class FontRes { static const String B612_REGULAR = 'B612-Regular'; static const String BUNGEESHADE_REGULAR = 'BungeeShade-Regular'; static const String CONCERTONE_REGULAR = 'ConcertOne-Regular'; - static const String DANCINGSCRIPT_VARIABLEFONT_WGHT = 'DancingScript-VariableFont_wght'; + static const String DANCINGSCRIPT_VARIABLEFONT_WGHT = + 'DancingScript-VariableFont_wght'; static const String FREDERICKATHEGREAT_REGULAR = 'FrederickatheGreat-Regular'; static const String INDIEFLOWER_REGULAR = 'IndieFlower-Regular'; static const String NEONDERTHAW_REGULAR = 'Neonderthaw-Regular'; diff --git a/packages/stories_editor/lib/src/presentation/utils/color_detection.dart b/packages/stories_editor/lib/src/presentation/utils/color_detection.dart index 100e6ce0..d214a738 100644 --- a/packages/stories_editor/lib/src/presentation/utils/color_detection.dart +++ b/packages/stories_editor/lib/src/presentation/utils/color_detection.dart @@ -72,4 +72,4 @@ int pixel32ToArgb(List pixel) { // Shift and pack the channels into a single integer in ARGB format return (pixel[3] << 24) | (pixel[0] << 16) | (pixel[1] << 8) | pixel[2]; -} \ No newline at end of file +} diff --git a/packages/stories_editor/lib/src/presentation/utils/image_compress.dart b/packages/stories_editor/lib/src/presentation/utils/image_compress.dart index e6d208e0..2974c749 100644 --- a/packages/stories_editor/lib/src/presentation/utils/image_compress.dart +++ b/packages/stories_editor/lib/src/presentation/utils/image_compress.dart @@ -34,7 +34,7 @@ class ImageCompress { } final split = filePath.substring(0, lastIndex); final outPath = '${split}_out${filePath.substring(lastIndex)}'; - return FlutterImageCompress.compressAndGetFile( + return FlutterImageCompress.compressAndGetFile( file.absolute.path, outPath, quality: quality, diff --git a/packages/stories_editor/lib/src/presentation/widgets/scrollable_pageView.dart b/packages/stories_editor/lib/src/presentation/widgets/scrollable_pageView.dart index d4c4a19a..d2749ad0 100644 --- a/packages/stories_editor/lib/src/presentation/widgets/scrollable_pageView.dart +++ b/packages/stories_editor/lib/src/presentation/widgets/scrollable_pageView.dart @@ -18,7 +18,7 @@ class ScrollablePageView extends StatefulWidget { required this.pageController, required this.gridController, }); - + @override State createState() => _ScrollablePageViewState(); } diff --git a/packages/stories_editor/lib/stories_editor.dart b/packages/stories_editor/lib/stories_editor.dart index 4dd3c8dc..fc0577e5 100644 --- a/packages/stories_editor/lib/stories_editor.dart +++ b/packages/stories_editor/lib/stories_editor.dart @@ -99,7 +99,8 @@ class StoriesEditor extends StatelessWidget { onBackPress: onBackPress, editorBackgroundColor: editorBackgroundColor, galleryThumbnailQuality: galleryThumbnailQuality, - storiesEditorLocalizationDelegate: storiesEditorLocalizationDelegate, + storiesEditorLocalizationDelegate: + storiesEditorLocalizationDelegate, ), ), ),