chore: Follow up user bottom sheet
This commit is contained in:
parent
010ae8fb09
commit
9e0acdfd5f
2 changed files with 19 additions and 5 deletions
|
|
@ -85,7 +85,10 @@ class UserBottomSheetView extends StatelessWidget {
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
TextButton.icon(
|
TextButton.icon(
|
||||||
onPressed: () => FluffyShare.share(userId, context),
|
onPressed: () => FluffyShare.share(
|
||||||
|
'https://matrix.to/#/$userId}',
|
||||||
|
context,
|
||||||
|
),
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.adaptive.share_outlined,
|
Icons.adaptive.share_outlined,
|
||||||
size: 16,
|
size: 16,
|
||||||
|
|
@ -102,7 +105,11 @@ class UserBottomSheetView extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextButton.icon(
|
TextButton.icon(
|
||||||
onPressed: () => FluffyShare.share(userId, context),
|
onPressed: () => FluffyShare.share(
|
||||||
|
userId,
|
||||||
|
context,
|
||||||
|
copyOnly: true,
|
||||||
|
),
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.copy_outlined,
|
Icons.copy_outlined,
|
||||||
size: 14,
|
size: 14,
|
||||||
|
|
@ -125,7 +132,10 @@ class UserBottomSheetView extends StatelessWidget {
|
||||||
),
|
),
|
||||||
if (userId != client.userID)
|
if (userId != client.userID)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(12.0),
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16.0,
|
||||||
|
vertical: 8.0,
|
||||||
|
),
|
||||||
child: ElevatedButton.icon(
|
child: ElevatedButton.icon(
|
||||||
onPressed: () => controller
|
onPressed: () => controller
|
||||||
.participantAction(UserBottomSheetAction.message),
|
.participantAction(UserBottomSheetAction.message),
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,12 @@ import 'package:share_plus/share_plus.dart';
|
||||||
import 'package:fluffychat/utils/platform_infos.dart';
|
import 'package:fluffychat/utils/platform_infos.dart';
|
||||||
|
|
||||||
abstract class FluffyShare {
|
abstract class FluffyShare {
|
||||||
static Future<void> share(String text, BuildContext context) async {
|
static Future<void> share(
|
||||||
if (PlatformInfos.isMobile) {
|
String text,
|
||||||
|
BuildContext context, {
|
||||||
|
bool copyOnly = false,
|
||||||
|
}) async {
|
||||||
|
if (PlatformInfos.isMobile && !copyOnly) {
|
||||||
final box = context.findRenderObject() as RenderBox;
|
final box = context.findRenderObject() as RenderBox;
|
||||||
return Share.share(
|
return Share.share(
|
||||||
text,
|
text,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue