forked from eatvio/eatvio_app
feat(feed): add share url
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.da
|
||||
import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
class BlogPostWidget extends StatefulWidget {
|
||||
final FeedBlogPostModel feedBlogPostModel;
|
||||
@@ -100,18 +101,25 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
child: Row(
|
||||
children: [
|
||||
_iconButton(Icons.favorite_border_rounded, widget.feedBlogPostModel.totalLikes.toString()),
|
||||
_iconButton(icon: Icons.favorite_border_rounded, text: widget.feedBlogPostModel.totalLikes.toString()),
|
||||
SizedBox(width: 8),
|
||||
_iconButton(
|
||||
Icons.mode_comment_outlined,
|
||||
widget.feedBlogPostModel.totalComments.toString(),
|
||||
() => GoRouter.of(context).pushNamed(
|
||||
icon: Icons.mode_comment_outlined,
|
||||
text: widget.feedBlogPostModel.totalComments.toString(),
|
||||
onTap: () => GoRouter.of(context).pushNamed(
|
||||
'blogPostScreen',
|
||||
extra: widget.feedBlogPostModel,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
_iconButton(Icons.reply_rounded),
|
||||
_iconButton(
|
||||
icon: Icons.reply_rounded,
|
||||
onTap: () => Share.shareUri(
|
||||
Uri.parse(
|
||||
baseUrl + '/ru/blog_post/' + widget.feedBlogPostModel.id.toString(),
|
||||
),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Icon(
|
||||
Icons.visibility_rounded,
|
||||
@@ -137,7 +145,7 @@ class _BlogPostWidgetState extends State<BlogPostWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
_iconButton(IconData icon, [String? text, Function()? onTap]) {
|
||||
_iconButton({required IconData icon, String? text, Function()? onTap}) {
|
||||
return InkWell(
|
||||
onTap: onTap ?? () {},
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
|
||||
@@ -48,6 +48,7 @@ dependencies:
|
||||
syncfusion_flutter_charts: ^26.2.8
|
||||
table_calendar: ^3.1.2
|
||||
flutter_keyboard_visibility: ^6.0.0
|
||||
share_plus: ^10.0.0
|
||||
|
||||
dev_dependencies:
|
||||
build_runner: ^2.4.11
|
||||
|
||||
Reference in New Issue
Block a user