Skip to content

Commit

Permalink
ShareSpaceObjectWidget class with related params
Browse files Browse the repository at this point in the history
  • Loading branch information
kumarpalsinh25 committed Nov 29, 2024
1 parent 3faa415 commit f6b3c08
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
25 changes: 20 additions & 5 deletions app/lib/common/widgets/share/action/share_space_object_action.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:acter/common/widgets/share/widgets/attach_options.dart';
import 'package:acter/common/widgets/share/widgets/external_share_options.dart';
import 'package:acter/features/deep_linking/actions/show_qr_code.dart';
import 'package:acter/features/deep_linking/types.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
Expand All @@ -9,26 +10,40 @@ import 'package:share_plus/share_plus.dart';

Future<void> openShareSpaceObjectDialog({
required BuildContext context,
required String link,
required String spaceId,
required ObjectType objectType,
required String objectId,
}) async {
await showModalBottomSheet(
showDragHandle: true,
useSafeArea: true,
context: context,
isScrollControlled: true,
isDismissible: true,
builder: (context) => ShareActionUI(link: link),
builder: (context) => ShareSpaceObjectActionUI(
spaceId: spaceId,
objectType: objectType,
objectId: objectId,
),
);
}

class ShareActionUI extends StatelessWidget {
final String link;
class ShareSpaceObjectActionUI extends StatelessWidget {
final String spaceId;
final ObjectType objectType;
final String objectId;

const ShareActionUI({super.key, required this.link});
const ShareSpaceObjectActionUI({
super.key,
required this.spaceId,
required this.objectType,
required this.objectId,
});

@override
Widget build(BuildContext context) {
final lang = L10n.of(context);
final link = '';
return SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(12),
Expand Down
4 changes: 3 additions & 1 deletion app/lib/common/widgets/share/share_space_object_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class ShareSpaceObjectWidget extends StatelessWidget {
icon: PhosphorIcon(PhosphorIcons.shareFat()),
onPressed: () => openShareSpaceObjectDialog(
context: context,
link: spaceId,
spaceId: spaceId,
objectType: objectType,
objectId: objectId,
),
);
}
Expand Down

0 comments on commit f6b3c08

Please sign in to comment.