Bring back the navigator cuz it needs to be `.fromPostView`

goToPost made it so that the post would get downloaded again when going from pots to fullpost
This commit is contained in:
krawieck 2020-09-10 13:11:16 +02:00
parent b5f581f773
commit cec2c7eeb4
1 changed files with 7 additions and 2 deletions

View File

@ -7,6 +7,7 @@ import 'package:lemmy_api_client/lemmy_api_client.dart';
import 'package:timeago/timeago.dart' as timeago;
import 'package:url_launcher/url_launcher.dart' as ul;
import '../pages/full_post.dart';
import '../url_launcher.dart';
import '../util/api_extensions.dart';
import '../util/goto.dart';
@ -417,11 +418,15 @@ class Post extends StatelessWidget {
return Container(
decoration: BoxDecoration(
boxShadow: [BoxShadow(blurRadius: 10, color: Colors.black54)],
color: theme.colorScheme.surface,
color: theme.cardColor,
borderRadius: BorderRadius.all(Radius.circular(20)),
),
child: InkWell(
onTap: fullPost ? null : () => goToPost(context, instanceUrl, post.id),
onTap: fullPost
? null
: () => Navigator.of(context).push(MaterialPageRoute(
builder: (context) => FullPostPage.fromPostView(
post))), //, instanceUrl, post.id),
child: Column(
children: [
info(),