♻️ Removed the post compose screen completely
This commit is contained in:
@@ -105,17 +105,6 @@ final routerProvider = Provider<GoRouter>((ref) {
|
|||||||
},
|
},
|
||||||
routes: [
|
routes: [
|
||||||
// Standalone routes without bottom navigation
|
// Standalone routes without bottom navigation
|
||||||
GoRoute(
|
|
||||||
name: 'postCompose',
|
|
||||||
path: '/posts/compose',
|
|
||||||
builder:
|
|
||||||
(context, state) => PostComposeScreen(
|
|
||||||
initialState: state.extra as PostComposeInitialState?,
|
|
||||||
type:
|
|
||||||
int.tryParse(state.uri.queryParameters['type'] ?? '0') ??
|
|
||||||
0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
GoRoute(
|
GoRoute(
|
||||||
name: 'postEdit',
|
name: 'postEdit',
|
||||||
path: '/posts/:id/edit',
|
path: '/posts/:id/edit',
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import 'package:island/widgets/post/post_award_history_sheet.dart';
|
|||||||
import 'package:island/widgets/post/post_pin_sheet.dart';
|
import 'package:island/widgets/post/post_pin_sheet.dart';
|
||||||
import 'package:island/widgets/post/post_quick_reply.dart';
|
import 'package:island/widgets/post/post_quick_reply.dart';
|
||||||
import 'package:island/widgets/post/post_replies.dart';
|
import 'package:island/widgets/post/post_replies.dart';
|
||||||
|
import 'package:island/widgets/post/compose_sheet.dart';
|
||||||
import 'package:island/widgets/response.dart';
|
import 'package:island/widgets/response.dart';
|
||||||
import 'package:island/utils/share_utils.dart';
|
import 'package:island/utils/share_utils.dart';
|
||||||
import 'package:island/widgets/safety/abuse_report_helper.dart';
|
import 'package:island/widgets/safety/abuse_report_helper.dart';
|
||||||
@@ -229,9 +230,9 @@ class PostActionButtons extends HookConsumerWidget {
|
|||||||
final replyButtons = <Widget>[
|
final replyButtons = <Widget>[
|
||||||
FilledButton.tonal(
|
FilledButton.tonal(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.pushNamed(
|
PostComposeSheet.show(
|
||||||
'postCompose',
|
context,
|
||||||
extra: PostComposeInitialState(replyingTo: post),
|
initialState: PostComposeInitialState(replyingTo: post),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
style: FilledButton.styleFrom(
|
style: FilledButton.styleFrom(
|
||||||
@@ -255,9 +256,9 @@ class PostActionButtons extends HookConsumerWidget {
|
|||||||
message: 'forward'.tr(),
|
message: 'forward'.tr(),
|
||||||
child: FilledButton.tonal(
|
child: FilledButton.tonal(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.pushNamed(
|
PostComposeSheet.show(
|
||||||
'postCompose',
|
context,
|
||||||
extra: PostComposeInitialState(forwardingTo: post),
|
initialState: PostComposeInitialState(forwardingTo: post),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
style: FilledButton.styleFrom(
|
style: FilledButton.styleFrom(
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import 'package:island/widgets/content/sheet.dart';
|
|||||||
import 'package:material_symbols_icons/symbols.dart';
|
import 'package:material_symbols_icons/symbols.dart';
|
||||||
import 'package:island/screens/posts/compose.dart';
|
import 'package:island/screens/posts/compose.dart';
|
||||||
import 'package:island/models/file.dart';
|
import 'package:island/models/file.dart';
|
||||||
|
import 'package:island/widgets/post/compose_sheet.dart';
|
||||||
import 'package:island/pods/link_preview.dart';
|
import 'package:island/pods/link_preview.dart';
|
||||||
import 'package:island/pods/network.dart';
|
import 'package:island/pods/network.dart';
|
||||||
import 'package:mime/mime.dart';
|
import 'package:mime/mime.dart';
|
||||||
@@ -174,9 +175,9 @@ class _ShareSheetState extends ConsumerState<ShareSheet> {
|
|||||||
attachments: attachments,
|
attachments: attachments,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Navigate to compose screen
|
// Show compose sheet
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
context.pushNamed('postCompose', extra: initialState);
|
PostComposeSheet.show(context, initialState: initialState);
|
||||||
Navigator.of(context).pop(); // Close the share sheet
|
Navigator.of(context).pop(); // Close the share sheet
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user