From 9ddce751f2dd11404a4f54eb545178f74d08682f Mon Sep 17 00:00:00 2001 From: Arenukvern Date: Wed, 6 Mar 2024 05:45:14 +0200 Subject: [PATCH 1/7] wip: changelog as note --- Makefile | 5 + lib/home/home_screen.dart | 2 +- lib/home/project_view.dart | 3 + lib/home/tags/tags_screen.dart | 4 +- lib/home/widgets/project_tile.dart | 12 +- lib/note/note_view_bloc.dart | 2 +- .../src/data_models/data_models.freezed.dart | 426 +++++++++++++++++- .../lib/src/data_models/data_models.g.dart | 33 ++ .../core/lib/src/data_models/project.dart | 38 +- .../projects_repository.dart | 9 +- .../local_hive/hive_models.g.dart | 1 + packages/core/lib/src/router_paths.dart | 1 + .../src/state/opened_project_notifier.dart | 4 + 13 files changed, 521 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index a67bde5d..37798d1a 100644 --- a/Makefile +++ b/Makefile @@ -43,3 +43,8 @@ build-google-play: fvm flutter build appbundle --dart-define-from-file=configs/envs/prod.json --dart-define=STORE=googlePlay -t lib/main_prod.dart build-rustore: fvm flutter build apk --dart-define-from-file=configs/envs/prod.json --dart-define=STORE=rustore -t lib/main_prod.dart +# pass +# as argument: make v="3.19." run +# or be defined as environment: wid="" wis="" v="3.19." make run build-snap +deploy-snap: + snapcraft upload --release=edge last-answer_$(v)_arm64.snap \ No newline at end of file diff --git a/lib/home/home_screen.dart b/lib/home/home_screen.dart index 04c415ec..7269a249 100644 --- a/lib/home/home_screen.dart +++ b/lib/home/home_screen.dart @@ -233,7 +233,7 @@ class _ProjectsListView extends StatelessWidget { onRemove: (final _) async { final shouldProceed = await showRemoveTitleDialog( context: context, - title: item.title, + title: item.getTitle(context), ); if (shouldProceed) { projectsNotifier.deleteProject(item); diff --git a/lib/home/project_view.dart b/lib/home/project_view.dart index 4924394e..f87c995d 100644 --- a/lib/home/project_view.dart +++ b/lib/home/project_view.dart @@ -3,6 +3,7 @@ import 'package:lastanswer/common_imports.dart'; import 'package:lastanswer/home/project_widgets/project_widgets.dart'; import 'package:lastanswer/idea/idea_view.dart'; import 'package:lastanswer/note/note_view.dart'; +import 'package:lastanswer/settings/views/changelog_view.dart'; class ProjectView extends StatelessWidget { const ProjectView({super.key}); @@ -27,6 +28,8 @@ class ProjectView extends StatelessWidget { Expanded(child: NoteView(note: note, key: ValueKey(id))), ], ), + // TODO(arenukvern): description, + changelog: (final changelog) => const ChangelogView(), ); } } diff --git a/lib/home/tags/tags_screen.dart b/lib/home/tags/tags_screen.dart index eec0f7da..e4090494 100644 --- a/lib/home/tags/tags_screen.dart +++ b/lib/home/tags/tags_screen.dart @@ -268,7 +268,7 @@ class SelectableProjectListTile extends StatelessWidget { final void Function(bool isSelected, ProjectModel project) onTap; @override Widget build(final BuildContext context) => ListTile( - title: Text(project.title), + title: Text(project.getTitle(context)), selected: selected, trailing: Icon( Icons.check, @@ -290,7 +290,7 @@ class ClosableProjectListTile extends StatelessWidget { final ValueChanged onDelete; @override Widget build(final BuildContext context) => ListTile( - title: Text(project.title, maxLines: 2), + title: Text(project.getTitle(context), maxLines: 2), trailing: IconButton( iconSize: 16, onPressed: () => onDelete(project), diff --git a/lib/home/widgets/project_tile.dart b/lib/home/widgets/project_tile.dart index 6641b991..06858eb8 100644 --- a/lib/home/widgets/project_tile.dart +++ b/lib/home/widgets/project_tile.dart @@ -19,7 +19,7 @@ class ProjectTile extends StatelessWidget { final ValueChanged onTap; final ValueChanged onRemove; - String createTitle() => project.title; + String createTitle(final BuildContext context) => project.getTitle(context); @override Widget build(final BuildContext context) { @@ -34,6 +34,14 @@ class ProjectTile extends StatelessWidget { color: theme.colorScheme.primary.withOpacity(0.5), ), ), + changelog: (final changelog) => SizedBox.square( + dimension: 14, + child: Icon( + Icons.newspaper, + size: 12.5, + color: theme.colorScheme.primary.withOpacity(0.5), + ), + ), note: (final note) => SizedBox.square( dimension: 14, child: Icon( @@ -64,7 +72,7 @@ class ProjectTile extends StatelessWidget { id: project.id.value, type: HeroIdTypes.projectTitle, child: Text( - ' ${createTitle()}', + ' ${createTitle(context)}', overflow: TextOverflow.ellipsis, maxLines: 4, ), diff --git a/lib/note/note_view_bloc.dart b/lib/note/note_view_bloc.dart index 5b14fb7b..27cb76a5 100644 --- a/lib/note/note_view_bloc.dart +++ b/lib/note/note_view_bloc.dart @@ -55,7 +55,7 @@ class NoteViewBloc extends ValueNotifier { Future onRemove(final BuildContext context) async { final remove = await showRemoveTitleDialog( - title: note.title, + title: note.getTitle(context), context: context, ); if (!remove) return; diff --git a/packages/core/lib/src/data_models/data_models.freezed.dart b/packages/core/lib/src/data_models/data_models.freezed.dart index de21f671..f88e107d 100644 --- a/packages/core/lib/src/data_models/data_models.freezed.dart +++ b/packages/core/lib/src/data_models/data_models.freezed.dart @@ -250,6 +250,8 @@ ProjectModel _$ProjectModelFromJson(Map json) { return ProjectModelIdea.fromJson(json); case 'note': return ProjectModelNote.fromJson(json); + case 'changelog': + return ProjectModelChangelog.fromJson(json); default: throw CheckedFromJsonException(json, 'runtimeType', 'ProjectModel', @@ -263,7 +265,6 @@ mixin _$ProjectModel { DateTime get createdAt => throw _privateConstructorUsedError; DateTime get updatedAt => throw _privateConstructorUsedError; ProjectTypes get type => throw _privateConstructorUsedError; - DateTime? get archivedAt => throw _privateConstructorUsedError; List get tagsIds => throw _privateConstructorUsedError; @optionalTypeArgs TResult when({ @@ -288,6 +289,14 @@ mixin _$ProjectModel { DateTime? archivedAt, List tagsIds) note, + required TResult Function( + DateTime createdAt, + DateTime updatedAt, + LocalizedTextModel title, + ProjectModelId id, + ProjectTypes type, + List tagsIds) + changelog, }) => throw _privateConstructorUsedError; @optionalTypeArgs @@ -313,6 +322,14 @@ mixin _$ProjectModel { DateTime? archivedAt, List tagsIds)? note, + TResult? Function( + DateTime createdAt, + DateTime updatedAt, + LocalizedTextModel title, + ProjectModelId id, + ProjectTypes type, + List tagsIds)? + changelog, }) => throw _privateConstructorUsedError; @optionalTypeArgs @@ -338,6 +355,14 @@ mixin _$ProjectModel { DateTime? archivedAt, List tagsIds)? note, + TResult Function( + DateTime createdAt, + DateTime updatedAt, + LocalizedTextModel title, + ProjectModelId id, + ProjectTypes type, + List tagsIds)? + changelog, required TResult orElse(), }) => throw _privateConstructorUsedError; @@ -345,18 +370,21 @@ mixin _$ProjectModel { TResult map({ required TResult Function(ProjectModelIdea value) idea, required TResult Function(ProjectModelNote value) note, + required TResult Function(ProjectModelChangelog value) changelog, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? mapOrNull({ TResult? Function(ProjectModelIdea value)? idea, TResult? Function(ProjectModelNote value)? note, + TResult? Function(ProjectModelChangelog value)? changelog, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeMap({ TResult Function(ProjectModelIdea value)? idea, TResult Function(ProjectModelNote value)? note, + TResult Function(ProjectModelChangelog value)? changelog, required TResult orElse(), }) => throw _privateConstructorUsedError; @@ -377,7 +405,6 @@ abstract class $ProjectModelCopyWith<$Res> { DateTime createdAt, DateTime updatedAt, ProjectTypes type, - DateTime? archivedAt, List tagsIds}); } @@ -398,7 +425,6 @@ class _$ProjectModelCopyWithImpl<$Res, $Val extends ProjectModel> Object? createdAt = null, Object? updatedAt = null, Object? type = null, - Object? archivedAt = freezed, Object? tagsIds = null, }) { return _then(_value.copyWith( @@ -418,10 +444,6 @@ class _$ProjectModelCopyWithImpl<$Res, $Val extends ProjectModel> ? _value.type : type // ignore: cast_nullable_to_non_nullable as ProjectTypes, - archivedAt: freezed == archivedAt - ? _value.archivedAt - : archivedAt // ignore: cast_nullable_to_non_nullable - as DateTime?, tagsIds: null == tagsIds ? _value.tagsIds : tagsIds // ignore: cast_nullable_to_non_nullable @@ -655,6 +677,14 @@ class _$ProjectModelIdeaImpl extends ProjectModelIdea { DateTime? archivedAt, List tagsIds) note, + required TResult Function( + DateTime createdAt, + DateTime updatedAt, + LocalizedTextModel title, + ProjectModelId id, + ProjectTypes type, + List tagsIds) + changelog, }) { return idea(id, createdAt, updatedAt, title, type, archivedAt, answers, draftAnswer, tagsIds); @@ -684,6 +714,14 @@ class _$ProjectModelIdeaImpl extends ProjectModelIdea { DateTime? archivedAt, List tagsIds)? note, + TResult? Function( + DateTime createdAt, + DateTime updatedAt, + LocalizedTextModel title, + ProjectModelId id, + ProjectTypes type, + List tagsIds)? + changelog, }) { return idea?.call(id, createdAt, updatedAt, title, type, archivedAt, answers, draftAnswer, tagsIds); @@ -713,6 +751,14 @@ class _$ProjectModelIdeaImpl extends ProjectModelIdea { DateTime? archivedAt, List tagsIds)? note, + TResult Function( + DateTime createdAt, + DateTime updatedAt, + LocalizedTextModel title, + ProjectModelId id, + ProjectTypes type, + List tagsIds)? + changelog, required TResult orElse(), }) { if (idea != null) { @@ -727,6 +773,7 @@ class _$ProjectModelIdeaImpl extends ProjectModelIdea { TResult map({ required TResult Function(ProjectModelIdea value) idea, required TResult Function(ProjectModelNote value) note, + required TResult Function(ProjectModelChangelog value) changelog, }) { return idea(this); } @@ -736,6 +783,7 @@ class _$ProjectModelIdeaImpl extends ProjectModelIdea { TResult? mapOrNull({ TResult? Function(ProjectModelIdea value)? idea, TResult? Function(ProjectModelNote value)? note, + TResult? Function(ProjectModelChangelog value)? changelog, }) { return idea?.call(this); } @@ -745,6 +793,7 @@ class _$ProjectModelIdeaImpl extends ProjectModelIdea { TResult maybeMap({ TResult Function(ProjectModelIdea value)? idea, TResult Function(ProjectModelNote value)? note, + TResult Function(ProjectModelChangelog value)? changelog, required TResult orElse(), }) { if (idea != null) { @@ -787,7 +836,6 @@ abstract class ProjectModelIdea extends ProjectModel String get title; @override ProjectTypes get type; - @override DateTime? get archivedAt; List get answers; IdeaProjectAnswerModel? get draftAnswer; @@ -992,6 +1040,14 @@ class _$ProjectModelNoteImpl extends ProjectModelNote { DateTime? archivedAt, List tagsIds) note, + required TResult Function( + DateTime createdAt, + DateTime updatedAt, + LocalizedTextModel title, + ProjectModelId id, + ProjectTypes type, + List tagsIds) + changelog, }) { return note(id, createdAt, updatedAt, this.note, type, charactersLimit, archivedAt, tagsIds); @@ -1021,6 +1077,14 @@ class _$ProjectModelNoteImpl extends ProjectModelNote { DateTime? archivedAt, List tagsIds)? note, + TResult? Function( + DateTime createdAt, + DateTime updatedAt, + LocalizedTextModel title, + ProjectModelId id, + ProjectTypes type, + List tagsIds)? + changelog, }) { return note?.call(id, createdAt, updatedAt, this.note, type, charactersLimit, archivedAt, tagsIds); @@ -1050,6 +1114,14 @@ class _$ProjectModelNoteImpl extends ProjectModelNote { DateTime? archivedAt, List tagsIds)? note, + TResult Function( + DateTime createdAt, + DateTime updatedAt, + LocalizedTextModel title, + ProjectModelId id, + ProjectTypes type, + List tagsIds)? + changelog, required TResult orElse(), }) { if (note != null) { @@ -1064,6 +1136,7 @@ class _$ProjectModelNoteImpl extends ProjectModelNote { TResult map({ required TResult Function(ProjectModelIdea value) idea, required TResult Function(ProjectModelNote value) note, + required TResult Function(ProjectModelChangelog value) changelog, }) { return note(this); } @@ -1073,6 +1146,7 @@ class _$ProjectModelNoteImpl extends ProjectModelNote { TResult? mapOrNull({ TResult? Function(ProjectModelIdea value)? idea, TResult? Function(ProjectModelNote value)? note, + TResult? Function(ProjectModelChangelog value)? changelog, }) { return note?.call(this); } @@ -1082,6 +1156,7 @@ class _$ProjectModelNoteImpl extends ProjectModelNote { TResult maybeMap({ TResult Function(ProjectModelIdea value)? idea, TResult Function(ProjectModelNote value)? note, + TResult Function(ProjectModelChangelog value)? changelog, required TResult orElse(), }) { if (note != null) { @@ -1124,7 +1199,6 @@ abstract class ProjectModelNote extends ProjectModel @override ProjectTypes get type; int get charactersLimit; - @override DateTime? get archivedAt; @override List get tagsIds; @@ -1134,6 +1208,340 @@ abstract class ProjectModelNote extends ProjectModel throw _privateConstructorUsedError; } +/// @nodoc +abstract class _$$ProjectModelChangelogImplCopyWith<$Res> + implements $ProjectModelCopyWith<$Res> { + factory _$$ProjectModelChangelogImplCopyWith( + _$ProjectModelChangelogImpl value, + $Res Function(_$ProjectModelChangelogImpl) then) = + __$$ProjectModelChangelogImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {DateTime createdAt, + DateTime updatedAt, + LocalizedTextModel title, + ProjectModelId id, + ProjectTypes type, + List tagsIds}); + + $LocalizedTextModelCopyWith<$Res> get title; +} + +/// @nodoc +class __$$ProjectModelChangelogImplCopyWithImpl<$Res> + extends _$ProjectModelCopyWithImpl<$Res, _$ProjectModelChangelogImpl> + implements _$$ProjectModelChangelogImplCopyWith<$Res> { + __$$ProjectModelChangelogImplCopyWithImpl(_$ProjectModelChangelogImpl _value, + $Res Function(_$ProjectModelChangelogImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? createdAt = null, + Object? updatedAt = null, + Object? title = null, + Object? id = null, + Object? type = null, + Object? tagsIds = null, + }) { + return _then(_$ProjectModelChangelogImpl( + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + title: null == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as LocalizedTextModel, + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as ProjectModelId, + type: null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as ProjectTypes, + tagsIds: null == tagsIds + ? _value._tagsIds + : tagsIds // ignore: cast_nullable_to_non_nullable + as List, + )); + } + + @override + @pragma('vm:prefer-inline') + $LocalizedTextModelCopyWith<$Res> get title { + return $LocalizedTextModelCopyWith<$Res>(_value.title, (value) { + return _then(_value.copyWith(title: value)); + }); + } +} + +/// @nodoc +@JsonSerializable() +class _$ProjectModelChangelogImpl extends ProjectModelChangelog { + const _$ProjectModelChangelogImpl( + {required this.createdAt, + required this.updatedAt, + this.title = LocalizedTextModel.empty, + this.id = ProjectModelId.systemChangelog, + this.type = ProjectTypes.systemChangelog, + final List tagsIds = const [], + final String? $type}) + : _tagsIds = tagsIds, + $type = $type ?? 'changelog', + super._(); + + factory _$ProjectModelChangelogImpl.fromJson(Map json) => + _$$ProjectModelChangelogImplFromJson(json); + + @override + final DateTime createdAt; + @override + final DateTime updatedAt; + @override + @JsonKey() + final LocalizedTextModel title; + @override + @JsonKey() + final ProjectModelId id; + @override + @JsonKey() + final ProjectTypes type; + final List _tagsIds; + @override + @JsonKey() + List get tagsIds { + if (_tagsIds is EqualUnmodifiableListView) return _tagsIds; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_tagsIds); + } + + @JsonKey(name: 'runtimeType') + final String $type; + + @override + String toString() { + return 'ProjectModel.changelog(createdAt: $createdAt, updatedAt: $updatedAt, title: $title, id: $id, type: $type, tagsIds: $tagsIds)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ProjectModelChangelogImpl && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt) && + (identical(other.title, title) || other.title == title) && + (identical(other.id, id) || other.id == id) && + (identical(other.type, type) || other.type == type) && + const DeepCollectionEquality().equals(other._tagsIds, _tagsIds)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, createdAt, updatedAt, title, id, + type, const DeepCollectionEquality().hash(_tagsIds)); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$ProjectModelChangelogImplCopyWith<_$ProjectModelChangelogImpl> + get copyWith => __$$ProjectModelChangelogImplCopyWithImpl< + _$ProjectModelChangelogImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function( + ProjectModelId id, + DateTime createdAt, + DateTime updatedAt, + String title, + ProjectTypes type, + DateTime? archivedAt, + List answers, + IdeaProjectAnswerModel? draftAnswer, + List tagsIds) + idea, + required TResult Function( + ProjectModelId id, + DateTime createdAt, + DateTime updatedAt, + String note, + ProjectTypes type, + int charactersLimit, + DateTime? archivedAt, + List tagsIds) + note, + required TResult Function( + DateTime createdAt, + DateTime updatedAt, + LocalizedTextModel title, + ProjectModelId id, + ProjectTypes type, + List tagsIds) + changelog, + }) { + return changelog(createdAt, updatedAt, title, id, type, tagsIds); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function( + ProjectModelId id, + DateTime createdAt, + DateTime updatedAt, + String title, + ProjectTypes type, + DateTime? archivedAt, + List answers, + IdeaProjectAnswerModel? draftAnswer, + List tagsIds)? + idea, + TResult? Function( + ProjectModelId id, + DateTime createdAt, + DateTime updatedAt, + String note, + ProjectTypes type, + int charactersLimit, + DateTime? archivedAt, + List tagsIds)? + note, + TResult? Function( + DateTime createdAt, + DateTime updatedAt, + LocalizedTextModel title, + ProjectModelId id, + ProjectTypes type, + List tagsIds)? + changelog, + }) { + return changelog?.call(createdAt, updatedAt, title, id, type, tagsIds); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function( + ProjectModelId id, + DateTime createdAt, + DateTime updatedAt, + String title, + ProjectTypes type, + DateTime? archivedAt, + List answers, + IdeaProjectAnswerModel? draftAnswer, + List tagsIds)? + idea, + TResult Function( + ProjectModelId id, + DateTime createdAt, + DateTime updatedAt, + String note, + ProjectTypes type, + int charactersLimit, + DateTime? archivedAt, + List tagsIds)? + note, + TResult Function( + DateTime createdAt, + DateTime updatedAt, + LocalizedTextModel title, + ProjectModelId id, + ProjectTypes type, + List tagsIds)? + changelog, + required TResult orElse(), + }) { + if (changelog != null) { + return changelog(createdAt, updatedAt, title, id, type, tagsIds); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(ProjectModelIdea value) idea, + required TResult Function(ProjectModelNote value) note, + required TResult Function(ProjectModelChangelog value) changelog, + }) { + return changelog(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(ProjectModelIdea value)? idea, + TResult? Function(ProjectModelNote value)? note, + TResult? Function(ProjectModelChangelog value)? changelog, + }) { + return changelog?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(ProjectModelIdea value)? idea, + TResult Function(ProjectModelNote value)? note, + TResult Function(ProjectModelChangelog value)? changelog, + required TResult orElse(), + }) { + if (changelog != null) { + return changelog(this); + } + return orElse(); + } + + @override + Map toJson() { + return _$$ProjectModelChangelogImplToJson( + this, + ); + } +} + +abstract class ProjectModelChangelog extends ProjectModel implements Sharable { + const factory ProjectModelChangelog( + {required final DateTime createdAt, + required final DateTime updatedAt, + final LocalizedTextModel title, + final ProjectModelId id, + final ProjectTypes type, + final List tagsIds}) = _$ProjectModelChangelogImpl; + const ProjectModelChangelog._() : super._(); + + factory ProjectModelChangelog.fromJson(Map json) = + _$ProjectModelChangelogImpl.fromJson; + + @override + DateTime get createdAt; + @override + DateTime get updatedAt; + LocalizedTextModel get title; + @override + ProjectModelId get id; + @override + ProjectTypes get type; + @override + List get tagsIds; + @override + @JsonKey(ignore: true) + _$$ProjectModelChangelogImplCopyWith<_$ProjectModelChangelogImpl> + get copyWith => throw _privateConstructorUsedError; +} + IdeaProjectAnswerModel _$IdeaProjectAnswerModelFromJson( Map json) { return _IdeaProjectAnswerModel.fromJson(json); diff --git a/packages/core/lib/src/data_models/data_models.g.dart b/packages/core/lib/src/data_models/data_models.g.dart index 2854ed0a..e63d2d00 100644 --- a/packages/core/lib/src/data_models/data_models.g.dart +++ b/packages/core/lib/src/data_models/data_models.g.dart @@ -71,6 +71,7 @@ Map _$$ProjectModelIdeaImplToJson( const _$ProjectTypesEnumMap = { ProjectTypes.idea: 'idea', ProjectTypes.note: 'note', + ProjectTypes.systemChangelog: 'systemChangelog', }; _$ProjectModelNoteImpl _$$ProjectModelNoteImplFromJson( @@ -107,6 +108,38 @@ Map _$$ProjectModelNoteImplToJson( 'runtimeType': instance.$type, }; +_$ProjectModelChangelogImpl _$$ProjectModelChangelogImplFromJson( + Map json) => + _$ProjectModelChangelogImpl( + createdAt: DateTime.parse(json['createdAt'] as String), + updatedAt: DateTime.parse(json['updatedAt'] as String), + title: json['title'] == null + ? LocalizedTextModel.empty + : LocalizedTextModel.fromJson(json['title'] as Map), + id: json['id'] == null + ? ProjectModelId.systemChangelog + : ProjectModelId.fromJson(json['id'] as String), + type: $enumDecodeNullable(_$ProjectTypesEnumMap, json['type']) ?? + ProjectTypes.systemChangelog, + tagsIds: (json['tagsIds'] as List?) + ?.map((e) => ProjectTagModelId.fromJson(e as String)) + .toList() ?? + const [], + $type: json['runtimeType'] as String?, + ); + +Map _$$ProjectModelChangelogImplToJson( + _$ProjectModelChangelogImpl instance) => + { + 'createdAt': instance.createdAt.toIso8601String(), + 'updatedAt': instance.updatedAt.toIso8601String(), + 'title': instance.title, + 'id': instance.id, + 'type': _$ProjectTypesEnumMap[instance.type]!, + 'tagsIds': instance.tagsIds, + 'runtimeType': instance.$type, + }; + _$IdeaProjectAnswerModelImpl _$$IdeaProjectAnswerModelImplFromJson( Map json) => _$IdeaProjectAnswerModelImpl( diff --git a/packages/core/lib/src/data_models/project.dart b/packages/core/lib/src/data_models/project.dart index c31a5a39..3033f69f 100644 --- a/packages/core/lib/src/data_models/project.dart +++ b/packages/core/lib/src/data_models/project.dart @@ -4,6 +4,7 @@ extension type const ProjectModelId(String value) { factory ProjectModelId.fromJson(final String value) => ProjectModelId(value); factory ProjectModelId.generate() => ProjectModelId(createId()); static const empty = ProjectModelId(''); + static const systemChangelog = ProjectModelId('changelog'); bool get isEmpty => value.isEmpty; String toJson() => value; } @@ -11,6 +12,7 @@ extension type const ProjectModelId(String value) { enum ProjectTypes { idea, note, + systemChangelog, } @freezed @@ -40,13 +42,42 @@ sealed class ProjectModel with _$ProjectModel implements Sharable, Archivable { final DateTime? archivedAt, @Default([]) final List tagsIds, }) = ProjectModelNote; + + /// keeps only position of system changelog whithout any content + @Implements() + const factory ProjectModel.changelog({ + required final DateTime createdAt, + required final DateTime updatedAt, + @Default(LocalizedTextModel.empty) final LocalizedTextModel title, + @Default(ProjectModelId.systemChangelog) final ProjectModelId id, + @Default(ProjectTypes.systemChangelog) final ProjectTypes type, + @Default([]) final List tagsIds, + }) = ProjectModelChangelog; factory ProjectModel.fromJson(final dynamic json) => _$ProjectModelFromJson(json as Map); const ProjectModel._(); + static ProjectModelChangelog getSystemChangelogFromNotifications({ + required final ProjectModelChangelog project, + required final List notifications, + }) { + final newest = notifications.first; + final oldest = notifications.last; + + return ProjectModelChangelog( + createdAt: oldest.created, + title: newest.title, + updatedAt: project.updatedAt.isAfter(newest.created) + ? project.updatedAt + : newest.created, + ); + } + static const titleLimit = 90; - String get title => switch (this) { + String getTitle(final BuildContext context) => switch (this) { ProjectModelIdea(title: final titleStr) => titleStr, ProjectModelNote(:final note) => _getTitle(note), + ProjectModelChangelog(:final title) => + _getTitle(title.localize(context)), }; @override @@ -54,10 +85,13 @@ sealed class ProjectModel with _$ProjectModel implements Sharable, Archivable { idea: (final value) => ideaProjectToShareString(context: context, projectIdea: value), note: (final value) => value.note, + + /// maybe share newest changelog, but not sure + changelog: (final value) => '', ); @override - String toSharableTitle(final BuildContext context) => title; + String toSharableTitle(final BuildContext context) => getTitle(context); static final emptyNote = ProjectModelNote( id: ProjectModelId.empty, diff --git a/packages/core/lib/src/data_repositories/projects_repository.dart b/packages/core/lib/src/data_repositories/projects_repository.dart index 0edd8dbf..877492e3 100644 --- a/packages/core/lib/src/data_repositories/projects_repository.dart +++ b/packages/core/lib/src/data_repositories/projects_repository.dart @@ -28,8 +28,13 @@ class ProjectsRepository { Future> getPaginated({ required final PaginatedPageRequestModel request, - }) async => - _datasource.getPaginated(dto: request); + }) async { + final response = _datasource.getPaginated(dto: request); + + /// hack to inject changelog + if (request.data?.shouldAddChangelog == true) {} + return response; + } } final class TagsRepository diff --git a/packages/core/lib/src/data_sources/local_hive/hive_models.g.dart b/packages/core/lib/src/data_sources/local_hive/hive_models.g.dart index 686cbcc1..f884d091 100644 --- a/packages/core/lib/src/data_sources/local_hive/hive_models.g.dart +++ b/packages/core/lib/src/data_sources/local_hive/hive_models.g.dart @@ -270,4 +270,5 @@ Map _$SerializableProjectIdToJson( const _$ProjectTypesEnumMap = { ProjectTypes.idea: 'idea', ProjectTypes.note: 'note', + ProjectTypes.systemChangelog: 'systemChangelog', }; diff --git a/packages/core/lib/src/router_paths.dart b/packages/core/lib/src/router_paths.dart index 45601701..537f0638 100644 --- a/packages/core/lib/src/router_paths.dart +++ b/packages/core/lib/src/router_paths.dart @@ -5,6 +5,7 @@ class ScreenPaths { static const bootstrap = '/'; static const home = '/home'; static const intro = '/intro'; + static const changelog = '$home/changelog'; static String idea({required final ProjectModelId ideaId}) => '$home/i/${ideaId.value}'; static String ideaAnswer({ diff --git a/packages/core/lib/src/state/opened_project_notifier.dart b/packages/core/lib/src/state/opened_project_notifier.dart index 9702cdfd..eb19103a 100644 --- a/packages/core/lib/src/state/opened_project_notifier.dart +++ b/packages/core/lib/src/state/opened_project_notifier.dart @@ -26,6 +26,7 @@ class OpenedProjectNotifier final path = switch (project.type) { ProjectTypes.note => ScreenPaths.note(noteId: project.id), ProjectTypes.idea => ScreenPaths.idea(ideaId: project.id), + ProjectTypes.systemChangelog => ScreenPaths.changelog, }; unawaited(context.push(path)); } @@ -43,6 +44,9 @@ class OpenedProjectNotifier if (note.note.isNotEmpty) return; dto.projectsNotifier.deleteProject(note); }, + changelog: (final value) { + // noop + }, ); } From d198028556687a781286b87d315681e71b7f158d Mon Sep 17 00:00:00 2001 From: Arenukvern Date: Wed, 6 Mar 2024 22:45:47 +0200 Subject: [PATCH 2/7] feat: updates now visible in projects fix: characters limit layout --- CHANGELOG.md | 8 ++ lib/home/home_screen.dart | 2 +- lib/home/project_view.dart | 56 +++++++++++-- .../project_widgets/project_view_app_bar.dart | 13 --- lib/home/project_widgets/project_widgets.dart | 1 - lib/note/widgets/desktop_note_settings.dart | 20 +++-- lib/router.dart | 4 + lib/settings/features/characters_limit.dart | 46 +++++------ lib/settings/settings_screen.dart | 2 - lib/settings/views/changelog_view.dart | 1 + macos/Podfile.lock | 2 +- .../assets/json/updates_notifications.json | 6 +- .../src/data_models/data_models.freezed.dart | 82 ++++++++++++++----- .../lib/src/data_models/data_models.g.dart | 4 + .../core/lib/src/data_models/project.dart | 9 +- .../lib/src/state/notifications_notifier.dart | 20 +++-- 16 files changed, 182 insertions(+), 94 deletions(-) delete mode 100644 lib/home/project_widgets/project_view_app_bar.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index b51d53a1..ba8a64d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 3.20 (next) + +🧩 Puzzle update 🧩 + +- feat: app updates now visible in projects + +- fix: characters limit layout made more compact and cozy + ## 3.19 🪄 Scourgify update!:) diff --git a/lib/home/home_screen.dart b/lib/home/home_screen.dart index 7269a249..cba8ec3d 100644 --- a/lib/home/home_screen.dart +++ b/lib/home/home_screen.dart @@ -178,7 +178,7 @@ class _TagListTile extends StatelessWidget { Text(tag.isEmpty ? l10n.all : tag.title, textAlign: TextAlign.center), // ignore: avoid_bool_literals_in_conditional_expressions selected: - tag.isEmpty && selectedTagId.isEmpty ? true : tag.id == selectedTagId, + (tag.isEmpty && selectedTagId.isEmpty) || tag.id == selectedTagId, onTap: onTap, ); } diff --git a/lib/home/project_view.dart b/lib/home/project_view.dart index f87c995d..d0df4f93 100644 --- a/lib/home/project_view.dart +++ b/lib/home/project_view.dart @@ -1,6 +1,5 @@ import 'package:lastanswer/_library/widgets/widgets.dart'; import 'package:lastanswer/common_imports.dart'; -import 'package:lastanswer/home/project_widgets/project_widgets.dart'; import 'package:lastanswer/idea/idea_view.dart'; import 'package:lastanswer/note/note_view.dart'; import 'package:lastanswer/settings/views/changelog_view.dart'; @@ -19,17 +18,56 @@ class ProjectView extends StatelessWidget { } final id = projectContainer.value.id; - final screenLayout = ScreenLayout.of(context); return projectContainer.value.map( idea: (final idea) => IdeaView(idea: idea, key: ValueKey(id)), - note: (final note) => Column( - children: [ - if (screenLayout.small) const ProjectViewAppBar() else const Gap(42), - Expanded(child: NoteView(note: note, key: ValueKey(id))), - ], + note: (final note) => _AdaptiveView( + appBar: const _ProjectViewAppBar(), + child: NoteView(note: note, key: ValueKey(id)), + ), + changelog: (final changelog) => const _AdaptiveView( + appBar: _ChangelogViewAppBar(), + child: ChangelogView(), ), - // TODO(arenukvern): description, - changelog: (final changelog) => const ChangelogView(), ); } } + +class _AdaptiveView extends StatelessWidget { + const _AdaptiveView({required this.child, required this.appBar, super.key}); + final Widget appBar; + final Widget child; + + @override + Widget build(final BuildContext context) { + final screenLayout = ScreenLayout.of(context); + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + if (screenLayout.small) appBar else const Gap(42), + Expanded(child: child), + ], + ); + } +} + +class _ProjectViewAppBar extends StatelessWidget { + const _ProjectViewAppBar({super.key}); + + @override + Widget build(final BuildContext context) => BackTextUniversalAppBar( + onBack: () => context.go(ScreenPaths.home), + titleStr: '', + useBackButton: true, + ); +} + +class _ChangelogViewAppBar extends StatelessWidget { + const _ChangelogViewAppBar({super.key}); + + @override + Widget build(final BuildContext context) => BackTextUniversalAppBar( + onBack: () => context.go(ScreenPaths.home), + titleStr: context.l10n.changeLog, + useBackButton: true, + ); +} diff --git a/lib/home/project_widgets/project_view_app_bar.dart b/lib/home/project_widgets/project_view_app_bar.dart deleted file mode 100644 index c1de4b2b..00000000 --- a/lib/home/project_widgets/project_view_app_bar.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:lastanswer/_library/widgets/widgets.dart'; -import 'package:lastanswer/common_imports.dart'; - -class ProjectViewAppBar extends StatelessWidget { - const ProjectViewAppBar({super.key}); - - @override - Widget build(final BuildContext context) => BackTextUniversalAppBar( - onBack: () => context.go(ScreenPaths.home), - titleStr: '', - useBackButton: true, - ); -} diff --git a/lib/home/project_widgets/project_widgets.dart b/lib/home/project_widgets/project_widgets.dart index cd4a72df..6375f883 100644 --- a/lib/home/project_widgets/project_widgets.dart +++ b/lib/home/project_widgets/project_widgets.dart @@ -1,3 +1,2 @@ export 'project_text_field.dart'; export 'project_title_field.dart'; -export 'project_view_app_bar.dart'; diff --git a/lib/note/widgets/desktop_note_settings.dart b/lib/note/widgets/desktop_note_settings.dart index e30e3b5d..09dab2f3 100644 --- a/lib/note/widgets/desktop_note_settings.dart +++ b/lib/note/widgets/desktop_note_settings.dart @@ -23,6 +23,7 @@ class DesktopNoteSettingsMenu extends HookWidget { ); return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ const SizedBox(height: borderPadding), HovarableListTile( @@ -38,8 +39,8 @@ class DesktopNoteSettingsMenu extends HookWidget { ), ), ), - const SizedBox(height: borderPadding * 2), - divider, + const Gap(borderPadding * 2), + const Divider(height: 4, thickness: 4), Expanded( child: HoverableArea( clickable: false, @@ -48,25 +49,26 @@ class DesktopNoteSettingsMenu extends HookWidget { child: Padding( padding: const EdgeInsets.symmetric(horizontal: borderPadding), child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ const SizedBox(height: borderPadding * 2), Row( - mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( - '${context.l10n.charactersLimit}:', - textAlign: TextAlign.center, - style: theme.textTheme.titleLarge, + Flexible( + child: Text( + '${context.l10n.charactersLimit}:', + textAlign: TextAlign.left, + style: theme.textTheme.titleMedium, + ), ), ], ), - const Divider(), + const Gap(2), Expanded( child: CharactersLimitSetting( controller: characterLimitController, ), ), - const Divider(), ], ), ), diff --git a/lib/router.dart b/lib/router.dart index e0344407..9e581029 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -40,6 +40,10 @@ final appRouter = GoRouter( '/home/i/:ideaId', (final _) => const ProjectView(), ), + AppRoute( + ScreenPaths.changelog, + (final _) => const ProjectView(), + ), ], ), ], diff --git a/lib/settings/features/characters_limit.dart b/lib/settings/features/characters_limit.dart index 47bec754..74e633c1 100644 --- a/lib/settings/features/characters_limit.dart +++ b/lib/settings/features/characters_limit.dart @@ -22,23 +22,24 @@ class CharactersLimitSetting extends HookWidget { otherButton = Row( mainAxisSize: MainAxisSize.min, children: [ - const Gap(12), - UiTextField( - value: controller.limit, - focusNode: controller.focusNode, - onChanged: controller.onLimitChanged, - keyboardType: TextInputType.number, - autocorrect: false, - enableSuggestions: false, - inputFormatters: [FilteringTextInputFormatter.digitsOnly], - decoration: const InputDecoration() - .applyDefaults(theme.inputDecorationTheme) - .copyWith( - hintText: context.l10n.charactersUnlimited, - constraints: const BoxConstraints(maxWidth: 60), - ), + Flexible( + child: UiTextField( + value: controller.limit, + focusNode: controller.focusNode, + onChanged: controller.onLimitChanged, + keyboardType: TextInputType.number, + autocorrect: false, + enableSuggestions: false, + inputFormatters: [FilteringTextInputFormatter.digitsOnly], + decoration: const InputDecoration() + .applyDefaults(theme.inputDecorationTheme) + .copyWith( + isDense: true, + hintText: context.l10n.charactersUnlimited, + constraints: const BoxConstraints(maxWidth: 60), + ), + ), ), - const Gap(2), HoverableButton( onPressed: controller.isEditing ? controller.onClearLimit : null, child: const Icon( @@ -49,12 +50,9 @@ class CharactersLimitSetting extends HookWidget { ], ); } else { - otherButton = Padding( - padding: const EdgeInsets.only(right: 8), - child: HoverableButton( - onPressed: () => controller.setIsEditing(true), - child: Text(context.l10n.charactersUnlimited), - ), + otherButton = HoverableButton( + onPressed: () => controller.setIsEditing(true), + child: Text(context.l10n.charactersUnlimited), ); } // TODO(arenukvern): refactor to separate widget @@ -100,8 +98,8 @@ class CharactersLimitSetting extends HookWidget { } return Wrap( - spacing: 14, - runSpacing: 14, + spacing: 8, + runSpacing: 8, crossAxisAlignment: WrapCrossAlignment.center, children: [ CharactersLimitButton( diff --git a/lib/settings/settings_screen.dart b/lib/settings/settings_screen.dart index 89f9ec32..b97e2f69 100644 --- a/lib/settings/settings_screen.dart +++ b/lib/settings/settings_screen.dart @@ -22,7 +22,6 @@ class SettingsScreen extends HookWidget { const MyAccountViewRemoteImpl() else const MyAccountViewLocalImpl(), - const ChangelogView(), ]; Widget child = TabBarView( physics: const SpeedyPageViewScrollPhysics(), @@ -37,7 +36,6 @@ class SettingsScreen extends HookWidget { tabs: [ Tab(text: context.l10n.generalSettingsShortTitle), if (isAccountViewVisible) Tab(text: context.l10n.myAccount), - Tab(text: context.l10n.changeLog), ], ), ); diff --git a/lib/settings/views/changelog_view.dart b/lib/settings/views/changelog_view.dart index f0247234..e7e2cfa5 100644 --- a/lib/settings/views/changelog_view.dart +++ b/lib/settings/views/changelog_view.dart @@ -16,6 +16,7 @@ class ChangelogView extends StatelessWidget { return Column( mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Padding( padding: EdgeInsets.only(top: i == 0 ? 0 : 32, bottom: 24), diff --git a/macos/Podfile.lock b/macos/Podfile.lock index a46ecc89..6cd83a18 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -290,4 +290,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 329c3f477c2913a5855e69d5463fbe341bc4695e -COCOAPODS: 1.14.3 +COCOAPODS: 1.15.2 diff --git a/packages/core/assets/json/updates_notifications.json b/packages/core/assets/json/updates_notifications.json index 0c7128fa..6cd9642b 100644 --- a/packages/core/assets/json/updates_notifications.json +++ b/packages/core/assets/json/updates_notifications.json @@ -2,9 +2,9 @@ { "id": "5", "message": { - "ru": "- feat(🗂️): новая опция группировки проектов в папки (экспериментальная)\n- feat(💾): множество вариантов резервного копирования и восстановления данных (экспериментальная)\nfix: обновление проекта просто кликнув по нему", - "en": "- feat(🗂️): new option to group projects into folders (experimental)\n- feat(💾): many options to backup and restore data (experimental)\n - fix: update project just for clicking to it", - "it": "- feat(🗂️): nuova opzione per raggruppare i progetti in cartelle (sperimentale)\n- feat(💾): molte opzioni per eseguire il backup e ripristinare i dati (sperimentale)\nfix: aggiornare il progetto semplicemente cliccandoci sopra", + "ru": "- feat(🗂️): новая опция группировки проектов в папки (экспериментальная)\n- feat(💾): множество вариантов резервного копирования и восстановления данных (экспериментальная)\n- fix: обновление проекта просто кликнув по нему. \n\nПотрясающих идей и настроения 🏞️\nАнтон", + "en": "- feat(🗂️): new option to group projects into folders (experimental)\n- feat(💾): many options to backup and restore data (experimental)\n- fix: update project just for clicking to it. \n\nHave great ideas and mood 🏞️\nAnton", + "it": "- feat(🗂️): nuova opzione per raggruppare i progetti in cartelle (sperimentale)\n- feat(💾): molte opzioni per eseguire il backup e ripristinare i dati (sperimentale)\n- fix: aggiornare il progetto semplicemente cliccandoci sopra \n\nHai delle ottime idee e umore 🏞️\nAnton", "ga": "" }, "title": { diff --git a/packages/core/lib/src/data_models/data_models.freezed.dart b/packages/core/lib/src/data_models/data_models.freezed.dart index f88e107d..43e29663 100644 --- a/packages/core/lib/src/data_models/data_models.freezed.dart +++ b/packages/core/lib/src/data_models/data_models.freezed.dart @@ -265,6 +265,7 @@ mixin _$ProjectModel { DateTime get createdAt => throw _privateConstructorUsedError; DateTime get updatedAt => throw _privateConstructorUsedError; ProjectTypes get type => throw _privateConstructorUsedError; + DateTime? get archivedAt => throw _privateConstructorUsedError; List get tagsIds => throw _privateConstructorUsedError; @optionalTypeArgs TResult when({ @@ -295,7 +296,8 @@ mixin _$ProjectModel { LocalizedTextModel title, ProjectModelId id, ProjectTypes type, - List tagsIds) + List tagsIds, + DateTime? archivedAt) changelog, }) => throw _privateConstructorUsedError; @@ -328,7 +330,8 @@ mixin _$ProjectModel { LocalizedTextModel title, ProjectModelId id, ProjectTypes type, - List tagsIds)? + List tagsIds, + DateTime? archivedAt)? changelog, }) => throw _privateConstructorUsedError; @@ -361,7 +364,8 @@ mixin _$ProjectModel { LocalizedTextModel title, ProjectModelId id, ProjectTypes type, - List tagsIds)? + List tagsIds, + DateTime? archivedAt)? changelog, required TResult orElse(), }) => @@ -405,6 +409,7 @@ abstract class $ProjectModelCopyWith<$Res> { DateTime createdAt, DateTime updatedAt, ProjectTypes type, + DateTime? archivedAt, List tagsIds}); } @@ -425,6 +430,7 @@ class _$ProjectModelCopyWithImpl<$Res, $Val extends ProjectModel> Object? createdAt = null, Object? updatedAt = null, Object? type = null, + Object? archivedAt = freezed, Object? tagsIds = null, }) { return _then(_value.copyWith( @@ -444,6 +450,10 @@ class _$ProjectModelCopyWithImpl<$Res, $Val extends ProjectModel> ? _value.type : type // ignore: cast_nullable_to_non_nullable as ProjectTypes, + archivedAt: freezed == archivedAt + ? _value.archivedAt + : archivedAt // ignore: cast_nullable_to_non_nullable + as DateTime?, tagsIds: null == tagsIds ? _value.tagsIds : tagsIds // ignore: cast_nullable_to_non_nullable @@ -683,7 +693,8 @@ class _$ProjectModelIdeaImpl extends ProjectModelIdea { LocalizedTextModel title, ProjectModelId id, ProjectTypes type, - List tagsIds) + List tagsIds, + DateTime? archivedAt) changelog, }) { return idea(id, createdAt, updatedAt, title, type, archivedAt, answers, @@ -720,7 +731,8 @@ class _$ProjectModelIdeaImpl extends ProjectModelIdea { LocalizedTextModel title, ProjectModelId id, ProjectTypes type, - List tagsIds)? + List tagsIds, + DateTime? archivedAt)? changelog, }) { return idea?.call(id, createdAt, updatedAt, title, type, archivedAt, @@ -757,7 +769,8 @@ class _$ProjectModelIdeaImpl extends ProjectModelIdea { LocalizedTextModel title, ProjectModelId id, ProjectTypes type, - List tagsIds)? + List tagsIds, + DateTime? archivedAt)? changelog, required TResult orElse(), }) { @@ -836,6 +849,7 @@ abstract class ProjectModelIdea extends ProjectModel String get title; @override ProjectTypes get type; + @override DateTime? get archivedAt; List get answers; IdeaProjectAnswerModel? get draftAnswer; @@ -1046,7 +1060,8 @@ class _$ProjectModelNoteImpl extends ProjectModelNote { LocalizedTextModel title, ProjectModelId id, ProjectTypes type, - List tagsIds) + List tagsIds, + DateTime? archivedAt) changelog, }) { return note(id, createdAt, updatedAt, this.note, type, charactersLimit, @@ -1083,7 +1098,8 @@ class _$ProjectModelNoteImpl extends ProjectModelNote { LocalizedTextModel title, ProjectModelId id, ProjectTypes type, - List tagsIds)? + List tagsIds, + DateTime? archivedAt)? changelog, }) { return note?.call(id, createdAt, updatedAt, this.note, type, @@ -1120,7 +1136,8 @@ class _$ProjectModelNoteImpl extends ProjectModelNote { LocalizedTextModel title, ProjectModelId id, ProjectTypes type, - List tagsIds)? + List tagsIds, + DateTime? archivedAt)? changelog, required TResult orElse(), }) { @@ -1199,6 +1216,7 @@ abstract class ProjectModelNote extends ProjectModel @override ProjectTypes get type; int get charactersLimit; + @override DateTime? get archivedAt; @override List get tagsIds; @@ -1223,7 +1241,8 @@ abstract class _$$ProjectModelChangelogImplCopyWith<$Res> LocalizedTextModel title, ProjectModelId id, ProjectTypes type, - List tagsIds}); + List tagsIds, + DateTime? archivedAt}); $LocalizedTextModelCopyWith<$Res> get title; } @@ -1245,6 +1264,7 @@ class __$$ProjectModelChangelogImplCopyWithImpl<$Res> Object? id = null, Object? type = null, Object? tagsIds = null, + Object? archivedAt = freezed, }) { return _then(_$ProjectModelChangelogImpl( createdAt: null == createdAt @@ -1271,6 +1291,10 @@ class __$$ProjectModelChangelogImplCopyWithImpl<$Res> ? _value._tagsIds : tagsIds // ignore: cast_nullable_to_non_nullable as List, + archivedAt: freezed == archivedAt + ? _value.archivedAt + : archivedAt // ignore: cast_nullable_to_non_nullable + as DateTime?, )); } @@ -1293,6 +1317,7 @@ class _$ProjectModelChangelogImpl extends ProjectModelChangelog { this.id = ProjectModelId.systemChangelog, this.type = ProjectTypes.systemChangelog, final List tagsIds = const [], + this.archivedAt, final String? $type}) : _tagsIds = tagsIds, $type = $type ?? 'changelog', @@ -1323,12 +1348,15 @@ class _$ProjectModelChangelogImpl extends ProjectModelChangelog { return EqualUnmodifiableListView(_tagsIds); } + @override + final DateTime? archivedAt; + @JsonKey(name: 'runtimeType') final String $type; @override String toString() { - return 'ProjectModel.changelog(createdAt: $createdAt, updatedAt: $updatedAt, title: $title, id: $id, type: $type, tagsIds: $tagsIds)'; + return 'ProjectModel.changelog(createdAt: $createdAt, updatedAt: $updatedAt, title: $title, id: $id, type: $type, tagsIds: $tagsIds, archivedAt: $archivedAt)'; } @override @@ -1343,13 +1371,15 @@ class _$ProjectModelChangelogImpl extends ProjectModelChangelog { (identical(other.title, title) || other.title == title) && (identical(other.id, id) || other.id == id) && (identical(other.type, type) || other.type == type) && - const DeepCollectionEquality().equals(other._tagsIds, _tagsIds)); + const DeepCollectionEquality().equals(other._tagsIds, _tagsIds) && + (identical(other.archivedAt, archivedAt) || + other.archivedAt == archivedAt)); } @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, createdAt, updatedAt, title, id, - type, const DeepCollectionEquality().hash(_tagsIds)); + type, const DeepCollectionEquality().hash(_tagsIds), archivedAt); @JsonKey(ignore: true) @override @@ -1388,10 +1418,12 @@ class _$ProjectModelChangelogImpl extends ProjectModelChangelog { LocalizedTextModel title, ProjectModelId id, ProjectTypes type, - List tagsIds) + List tagsIds, + DateTime? archivedAt) changelog, }) { - return changelog(createdAt, updatedAt, title, id, type, tagsIds); + return changelog( + createdAt, updatedAt, title, id, type, tagsIds, archivedAt); } @override @@ -1424,10 +1456,12 @@ class _$ProjectModelChangelogImpl extends ProjectModelChangelog { LocalizedTextModel title, ProjectModelId id, ProjectTypes type, - List tagsIds)? + List tagsIds, + DateTime? archivedAt)? changelog, }) { - return changelog?.call(createdAt, updatedAt, title, id, type, tagsIds); + return changelog?.call( + createdAt, updatedAt, title, id, type, tagsIds, archivedAt); } @override @@ -1460,12 +1494,14 @@ class _$ProjectModelChangelogImpl extends ProjectModelChangelog { LocalizedTextModel title, ProjectModelId id, ProjectTypes type, - List tagsIds)? + List tagsIds, + DateTime? archivedAt)? changelog, required TResult orElse(), }) { if (changelog != null) { - return changelog(createdAt, updatedAt, title, id, type, tagsIds); + return changelog( + createdAt, updatedAt, title, id, type, tagsIds, archivedAt); } return orElse(); } @@ -1512,14 +1548,16 @@ class _$ProjectModelChangelogImpl extends ProjectModelChangelog { } } -abstract class ProjectModelChangelog extends ProjectModel implements Sharable { +abstract class ProjectModelChangelog extends ProjectModel + implements Sharable, Archivable { const factory ProjectModelChangelog( {required final DateTime createdAt, required final DateTime updatedAt, final LocalizedTextModel title, final ProjectModelId id, final ProjectTypes type, - final List tagsIds}) = _$ProjectModelChangelogImpl; + final List tagsIds, + final DateTime? archivedAt}) = _$ProjectModelChangelogImpl; const ProjectModelChangelog._() : super._(); factory ProjectModelChangelog.fromJson(Map json) = @@ -1537,6 +1575,8 @@ abstract class ProjectModelChangelog extends ProjectModel implements Sharable { @override List get tagsIds; @override + DateTime? get archivedAt; + @override @JsonKey(ignore: true) _$$ProjectModelChangelogImplCopyWith<_$ProjectModelChangelogImpl> get copyWith => throw _privateConstructorUsedError; diff --git a/packages/core/lib/src/data_models/data_models.g.dart b/packages/core/lib/src/data_models/data_models.g.dart index e63d2d00..beef072c 100644 --- a/packages/core/lib/src/data_models/data_models.g.dart +++ b/packages/core/lib/src/data_models/data_models.g.dart @@ -125,6 +125,9 @@ _$ProjectModelChangelogImpl _$$ProjectModelChangelogImplFromJson( ?.map((e) => ProjectTagModelId.fromJson(e as String)) .toList() ?? const [], + archivedAt: json['archivedAt'] == null + ? null + : DateTime.parse(json['archivedAt'] as String), $type: json['runtimeType'] as String?, ); @@ -137,6 +140,7 @@ Map _$$ProjectModelChangelogImplToJson( 'id': instance.id, 'type': _$ProjectTypesEnumMap[instance.type]!, 'tagsIds': instance.tagsIds, + 'archivedAt': instance.archivedAt?.toIso8601String(), 'runtimeType': instance.$type, }; diff --git a/packages/core/lib/src/data_models/project.dart b/packages/core/lib/src/data_models/project.dart index 3033f69f..0337b5d0 100644 --- a/packages/core/lib/src/data_models/project.dart +++ b/packages/core/lib/src/data_models/project.dart @@ -45,6 +45,7 @@ sealed class ProjectModel with _$ProjectModel implements Sharable, Archivable { /// keeps only position of system changelog whithout any content @Implements() + @Implements() const factory ProjectModel.changelog({ required final DateTime createdAt, required final DateTime updatedAt, @@ -52,12 +53,12 @@ sealed class ProjectModel with _$ProjectModel implements Sharable, Archivable { @Default(ProjectModelId.systemChangelog) final ProjectModelId id, @Default(ProjectTypes.systemChangelog) final ProjectTypes type, @Default([]) final List tagsIds, + final DateTime? archivedAt, }) = ProjectModelChangelog; factory ProjectModel.fromJson(final dynamic json) => _$ProjectModelFromJson(json as Map); const ProjectModel._(); - static ProjectModelChangelog getSystemChangelogFromNotifications({ - required final ProjectModelChangelog project, + factory ProjectModel.getSystemChangelogFromNotifications({ required final List notifications, }) { final newest = notifications.first; @@ -66,9 +67,7 @@ sealed class ProjectModel with _$ProjectModel implements Sharable, Archivable { return ProjectModelChangelog( createdAt: oldest.created, title: newest.title, - updatedAt: project.updatedAt.isAfter(newest.created) - ? project.updatedAt - : newest.created, + updatedAt: newest.created, ); } diff --git a/packages/core/lib/src/state/notifications_notifier.dart b/packages/core/lib/src/state/notifications_notifier.dart index 7012ab5e..5447eb53 100644 --- a/packages/core/lib/src/state/notifications_notifier.dart +++ b/packages/core/lib/src/state/notifications_notifier.dart @@ -12,19 +12,21 @@ class NotificationsNotifierState with _$NotificationsNotifierState { class NotificationsNotifier extends ValueNotifier implements Loadable { NotificationsNotifier(final BuildContext context) - : notificationRepository = context.read(), + : _notificationRepository = context.read(), + _projectsRepository = context.read(), super(const NotificationsNotifierState()); - final NotificationsRepository notificationRepository; + final NotificationsRepository _notificationRepository; + final ProjectsRepository _projectsRepository; Future readAllUpdates() async { setValue(value.copyWith(hasUnreadUpdates: false)); - await notificationRepository.setLastReadTime(); + await _notificationRepository.setLastReadTime(); } List get updates => value.updates; bool get hasUnreadUpdates => value.hasUnreadUpdates; Future determineUnreadUpdates() async { - final lastReadTime = await notificationRepository.getLastReadDateTime(); + final lastReadTime = await _notificationRepository.getLastReadDateTime(); if (lastReadTime == null) { setValue(value.copyWith(hasUnreadUpdates: true)); } else { @@ -42,8 +44,16 @@ class NotificationsNotifier extends ValueNotifier @override Future onLoad() async { final notifications = - await notificationRepository.getUpdatesNotifications(); + await _notificationRepository.getUpdatesNotifications(); await determineUnreadUpdates(); setValue(value.copyWith(updates: notifications)); + + /// always update project, to make sure, it is up to date + /// That's absolutely okay if project is not created yet + /// or it is different in projects + final project = ProjectModel.getSystemChangelogFromNotifications( + notifications: notifications, + ); + await _projectsRepository.put(project: project); } } From 01ff0566b3003ad5c381e49e2bc30137dceb78d1 Mon Sep 17 00:00:00 2001 From: Arenukvern Date: Wed, 6 Mar 2024 22:57:37 +0200 Subject: [PATCH 3/7] fix: delete changelog :D --- lib/_library/widgets/core/dismissible_tile.dart | 3 +++ lib/home/widgets/project_tile.dart | 1 + 2 files changed, 4 insertions(+) diff --git a/lib/_library/widgets/core/dismissible_tile.dart b/lib/_library/widgets/core/dismissible_tile.dart index a91d13e1..99818ec7 100644 --- a/lib/_library/widgets/core/dismissible_tile.dart +++ b/lib/_library/widgets/core/dismissible_tile.dart @@ -5,9 +5,11 @@ class DismissibleTile extends StatelessWidget { required this.child, required this.dismissibleKey, required this.onDismissed, + this.canDismiss = true, // final this.confirmDismiss, super.key, }); + final bool canDismiss; final VoidCallback onDismissed; // final ConfirmDismissCallback? confirmDismiss; final Widget child; @@ -15,6 +17,7 @@ class DismissibleTile extends StatelessWidget { @override Widget build(final BuildContext context) => slidable.Slidable( key: dismissibleKey, + enabled: canDismiss, startActionPane: slidable.ActionPane( motion: const slidable.BehindMotion(), children: [ diff --git a/lib/home/widgets/project_tile.dart b/lib/home/widgets/project_tile.dart index 06858eb8..9892760c 100644 --- a/lib/home/widgets/project_tile.dart +++ b/lib/home/widgets/project_tile.dart @@ -54,6 +54,7 @@ class ProjectTile extends StatelessWidget { ); return DismissibleTile( + canDismiss: project.type != ProjectTypes.systemChangelog, dismissibleKey: ValueKey(project.id), // confirmDismiss: (final direction) async { // if (direction != DismissDirection.startToEnd) return false; From 49df3b3d98e88ffb08a2d64f8cd724a4ddc52138 Mon Sep 17 00:00:00 2001 From: Arenukvern Date: Wed, 6 Mar 2024 23:29:20 +0200 Subject: [PATCH 4/7] feat: adaptive folders --- lib/home/home_screen.dart | 39 +++++++++++++++++++++++++--------- lib/home/tags/tags_screen.dart | 6 ++++-- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/lib/home/home_screen.dart b/lib/home/home_screen.dart index cba8ec3d..bc2c995b 100644 --- a/lib/home/home_screen.dart +++ b/lib/home/home_screen.dart @@ -110,17 +110,36 @@ class TagsVerticalBar extends StatelessWidget { onPressed: () async => showAdaptiveDialog( context: context, barrierDismissible: true, - builder: (final context) => Dialog( - child: ConstrainedBox( - constraints: const BoxConstraints( - maxHeight: 600, - maxWidth: 400, - minWidth: 200, - minHeight: 150, + builder: (final context) { + final screenLayout = ScreenLayout.of(context); + return AnimatedContainer( + duration: 350.milliseconds, + padding: screenLayout.small + ? EdgeInsets.zero + : const EdgeInsets.symmetric( + horizontal: 40, + vertical: 24, + ), + child: Dialog( + insetPadding: EdgeInsets.zero, + child: ConstrainedBox( + constraints: screenLayout.small + ? const BoxConstraints() + : const BoxConstraints( + maxHeight: 600, + maxWidth: 400, + minWidth: 200, + minHeight: 150, + ), + child: AnimatedSize( + curve: Curves.easeIn, + duration: 150.milliseconds, + child: const TagsScreen(), + ), + ), ), - child: const TagsScreen(), - ), - ), + ); + }, ), icon: const Icon(Icons.edit_square), tooltip: l10n.clickToEditFolders, diff --git a/lib/home/tags/tags_screen.dart b/lib/home/tags/tags_screen.dart index e4090494..6dcee427 100644 --- a/lib/home/tags/tags_screen.dart +++ b/lib/home/tags/tags_screen.dart @@ -27,7 +27,9 @@ class TagsScreenBody extends StatelessWidget { TagsScreenType.allTags => const _TagsListView(), TagsScreenType.editingTag => const _ManageTagView(), TagsScreenType.addProjects => const _AddProjectsView(), - }; + } + .animate() + .fadeIn(); } } @@ -365,7 +367,7 @@ class _AddProjectsView extends StatelessWidget { padding: const MaterialStatePropertyAll( EdgeInsets.symmetric(horizontal: 16), ), - autoFocus: true, + autoFocus: PlatformInfo.isNativeWebDesktop, ), ], ); From 55974699cc3d95109aa9de3a779edf2201ad6207 Mon Sep 17 00:00:00 2001 From: Arenukvern Date: Thu, 7 Mar 2024 00:34:28 +0200 Subject: [PATCH 5/7] chore: firebase --- ios/Podfile.lock | 278 ------------------ ios/Runner.xcodeproj/project.pbxproj | 12 +- macos/Flutter/GeneratedPluginRegistrant.swift | 2 - packages/core/pubspec.yaml | 10 +- packages/ui_kit/pubspec.yaml | 10 +- pubspec.lock | 56 +--- 6 files changed, 32 insertions(+), 336 deletions(-) delete mode 100644 ios/Podfile.lock diff --git a/ios/Podfile.lock b/ios/Podfile.lock deleted file mode 100644 index 9c55c7d3..00000000 --- a/ios/Podfile.lock +++ /dev/null @@ -1,278 +0,0 @@ -PODS: - - connectivity_plus (0.0.1): - - Flutter - - ReachabilitySwift - - device_info_plus (0.0.1): - - Flutter - - Firebase/Analytics (10.17.0): - - Firebase/Core - - Firebase/Core (10.17.0): - - Firebase/CoreOnly - - FirebaseAnalytics (~> 10.17.0) - - Firebase/CoreOnly (10.17.0): - - FirebaseCore (= 10.17.0) - - Firebase/Crashlytics (10.17.0): - - Firebase/CoreOnly - - FirebaseCrashlytics (~> 10.17.0) - - Firebase/Messaging (10.17.0): - - Firebase/CoreOnly - - FirebaseMessaging (~> 10.17.0) - - firebase_analytics (10.7.0): - - Firebase/Analytics (= 10.17.0) - - firebase_core - - Flutter - - firebase_core (2.22.0): - - Firebase/CoreOnly (= 10.17.0) - - Flutter - - firebase_crashlytics (3.4.4): - - Firebase/Crashlytics (= 10.17.0) - - firebase_core - - Flutter - - firebase_messaging (14.7.4): - - Firebase/Messaging (= 10.17.0) - - firebase_core - - Flutter - - FirebaseAnalytics (10.17.0): - - FirebaseAnalytics/AdIdSupport (= 10.17.0) - - FirebaseCore (~> 10.0) - - FirebaseInstallations (~> 10.0) - - GoogleUtilities/AppDelegateSwizzler (~> 7.11) - - GoogleUtilities/MethodSwizzler (~> 7.11) - - GoogleUtilities/Network (~> 7.11) - - "GoogleUtilities/NSData+zlib (~> 7.11)" - - nanopb (< 2.30910.0, >= 2.30908.0) - - FirebaseAnalytics/AdIdSupport (10.17.0): - - FirebaseCore (~> 10.0) - - FirebaseInstallations (~> 10.0) - - GoogleAppMeasurement (= 10.17.0) - - GoogleUtilities/AppDelegateSwizzler (~> 7.11) - - GoogleUtilities/MethodSwizzler (~> 7.11) - - GoogleUtilities/Network (~> 7.11) - - "GoogleUtilities/NSData+zlib (~> 7.11)" - - nanopb (< 2.30910.0, >= 2.30908.0) - - FirebaseCore (10.17.0): - - FirebaseCoreInternal (~> 10.0) - - GoogleUtilities/Environment (~> 7.8) - - GoogleUtilities/Logger (~> 7.8) - - FirebaseCoreExtension (10.17.0): - - FirebaseCore (~> 10.0) - - FirebaseCoreInternal (10.17.0): - - "GoogleUtilities/NSData+zlib (~> 7.8)" - - FirebaseCrashlytics (10.17.0): - - FirebaseCore (~> 10.5) - - FirebaseInstallations (~> 10.0) - - FirebaseSessions (~> 10.5) - - GoogleDataTransport (~> 9.2) - - GoogleUtilities/Environment (~> 7.8) - - nanopb (< 2.30910.0, >= 2.30908.0) - - PromisesObjC (~> 2.1) - - FirebaseInstallations (10.17.0): - - FirebaseCore (~> 10.0) - - GoogleUtilities/Environment (~> 7.8) - - GoogleUtilities/UserDefaults (~> 7.8) - - PromisesObjC (~> 2.1) - - FirebaseMessaging (10.17.0): - - FirebaseCore (~> 10.0) - - FirebaseInstallations (~> 10.0) - - GoogleDataTransport (~> 9.2) - - GoogleUtilities/AppDelegateSwizzler (~> 7.8) - - GoogleUtilities/Environment (~> 7.8) - - GoogleUtilities/Reachability (~> 7.8) - - GoogleUtilities/UserDefaults (~> 7.8) - - nanopb (< 2.30910.0, >= 2.30908.0) - - FirebaseSessions (10.17.0): - - FirebaseCore (~> 10.5) - - FirebaseCoreExtension (~> 10.0) - - FirebaseInstallations (~> 10.0) - - GoogleDataTransport (~> 9.2) - - GoogleUtilities/Environment (~> 7.10) - - nanopb (< 2.30910.0, >= 2.30908.0) - - PromisesSwift (~> 2.1) - - Flutter (1.0.0) - - flutter_keyboard_visibility (0.0.1): - - Flutter - - flutter_native_splash (0.0.1): - - Flutter - - GoogleAppMeasurement (10.17.0): - - GoogleAppMeasurement/AdIdSupport (= 10.17.0) - - GoogleUtilities/AppDelegateSwizzler (~> 7.11) - - GoogleUtilities/MethodSwizzler (~> 7.11) - - GoogleUtilities/Network (~> 7.11) - - "GoogleUtilities/NSData+zlib (~> 7.11)" - - nanopb (< 2.30910.0, >= 2.30908.0) - - GoogleAppMeasurement/AdIdSupport (10.17.0): - - GoogleAppMeasurement/WithoutAdIdSupport (= 10.17.0) - - GoogleUtilities/AppDelegateSwizzler (~> 7.11) - - GoogleUtilities/MethodSwizzler (~> 7.11) - - GoogleUtilities/Network (~> 7.11) - - "GoogleUtilities/NSData+zlib (~> 7.11)" - - nanopb (< 2.30910.0, >= 2.30908.0) - - GoogleAppMeasurement/WithoutAdIdSupport (10.17.0): - - GoogleUtilities/AppDelegateSwizzler (~> 7.11) - - GoogleUtilities/MethodSwizzler (~> 7.11) - - GoogleUtilities/Network (~> 7.11) - - "GoogleUtilities/NSData+zlib (~> 7.11)" - - nanopb (< 2.30910.0, >= 2.30908.0) - - GoogleDataTransport (9.2.5): - - GoogleUtilities/Environment (~> 7.7) - - nanopb (< 2.30910.0, >= 2.30908.0) - - PromisesObjC (< 3.0, >= 1.2) - - GoogleUtilities/AppDelegateSwizzler (7.11.6): - - GoogleUtilities/Environment - - GoogleUtilities/Logger - - GoogleUtilities/Network - - GoogleUtilities/Environment (7.11.6): - - PromisesObjC (< 3.0, >= 1.2) - - GoogleUtilities/Logger (7.11.6): - - GoogleUtilities/Environment - - GoogleUtilities/MethodSwizzler (7.11.6): - - GoogleUtilities/Logger - - GoogleUtilities/Network (7.11.6): - - GoogleUtilities/Logger - - "GoogleUtilities/NSData+zlib" - - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (7.11.6)" - - GoogleUtilities/Reachability (7.11.6): - - GoogleUtilities/Logger - - GoogleUtilities/UserDefaults (7.11.6): - - GoogleUtilities/Logger - - isar_flutter_libs (1.0.0): - - Flutter - - nanopb (2.30909.1): - - nanopb/decode (= 2.30909.1) - - nanopb/encode (= 2.30909.1) - - nanopb/decode (2.30909.1) - - nanopb/encode (2.30909.1) - - package_info_plus (0.4.5): - - Flutter - - pasteboard (0.0.1): - - Flutter - - path_provider_foundation (0.0.1): - - Flutter - - FlutterMacOS - - permission_handler_apple (9.1.1): - - Flutter - - PromisesObjC (2.3.1) - - PromisesSwift (2.3.1): - - PromisesObjC (= 2.3.1) - - ReachabilitySwift (5.0.0) - - share_plus (0.0.1): - - Flutter - - shared_preferences_foundation (0.0.1): - - Flutter - - FlutterMacOS - - url_launcher_ios (0.0.1): - - Flutter - -DEPENDENCIES: - - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - - firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) - - firebase_core (from `.symlinks/plugins/firebase_core/ios`) - - firebase_crashlytics (from `.symlinks/plugins/firebase_crashlytics/ios`) - - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - - Flutter (from `Flutter`) - - flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`) - - flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`) - - isar_flutter_libs (from `.symlinks/plugins/isar_flutter_libs/ios`) - - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - - pasteboard (from `.symlinks/plugins/pasteboard/ios`) - - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - - share_plus (from `.symlinks/plugins/share_plus/ios`) - - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - -SPEC REPOS: - trunk: - - Firebase - - FirebaseAnalytics - - FirebaseCore - - FirebaseCoreExtension - - FirebaseCoreInternal - - FirebaseCrashlytics - - FirebaseInstallations - - FirebaseMessaging - - FirebaseSessions - - GoogleAppMeasurement - - GoogleDataTransport - - GoogleUtilities - - nanopb - - PromisesObjC - - PromisesSwift - - ReachabilitySwift - -EXTERNAL SOURCES: - connectivity_plus: - :path: ".symlinks/plugins/connectivity_plus/ios" - device_info_plus: - :path: ".symlinks/plugins/device_info_plus/ios" - firebase_analytics: - :path: ".symlinks/plugins/firebase_analytics/ios" - firebase_core: - :path: ".symlinks/plugins/firebase_core/ios" - firebase_crashlytics: - :path: ".symlinks/plugins/firebase_crashlytics/ios" - firebase_messaging: - :path: ".symlinks/plugins/firebase_messaging/ios" - Flutter: - :path: Flutter - flutter_keyboard_visibility: - :path: ".symlinks/plugins/flutter_keyboard_visibility/ios" - flutter_native_splash: - :path: ".symlinks/plugins/flutter_native_splash/ios" - isar_flutter_libs: - :path: ".symlinks/plugins/isar_flutter_libs/ios" - package_info_plus: - :path: ".symlinks/plugins/package_info_plus/ios" - pasteboard: - :path: ".symlinks/plugins/pasteboard/ios" - path_provider_foundation: - :path: ".symlinks/plugins/path_provider_foundation/darwin" - permission_handler_apple: - :path: ".symlinks/plugins/permission_handler_apple/ios" - share_plus: - :path: ".symlinks/plugins/share_plus/ios" - shared_preferences_foundation: - :path: ".symlinks/plugins/shared_preferences_foundation/darwin" - url_launcher_ios: - :path: ".symlinks/plugins/url_launcher_ios/ios" - -SPEC CHECKSUMS: - connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d - device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6 - Firebase: f4ac0b02927af9253ae094d23deecf0890da7374 - firebase_analytics: d6f520c1030d2c1215851f6e332d39a489a30bd2 - firebase_core: efc9455611b8769fa90fbdae5da182600bd6901c - firebase_crashlytics: 6a564f58db90be49c49d9ac100bc5cc3fcbf8267 - firebase_messaging: 9c697d1ecfe77edf15d995b5048906ffc994c96c - FirebaseAnalytics: b9284f9fff10157a843e0422e908711f7bf3b9f2 - FirebaseCore: 534544dd98cabcf4bf8598d88ec683b02319a528 - FirebaseCoreExtension: 47720bb330d7041047c0935a34a3a4b92f818074 - FirebaseCoreInternal: 2cf9202e226e3f78d2bf6d56c472686b935bfb7f - FirebaseCrashlytics: d78651ad7db206ef98269e103ac38d69d569200a - FirebaseInstallations: 9387bf15abfc69a714f54e54f74a251264fdb79b - FirebaseMessaging: 1367b28c0c83a63072af4a711328fcc2e6899902 - FirebaseSessions: 49f39e5c10e3f9fdd38d01b748329bae2a2fa8ed - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 - flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069 - flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef - GoogleAppMeasurement: 4dcddfc7f102825c1c4e6422cb35567b101881a7 - GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2 - GoogleUtilities: 202e7a9f5128accd11160fb9c19612de1911aa19 - isar_flutter_libs: b69f437aeab9c521821c3f376198c4371fa21073 - nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5 - package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85 - pasteboard: 982969ebaa7c78af3e6cc7761e8f5e77565d9ce0 - path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 - permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 - PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4 - PromisesSwift: 28dca69a9c40779916ac2d6985a0192a5cb4a265 - ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 - share_plus: c3fef564749587fc939ef86ffb283ceac0baf9f5 - shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 - url_launcher_ios: 68d46cc9766d0c41dbdc884310529557e3cd7a86 - -PODFILE CHECKSUM: c14fdbfb9440b342d406257e9273ff4c18868c17 - -COCOAPODS: 1.13.0 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 6426ef0e..f8428cbe 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -380,7 +380,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -401,7 +401,7 @@ ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -465,7 +465,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -515,7 +515,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -538,7 +538,7 @@ ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -567,7 +567,7 @@ ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 29000d5c..283c5ff6 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -12,7 +12,6 @@ import file_selector_macos import firebase_analytics import firebase_core import firebase_crashlytics -import firebase_messaging import in_app_purchase_storekit import isar_flutter_libs import package_info_plus @@ -31,7 +30,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLTFirebaseAnalyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAnalyticsPlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin")) - FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) InAppPurchasePlugin.register(with: registry.registrar(forPlugin: "InAppPurchasePlugin")) IsarFlutterLibsPlugin.register(with: registry.registrar(forPlugin: "IsarFlutterLibsPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) diff --git a/packages/core/pubspec.yaml b/packages/core/pubspec.yaml index 203561db..a96a0af8 100644 --- a/packages/core/pubspec.yaml +++ b/packages/core/pubspec.yaml @@ -16,11 +16,11 @@ dependencies: file_picker: ^6.1.1 file_saver: ^0.2.9 file_selector: ^1.0.3 - firebase_analytics: ^10.8.5 - firebase_core: ^2.25.4 - firebase_core_web: ^2.11.4 - firebase_crashlytics: ^3.4.14 - firebase_messaging: ^14.7.15 + firebase_analytics: ^10.8.8 + firebase_analytics_web: ^0.5.5+20 + firebase_core: ^2.26.0 + firebase_core_web: ^2.11.5 + firebase_crashlytics: ^3.4.17 flutter: sdk: flutter flutter_animate: ^4.2.0+1 diff --git a/packages/ui_kit/pubspec.yaml b/packages/ui_kit/pubspec.yaml index 5d3abf06..c06d06b7 100644 --- a/packages/ui_kit/pubspec.yaml +++ b/packages/ui_kit/pubspec.yaml @@ -13,11 +13,11 @@ dependencies: core: path: ../core equatable: ^2.0.5 - firebase_analytics: ^10.8.5 - firebase_core: ^2.25.4 - firebase_core_web: ^2.11.4 - firebase_crashlytics: ^3.4.14 - firebase_messaging: ^14.7.15 + firebase_analytics: ^10.8.8 + firebase_analytics_web: ^0.5.5+20 + firebase_core: ^2.26.0 + firebase_core_web: ^2.11.5 + firebase_crashlytics: ^3.4.17 flutter: sdk: flutter flutter_animate: ^4.2.0+1 diff --git a/pubspec.lock b/pubspec.lock index 45452db2..cd6e6bd4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -13,10 +13,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: "1a52f1afae8ab7ac4741425114713bdbba802f1ce1e0648e167ffcc6e05e96cf" + sha256: "2489c399d8b23a12704bd9e056e3df957c69ceec621f4fc8d69fa7cd5211d1f4" url: "https://pub.dev" source: hosted - version: "1.3.21" + version: "1.3.24" analyzer: dependency: "direct dev" description: @@ -507,34 +507,34 @@ packages: dependency: transitive description: name: firebase_analytics - sha256: edb9f9eaecf0e6431e5c12b7fabdb68be3e85ce51f941ccbfa6cb71327e8b535 + sha256: c7f243b336232d01f2f7913d937107bc3a147e2aefb3008dbe0a56d2cf134c3e url: "https://pub.dev" source: hosted - version: "10.8.5" + version: "10.8.8" firebase_analytics_platform_interface: dependency: transitive description: name: firebase_analytics_platform_interface - sha256: de4a54353cf58412c6da6b660a0dbad8efacb33b345c0286bc3a2edb869124d8 + sha256: "2e68d302f566f2dec15b9d5a0c710c5d4c759a041aea5b33548785c198921541" url: "https://pub.dev" source: hosted - version: "3.9.5" + version: "3.9.8" firebase_analytics_web: dependency: transitive description: name: firebase_analytics_web - sha256: "77e4c02ffd0204ccc7856221193265c807b7e056fa62855f973a7f77435b5d41" + sha256: "5975aa69c58cc1f66597fc6e769b77b7cd8e3b32c6f9df6b36a496286399b510" url: "https://pub.dev" source: hosted - version: "0.5.5+17" + version: "0.5.5+20" firebase_core: dependency: "direct main" description: name: firebase_core - sha256: "7e049e32a9d347616edb39542cf92cd53fdb4a99fb6af0a0bff327c14cd76445" + sha256: a746f861618eef57a11d8b658a2db1fa5a336fc82ba65b7763d7e2292687de2b url: "https://pub.dev" source: hosted - version: "2.25.4" + version: "2.26.0" firebase_core_platform_interface: dependency: transitive description: @@ -547,50 +547,26 @@ packages: dependency: "direct main" description: name: firebase_core_web - sha256: "57e61d6010e253b36d38191cefd6199d7849152cdcd234b61ca290cdb278a0ba" + sha256: c8e1d59385eee98de63c92f961d2a7062c5d9a65e7f45bdc7f1b0b205aab2492 url: "https://pub.dev" source: hosted - version: "2.11.4" + version: "2.11.5" firebase_crashlytics: dependency: "direct main" description: name: firebase_crashlytics - sha256: efd096e4c3d2c568e128505b6e4ce5f5d5a1629f700a4d6fee6bd25b85937dde + sha256: "1b871e88921cd3bcf8fadfed32af7adbfecaa7e6a8bf5f44a2e0c1f6310c6842" url: "https://pub.dev" source: hosted - version: "3.4.14" + version: "3.4.17" firebase_crashlytics_platform_interface: dependency: transitive description: name: firebase_crashlytics_platform_interface - sha256: "225a54d834a118be262c1f1096d407515e35b99d9b474c987abdcff7663f2b81" + sha256: f8af3f770257fc1ddd6cf1741edcf6cb440124f02e197480b05f26417d48a7b2 url: "https://pub.dev" source: hosted - version: "3.6.21" - firebase_messaging: - dependency: transitive - description: - name: firebase_messaging - sha256: "9c97b20c012542252a8853f11334efd833ddae83551fe37d27f87d885c655038" - url: "https://pub.dev" - source: hosted - version: "14.7.15" - firebase_messaging_platform_interface: - dependency: transitive - description: - name: firebase_messaging_platform_interface - sha256: d464b255e922c7915dc4b0ebc305ebad4e1f130519bee3d6e568ef2ea1613a4b - url: "https://pub.dev" - source: hosted - version: "4.5.23" - firebase_messaging_web: - dependency: transitive - description: - name: firebase_messaging_web - sha256: f3f71aeec719ec1fe2c99f75cd74d00d33f1c240cf1e402cc9d43883e84f935a - url: "https://pub.dev" - source: hosted - version: "3.6.4" + version: "3.6.24" fixnum: dependency: transitive description: From 765fe45af47c5478ec57ca8a50f2d00b21f80594 Mon Sep 17 00:00:00 2001 From: Arenukvern Date: Thu, 7 Mar 2024 00:35:01 +0200 Subject: [PATCH 6/7] chore: 3.19.5+47 --- pubspec.yaml | 2 +- snap/snapcraft.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 5e98feac..076927df 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 3.19.4+46 +version: 3.19.5+47 environment: sdk: ">=3.3.0 <4.0.0" diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 9d5cd596..4a1505e9 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,5 @@ name: last-answer -version: 3.19.4+46 +version: 3.19.5+47 summary: Fast ideas brainstorming tool with quick notes description: | Do you have a cool idea and need to get it down quickly? Or do you blog / write articles on social media? From 0d1be5f347342cd9a8c459f19b473b8fd136dd88 Mon Sep 17 00:00:00 2001 From: Arenukvern Date: Thu, 7 Mar 2024 00:46:13 +0200 Subject: [PATCH 7/7] fix: release web workflow --- .github/workflows/release_web.workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_web.workflow.yml b/.github/workflows/release_web.workflow.yml index 9e604a40..1d140d95 100644 --- a/.github/workflows/release_web.workflow.yml +++ b/.github/workflows/release_web.workflow.yml @@ -4,7 +4,7 @@ on: types: [created] push: branches: - - master-web + - release/web jobs: build: name: Build Web