Compare commits
No commits in common. "312d68286ee770319473cbd047550414d4e8d5fb" and "356d3d4d3ece405b5318c04c0132b567fc96bb7f" have entirely different histories.
312d68286e
...
356d3d4d3e
@ -46,10 +46,10 @@ class NotificationProvider extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Platform.isIOS || Platform.isMacOS) {
|
if (Platform.isIOS || Platform.isMacOS) {
|
||||||
provider = 'apns';
|
provider = 'apple';
|
||||||
token = await FirebaseMessaging.instance.getAPNSToken();
|
token = await FirebaseMessaging.instance.getAPNSToken();
|
||||||
} else {
|
} else {
|
||||||
provider = 'fcm';
|
provider = 'firebase';
|
||||||
token = await FirebaseMessaging.instance.getToken();
|
token = await FirebaseMessaging.instance.getToken();
|
||||||
}
|
}
|
||||||
log('Device Push Token is $token');
|
log('Device Push Token is $token');
|
||||||
|
@ -197,24 +197,11 @@ class _NotificationScreenState extends State<NotificationScreen> {
|
|||||||
'interactive.subscription'
|
'interactive.subscription'
|
||||||
].contains(nty.topic) &&
|
].contains(nty.topic) &&
|
||||||
nty.metadata['related_post'] != null)
|
nty.metadata['related_post'] != null)
|
||||||
StyledWidget(Container(
|
PostItem(
|
||||||
decoration: BoxDecoration(
|
data: SnPost.fromJson(
|
||||||
borderRadius: const BorderRadius.all(
|
nty.metadata['related_post']!,
|
||||||
Radius.circular(8)),
|
|
||||||
border: Border.all(
|
|
||||||
color: Theme.of(context).dividerColor,
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
child: PostItem(
|
),
|
||||||
data: SnPost.fromJson(
|
|
||||||
nty.metadata['related_post']!,
|
|
||||||
),
|
|
||||||
showComments: false,
|
|
||||||
showReactions: false,
|
|
||||||
showMenu: false,
|
|
||||||
),
|
|
||||||
)).padding(top: 8),
|
|
||||||
const Gap(8),
|
const Gap(8),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
|
@ -18,8 +18,8 @@ class SnPost with _$SnPost {
|
|||||||
required String language,
|
required String language,
|
||||||
required String? alias,
|
required String? alias,
|
||||||
required String? aliasPrefix,
|
required String? aliasPrefix,
|
||||||
@Default([]) List<dynamic> tags,
|
required List<dynamic> tags,
|
||||||
@Default([]) List<dynamic> categories,
|
required List<dynamic> categories,
|
||||||
required List<SnPost>? replies,
|
required List<SnPost>? replies,
|
||||||
required int? replyId,
|
required int? replyId,
|
||||||
required int? repostId,
|
required int? repostId,
|
||||||
|
@ -583,8 +583,8 @@ class _$SnPostImpl extends _SnPost {
|
|||||||
required this.language,
|
required this.language,
|
||||||
required this.alias,
|
required this.alias,
|
||||||
required this.aliasPrefix,
|
required this.aliasPrefix,
|
||||||
final List<dynamic> tags = const [],
|
required final List<dynamic> tags,
|
||||||
final List<dynamic> categories = const [],
|
required final List<dynamic> categories,
|
||||||
required final List<SnPost>? replies,
|
required final List<SnPost>? replies,
|
||||||
required this.replyId,
|
required this.replyId,
|
||||||
required this.repostId,
|
required this.repostId,
|
||||||
@ -642,7 +642,6 @@ class _$SnPostImpl extends _SnPost {
|
|||||||
final String? aliasPrefix;
|
final String? aliasPrefix;
|
||||||
final List<dynamic> _tags;
|
final List<dynamic> _tags;
|
||||||
@override
|
@override
|
||||||
@JsonKey()
|
|
||||||
List<dynamic> get tags {
|
List<dynamic> get tags {
|
||||||
if (_tags is EqualUnmodifiableListView) return _tags;
|
if (_tags is EqualUnmodifiableListView) return _tags;
|
||||||
// ignore: implicit_dynamic_type
|
// ignore: implicit_dynamic_type
|
||||||
@ -651,7 +650,6 @@ class _$SnPostImpl extends _SnPost {
|
|||||||
|
|
||||||
final List<dynamic> _categories;
|
final List<dynamic> _categories;
|
||||||
@override
|
@override
|
||||||
@JsonKey()
|
|
||||||
List<dynamic> get categories {
|
List<dynamic> get categories {
|
||||||
if (_categories is EqualUnmodifiableListView) return _categories;
|
if (_categories is EqualUnmodifiableListView) return _categories;
|
||||||
// ignore: implicit_dynamic_type
|
// ignore: implicit_dynamic_type
|
||||||
@ -852,8 +850,8 @@ abstract class _SnPost extends SnPost {
|
|||||||
required final String language,
|
required final String language,
|
||||||
required final String? alias,
|
required final String? alias,
|
||||||
required final String? aliasPrefix,
|
required final String? aliasPrefix,
|
||||||
final List<dynamic> tags,
|
required final List<dynamic> tags,
|
||||||
final List<dynamic> categories,
|
required final List<dynamic> categories,
|
||||||
required final List<SnPost>? replies,
|
required final List<SnPost>? replies,
|
||||||
required final int? replyId,
|
required final int? replyId,
|
||||||
required final int? repostId,
|
required final int? repostId,
|
||||||
|
@ -18,8 +18,8 @@ _$SnPostImpl _$$SnPostImplFromJson(Map<String, dynamic> json) => _$SnPostImpl(
|
|||||||
language: json['language'] as String,
|
language: json['language'] as String,
|
||||||
alias: json['alias'] as String?,
|
alias: json['alias'] as String?,
|
||||||
aliasPrefix: json['alias_prefix'] as String?,
|
aliasPrefix: json['alias_prefix'] as String?,
|
||||||
tags: json['tags'] as List<dynamic>? ?? const [],
|
tags: json['tags'] as List<dynamic>,
|
||||||
categories: json['categories'] as List<dynamic>? ?? const [],
|
categories: json['categories'] as List<dynamic>,
|
||||||
replies: (json['replies'] as List<dynamic>?)
|
replies: (json['replies'] as List<dynamic>?)
|
||||||
?.map((e) => SnPost.fromJson(e as Map<String, dynamic>))
|
?.map((e) => SnPost.fromJson(e as Map<String, dynamic>))
|
||||||
.toList(),
|
.toList(),
|
||||||
|
@ -18,7 +18,6 @@ class PostItem extends StatelessWidget {
|
|||||||
final SnPost data;
|
final SnPost data;
|
||||||
final bool showReactions;
|
final bool showReactions;
|
||||||
final bool showComments;
|
final bool showComments;
|
||||||
final bool showMenu;
|
|
||||||
final double? maxWidth;
|
final double? maxWidth;
|
||||||
final Function(SnPost data)? onChanged;
|
final Function(SnPost data)? onChanged;
|
||||||
const PostItem({
|
const PostItem({
|
||||||
@ -26,7 +25,6 @@ class PostItem extends StatelessWidget {
|
|||||||
required this.data,
|
required this.data,
|
||||||
this.showReactions = true,
|
this.showReactions = true,
|
||||||
this.showComments = true,
|
this.showComments = true,
|
||||||
this.showMenu = true,
|
|
||||||
this.maxWidth,
|
this.maxWidth,
|
||||||
this.onChanged,
|
this.onChanged,
|
||||||
});
|
});
|
||||||
@ -45,7 +43,7 @@ class PostItem extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
_PostContentHeader(data: data, showMenu: showMenu)
|
_PostContentHeader(data: data)
|
||||||
.padding(horizontal: 12, vertical: 8),
|
.padding(horizontal: 12, vertical: 8),
|
||||||
if (data.body['title'] != null ||
|
if (data.body['title'] != null ||
|
||||||
data.body['description'] != null)
|
data.body['description'] != null)
|
||||||
@ -64,7 +62,7 @@ class PostItem extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (data.preload?.attachments?.isNotEmpty ?? false)
|
if (data.preload?.attachments?.isNotEmpty ?? true)
|
||||||
AttachmentList(
|
AttachmentList(
|
||||||
data: data.preload!.attachments!,
|
data: data.preload!.attachments!,
|
||||||
bordered: true,
|
bordered: true,
|
||||||
@ -109,71 +107,70 @@ class _PostBottomAction extends StatelessWidget {
|
|||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
if (showReactions || showComments)
|
Row(
|
||||||
Row(
|
children: [
|
||||||
children: [
|
if (showReactions)
|
||||||
if (showReactions)
|
InkWell(
|
||||||
InkWell(
|
child: Row(
|
||||||
child: Row(
|
children: [
|
||||||
children: [
|
Icon(Symbols.add_reaction, size: 20, color: iconColor),
|
||||||
Icon(Symbols.add_reaction, size: 20, color: iconColor),
|
const Gap(8),
|
||||||
const Gap(8),
|
if (data.totalUpvote > 0 &&
|
||||||
if (data.totalUpvote > 0 &&
|
data.totalUpvote >= data.totalDownvote)
|
||||||
data.totalUpvote >= data.totalDownvote)
|
Text('postReactionUpvote').plural(
|
||||||
Text('postReactionUpvote').plural(
|
data.totalUpvote,
|
||||||
data.totalUpvote,
|
)
|
||||||
)
|
else if (data.totalDownvote > 0)
|
||||||
else if (data.totalDownvote > 0)
|
Text('postReactionDownvote').plural(
|
||||||
Text('postReactionDownvote').plural(
|
data.totalDownvote,
|
||||||
data.totalDownvote,
|
)
|
||||||
)
|
else
|
||||||
else
|
Text('postReact').tr(),
|
||||||
Text('postReact').tr(),
|
],
|
||||||
],
|
).padding(horizontal: 8, vertical: 8),
|
||||||
).padding(horizontal: 8, vertical: 8),
|
onTap: () {
|
||||||
onTap: () {
|
showModalBottomSheet(
|
||||||
showModalBottomSheet(
|
context: context,
|
||||||
context: context,
|
builder: (context) => PostReactionPopup(
|
||||||
builder: (context) => PostReactionPopup(
|
data: data,
|
||||||
data: data,
|
onChanged: (value, attr, delta) {
|
||||||
onChanged: (value, attr, delta) {
|
onChanged(data.copyWith(
|
||||||
onChanged(data.copyWith(
|
totalUpvote: attr == 1
|
||||||
totalUpvote: attr == 1
|
? data.totalUpvote + delta
|
||||||
? data.totalUpvote + delta
|
: data.totalUpvote,
|
||||||
: data.totalUpvote,
|
totalDownvote: attr == 2
|
||||||
totalDownvote: attr == 2
|
? data.totalDownvote + delta
|
||||||
? data.totalDownvote + delta
|
: data.totalDownvote,
|
||||||
: data.totalDownvote,
|
metric: data.metric.copyWith(reactionList: value),
|
||||||
metric: data.metric.copyWith(reactionList: value),
|
));
|
||||||
));
|
},
|
||||||
},
|
),
|
||||||
),
|
);
|
||||||
);
|
},
|
||||||
},
|
),
|
||||||
),
|
if (showComments)
|
||||||
if (showComments)
|
InkWell(
|
||||||
InkWell(
|
child: Row(
|
||||||
child: Row(
|
children: [
|
||||||
children: [
|
Icon(Symbols.comment, size: 20, color: iconColor),
|
||||||
Icon(Symbols.comment, size: 20, color: iconColor),
|
const Gap(8),
|
||||||
const Gap(8),
|
Text('postComments').plural(data.metric.replyCount),
|
||||||
Text('postComments').plural(data.metric.replyCount),
|
],
|
||||||
],
|
).padding(horizontal: 8, vertical: 8),
|
||||||
).padding(horizontal: 8, vertical: 8),
|
onTap: () {
|
||||||
onTap: () {
|
showModalBottomSheet(
|
||||||
showModalBottomSheet(
|
context: context,
|
||||||
context: context,
|
useRootNavigator: true,
|
||||||
useRootNavigator: true,
|
builder: (context) => PostCommentListPopup(
|
||||||
builder: (context) => PostCommentListPopup(
|
postId: data.id,
|
||||||
postId: data.id,
|
commentCount: data.metric.replyCount,
|
||||||
commentCount: data.metric.replyCount,
|
),
|
||||||
),
|
);
|
||||||
);
|
},
|
||||||
},
|
),
|
||||||
),
|
].expand((ele) => [ele, const Gap(8)]).toList()
|
||||||
].expand((ele) => [ele, const Gap(8)]).toList()
|
..removeLast(),
|
||||||
..removeLast(),
|
),
|
||||||
),
|
|
||||||
InkWell(
|
InkWell(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Symbols.share,
|
Symbols.share,
|
||||||
@ -214,11 +211,11 @@ class _PostHeadline extends StatelessWidget {
|
|||||||
class _PostContentHeader extends StatelessWidget {
|
class _PostContentHeader extends StatelessWidget {
|
||||||
final SnPost data;
|
final SnPost data;
|
||||||
final bool isCompact;
|
final bool isCompact;
|
||||||
final bool showMenu;
|
final bool showActions;
|
||||||
const _PostContentHeader({
|
const _PostContentHeader({
|
||||||
required this.data,
|
required this.data,
|
||||||
this.isCompact = false,
|
this.isCompact = false,
|
||||||
this.showMenu = true,
|
this.showActions = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -267,7 +264,7 @@ class _PostContentHeader extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (showMenu)
|
if (showActions)
|
||||||
PopupMenuButton(
|
PopupMenuButton(
|
||||||
icon: const Icon(Symbols.more_horiz),
|
icon: const Icon(Symbols.more_horiz),
|
||||||
style: const ButtonStyle(
|
style: const ButtonStyle(
|
||||||
@ -379,7 +376,7 @@ class _PostQuoteContent extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
_PostContentHeader(data: child, isCompact: true, showMenu: false)
|
_PostContentHeader(data: child, isCompact: true, showActions: false)
|
||||||
.padding(bottom: 4),
|
.padding(bottom: 4),
|
||||||
_PostContentBody(data: child.body),
|
_PostContentBody(data: child.body),
|
||||||
],
|
],
|
||||||
|
24
pubspec.lock
24
pubspec.lock
@ -450,10 +450,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: file_selector_linux
|
name: file_selector_linux
|
||||||
sha256: "54cbbd957e1156d29548c7d9b9ec0c0ebb6de0a90452198683a7d23aed617a33"
|
sha256: b2b91daf8a68ecfa4a01b778a6f52edef9b14ecd506e771488ea0f2e0784198b
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.9.3+2"
|
version: "0.9.3+1"
|
||||||
file_selector_macos:
|
file_selector_macos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -567,10 +567,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: flutter_animate
|
name: flutter_animate
|
||||||
sha256: "7befe2d3252728afb77aecaaea1dec88a89d35b9b1d2eea6d04479e8af9117b5"
|
sha256: "5fc5bb5486624a9ed2d3d9a04a9f7a6a92511f36a030531e092ce819ab3091af"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.5.2"
|
version: "4.5.1"
|
||||||
flutter_cache_manager:
|
flutter_cache_manager:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -662,10 +662,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: flutter_webrtc
|
name: flutter_webrtc
|
||||||
sha256: fcaee6f28cc1221e804fcba16fbee6f20b0848af20fe11174a0f97c3b9833381
|
sha256: "0b69ecab98211504c10d40c1c4cb48eb387e03ea8e732079bd0d2665d8c20d3f"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.2"
|
version: "0.12.1+hotfix.1"
|
||||||
freezed:
|
freezed:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
@ -1190,10 +1190,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_android
|
name: path_provider_android
|
||||||
sha256: "8c4967f8b7cb46dc914e178daa29813d83ae502e0529d7b0478330616a691ef7"
|
sha256: c464428172cb986b758c6d1724c603097febb8fb855aa265aeecc9280c294d4a
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.14"
|
version: "2.2.12"
|
||||||
path_provider_foundation:
|
path_provider_foundation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -1815,6 +1815,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.9.0"
|
version: "0.9.0"
|
||||||
|
visibility_detector:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: visibility_detector
|
||||||
|
sha256: dd5cc11e13494f432d15939c3aa8ae76844c42b723398643ce9addb88a5ed420
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.4.0+2"
|
||||||
vm_service:
|
vm_service:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 2.0.0+9
|
version: 2.0.0+8
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.5.4
|
sdk: ^3.5.4
|
||||||
|
Loading…
x
Reference in New Issue
Block a user