♻️ Openable Post Item now push pages
This commit is contained in:
parent
12d03836f9
commit
0722c99f21
@ -1,7 +1,6 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
|
|
||||||
import 'package:animations/animations.dart';
|
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:file_saver/file_saver.dart';
|
import 'package:file_saver/file_saver.dart';
|
||||||
@ -26,7 +25,6 @@ import 'package:surface/providers/sn_network.dart';
|
|||||||
import 'package:surface/providers/translation.dart';
|
import 'package:surface/providers/translation.dart';
|
||||||
import 'package:surface/providers/user_directory.dart';
|
import 'package:surface/providers/user_directory.dart';
|
||||||
import 'package:surface/providers/userinfo.dart';
|
import 'package:surface/providers/userinfo.dart';
|
||||||
import 'package:surface/screens/post/post_detail.dart';
|
|
||||||
import 'package:surface/types/attachment.dart';
|
import 'package:surface/types/attachment.dart';
|
||||||
import 'package:surface/types/post.dart';
|
import 'package:surface/types/post.dart';
|
||||||
import 'package:surface/types/reaction.dart';
|
import 'package:surface/types/reaction.dart';
|
||||||
@ -74,40 +72,25 @@ class OpenablePostItem extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final cfg = context.read<ConfigProvider>();
|
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
constraints: BoxConstraints(maxWidth: maxWidth ?? double.infinity),
|
constraints: BoxConstraints(maxWidth: maxWidth ?? double.infinity),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: OpenContainer(
|
child: GestureDetector(
|
||||||
closedBuilder: (_, __) => Container(
|
child: PostItem(
|
||||||
constraints: BoxConstraints(maxWidth: maxWidth ?? double.infinity),
|
data: data,
|
||||||
child: PostItem(
|
maxWidth: maxWidth,
|
||||||
data: data,
|
showComments: showComments,
|
||||||
maxWidth: maxWidth,
|
showFullPost: showFullPost,
|
||||||
showComments: showComments,
|
showExpandableComments: showExpandableComments,
|
||||||
showFullPost: showFullPost,
|
onChanged: onChanged,
|
||||||
showExpandableComments: showExpandableComments,
|
onDeleted: onDeleted,
|
||||||
onChanged: onChanged,
|
onSelectAnswer: onSelectAnswer,
|
||||||
onDeleted: onDeleted,
|
|
||||||
onSelectAnswer: onSelectAnswer,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
openBuilder: (_, close) => PostDetailScreen(
|
|
||||||
slug: data.id.toString(),
|
|
||||||
preload: data,
|
|
||||||
onBack: close,
|
|
||||||
),
|
|
||||||
openColor: Colors.transparent,
|
|
||||||
openElevation: 0,
|
|
||||||
transitionType: ContainerTransitionType.fade,
|
|
||||||
closedElevation: 0,
|
|
||||||
closedColor: Theme.of(context).colorScheme.surface.withOpacity(
|
|
||||||
cfg.prefs.getBool(kAppBackgroundStoreKey) == true ? 0 : 1,
|
|
||||||
),
|
|
||||||
closedShape: const RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(16)),
|
|
||||||
),
|
),
|
||||||
|
onTap: () {
|
||||||
|
GoRouter.of(context).pushNamed('postDetail', pathParameters: {
|
||||||
|
'slug': data.id.toString(),
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user