diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b18818..b05236e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.8.1 + +- Added support for hiding author and date information from articles (read more here: ). + ## 0.8.0 - **BREAKING**: Replaced providing the feedback and help urls with just providing the `organizationName`. diff --git a/lib/actions.dart b/lib/actions.dart index 823221c..bb4ad72 100644 --- a/lib/actions.dart +++ b/lib/actions.dart @@ -79,9 +79,6 @@ void openHelpCenter({ /// Search fill color Color? searchFillColor, - /// Hide Authors - bool hideAuthors = false, - /// Show Search Bar bool showSearchBar = true, @@ -103,7 +100,6 @@ void openHelpCenter({ primaryColor: primaryColor, textColor: textColor, backgroundColor: backgroundColor, - hideAuthors: hideAuthors, searchFillColor: searchFillColor, defaultLocale: defaultLocale, showSearchBar: showSearchBar, diff --git a/lib/api/models/_models.freezed.dart b/lib/api/models/_models.freezed.dart index 55c47d1..2606a1b 100644 --- a/lib/api/models/_models.freezed.dart +++ b/lib/api/models/_models.freezed.dart @@ -64,12 +64,12 @@ mixin _$Article { @JsonKey(name: 'locale', required: true) String get locale => throw _privateConstructorUsedError; //TODO: add translations - /// The date when the article was created. - DateTime get createdAt => throw _privateConstructorUsedError; + /// The date when the article was created (will be null if hideDateInfo is true) + DateTime? get createdAt => throw _privateConstructorUsedError; + + /// The date when the article was last updated (will be null if hideDateInfo is true) + DateTime? get updatedAt => throw _privateConstructorUsedError; - /// The date when the article was last updated. - DateTime get updatedAt => - throw _privateConstructorUsedError; //TODO: add author /// The URL-friendly slug of the article. @JsonKey(name: 'slug', required: true) String get slug => throw _privateConstructorUsedError; @@ -89,9 +89,9 @@ mixin _$Article { @JsonKey(name: 'isPublished', defaultValue: true) bool get isPublished => throw _privateConstructorUsedError; - /// Author of the article - @JsonKey(name: 'author', required: true) - Author get author => throw _privateConstructorUsedError; + /// Author of the article (will be null if hideAuthorInfo is true) + @JsonKey(name: 'author') + Author? get author => throw _privateConstructorUsedError; /// An array of available locales for the article. @JsonKey(name: 'availableLocales', required: true) @@ -126,22 +126,22 @@ abstract class $ArticleCopyWith<$Res> { @JsonKey(name: 'organizationId', required: true) String organizationId, @JsonKey(name: 'state', defaultValue: 'live') String state, @JsonKey(name: 'locale', required: true) String locale, - DateTime createdAt, - DateTime updatedAt, + DateTime? createdAt, + DateTime? updatedAt, @JsonKey(name: 'slug', required: true) String slug, @JsonKey(name: 'featurebaseUrl', required: true) String featurebaseUrl, String? externalUrl, @JsonKey(name: 'isDraftDiffersFromLive', defaultValue: false) bool isDraftDiffersFromLive, @JsonKey(name: 'isPublished', defaultValue: true) bool isPublished, - @JsonKey(name: 'author', required: true) Author author, + @JsonKey(name: 'author') Author? author, @JsonKey(name: 'availableLocales', required: true) List availableLocales, @JsonKey(name: 'publishedLocales', required: true) List publishedLocales}); $FBIconCopyWith<$Res>? get icon; - $AuthorCopyWith<$Res> get author; + $AuthorCopyWith<$Res>? get author; } /// @nodoc @@ -169,14 +169,14 @@ class _$ArticleCopyWithImpl<$Res, $Val extends Article> Object? organizationId = null, Object? state = null, Object? locale = null, - Object? createdAt = null, - Object? updatedAt = null, + Object? createdAt = freezed, + Object? updatedAt = freezed, Object? slug = null, Object? featurebaseUrl = null, Object? externalUrl = freezed, Object? isDraftDiffersFromLive = null, Object? isPublished = null, - Object? author = null, + Object? author = freezed, Object? availableLocales = null, Object? publishedLocales = null, }) { @@ -221,14 +221,14 @@ class _$ArticleCopyWithImpl<$Res, $Val extends Article> ? _value.locale : locale // ignore: cast_nullable_to_non_nullable as String, - createdAt: null == createdAt + createdAt: freezed == createdAt ? _value.createdAt : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: null == updatedAt + as DateTime?, + updatedAt: freezed == updatedAt ? _value.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime, + as DateTime?, slug: null == slug ? _value.slug : slug // ignore: cast_nullable_to_non_nullable @@ -249,10 +249,10 @@ class _$ArticleCopyWithImpl<$Res, $Val extends Article> ? _value.isPublished : isPublished // ignore: cast_nullable_to_non_nullable as bool, - author: null == author + author: freezed == author ? _value.author : author // ignore: cast_nullable_to_non_nullable - as Author, + as Author?, availableLocales: null == availableLocales ? _value.availableLocales : availableLocales // ignore: cast_nullable_to_non_nullable @@ -282,8 +282,12 @@ class _$ArticleCopyWithImpl<$Res, $Val extends Article> /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') - $AuthorCopyWith<$Res> get author { - return $AuthorCopyWith<$Res>(_value.author, (value) { + $AuthorCopyWith<$Res>? get author { + if (_value.author == null) { + return null; + } + + return $AuthorCopyWith<$Res>(_value.author!, (value) { return _then(_value.copyWith(author: value) as $Val); }); } @@ -307,15 +311,15 @@ abstract class _$$ArticleImplCopyWith<$Res> implements $ArticleCopyWith<$Res> { @JsonKey(name: 'organizationId', required: true) String organizationId, @JsonKey(name: 'state', defaultValue: 'live') String state, @JsonKey(name: 'locale', required: true) String locale, - DateTime createdAt, - DateTime updatedAt, + DateTime? createdAt, + DateTime? updatedAt, @JsonKey(name: 'slug', required: true) String slug, @JsonKey(name: 'featurebaseUrl', required: true) String featurebaseUrl, String? externalUrl, @JsonKey(name: 'isDraftDiffersFromLive', defaultValue: false) bool isDraftDiffersFromLive, @JsonKey(name: 'isPublished', defaultValue: true) bool isPublished, - @JsonKey(name: 'author', required: true) Author author, + @JsonKey(name: 'author') Author? author, @JsonKey(name: 'availableLocales', required: true) List availableLocales, @JsonKey(name: 'publishedLocales', required: true) @@ -324,7 +328,7 @@ abstract class _$$ArticleImplCopyWith<$Res> implements $ArticleCopyWith<$Res> { @override $FBIconCopyWith<$Res>? get icon; @override - $AuthorCopyWith<$Res> get author; + $AuthorCopyWith<$Res>? get author; } /// @nodoc @@ -350,14 +354,14 @@ class __$$ArticleImplCopyWithImpl<$Res> Object? organizationId = null, Object? state = null, Object? locale = null, - Object? createdAt = null, - Object? updatedAt = null, + Object? createdAt = freezed, + Object? updatedAt = freezed, Object? slug = null, Object? featurebaseUrl = null, Object? externalUrl = freezed, Object? isDraftDiffersFromLive = null, Object? isPublished = null, - Object? author = null, + Object? author = freezed, Object? availableLocales = null, Object? publishedLocales = null, }) { @@ -402,14 +406,14 @@ class __$$ArticleImplCopyWithImpl<$Res> ? _value.locale : locale // ignore: cast_nullable_to_non_nullable as String, - createdAt: null == createdAt + createdAt: freezed == createdAt ? _value.createdAt : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: null == updatedAt + as DateTime?, + updatedAt: freezed == updatedAt ? _value.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime, + as DateTime?, slug: null == slug ? _value.slug : slug // ignore: cast_nullable_to_non_nullable @@ -430,10 +434,10 @@ class __$$ArticleImplCopyWithImpl<$Res> ? _value.isPublished : isPublished // ignore: cast_nullable_to_non_nullable as bool, - author: null == author + author: freezed == author ? _value.author : author // ignore: cast_nullable_to_non_nullable - as Author, + as Author?, availableLocales: null == availableLocales ? _value._availableLocales : availableLocales // ignore: cast_nullable_to_non_nullable @@ -461,8 +465,8 @@ class _$ArticleImpl implements _Article { required this.organizationId, @JsonKey(name: 'state', defaultValue: 'live') required this.state, @JsonKey(name: 'locale', required: true) required this.locale, - required this.createdAt, - required this.updatedAt, + this.createdAt, + this.updatedAt, @JsonKey(name: 'slug', required: true) required this.slug, @JsonKey(name: 'featurebaseUrl', required: true) required this.featurebaseUrl, @@ -471,7 +475,7 @@ class _$ArticleImpl implements _Article { required this.isDraftDiffersFromLive, @JsonKey(name: 'isPublished', defaultValue: true) required this.isPublished, - @JsonKey(name: 'author', required: true) required this.author, + @JsonKey(name: 'author') this.author, @JsonKey(name: 'availableLocales', required: true) required final List availableLocales, @JsonKey(name: 'publishedLocales', required: true) @@ -536,14 +540,14 @@ class _$ArticleImpl implements _Article { @JsonKey(name: 'locale', required: true) final String locale; //TODO: add translations - /// The date when the article was created. + /// The date when the article was created (will be null if hideDateInfo is true) @override - final DateTime createdAt; + final DateTime? createdAt; - /// The date when the article was last updated. + /// The date when the article was last updated (will be null if hideDateInfo is true) @override - final DateTime updatedAt; -//TODO: add author + final DateTime? updatedAt; + /// The URL-friendly slug of the article. @override @JsonKey(name: 'slug', required: true) @@ -568,10 +572,10 @@ class _$ArticleImpl implements _Article { @JsonKey(name: 'isPublished', defaultValue: true) final bool isPublished; - /// Author of the article + /// Author of the article (will be null if hideAuthorInfo is true) @override - @JsonKey(name: 'author', required: true) - final Author author; + @JsonKey(name: 'author') + final Author? author; /// An array of available locales for the article. final List _availableLocales; @@ -702,8 +706,8 @@ abstract class _Article implements Article { required final String organizationId, @JsonKey(name: 'state', defaultValue: 'live') required final String state, @JsonKey(name: 'locale', required: true) required final String locale, - required final DateTime createdAt, - required final DateTime updatedAt, + final DateTime? createdAt, + final DateTime? updatedAt, @JsonKey(name: 'slug', required: true) required final String slug, @JsonKey(name: 'featurebaseUrl', required: true) required final String featurebaseUrl, @@ -712,7 +716,7 @@ abstract class _Article implements Article { required final bool isDraftDiffersFromLive, @JsonKey(name: 'isPublished', defaultValue: true) required final bool isPublished, - @JsonKey(name: 'author', required: true) required final Author author, + @JsonKey(name: 'author') final Author? author, @JsonKey(name: 'availableLocales', required: true) required final List availableLocales, @JsonKey(name: 'publishedLocales', required: true) @@ -773,13 +777,14 @@ abstract class _Article implements Article { @override @JsonKey(name: 'locale', required: true) String get locale; //TODO: add translations - /// The date when the article was created. + /// The date when the article was created (will be null if hideDateInfo is true) @override - DateTime get createdAt; + DateTime? get createdAt; - /// The date when the article was last updated. + /// The date when the article was last updated (will be null if hideDateInfo is true) @override - DateTime get updatedAt; //TODO: add author + DateTime? get updatedAt; + /// The URL-friendly slug of the article. @override @JsonKey(name: 'slug', required: true) @@ -804,10 +809,10 @@ abstract class _Article implements Article { @JsonKey(name: 'isPublished', defaultValue: true) bool get isPublished; - /// Author of the article + /// Author of the article (will be null if hideAuthorInfo is true) @override - @JsonKey(name: 'author', required: true) - Author get author; + @JsonKey(name: 'author') + Author? get author; /// An array of available locales for the article. @override @@ -1903,9 +1908,9 @@ mixin _$Collection { @JsonKey(name: 'locale', required: true) String get locale => throw _privateConstructorUsedError; - /// Authors of the article - @JsonKey(name: 'authors', required: true) - List get authors => throw _privateConstructorUsedError; + /// Authors of the article (will be null if hideAuthorInfo is true) + @JsonKey(name: 'authors') + List? get authors => throw _privateConstructorUsedError; /// An array of available locales for the collection. @JsonKey(name: 'availableLocales', required: true) @@ -1946,7 +1951,7 @@ abstract class $CollectionCopyWith<$Res> { @JsonKey(name: 'featurebaseUrl', required: true) String featurebaseUrl, String? externalUrl, @JsonKey(name: 'locale', required: true) String locale, - @JsonKey(name: 'authors', required: true) List authors, + @JsonKey(name: 'authors') List? authors, @JsonKey(name: 'availableLocales', required: true) List availableLocales, List? structure}); @@ -1984,7 +1989,7 @@ class _$CollectionCopyWithImpl<$Res, $Val extends Collection> Object? featurebaseUrl = null, Object? externalUrl = freezed, Object? locale = null, - Object? authors = null, + Object? authors = freezed, Object? availableLocales = null, Object? structure = freezed, }) { @@ -2049,10 +2054,10 @@ class _$CollectionCopyWithImpl<$Res, $Val extends Collection> ? _value.locale : locale // ignore: cast_nullable_to_non_nullable as String, - authors: null == authors + authors: freezed == authors ? _value.authors : authors // ignore: cast_nullable_to_non_nullable - as List, + as List?, availableLocales: null == availableLocales ? _value.availableLocales : availableLocales // ignore: cast_nullable_to_non_nullable @@ -2103,7 +2108,7 @@ abstract class _$$CollectionImplCopyWith<$Res> @JsonKey(name: 'featurebaseUrl', required: true) String featurebaseUrl, String? externalUrl, @JsonKey(name: 'locale', required: true) String locale, - @JsonKey(name: 'authors', required: true) List authors, + @JsonKey(name: 'authors') List? authors, @JsonKey(name: 'availableLocales', required: true) List availableLocales, List? structure}); @@ -2140,7 +2145,7 @@ class __$$CollectionImplCopyWithImpl<$Res> Object? featurebaseUrl = null, Object? externalUrl = freezed, Object? locale = null, - Object? authors = null, + Object? authors = freezed, Object? availableLocales = null, Object? structure = freezed, }) { @@ -2205,10 +2210,10 @@ class __$$CollectionImplCopyWithImpl<$Res> ? _value.locale : locale // ignore: cast_nullable_to_non_nullable as String, - authors: null == authors + authors: freezed == authors ? _value._authors : authors // ignore: cast_nullable_to_non_nullable - as List, + as List?, availableLocales: null == availableLocales ? _value._availableLocales : availableLocales // ignore: cast_nullable_to_non_nullable @@ -2244,8 +2249,7 @@ class _$CollectionImpl implements _Collection { required this.featurebaseUrl, required this.externalUrl, @JsonKey(name: 'locale', required: true) required this.locale, - @JsonKey(name: 'authors', required: true) - required final List authors, + @JsonKey(name: 'authors') final List? authors, @JsonKey(name: 'availableLocales', required: true) required final List availableLocales, final List? structure}) @@ -2328,16 +2332,18 @@ class _$CollectionImpl implements _Collection { @JsonKey(name: 'locale', required: true) final String locale; - /// Authors of the article - final List _authors; + /// Authors of the article (will be null if hideAuthorInfo is true) + final List? _authors; - /// Authors of the article + /// Authors of the article (will be null if hideAuthorInfo is true) @override - @JsonKey(name: 'authors', required: true) - List get authors { + @JsonKey(name: 'authors') + List? get authors { + final value = _authors; + if (value == null) return null; if (_authors is EqualUnmodifiableListView) return _authors; // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_authors); + return EqualUnmodifiableListView(value); } /// An array of available locales for the collection. @@ -2469,8 +2475,7 @@ abstract class _Collection implements Collection { required final String featurebaseUrl, required final String? externalUrl, @JsonKey(name: 'locale', required: true) required final String locale, - @JsonKey(name: 'authors', required: true) - required final List authors, + @JsonKey(name: 'authors') final List? authors, @JsonKey(name: 'availableLocales', required: true) required final List availableLocales, final List? structure}) = _$CollectionImpl; @@ -2550,10 +2555,10 @@ abstract class _Collection implements Collection { @JsonKey(name: 'locale', required: true) String get locale; - /// Authors of the article + /// Authors of the article (will be null if hideAuthorInfo is true) @override - @JsonKey(name: 'authors', required: true) - List get authors; + @JsonKey(name: 'authors') + List? get authors; /// An array of available locales for the collection. @override @@ -3012,6 +3017,12 @@ mixin _$HelpCenter { /// The date when the help center was last updated. DateTime get updatedAt => throw _privateConstructorUsedError; + /// Whether to hide the date info on articles. + bool get hideDateInfo => throw _privateConstructorUsedError; + + /// Whether to hide the author info on articles. + bool get hideAuthorInfo => throw _privateConstructorUsedError; + /// List of collections (only returned when using the withStructure option) List? get structure => throw _privateConstructorUsedError; @@ -3045,6 +3056,8 @@ abstract class $HelpCenterCopyWith<$Res> { List availableLocales, DateTime createdAt, DateTime updatedAt, + bool hideDateInfo, + bool hideAuthorInfo, List? structure}); } @@ -3076,6 +3089,8 @@ class _$HelpCenterCopyWithImpl<$Res, $Val extends HelpCenter> Object? availableLocales = null, Object? createdAt = null, Object? updatedAt = null, + Object? hideDateInfo = null, + Object? hideAuthorInfo = null, Object? structure = freezed, }) { return _then(_value.copyWith( @@ -3131,6 +3146,14 @@ class _$HelpCenterCopyWithImpl<$Res, $Val extends HelpCenter> ? _value.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable as DateTime, + hideDateInfo: null == hideDateInfo + ? _value.hideDateInfo + : hideDateInfo // ignore: cast_nullable_to_non_nullable + as bool, + hideAuthorInfo: null == hideAuthorInfo + ? _value.hideAuthorInfo + : hideAuthorInfo // ignore: cast_nullable_to_non_nullable + as bool, structure: freezed == structure ? _value.structure : structure // ignore: cast_nullable_to_non_nullable @@ -3161,6 +3184,8 @@ abstract class _$$HelpCenterImplCopyWith<$Res> List availableLocales, DateTime createdAt, DateTime updatedAt, + bool hideDateInfo, + bool hideAuthorInfo, List? structure}); } @@ -3190,6 +3215,8 @@ class __$$HelpCenterImplCopyWithImpl<$Res> Object? availableLocales = null, Object? createdAt = null, Object? updatedAt = null, + Object? hideDateInfo = null, + Object? hideAuthorInfo = null, Object? structure = freezed, }) { return _then(_$HelpCenterImpl( @@ -3245,6 +3272,14 @@ class __$$HelpCenterImplCopyWithImpl<$Res> ? _value.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable as DateTime, + hideDateInfo: null == hideDateInfo + ? _value.hideDateInfo + : hideDateInfo // ignore: cast_nullable_to_non_nullable + as bool, + hideAuthorInfo: null == hideAuthorInfo + ? _value.hideAuthorInfo + : hideAuthorInfo // ignore: cast_nullable_to_non_nullable + as bool, structure: freezed == structure ? _value._structure : structure // ignore: cast_nullable_to_non_nullable @@ -3270,6 +3305,8 @@ class _$HelpCenterImpl implements _HelpCenter { required final List availableLocales, required this.createdAt, required this.updatedAt, + this.hideDateInfo = false, + this.hideAuthorInfo = false, final List? structure}) : _navItems = navItems, _availableLocales = availableLocales, @@ -3345,6 +3382,16 @@ class _$HelpCenterImpl implements _HelpCenter { @override final DateTime updatedAt; + /// Whether to hide the date info on articles. + @override + @JsonKey() + final bool hideDateInfo; + + /// Whether to hide the author info on articles. + @override + @JsonKey() + final bool hideAuthorInfo; + /// List of collections (only returned when using the withStructure option) final List? _structure; @@ -3360,7 +3407,7 @@ class _$HelpCenterImpl implements _HelpCenter { @override String toString() { - return 'HelpCenter(helpCenterId: $helpCenterId, displayName: $displayName, title: $title, description: $description, searchPlaceholder: $searchPlaceholder, navItems: $navItems, isPublic: $isPublic, organizationId: $organizationId, defaultLocale: $defaultLocale, locale: $locale, availableLocales: $availableLocales, createdAt: $createdAt, updatedAt: $updatedAt, structure: $structure)'; + return 'HelpCenter(helpCenterId: $helpCenterId, displayName: $displayName, title: $title, description: $description, searchPlaceholder: $searchPlaceholder, navItems: $navItems, isPublic: $isPublic, organizationId: $organizationId, defaultLocale: $defaultLocale, locale: $locale, availableLocales: $availableLocales, createdAt: $createdAt, updatedAt: $updatedAt, hideDateInfo: $hideDateInfo, hideAuthorInfo: $hideAuthorInfo, structure: $structure)'; } @override @@ -3391,6 +3438,10 @@ class _$HelpCenterImpl implements _HelpCenter { other.createdAt == createdAt) && (identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt) && + (identical(other.hideDateInfo, hideDateInfo) || + other.hideDateInfo == hideDateInfo) && + (identical(other.hideAuthorInfo, hideAuthorInfo) || + other.hideAuthorInfo == hideAuthorInfo) && const DeepCollectionEquality() .equals(other._structure, _structure)); } @@ -3412,6 +3463,8 @@ class _$HelpCenterImpl implements _HelpCenter { const DeepCollectionEquality().hash(_availableLocales), createdAt, updatedAt, + hideDateInfo, + hideAuthorInfo, const DeepCollectionEquality().hash(_structure)); /// Create a copy of HelpCenter @@ -3445,6 +3498,8 @@ abstract class _HelpCenter implements HelpCenter { required final List availableLocales, required final DateTime createdAt, required final DateTime updatedAt, + final bool hideDateInfo, + final bool hideAuthorInfo, final List? structure}) = _$HelpCenterImpl; factory _HelpCenter.fromJson(Map json) = @@ -3502,6 +3557,14 @@ abstract class _HelpCenter implements HelpCenter { @override DateTime get updatedAt; + /// Whether to hide the date info on articles. + @override + bool get hideDateInfo; + + /// Whether to hide the author info on articles. + @override + bool get hideAuthorInfo; + /// List of collections (only returned when using the withStructure option) @override List? get structure; diff --git a/lib/api/models/_models.g.dart b/lib/api/models/_models.g.dart index 6675651..4f5a44f 100644 --- a/lib/api/models/_models.g.dart +++ b/lib/api/models/_models.g.dart @@ -16,7 +16,6 @@ _$ArticleImpl _$$ArticleImplFromJson(Map json) { 'locale', 'slug', 'featurebaseUrl', - 'author', 'availableLocales', 'publishedLocales' ], @@ -34,14 +33,20 @@ _$ArticleImpl _$$ArticleImplFromJson(Map json) { organizationId: json['organizationId'] as String, state: json['state'] as String? ?? 'live', locale: json['locale'] as String, - createdAt: DateTime.parse(json['createdAt'] as String), - updatedAt: DateTime.parse(json['updatedAt'] as String), + createdAt: json['createdAt'] == null + ? null + : DateTime.parse(json['createdAt'] as String), + updatedAt: json['updatedAt'] == null + ? null + : DateTime.parse(json['updatedAt'] as String), slug: json['slug'] as String, featurebaseUrl: json['featurebaseUrl'] as String, externalUrl: json['externalUrl'] as String?, isDraftDiffersFromLive: json['isDraftDiffersFromLive'] as bool? ?? false, isPublished: json['isPublished'] as bool? ?? true, - author: Author.fromJson(json['author'] as Map), + author: json['author'] == null + ? null + : Author.fromJson(json['author'] as Map), availableLocales: (json['availableLocales'] as List) .map((e) => e as String) .toList(), @@ -63,8 +68,8 @@ Map _$$ArticleImplToJson(_$ArticleImpl instance) => 'organizationId': instance.organizationId, 'state': instance.state, 'locale': instance.locale, - 'createdAt': instance.createdAt.toIso8601String(), - 'updatedAt': instance.updatedAt.toIso8601String(), + 'createdAt': instance.createdAt?.toIso8601String(), + 'updatedAt': instance.updatedAt?.toIso8601String(), 'slug': instance.slug, 'featurebaseUrl': instance.featurebaseUrl, 'externalUrl': instance.externalUrl, @@ -184,7 +189,6 @@ _$CollectionImpl _$$CollectionImplFromJson(Map json) { 'slug', 'featurebaseUrl', 'locale', - 'authors', 'availableLocales' ], ); @@ -206,8 +210,8 @@ _$CollectionImpl _$$CollectionImplFromJson(Map json) { featurebaseUrl: json['featurebaseUrl'] as String, externalUrl: json['externalUrl'] as String?, locale: json['locale'] as String, - authors: (json['authors'] as List) - .map((e) => Author.fromJson(e as Map)) + authors: (json['authors'] as List?) + ?.map((e) => Author.fromJson(e as Map)) .toList(), availableLocales: (json['availableLocales'] as List) .map((e) => e as String) @@ -259,6 +263,8 @@ _$HelpCenterImpl _$$HelpCenterImplFromJson(Map json) => .toList(), createdAt: DateTime.parse(json['createdAt'] as String), updatedAt: DateTime.parse(json['updatedAt'] as String), + hideDateInfo: json['hideDateInfo'] as bool? ?? false, + hideAuthorInfo: json['hideAuthorInfo'] as bool? ?? false, structure: (json['structure'] as List?) ?.map((e) => Collection.fromJson(e as Map)) .toList(), @@ -279,6 +285,8 @@ Map _$$HelpCenterImplToJson(_$HelpCenterImpl instance) => 'availableLocales': instance.availableLocales, 'createdAt': instance.createdAt.toIso8601String(), 'updatedAt': instance.updatedAt.toIso8601String(), + 'hideDateInfo': instance.hideDateInfo, + 'hideAuthorInfo': instance.hideAuthorInfo, 'structure': instance.structure, }; diff --git a/lib/api/models/article.dart b/lib/api/models/article.dart index c4c852f..5ef7cc6 100644 --- a/lib/api/models/article.dart +++ b/lib/api/models/article.dart @@ -42,13 +42,11 @@ class Article with _$Article { //TODO: add translations - /// The date when the article was created. - required DateTime createdAt, + /// The date when the article was created (will be null if hideDateInfo is true) + DateTime? createdAt, - /// The date when the article was last updated. - required DateTime updatedAt, - - //TODO: add author + /// The date when the article was last updated (will be null if hideDateInfo is true) + DateTime? updatedAt, /// The URL-friendly slug of the article. @JsonKey(name: 'slug', required: true) required String slug, @@ -67,8 +65,8 @@ class Article with _$Article { /// Indicates whether the article is published. @JsonKey(name: 'isPublished', defaultValue: true) required bool isPublished, - /// Author of the article - @JsonKey(name: 'author', required: true) required Author author, + /// Author of the article (will be null if hideAuthorInfo is true) + @JsonKey(name: 'author') Author? author, /// An array of available locales for the article. @JsonKey(name: 'availableLocales', required: true) diff --git a/lib/api/models/collection.dart b/lib/api/models/collection.dart index 6e6f4ca..bcf4f99 100644 --- a/lib/api/models/collection.dart +++ b/lib/api/models/collection.dart @@ -51,8 +51,8 @@ class Collection with _$Collection { /// The locale of the collection. @JsonKey(name: 'locale', required: true) required String locale, - /// Authors of the article - @JsonKey(name: 'authors', required: true) required List authors, + /// Authors of the article (will be null if hideAuthorInfo is true) + @JsonKey(name: 'authors') List? authors, /// An array of available locales for the collection. @JsonKey(name: 'availableLocales', required: true) diff --git a/lib/api/models/help_center.dart b/lib/api/models/help_center.dart index 3c26ecb..0d48da7 100644 --- a/lib/api/models/help_center.dart +++ b/lib/api/models/help_center.dart @@ -42,6 +42,12 @@ class HelpCenter with _$HelpCenter { /// The date when the help center was last updated. required DateTime updatedAt, + /// Whether to hide the date info on articles. + @Default(false) bool hideDateInfo, + + /// Whether to hide the author info on articles. + @Default(false) bool hideAuthorInfo, + /// List of collections (only returned when using the withStructure option) List? structure, }) = _HelpCenter; diff --git a/lib/featurebase.dart b/lib/featurebase.dart index 8d7e0a3..8eb3636 100644 --- a/lib/featurebase.dart +++ b/lib/featurebase.dart @@ -22,6 +22,7 @@ import 'package:share_plus/share_plus.dart'; import 'package:styled_text/styled_text.dart'; import 'package:universal_io/io.dart'; import 'package:url_launcher/url_launcher_string.dart'; +import 'package:timeago/timeago.dart' as timeago; import 'api/models/_models.dart' as fb; //API diff --git a/lib/l10n/generated/featurebase_localizations.dart b/lib/l10n/generated/featurebase_localizations.dart index 9368fd4..70811e5 100644 --- a/lib/l10n/generated/featurebase_localizations.dart +++ b/lib/l10n/generated/featurebase_localizations.dart @@ -201,6 +201,12 @@ abstract class FeaturebaseLocalizations { /// **'Written by {author}'** String writtenBy(String author); + /// No description provided for @lastUpdated. + /// + /// In en, this message translates to: + /// **'Last updated {daysAgo}'** + String lastUpdated(String daysAgo); + /// This is the error message that is displayed when the data fails to load. /// /// In en, this message translates to: diff --git a/lib/l10n/generated/featurebase_localizations_af.dart b/lib/l10n/generated/featurebase_localizations_af.dart index d7d17b1..7a5042d 100644 --- a/lib/l10n/generated/featurebase_localizations_af.dart +++ b/lib/l10n/generated/featurebase_localizations_af.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsAf extends FeaturebaseLocalizations { return 'Geskryf deur $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Gewysig deur $daysAgo'; + } + @override String get failedToLoad => 'Kon nie laai nie'; diff --git a/lib/l10n/generated/featurebase_localizations_ar.dart b/lib/l10n/generated/featurebase_localizations_ar.dart index 225db95..5e3fca3 100644 --- a/lib/l10n/generated/featurebase_localizations_ar.dart +++ b/lib/l10n/generated/featurebase_localizations_ar.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsAr extends FeaturebaseLocalizations { return 'مكتوب بواسطة $author'; } + @override + String lastUpdated(String daysAgo) { + return 'تم التحديث بواسطة $daysAgo'; + } + @override String get failedToLoad => 'فشل التحميل'; diff --git a/lib/l10n/generated/featurebase_localizations_az.dart b/lib/l10n/generated/featurebase_localizations_az.dart index 630cb3c..b86c843 100644 --- a/lib/l10n/generated/featurebase_localizations_az.dart +++ b/lib/l10n/generated/featurebase_localizations_az.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsAz extends FeaturebaseLocalizations { return '$author tərəfindən yazılmışdır'; } + @override + String lastUpdated(String daysAgo) { + return '$daysAgo tarixində yeniləndi'; + } + @override String get failedToLoad => 'Yükləmək alınmadı'; diff --git a/lib/l10n/generated/featurebase_localizations_be.dart b/lib/l10n/generated/featurebase_localizations_be.dart index df253b3..ee7be4b 100644 --- a/lib/l10n/generated/featurebase_localizations_be.dart +++ b/lib/l10n/generated/featurebase_localizations_be.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsBe extends FeaturebaseLocalizations { return '$author напісаў'; } + @override + String lastUpdated(String daysAgo) { + return '$daysAgo абнаўлена'; + } + @override String get failedToLoad => 'Не атрымалася загрузіць'; diff --git a/lib/l10n/generated/featurebase_localizations_bg.dart b/lib/l10n/generated/featurebase_localizations_bg.dart index 6cb0d8a..f6cf113 100644 --- a/lib/l10n/generated/featurebase_localizations_bg.dart +++ b/lib/l10n/generated/featurebase_localizations_bg.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsBg extends FeaturebaseLocalizations { return 'Написано от $author'; } + @override + String lastUpdated(String daysAgo) { + return '$daysAgo дневно'; + } + @override String get failedToLoad => 'Грешка при зареждането'; diff --git a/lib/l10n/generated/featurebase_localizations_bo.dart b/lib/l10n/generated/featurebase_localizations_bo.dart index bbeecdd..8ce8a41 100644 --- a/lib/l10n/generated/featurebase_localizations_bo.dart +++ b/lib/l10n/generated/featurebase_localizations_bo.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsBo extends FeaturebaseLocalizations { return 'བྲིས། $author'; } + @override + String lastUpdated(String daysAgo) { + return 'སྤྱི་འགྲེལ་བྱེད་མ་ཐུབ། $daysAgo'; + } + @override String get failedToLoad => 'འཇུག་འདྲེན་བྱེད་མ་ཐུབ།'; diff --git a/lib/l10n/generated/featurebase_localizations_ca.dart b/lib/l10n/generated/featurebase_localizations_ca.dart index ebab27a..2396c1f 100644 --- a/lib/l10n/generated/featurebase_localizations_ca.dart +++ b/lib/l10n/generated/featurebase_localizations_ca.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsCa extends FeaturebaseLocalizations { return 'Escrit per $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Actualitzat fa $daysAgo'; + } + @override String get failedToLoad => 'No s\'ha pogut carregar'; diff --git a/lib/l10n/generated/featurebase_localizations_cs.dart b/lib/l10n/generated/featurebase_localizations_cs.dart index 6436205..ac0da1b 100644 --- a/lib/l10n/generated/featurebase_localizations_cs.dart +++ b/lib/l10n/generated/featurebase_localizations_cs.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsCs extends FeaturebaseLocalizations { return 'Napsal $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Aktualizováno $daysAgo'; + } + @override String get failedToLoad => 'Načítání selhalo'; diff --git a/lib/l10n/generated/featurebase_localizations_da.dart b/lib/l10n/generated/featurebase_localizations_da.dart index 9fb122c..61c9fb5 100644 --- a/lib/l10n/generated/featurebase_localizations_da.dart +++ b/lib/l10n/generated/featurebase_localizations_da.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsDa extends FeaturebaseLocalizations { return 'Skrevet af $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Sidst opdateret $daysAgo'; + } + @override String get failedToLoad => 'Kunne ikke indlæse'; diff --git a/lib/l10n/generated/featurebase_localizations_de.dart b/lib/l10n/generated/featurebase_localizations_de.dart index 1b9c30e..b82ee21 100644 --- a/lib/l10n/generated/featurebase_localizations_de.dart +++ b/lib/l10n/generated/featurebase_localizations_de.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsDe extends FeaturebaseLocalizations { return 'Geschrieben von $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Letzte Aktualisierung $daysAgo'; + } + @override String get failedToLoad => 'Laden fehlgeschlagen'; @@ -68,6 +73,11 @@ class FeaturebaseLocalizationsDeCh extends FeaturebaseLocalizationsDe { return 'Geschrieben von $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Zuletzt aktualisiert $daysAgo'; + } + @override String get failedToLoad => 'Laden fehlgeschlagen'; diff --git a/lib/l10n/generated/featurebase_localizations_el.dart b/lib/l10n/generated/featurebase_localizations_el.dart index 3916fad..ea4e562 100644 --- a/lib/l10n/generated/featurebase_localizations_el.dart +++ b/lib/l10n/generated/featurebase_localizations_el.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsEl extends FeaturebaseLocalizations { return 'Γραφτένο από $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Τελευταία ενημέρωση $daysAgo'; + } + @override String get failedToLoad => 'Αποτυχία φόρτωσης'; diff --git a/lib/l10n/generated/featurebase_localizations_en.dart b/lib/l10n/generated/featurebase_localizations_en.dart index 9896cd5..a0ff5cc 100644 --- a/lib/l10n/generated/featurebase_localizations_en.dart +++ b/lib/l10n/generated/featurebase_localizations_en.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsEn extends FeaturebaseLocalizations { return 'Written by $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Last updated $daysAgo'; + } + @override String get failedToLoad => 'Failed to load'; diff --git a/lib/l10n/generated/featurebase_localizations_es.dart b/lib/l10n/generated/featurebase_localizations_es.dart index 59b6b90..8027e88 100644 --- a/lib/l10n/generated/featurebase_localizations_es.dart +++ b/lib/l10n/generated/featurebase_localizations_es.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsEs extends FeaturebaseLocalizations { return 'Escrito por $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Última actualización $daysAgo'; + } + @override String get failedToLoad => 'Error al cargar'; @@ -68,6 +73,11 @@ class FeaturebaseLocalizationsEs419 extends FeaturebaseLocalizationsEs { return 'Escrito por $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Última actualización $daysAgo'; + } + @override String get failedToLoad => 'Error al cargar'; diff --git a/lib/l10n/generated/featurebase_localizations_fa.dart b/lib/l10n/generated/featurebase_localizations_fa.dart index 41ebf41..3d76487 100644 --- a/lib/l10n/generated/featurebase_localizations_fa.dart +++ b/lib/l10n/generated/featurebase_localizations_fa.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsFa extends FeaturebaseLocalizations { return 'نوشته شده توسط $author'; } + @override + String lastUpdated(String daysAgo) { + return 'آخرین به‌روزرسانی $daysAgo'; + } + @override String get failedToLoad => 'خطا در بارگذاری'; diff --git a/lib/l10n/generated/featurebase_localizations_fi.dart b/lib/l10n/generated/featurebase_localizations_fi.dart index 65df3e5..ac8c9d5 100644 --- a/lib/l10n/generated/featurebase_localizations_fi.dart +++ b/lib/l10n/generated/featurebase_localizations_fi.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsFi extends FeaturebaseLocalizations { return 'Kirjoitettu $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Päivitetty $daysAgo'; + } + @override String get failedToLoad => 'Lataus epäonnistui'; diff --git a/lib/l10n/generated/featurebase_localizations_fr.dart b/lib/l10n/generated/featurebase_localizations_fr.dart index 65d628c..d1b37a9 100644 --- a/lib/l10n/generated/featurebase_localizations_fr.dart +++ b/lib/l10n/generated/featurebase_localizations_fr.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsFr extends FeaturebaseLocalizations { return 'Rédigé par $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Dernière mise à jour $daysAgo'; + } + @override String get failedToLoad => 'Échec du chargement'; diff --git a/lib/l10n/generated/featurebase_localizations_gl.dart b/lib/l10n/generated/featurebase_localizations_gl.dart index 49ed65d..f373d94 100644 --- a/lib/l10n/generated/featurebase_localizations_gl.dart +++ b/lib/l10n/generated/featurebase_localizations_gl.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsGl extends FeaturebaseLocalizations { return 'Escrito por $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Última actualización $daysAgo'; + } + @override String get failedToLoad => 'Erro ao cargar'; diff --git a/lib/l10n/generated/featurebase_localizations_hi.dart b/lib/l10n/generated/featurebase_localizations_hi.dart index 22766f8..141e9bf 100644 --- a/lib/l10n/generated/featurebase_localizations_hi.dart +++ b/lib/l10n/generated/featurebase_localizations_hi.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsHi extends FeaturebaseLocalizations { return '$author द्वारा लिखित'; } + @override + String lastUpdated(String daysAgo) { + return 'अंतिम अपडेट $daysAgo'; + } + @override String get failedToLoad => 'लोड करने में विफल'; diff --git a/lib/l10n/generated/featurebase_localizations_hr.dart b/lib/l10n/generated/featurebase_localizations_hr.dart index fce2705..da2fb75 100644 --- a/lib/l10n/generated/featurebase_localizations_hr.dart +++ b/lib/l10n/generated/featurebase_localizations_hr.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsHr extends FeaturebaseLocalizations { return 'Napisao/la $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Zadnje ažurirano $daysAgo'; + } + @override String get failedToLoad => 'Neuspjelo učitavanje'; diff --git a/lib/l10n/generated/featurebase_localizations_hu.dart b/lib/l10n/generated/featurebase_localizations_hu.dart index 47fe632..2a2ef9c 100644 --- a/lib/l10n/generated/featurebase_localizations_hu.dart +++ b/lib/l10n/generated/featurebase_localizations_hu.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsHu extends FeaturebaseLocalizations { return 'Írta: $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Utoljára frissítve $daysAgo'; + } + @override String get failedToLoad => 'Betöltés sikertelen'; diff --git a/lib/l10n/generated/featurebase_localizations_id.dart b/lib/l10n/generated/featurebase_localizations_id.dart index be70ce4..b0522d3 100644 --- a/lib/l10n/generated/featurebase_localizations_id.dart +++ b/lib/l10n/generated/featurebase_localizations_id.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsId extends FeaturebaseLocalizations { return 'Ditulis oleh $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Terakhir diperbarui $daysAgo'; + } + @override String get failedToLoad => 'Gagal memuat'; diff --git a/lib/l10n/generated/featurebase_localizations_is.dart b/lib/l10n/generated/featurebase_localizations_is.dart index f932e22..9556d31 100644 --- a/lib/l10n/generated/featurebase_localizations_is.dart +++ b/lib/l10n/generated/featurebase_localizations_is.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsIs extends FeaturebaseLocalizations { return 'Höfundur: $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Síðasta uppfærsla $daysAgo'; + } + @override String get failedToLoad => 'Ekki tókst að hlaða'; diff --git a/lib/l10n/generated/featurebase_localizations_it.dart b/lib/l10n/generated/featurebase_localizations_it.dart index d78ee8e..313432e 100644 --- a/lib/l10n/generated/featurebase_localizations_it.dart +++ b/lib/l10n/generated/featurebase_localizations_it.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsIt extends FeaturebaseLocalizations { return 'Scritto da $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Ultimo aggiornamento $daysAgo'; + } + @override String get failedToLoad => 'Caricamento non riuscito'; diff --git a/lib/l10n/generated/featurebase_localizations_ja.dart b/lib/l10n/generated/featurebase_localizations_ja.dart index 0a5aea0..e8b9781 100644 --- a/lib/l10n/generated/featurebase_localizations_ja.dart +++ b/lib/l10n/generated/featurebase_localizations_ja.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsJa extends FeaturebaseLocalizations { return '著者: $author'; } + @override + String lastUpdated(String daysAgo) { + return '最終更新 $daysAgo'; + } + @override String get failedToLoad => '読み込みに失敗しました'; diff --git a/lib/l10n/generated/featurebase_localizations_ko.dart b/lib/l10n/generated/featurebase_localizations_ko.dart index 58e47bf..8807171 100644 --- a/lib/l10n/generated/featurebase_localizations_ko.dart +++ b/lib/l10n/generated/featurebase_localizations_ko.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsKo extends FeaturebaseLocalizations { return '$author 작성'; } + @override + String lastUpdated(String daysAgo) { + return '마지막 업데이트 $daysAgo'; + } + @override String get failedToLoad => '로드 실패'; diff --git a/lib/l10n/generated/featurebase_localizations_lt.dart b/lib/l10n/generated/featurebase_localizations_lt.dart index 1301f5a..7431c35 100644 --- a/lib/l10n/generated/featurebase_localizations_lt.dart +++ b/lib/l10n/generated/featurebase_localizations_lt.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsLt extends FeaturebaseLocalizations { return 'Autorius: $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Paskutinį kartą atnaujinta $daysAgo'; + } + @override String get failedToLoad => 'Nepavyko įkelti'; diff --git a/lib/l10n/generated/featurebase_localizations_lv.dart b/lib/l10n/generated/featurebase_localizations_lv.dart index 29d8997..6882c22 100644 --- a/lib/l10n/generated/featurebase_localizations_lv.dart +++ b/lib/l10n/generated/featurebase_localizations_lv.dart @@ -25,6 +25,11 @@ class FeaturebaseLocalizationsLv extends FeaturebaseLocalizations { return 'Autors: $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Pēdējā atjaunināšana $daysAgo'; + } + @override String get failedToLoad => 'Neizdevās ielādēt'; diff --git a/lib/l10n/generated/featurebase_localizations_ms.dart b/lib/l10n/generated/featurebase_localizations_ms.dart index 244816e..89f61ad 100644 --- a/lib/l10n/generated/featurebase_localizations_ms.dart +++ b/lib/l10n/generated/featurebase_localizations_ms.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsMs extends FeaturebaseLocalizations { return 'Ditulis oleh $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Diperbaharui $daysAgo'; + } + @override String get failedToLoad => 'Gagal dimuat'; diff --git a/lib/l10n/generated/featurebase_localizations_nb.dart b/lib/l10n/generated/featurebase_localizations_nb.dart index e705b58..e187c5a 100644 --- a/lib/l10n/generated/featurebase_localizations_nb.dart +++ b/lib/l10n/generated/featurebase_localizations_nb.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsNb extends FeaturebaseLocalizations { return 'Skrevet av $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Sist oppdatert $daysAgo'; + } + @override String get failedToLoad => 'Kunne ikke laste inn'; diff --git a/lib/l10n/generated/featurebase_localizations_nl.dart b/lib/l10n/generated/featurebase_localizations_nl.dart index 2f89770..1ea0dc4 100644 --- a/lib/l10n/generated/featurebase_localizations_nl.dart +++ b/lib/l10n/generated/featurebase_localizations_nl.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsNl extends FeaturebaseLocalizations { return 'Geschreven door $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Laatst bijgewerkt $daysAgo'; + } + @override String get failedToLoad => 'Laden mislukt'; diff --git a/lib/l10n/generated/featurebase_localizations_pl.dart b/lib/l10n/generated/featurebase_localizations_pl.dart index 4c65e2f..16eb70a 100644 --- a/lib/l10n/generated/featurebase_localizations_pl.dart +++ b/lib/l10n/generated/featurebase_localizations_pl.dart @@ -26,6 +26,11 @@ class FeaturebaseLocalizationsPl extends FeaturebaseLocalizations { return 'Napisane przez $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Ostatnia aktualizacja $daysAgo'; + } + @override String get failedToLoad => 'Nie udało się załadować'; diff --git a/lib/l10n/generated/featurebase_localizations_pt.dart b/lib/l10n/generated/featurebase_localizations_pt.dart index 7028925..291b27a 100644 --- a/lib/l10n/generated/featurebase_localizations_pt.dart +++ b/lib/l10n/generated/featurebase_localizations_pt.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsPt extends FeaturebaseLocalizations { return 'Escrito por $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Última atualização $daysAgo'; + } + @override String get failedToLoad => 'Falha ao carregar'; @@ -68,6 +73,11 @@ class FeaturebaseLocalizationsPtBr extends FeaturebaseLocalizationsPt { return 'Escrito por $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Última atualização $daysAgo'; + } + @override String get failedToLoad => 'Falha ao carregar'; diff --git a/lib/l10n/generated/featurebase_localizations_ro.dart b/lib/l10n/generated/featurebase_localizations_ro.dart index a6deeb4..ea281a5 100644 --- a/lib/l10n/generated/featurebase_localizations_ro.dart +++ b/lib/l10n/generated/featurebase_localizations_ro.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsRo extends FeaturebaseLocalizations { return 'Scris de $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Ultima actualizare $daysAgo'; + } + @override String get failedToLoad => 'Încărcare eșuată'; diff --git a/lib/l10n/generated/featurebase_localizations_ru.dart b/lib/l10n/generated/featurebase_localizations_ru.dart index cd57a2f..46d0795 100644 --- a/lib/l10n/generated/featurebase_localizations_ru.dart +++ b/lib/l10n/generated/featurebase_localizations_ru.dart @@ -26,6 +26,11 @@ class FeaturebaseLocalizationsRu extends FeaturebaseLocalizations { return 'Автор: $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Последнее обновление $daysAgo'; + } + @override String get failedToLoad => 'Не удалось загрузить'; diff --git a/lib/l10n/generated/featurebase_localizations_sk.dart b/lib/l10n/generated/featurebase_localizations_sk.dart index f6da206..58b6c43 100644 --- a/lib/l10n/generated/featurebase_localizations_sk.dart +++ b/lib/l10n/generated/featurebase_localizations_sk.dart @@ -25,6 +25,11 @@ class FeaturebaseLocalizationsSk extends FeaturebaseLocalizations { return 'Napísal $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Naposledy aktualizované $daysAgo'; + } + @override String get failedToLoad => 'Nepodarilo sa načítať'; diff --git a/lib/l10n/generated/featurebase_localizations_sl.dart b/lib/l10n/generated/featurebase_localizations_sl.dart index 887660f..7ca5e13 100644 --- a/lib/l10n/generated/featurebase_localizations_sl.dart +++ b/lib/l10n/generated/featurebase_localizations_sl.dart @@ -25,6 +25,11 @@ class FeaturebaseLocalizationsSl extends FeaturebaseLocalizations { return 'Avtor: $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Naposledy posodobljeno $daysAgo'; + } + @override String get failedToLoad => 'Napaka pri nalaganju'; diff --git a/lib/l10n/generated/featurebase_localizations_sr.dart b/lib/l10n/generated/featurebase_localizations_sr.dart index b3eaf44..42c46e4 100644 --- a/lib/l10n/generated/featurebase_localizations_sr.dart +++ b/lib/l10n/generated/featurebase_localizations_sr.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsSr extends FeaturebaseLocalizations { return 'Autor: $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Poslednja ažuriranja $daysAgo'; + } + @override String get failedToLoad => 'Učitavanje nije uspelo'; diff --git a/lib/l10n/generated/featurebase_localizations_sv.dart b/lib/l10n/generated/featurebase_localizations_sv.dart index 824b986..64fab19 100644 --- a/lib/l10n/generated/featurebase_localizations_sv.dart +++ b/lib/l10n/generated/featurebase_localizations_sv.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsSv extends FeaturebaseLocalizations { return 'Skriven av $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Senast uppdaterad $daysAgo'; + } + @override String get failedToLoad => 'Det gick inte att ladda'; diff --git a/lib/l10n/generated/featurebase_localizations_sw.dart b/lib/l10n/generated/featurebase_localizations_sw.dart index b34cf30..d5d9367 100644 --- a/lib/l10n/generated/featurebase_localizations_sw.dart +++ b/lib/l10n/generated/featurebase_localizations_sw.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsSw extends FeaturebaseLocalizations { return 'Imeandikwa na $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Mwisho wa kusafiri $daysAgo'; + } + @override String get failedToLoad => 'Imeshindwa kupakia'; diff --git a/lib/l10n/generated/featurebase_localizations_th.dart b/lib/l10n/generated/featurebase_localizations_th.dart index 3c5f7d2..a6e197b 100644 --- a/lib/l10n/generated/featurebase_localizations_th.dart +++ b/lib/l10n/generated/featurebase_localizations_th.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsTh extends FeaturebaseLocalizations { return 'เขียนโดย $author'; } + @override + String lastUpdated(String daysAgo) { + return 'อัพเดตล่าสุด $daysAgo'; + } + @override String get failedToLoad => 'โหลดไม่สำเร็จ'; diff --git a/lib/l10n/generated/featurebase_localizations_tr.dart b/lib/l10n/generated/featurebase_localizations_tr.dart index cfc4920..b593c35 100644 --- a/lib/l10n/generated/featurebase_localizations_tr.dart +++ b/lib/l10n/generated/featurebase_localizations_tr.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsTr extends FeaturebaseLocalizations { return '$author tarafından yazıldı'; } + @override + String lastUpdated(String daysAgo) { + return 'Son güncelleme $daysAgo'; + } + @override String get failedToLoad => 'Yüklenemedi'; diff --git a/lib/l10n/generated/featurebase_localizations_uk.dart b/lib/l10n/generated/featurebase_localizations_uk.dart index 04ba921..ad26a9e 100644 --- a/lib/l10n/generated/featurebase_localizations_uk.dart +++ b/lib/l10n/generated/featurebase_localizations_uk.dart @@ -26,6 +26,11 @@ class FeaturebaseLocalizationsUk extends FeaturebaseLocalizations { return 'Автор: $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Останнє оновлення $daysAgo'; + } + @override String get failedToLoad => 'Не вдалося завантажити'; diff --git a/lib/l10n/generated/featurebase_localizations_vi.dart b/lib/l10n/generated/featurebase_localizations_vi.dart index 3f91938..2debdf9 100644 --- a/lib/l10n/generated/featurebase_localizations_vi.dart +++ b/lib/l10n/generated/featurebase_localizations_vi.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsVi extends FeaturebaseLocalizations { return 'Viết bởi $author'; } + @override + String lastUpdated(String daysAgo) { + return 'Cập nhật lần cuối $daysAgo'; + } + @override String get failedToLoad => 'Không thể tải'; diff --git a/lib/l10n/generated/featurebase_localizations_zh.dart b/lib/l10n/generated/featurebase_localizations_zh.dart index 0a38ec1..3109426 100644 --- a/lib/l10n/generated/featurebase_localizations_zh.dart +++ b/lib/l10n/generated/featurebase_localizations_zh.dart @@ -24,6 +24,11 @@ class FeaturebaseLocalizationsZh extends FeaturebaseLocalizations { return '作者:$author'; } + @override + String lastUpdated(String daysAgo) { + return '最後更新 $daysAgo'; + } + @override String get failedToLoad => '載入失敗'; @@ -68,6 +73,11 @@ class FeaturebaseLocalizationsZhHans extends FeaturebaseLocalizationsZh { return '作者:$author'; } + @override + String lastUpdated(String daysAgo) { + return '最后更新 $daysAgo'; + } + @override String get failedToLoad => '加载失败'; @@ -112,6 +122,11 @@ class FeaturebaseLocalizationsZhHant extends FeaturebaseLocalizationsZh { return '作者:$author'; } + @override + String lastUpdated(String daysAgo) { + return '最後更新 $daysAgo'; + } + @override String get failedToLoad => '載入失敗'; @@ -156,6 +171,11 @@ class FeaturebaseLocalizationsZhTw extends FeaturebaseLocalizationsZh { return '作者:$author'; } + @override + String lastUpdated(String daysAgo) { + return '最後更新 $daysAgo'; + } + @override String get failedToLoad => '載入失敗'; diff --git a/lib/l10n/package_af.arb b/lib/l10n/package_af.arb index 5ba5600..8d17658 100644 --- a/lib/l10n/package_af.arb +++ b/lib/l10n/package_af.arb @@ -18,10 +18,16 @@ } } }, - "failedToLoad": "Kon nie laai nie", - "@failedToLoad": { - "description": "This is the error message that is displayed when the data fails to load." + "lastUpdated": "Gewysig deur {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 dae gelede" + } + } }, + "failedToLoad": "Kon nie laai nie", "tryAgainLater": "Probeer later weer", "@tryAgainLater": { "description": "This is the message that is displayed when the user should try again later." diff --git a/lib/l10n/package_ar.arb b/lib/l10n/package_ar.arb index ff01b2e..f61b75e 100644 --- a/lib/l10n/package_ar.arb +++ b/lib/l10n/package_ar.arb @@ -18,10 +18,16 @@ } } }, - "failedToLoad": "فشل التحميل", - "@failedToLoad": { - "description": "This is the error message that is displayed when the data fails to load." + "lastUpdated": "تم التحديث بواسطة {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 يوماً مضت" + } + } }, + "failedToLoad": "فشل التحميل", "tryAgainLater": "حاول مرة أخرى لاحقاً", "@tryAgainLater": { "description": "This is the message that is displayed when the user should try again later." diff --git a/lib/l10n/package_az.arb b/lib/l10n/package_az.arb index 93c7c10..c99e48a 100644 --- a/lib/l10n/package_az.arb +++ b/lib/l10n/package_az.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "{daysAgo} tarixində yeniləndi", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 gün ərzində" + } + } + }, "failedToLoad": "Yükləmək alınmadı", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_be.arb b/lib/l10n/package_be.arb index 5f69309..6d7518f 100644 --- a/lib/l10n/package_be.arb +++ b/lib/l10n/package_be.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "{daysAgo} абнаўлена", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 дзён таму" + } + } + }, "failedToLoad": "Не атрымалася загрузіць", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_bg.arb b/lib/l10n/package_bg.arb index 94b9bed..1b285f2 100644 --- a/lib/l10n/package_bg.arb +++ b/lib/l10n/package_bg.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "{daysAgo} дневно", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28" + } + } + }, "failedToLoad": "Грешка при зареждането", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_bo.arb b/lib/l10n/package_bo.arb index 180f1b0..0b8ff31 100644 --- a/lib/l10n/package_bo.arb +++ b/lib/l10n/package_bo.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "སྤྱི་འགྲེལ་བྱེད་མ་ཐུབ། {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 སྤྱི་འགྲེལ་བྱེད་མ་ཐུབ།" + } + } + }, "failedToLoad": "འཇུག་འདྲེན་བྱེད་མ་ཐུབ།", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_ca.arb b/lib/l10n/package_ca.arb index 878022a..16854ce 100644 --- a/lib/l10n/package_ca.arb +++ b/lib/l10n/package_ca.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Actualitzat fa {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28" + } + } + }, "failedToLoad": "No s'ha pogut carregar", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_cs.arb b/lib/l10n/package_cs.arb index f0c298b..cf30a42 100644 --- a/lib/l10n/package_cs.arb +++ b/lib/l10n/package_cs.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Aktualizováno {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28" + } + } + }, "failedToLoad": "Načítání selhalo", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_da.arb b/lib/l10n/package_da.arb index 695ec8a..4f19617 100644 --- a/lib/l10n/package_da.arb +++ b/lib/l10n/package_da.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Sidst opdateret {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28" + } + } + }, "failedToLoad": "Kunne ikke indlæse", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_de.arb b/lib/l10n/package_de.arb index 4cbce07..84982fb 100644 --- a/lib/l10n/package_de.arb +++ b/lib/l10n/package_de.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Letzte Aktualisierung {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 Tage" + } + } + }, "failedToLoad": "Laden fehlgeschlagen", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_de_CH.arb b/lib/l10n/package_de_CH.arb index 97176b5..542e05e 100644 --- a/lib/l10n/package_de_CH.arb +++ b/lib/l10n/package_de_CH.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Zuletzt aktualisiert {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28" + } + } + }, "failedToLoad": "Laden fehlgeschlagen", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_el.arb b/lib/l10n/package_el.arb index 0fbed4f..6acb7cd 100644 --- a/lib/l10n/package_el.arb +++ b/lib/l10n/package_el.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Τελευταία ενημέρωση {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28" + } + } + }, "failedToLoad": "Αποτυχία φόρτωσης", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_en.arb b/lib/l10n/package_en.arb index d638805..cdb1b0b 100644 --- a/lib/l10n/package_en.arb +++ b/lib/l10n/package_en.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Last updated {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 days ago" + } + } + }, "failedToLoad": "Failed to load", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_es.arb b/lib/l10n/package_es.arb index b187fca..b066f61 100644 --- a/lib/l10n/package_es.arb +++ b/lib/l10n/package_es.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Última actualización {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 días" + } + } + }, "failedToLoad": "Error al cargar", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_es_419.arb b/lib/l10n/package_es_419.arb index fb70835..4aebb17 100644 --- a/lib/l10n/package_es_419.arb +++ b/lib/l10n/package_es_419.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Última actualización {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28" + } + } + }, "failedToLoad": "Error al cargar", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_fa.arb b/lib/l10n/package_fa.arb index e576cd7..0c8a988 100644 --- a/lib/l10n/package_fa.arb +++ b/lib/l10n/package_fa.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "آخرین به‌روزرسانی {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28" + } + } + }, "failedToLoad": "خطا در بارگذاری", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_fi.arb b/lib/l10n/package_fi.arb index a08e6cf..9e766fe 100644 --- a/lib/l10n/package_fi.arb +++ b/lib/l10n/package_fi.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Päivitetty {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 päivää" + } + } + }, "failedToLoad": "Lataus epäonnistui", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_fr.arb b/lib/l10n/package_fr.arb index b380eaa..1f1bea1 100644 --- a/lib/l10n/package_fr.arb +++ b/lib/l10n/package_fr.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Dernière mise à jour {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 jours" + } + } + }, "failedToLoad": "Échec du chargement", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_gl.arb b/lib/l10n/package_gl.arb index 0b1df10..553bc76 100644 --- a/lib/l10n/package_gl.arb +++ b/lib/l10n/package_gl.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Última actualización {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 días" + } + } + }, "failedToLoad": "Erro ao cargar", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_hi.arb b/lib/l10n/package_hi.arb index 0d17da6..451b275 100644 --- a/lib/l10n/package_hi.arb +++ b/lib/l10n/package_hi.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "अंतिम अपडेट {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 दिन पहले" + } + } + }, "failedToLoad": "लोड करने में विफल", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_hr.arb b/lib/l10n/package_hr.arb index 004aad8..7000cea 100644 --- a/lib/l10n/package_hr.arb +++ b/lib/l10n/package_hr.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Zadnje ažurirano {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 days ago" + } + } + }, "failedToLoad": "Neuspjelo učitavanje", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_hu.arb b/lib/l10n/package_hu.arb index 0b47ad9..ef86460 100644 --- a/lib/l10n/package_hu.arb +++ b/lib/l10n/package_hu.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Utoljára frissítve {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 napja" + } + } + }, "failedToLoad": "Betöltés sikertelen", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_id.arb b/lib/l10n/package_id.arb index b999b6a..8bf0275 100644 --- a/lib/l10n/package_id.arb +++ b/lib/l10n/package_id.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Terakhir diperbarui {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 hari" + } + } + }, "failedToLoad": "Gagal memuat", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_is.arb b/lib/l10n/package_is.arb index dfdc789..f45f2e5 100644 --- a/lib/l10n/package_is.arb +++ b/lib/l10n/package_is.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Síðasta uppfærsla {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 dagar" + } + } + }, "failedToLoad": "Ekki tókst að hlaða", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_it.arb b/lib/l10n/package_it.arb index 857ce7a..257aadf 100644 --- a/lib/l10n/package_it.arb +++ b/lib/l10n/package_it.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Ultimo aggiornamento {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 giorni" + } + } + }, "failedToLoad": "Caricamento non riuscito", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_ja.arb b/lib/l10n/package_ja.arb index 381c472..dbe62a6 100644 --- a/lib/l10n/package_ja.arb +++ b/lib/l10n/package_ja.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "最終更新 {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 日" + } + } + }, "failedToLoad": "読み込みに失敗しました", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_ko.arb b/lib/l10n/package_ko.arb index 4aa5ec3..d01d849 100644 --- a/lib/l10n/package_ko.arb +++ b/lib/l10n/package_ko.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "마지막 업데이트 {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 일" + } + } + }, "failedToLoad": "로드 실패", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_lt.arb b/lib/l10n/package_lt.arb index 2ba2089..10b0941 100644 --- a/lib/l10n/package_lt.arb +++ b/lib/l10n/package_lt.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Paskutinį kartą atnaujinta {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 dienų" + } + } + }, "failedToLoad": "Nepavyko įkelti", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_lv.arb b/lib/l10n/package_lv.arb index f2f9699..e3dbdbf 100644 --- a/lib/l10n/package_lv.arb +++ b/lib/l10n/package_lv.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Pēdējā atjaunināšana {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 dienām" + } + } + }, "failedToLoad": "Neizdevās ielādēt", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_ms.arb b/lib/l10n/package_ms.arb index 8e9e9dc..c92078d 100644 --- a/lib/l10n/package_ms.arb +++ b/lib/l10n/package_ms.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Diperbaharui {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 hari" + } + } + }, "failedToLoad": "Gagal dimuat", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_nb.arb b/lib/l10n/package_nb.arb index e0b8a14..d94ff03 100644 --- a/lib/l10n/package_nb.arb +++ b/lib/l10n/package_nb.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Sist oppdatert {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 dager" + } + } + }, "failedToLoad": "Kunne ikke laste inn", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_nl.arb b/lib/l10n/package_nl.arb index e46d3c3..5528038 100644 --- a/lib/l10n/package_nl.arb +++ b/lib/l10n/package_nl.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Laatst bijgewerkt {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 dagen" + } + } + }, "failedToLoad": "Laden mislukt", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_pl.arb b/lib/l10n/package_pl.arb index 49ca235..a462ce8 100644 --- a/lib/l10n/package_pl.arb +++ b/lib/l10n/package_pl.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Ostatnia aktualizacja {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 dni temu" + } + } + }, "failedToLoad": "Nie udało się załadować", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_pt.arb b/lib/l10n/package_pt.arb index bc7823f..1da95e6 100644 --- a/lib/l10n/package_pt.arb +++ b/lib/l10n/package_pt.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Última atualização {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 dias" + } + } + }, "failedToLoad": "Falha ao carregar", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_pt_BR.arb b/lib/l10n/package_pt_BR.arb index 0cfc673..ed4780d 100644 --- a/lib/l10n/package_pt_BR.arb +++ b/lib/l10n/package_pt_BR.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Última atualização {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 dias" + } + } + }, "failedToLoad": "Falha ao carregar", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_ro.arb b/lib/l10n/package_ro.arb index 257d350..798e154 100644 --- a/lib/l10n/package_ro.arb +++ b/lib/l10n/package_ro.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Ultima actualizare {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 zile" + } + } + }, "failedToLoad": "Încărcare eșuată", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_ru.arb b/lib/l10n/package_ru.arb index 5ab4379..d2b3208 100644 --- a/lib/l10n/package_ru.arb +++ b/lib/l10n/package_ru.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Последнее обновление {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 дней" + } + } + }, "failedToLoad": "Не удалось загрузить", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_sk.arb b/lib/l10n/package_sk.arb index 7dbfa2f..9f6249c 100644 --- a/lib/l10n/package_sk.arb +++ b/lib/l10n/package_sk.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Naposledy aktualizované {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 dní" + } + } + }, "failedToLoad": "Nepodarilo sa načítať", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_sl.arb b/lib/l10n/package_sl.arb index 49c1821..65466b5 100644 --- a/lib/l10n/package_sl.arb +++ b/lib/l10n/package_sl.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Naposledy posodobljeno {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 dni" + } + } + }, "failedToLoad": "Napaka pri nalaganju", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_sr.arb b/lib/l10n/package_sr.arb index 27afddc..4cd5bb4 100644 --- a/lib/l10n/package_sr.arb +++ b/lib/l10n/package_sr.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Poslednja ažuriranja {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 dana" + } + } + }, "failedToLoad": "Učitavanje nije uspelo", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_sv.arb b/lib/l10n/package_sv.arb index 381ac99..e7b9c95 100644 --- a/lib/l10n/package_sv.arb +++ b/lib/l10n/package_sv.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Senast uppdaterad {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 dagar" + } + } + }, "failedToLoad": "Det gick inte att ladda", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_sw.arb b/lib/l10n/package_sw.arb index dea909f..ebe77c0 100644 --- a/lib/l10n/package_sw.arb +++ b/lib/l10n/package_sw.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Mwisho wa kusafiri {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 miaka" + } + } + }, "failedToLoad": "Imeshindwa kupakia", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_th.arb b/lib/l10n/package_th.arb index 563f3d6..6835be8 100644 --- a/lib/l10n/package_th.arb +++ b/lib/l10n/package_th.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "อัพเดตล่าสุด {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 วันที่ผ่านมา" + } + } + }, "failedToLoad": "โหลดไม่สำเร็จ", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_tr.arb b/lib/l10n/package_tr.arb index 67371b0..47626f1 100644 --- a/lib/l10n/package_tr.arb +++ b/lib/l10n/package_tr.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Son güncelleme {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 gün" + } + } + }, "failedToLoad": "Yüklenemedi", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_uk.arb b/lib/l10n/package_uk.arb index 913d907..648a78b 100644 --- a/lib/l10n/package_uk.arb +++ b/lib/l10n/package_uk.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Останнє оновлення {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 днів" + } + } + }, "failedToLoad": "Не вдалося завантажити", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_vi.arb b/lib/l10n/package_vi.arb index 2e607ec..48425e1 100644 --- a/lib/l10n/package_vi.arb +++ b/lib/l10n/package_vi.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "Cập nhật lần cuối {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 ngày" + } + } + }, "failedToLoad": "Không thể tải", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_zh.arb b/lib/l10n/package_zh.arb index a239bd4..51009e9 100644 --- a/lib/l10n/package_zh.arb +++ b/lib/l10n/package_zh.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "最後更新 {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 天" + } + } + }, "failedToLoad": "載入失敗", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_zh_Hans.arb b/lib/l10n/package_zh_Hans.arb index 7618eea..7d3173b 100644 --- a/lib/l10n/package_zh_Hans.arb +++ b/lib/l10n/package_zh_Hans.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "最后更新 {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 天" + } + } + }, "failedToLoad": "加载失败", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_zh_Hant.arb b/lib/l10n/package_zh_Hant.arb index f72d0ef..3c7f55c 100644 --- a/lib/l10n/package_zh_Hant.arb +++ b/lib/l10n/package_zh_Hant.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "最後更新 {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 天" + } + } + }, "failedToLoad": "載入失敗", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/l10n/package_zh_TW.arb b/lib/l10n/package_zh_TW.arb index bc36313..8ccf839 100644 --- a/lib/l10n/package_zh_TW.arb +++ b/lib/l10n/package_zh_TW.arb @@ -18,6 +18,15 @@ } } }, + "lastUpdated": "最後更新 {daysAgo}", + "@lastUpdated": { + "placeholders": { + "daysAgo": { + "type": "String", + "example": "28 天" + } + } + }, "failedToLoad": "載入失敗", "@failedToLoad": { "description": "This is the error message that is displayed when the data fails to load." diff --git a/lib/ui/changelog/changelog.dart b/lib/ui/changelog/changelog.dart index 53587fa..a7a4a44 100644 --- a/lib/ui/changelog/changelog.dart +++ b/lib/ui/changelog/changelog.dart @@ -54,6 +54,7 @@ class _ChangelogViewState extends ConsumerState { currentLocale = widget.defaultLocale; initializeDateFormatting(currentLocale.languageCode); _fbService.setup(widget.organizationName, widget.enableHapticFeedback); + _setupTimeAgo(); } @override diff --git a/lib/ui/help_center/article/article.dart b/lib/ui/help_center/article/article.dart index bb712e5..b4d9a7a 100644 --- a/lib/ui/help_center/article/article.dart +++ b/lib/ui/help_center/article/article.dart @@ -3,14 +3,12 @@ part of featurebase; class _ArticleView extends ConsumerStatefulWidget { final fb.Article article; final Color textColor; - final bool hideAuthors; final Locale locale; const _ArticleView({ // ignore: unused_element super.key, required this.article, required this.textColor, - required this.hideAuthors, required this.locale, }); @@ -58,29 +56,56 @@ class _ArticleViewState extends ConsumerState<_ArticleView> { ), textAlign: TextAlign.start, ), - if (!widget.hideAuthors) const SizedBox(height: 15), - if (!widget.hideAuthors) + if (widget.article.author != null && + widget.article.createdAt != null) + const SizedBox(height: 15), + if (widget.article.author != null && + widget.article.createdAt != null) Row( children: [ - ClipRRect( - borderRadius: BorderRadius.circular(40), - child: _SafeCachedNetworkImage( - imageUrl: widget.article.author.avatarUrl, - height: 40, - width: 40, + if (widget.article.author != null) + ClipRRect( + borderRadius: BorderRadius.circular(40), + child: _SafeCachedNetworkImage( + imageUrl: widget.article.author!.avatarUrl, + height: 40, + width: 40, + ), ), - ), - const SizedBox(width: 10), + if (widget.article.author != null) + const SizedBox(width: 10), Expanded( - child: Text( - FeaturebaseLocalizations.of(context) - .writtenBy(widget.article.author.name), - style: TextStyle( - fontSize: 14, - fontFamily: 'Inter', - fontWeight: FontWeight.w600, - color: widget.textColor.withOpacity(0.7), - ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (widget.article.author != null) + Text( + FeaturebaseLocalizations.of(context) + .writtenBy(widget.article.author!.name), + style: TextStyle( + fontSize: 14, + fontFamily: 'Inter', + fontWeight: FontWeight.w600, + color: widget.textColor.withOpacity(0.7), + ), + ), + if (widget.article.updatedAt != null) + Text( + FeaturebaseLocalizations.of(context) + .lastUpdated(timeago.format( + widget.article.updatedAt!, + locale: + FeaturebaseLocalizations.of(context) + .localeName, + )), + style: TextStyle( + fontSize: 14, + fontFamily: 'Inter', + fontWeight: FontWeight.w600, + color: widget.textColor.withOpacity(0.7), + ), + ), + ], ), ), ], @@ -98,7 +123,6 @@ class _ArticleViewState extends ConsumerState<_ArticleView> { locale: widget.locale, textColor: widget.textColor, renderMode: RenderMode.sliverList, - hideAuthors: widget.hideAuthors, ), ), error: (error, stackTrace) => SliverToBoxAdapter( diff --git a/lib/ui/help_center/collection/collection.dart b/lib/ui/help_center/collection/collection.dart index 5c06f2d..16eac45 100644 --- a/lib/ui/help_center/collection/collection.dart +++ b/lib/ui/help_center/collection/collection.dart @@ -3,14 +3,12 @@ part of featurebase; class _CollectionView extends StatefulWidget { final fb.Collection collection; final Color textColor; - final bool hideAuthors; final Locale locale; const _CollectionView({ // ignore: unused_element super.key, required this.collection, required this.textColor, - required this.hideAuthors, required this.locale, }); @@ -143,7 +141,6 @@ class _CollectionViewState extends State<_CollectionView> { builder: (context) => _ArticleView( article: article, textColor: widget.textColor, - hideAuthors: widget.hideAuthors, locale: widget.locale, ), ), @@ -269,7 +266,6 @@ class _CollectionViewState extends State<_CollectionView> { builder: (context) => _ArticleView( article: article, textColor: widget.textColor, - hideAuthors: widget.hideAuthors, locale: widget.locale, ), ), diff --git a/lib/ui/help_center/help_center.dart b/lib/ui/help_center/help_center.dart index 5eb1964..f1a9b39 100644 --- a/lib/ui/help_center/help_center.dart +++ b/lib/ui/help_center/help_center.dart @@ -19,9 +19,6 @@ class HelpCenterView extends ConsumerStatefulWidget { /// Search fill color final Color? searchFillColor; - /// Hide Authors - final bool hideAuthors; - /// Show Search Bar final bool showSearchBar; @@ -38,7 +35,6 @@ class HelpCenterView extends ConsumerStatefulWidget { required this.primaryColor, this.textColor = Colors.black, this.backgroundColor, - this.hideAuthors = false, this.defaultLocale = const Locale('en'), this.showSearchBar = true, this.searchFillColor, @@ -68,6 +64,7 @@ class _HelpCenterViewState extends ConsumerState { void initState() { currentLocale = widget.defaultLocale; _fbService.setup(widget.organizationName, widget.enableHapticFeedback); + _setupTimeAgo(); super.initState(); } @@ -186,7 +183,8 @@ class _HelpCenterViewState extends ConsumerState { helpCenter: data, textColor: widget.textColor, primaryColor: widget.primaryColor, - hideAuthors: widget.hideAuthors, + hideAuthors: data.hideAuthorInfo, + hideDate: data.hideDateInfo, locale: currentLocale, helpCenterContext: _helpCenterNavigatorKey.currentContext!, @@ -331,7 +329,6 @@ class _HelpCenterViewState extends ConsumerState { builder: (context) => _ArticleView( article: p0.item!, textColor: widget.textColor, - hideAuthors: widget.hideAuthors, locale: widget.defaultLocale, ), ), @@ -388,7 +385,7 @@ class _HelpCenterViewState extends ConsumerState { child: _CollectionCard( collection: collection, textColor: widget.textColor, - hideAuthors: widget.hideAuthors, + hideAuthors: data.hideAuthorInfo, locale: widget.defaultLocale, ), ); diff --git a/lib/ui/help_center/widgets/collection_card.dart b/lib/ui/help_center/widgets/collection_card.dart index 1e5df2a..43f3a25 100644 --- a/lib/ui/help_center/widgets/collection_card.dart +++ b/lib/ui/help_center/widgets/collection_card.dart @@ -25,7 +25,6 @@ class _CollectionCard extends StatelessWidget { builder: (context) => _CollectionView( collection: collection, textColor: textColor, - hideAuthors: hideAuthors, locale: locale, ), ), @@ -83,11 +82,12 @@ class _CollectionCard extends StatelessWidget { const SizedBox(height: 6), Row( children: [ - if (!hideAuthors) + if (!hideAuthors && collection.authors != null) _AuthorsImageStack( - authors: collection.authors, + authors: collection.authors!, ), - if (!hideAuthors) const SizedBox(width: 2), + if (!hideAuthors && collection.authors != null) + const SizedBox(width: 2), StyledText( text: FeaturebaseLocalizations.of(context).countArticles( collection.structure?.length ?? 0, diff --git a/lib/ui/help_center/widgets/navbar_expanding_collection.dart b/lib/ui/help_center/widgets/navbar_expanding_collection.dart index d847318..51e52e0 100644 --- a/lib/ui/help_center/widgets/navbar_expanding_collection.dart +++ b/lib/ui/help_center/widgets/navbar_expanding_collection.dart @@ -4,12 +4,14 @@ class _NavbarExpandingCollection extends StatefulWidget { final fb.Collection collection; final Color textColor; final bool hideAuthors; + final bool hideDate; final Locale locale; final BuildContext helpCenterContext; const _NavbarExpandingCollection({ required this.collection, required this.textColor, required this.hideAuthors, + required this.hideDate, required this.locale, required this.helpCenterContext, }); @@ -91,7 +93,6 @@ class _NavbarExpandingCollectionState builder: (context) => _ArticleView( article: article, textColor: widget.textColor, - hideAuthors: widget.hideAuthors, locale: widget.locale, ), ), @@ -150,7 +151,6 @@ class _NavbarExpandingCollectionState builder: (context) => _CollectionView( collection: collection, textColor: widget.textColor, - hideAuthors: widget.hideAuthors, locale: widget.locale, ), ), diff --git a/lib/ui/help_center/widgets/navbar_popup.dart b/lib/ui/help_center/widgets/navbar_popup.dart index 3a03f87..b2fd2bd 100644 --- a/lib/ui/help_center/widgets/navbar_popup.dart +++ b/lib/ui/help_center/widgets/navbar_popup.dart @@ -5,6 +5,7 @@ class _NavbarPopupWidget extends ConsumerWidget { final Color textColor; final Color primaryColor; final bool hideAuthors; + final bool hideDate; final Locale locale; final BuildContext helpCenterContext; final Function(Locale) onLocaleChange; @@ -13,6 +14,7 @@ class _NavbarPopupWidget extends ConsumerWidget { required this.textColor, required this.primaryColor, required this.hideAuthors, + required this.hideDate, required this.locale, required this.helpCenterContext, required this.onLocaleChange, @@ -60,6 +62,7 @@ class _NavbarPopupWidget extends ConsumerWidget { collection: collection, textColor: textColor, hideAuthors: hideAuthors, + hideDate: hideDate, locale: locale, helpCenterContext: helpCenterContext, ); diff --git a/lib/ui/widgets/render_html_widget.dart b/lib/ui/widgets/render_html_widget.dart index c920b92..3e18cca 100644 --- a/lib/ui/widgets/render_html_widget.dart +++ b/lib/ui/widgets/render_html_widget.dart @@ -5,14 +5,12 @@ class _RenderHtmlWidget extends ConsumerWidget { final RenderMode renderMode; final Locale locale; final Color textColor; - final bool hideAuthors; const _RenderHtmlWidget({ required this.html, this.renderMode = RenderMode.sliverList, required this.locale, required this.textColor, - this.hideAuthors = false, }); @override @@ -38,7 +36,6 @@ class _RenderHtmlWidget extends ConsumerWidget { builder: (context) => _ArticleView( article: temp, textColor: textColor, - hideAuthors: hideAuthors, locale: locale, ), ), diff --git a/lib/utils.dart b/lib/utils.dart index 17ce460..c84c749 100644 --- a/lib/utils.dart +++ b/lib/utils.dart @@ -183,6 +183,37 @@ _callHaptic() { } } +_setupTimeAgo() { + timeago.setLocaleMessages('en', timeago.EnMessages()); + timeago.setLocaleMessages('nl', timeago.NlMessages()); + timeago.setLocaleMessages('bn', timeago.BnMessages()); + timeago.setLocaleMessages('bs', timeago.BsMessages()); + timeago.setLocaleMessages('pt_BR', timeago.PtBrMessages()); + timeago.setLocaleMessages('ca', timeago.CaMessages()); + timeago.setLocaleMessages('cs', timeago.CsMessages()); + timeago.setLocaleMessages('da', timeago.DaMessages()); + timeago.setLocaleMessages('de', timeago.DeMessages()); + timeago.setLocaleMessages('hi', timeago.HiMessages()); + timeago.setLocaleMessages('hu', timeago.HuMessages()); + timeago.setLocaleMessages('id', timeago.IdMessages()); + timeago.setLocaleMessages('it', timeago.ItMessages()); + timeago.setLocaleMessages('ja', timeago.JaMessages()); + timeago.setLocaleMessages('ko', timeago.KoMessages()); + timeago.setLocaleMessages('lv', timeago.LvMessages()); + timeago.setLocaleMessages('mn', timeago.MnMessages()); + timeago.setLocaleMessages('pl', timeago.PlMessages()); + timeago.setLocaleMessages('ro', timeago.RoMessages()); + timeago.setLocaleMessages('ru', timeago.RuMessages()); + timeago.setLocaleMessages('sr', timeago.SrMessages()); + timeago.setLocaleMessages('es', timeago.EsMessages()); + timeago.setLocaleMessages('sv', timeago.SvMessages()); + timeago.setLocaleMessages('th', timeago.ThMessages()); + timeago.setLocaleMessages('tr', timeago.TrMessages()); + timeago.setLocaleMessages('uk', timeago.UkMessages()); + timeago.setLocaleMessages('vi', timeago.ViMessages()); + timeago.setLocaleMessages('zh_CN', timeago.ZhCnMessages()); +} + String _stripHtmlTags(String htmlString) { return htmlString.replaceAll(RegExp(r'<[^>]*>'), ''); } diff --git a/pubspec.yaml b/pubspec.yaml index 9904665..472c2a8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: featurebase description: "Featurebase Unofficial Flutter SDK" -version: 0.8.0 +version: 0.8.1 homepage: https://github.com/ae1dev/flutter_featurebase platforms: @@ -39,6 +39,7 @@ dependencies: searchfield: ^1.2.2 easy_infinite_pagination: ^0.0.6 universal_io: ^2.2.2 + timeago: ^3.7.0 collection: ^1.18.0 copy_with_extension: ^6.0.0 share_plus: ^10.1.4