♻️ Removed the post compose screen completely

This commit is contained in:
2025-11-02 01:43:04 +08:00
parent 877001b802
commit 88f149584e
3 changed files with 10 additions and 19 deletions

View File

@@ -105,17 +105,6 @@ final routerProvider = Provider<GoRouter>((ref) {
},
routes: [
// 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(
name: 'postEdit',
path: '/posts/:id/edit',

View File

@@ -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_quick_reply.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/utils/share_utils.dart';
import 'package:island/widgets/safety/abuse_report_helper.dart';
@@ -229,9 +230,9 @@ class PostActionButtons extends HookConsumerWidget {
final replyButtons = <Widget>[
FilledButton.tonal(
onPressed: () {
context.pushNamed(
'postCompose',
extra: PostComposeInitialState(replyingTo: post),
PostComposeSheet.show(
context,
initialState: PostComposeInitialState(replyingTo: post),
);
},
style: FilledButton.styleFrom(
@@ -255,9 +256,9 @@ class PostActionButtons extends HookConsumerWidget {
message: 'forward'.tr(),
child: FilledButton.tonal(
onPressed: () {
context.pushNamed(
'postCompose',
extra: PostComposeInitialState(forwardingTo: post),
PostComposeSheet.show(
context,
initialState: PostComposeInitialState(forwardingTo: post),
);
},
style: FilledButton.styleFrom(

View File

@@ -10,6 +10,7 @@ import 'package:island/widgets/content/sheet.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:island/screens/posts/compose.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/network.dart';
import 'package:mime/mime.dart';
@@ -174,9 +175,9 @@ class _ShareSheetState extends ConsumerState<ShareSheet> {
attachments: attachments,
);
// Navigate to compose screen
// Show compose sheet
if (mounted) {
context.pushNamed('postCompose', extra: initialState);
PostComposeSheet.show(context, initialState: initialState);
Navigator.of(context).pop(); // Close the share sheet
}
} catch (e) {