chore: Follow up bottomsheets
This commit is contained in:
parent
73f448e40a
commit
24b4e8157c
5 changed files with 5 additions and 51 deletions
|
|
@ -27,7 +27,6 @@ class BootstrapDialog extends StatefulWidget {
|
||||||
Future<bool?> show(BuildContext context) => showAdaptiveBottomSheet(
|
Future<bool?> show(BuildContext context) => showAdaptiveBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => this,
|
builder: (context) => this,
|
||||||
maxHeight: 600,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,10 @@ import 'package:fluffychat/pages/chat_details/chat_details.dart';
|
||||||
import 'package:fluffychat/pages/chat_details/participant_list_item.dart';
|
import 'package:fluffychat/pages/chat_details/participant_list_item.dart';
|
||||||
import 'package:fluffychat/utils/fluffy_share.dart';
|
import 'package:fluffychat/utils/fluffy_share.dart';
|
||||||
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
|
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
|
||||||
import 'package:fluffychat/utils/show_scaffold_dialog.dart';
|
|
||||||
import 'package:fluffychat/widgets/avatar.dart';
|
import 'package:fluffychat/widgets/avatar.dart';
|
||||||
import 'package:fluffychat/widgets/chat_settings_popup_menu.dart';
|
import 'package:fluffychat/widgets/chat_settings_popup_menu.dart';
|
||||||
import 'package:fluffychat/widgets/layouts/max_width_body.dart';
|
import 'package:fluffychat/widgets/layouts/max_width_body.dart';
|
||||||
import 'package:fluffychat/widgets/matrix.dart';
|
import 'package:fluffychat/widgets/matrix.dart';
|
||||||
import 'package:fluffychat/widgets/share_scaffold_dialog.dart';
|
|
||||||
import '../../utils/url_launcher.dart';
|
import '../../utils/url_launcher.dart';
|
||||||
import '../../widgets/qr_code_viewer.dart';
|
import '../../widgets/qr_code_viewer.dart';
|
||||||
|
|
||||||
|
|
@ -60,17 +58,6 @@ class ChatDetailsView extends StatelessWidget {
|
||||||
elevation: theme.appBarTheme.elevation,
|
elevation: theme.appBarTheme.elevation,
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
if (room.canonicalAlias.isNotEmpty) ...[
|
if (room.canonicalAlias.isNotEmpty) ...[
|
||||||
IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
showScaffoldDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) => ShareScaffoldDialog(
|
|
||||||
items: [TextShareItem(room.canonicalAlias)],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.forward_outlined),
|
|
||||||
),
|
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip: L10n.of(context).share,
|
tooltip: L10n.of(context).share,
|
||||||
icon: const Icon(Icons.qr_code_rounded),
|
icon: const Icon(Icons.qr_code_rounded),
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,10 @@ import 'package:matrix/matrix.dart';
|
||||||
import 'package:fluffychat/config/app_config.dart';
|
import 'package:fluffychat/config/app_config.dart';
|
||||||
import 'package:fluffychat/utils/date_time_extension.dart';
|
import 'package:fluffychat/utils/date_time_extension.dart';
|
||||||
import 'package:fluffychat/utils/fluffy_share.dart';
|
import 'package:fluffychat/utils/fluffy_share.dart';
|
||||||
import 'package:fluffychat/utils/show_scaffold_dialog.dart';
|
|
||||||
import 'package:fluffychat/utils/url_launcher.dart';
|
import 'package:fluffychat/utils/url_launcher.dart';
|
||||||
import 'package:fluffychat/widgets/avatar.dart';
|
import 'package:fluffychat/widgets/avatar.dart';
|
||||||
import 'package:fluffychat/widgets/presence_builder.dart';
|
import 'package:fluffychat/widgets/presence_builder.dart';
|
||||||
import 'package:fluffychat/widgets/qr_code_viewer.dart';
|
import 'package:fluffychat/widgets/qr_code_viewer.dart';
|
||||||
import 'package:fluffychat/widgets/share_scaffold_dialog.dart';
|
|
||||||
import '../../widgets/matrix.dart';
|
import '../../widgets/matrix.dart';
|
||||||
import 'user_bottom_sheet.dart';
|
import 'user_bottom_sheet.dart';
|
||||||
|
|
||||||
|
|
@ -43,21 +41,6 @@ class UserBottomSheetView extends StatelessWidget {
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
title: Text(displayname),
|
title: Text(displayname),
|
||||||
actions: [
|
actions: [
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
|
||||||
child: IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
showScaffoldDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) => ShareScaffoldDialog(
|
|
||||||
items: [TextShareItem(userId)],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.forward_outlined),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/config/app_config.dart';
|
import 'package:fluffychat/config/app_config.dart';
|
||||||
|
|
@ -8,9 +10,9 @@ Future<T?> showAdaptiveBottomSheet<T>({
|
||||||
required Widget Function(BuildContext) builder,
|
required Widget Function(BuildContext) builder,
|
||||||
bool isDismissible = true,
|
bool isDismissible = true,
|
||||||
bool isScrollControlled = true,
|
bool isScrollControlled = true,
|
||||||
double maxHeight = 600,
|
|
||||||
bool useRootNavigator = true,
|
bool useRootNavigator = true,
|
||||||
}) {
|
}) {
|
||||||
|
final maxHeight = min(MediaQuery.of(context).size.height - 32, 600);
|
||||||
final dialogMode = FluffyThemes.isColumnMode(context);
|
final dialogMode = FluffyThemes.isColumnMode(context);
|
||||||
return showModalBottomSheet(
|
return showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,11 @@ import 'package:go_router/go_router.dart';
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/utils/fluffy_share.dart';
|
import 'package:fluffychat/utils/fluffy_share.dart';
|
||||||
import 'package:fluffychat/utils/show_scaffold_dialog.dart';
|
|
||||||
import 'package:fluffychat/utils/url_launcher.dart';
|
import 'package:fluffychat/utils/url_launcher.dart';
|
||||||
import 'package:fluffychat/widgets/avatar.dart';
|
import 'package:fluffychat/widgets/avatar.dart';
|
||||||
import 'package:fluffychat/widgets/future_loading_dialog.dart';
|
import 'package:fluffychat/widgets/future_loading_dialog.dart';
|
||||||
import 'package:fluffychat/widgets/matrix.dart';
|
import 'package:fluffychat/widgets/matrix.dart';
|
||||||
import 'package:fluffychat/widgets/qr_code_viewer.dart';
|
import 'package:fluffychat/widgets/qr_code_viewer.dart';
|
||||||
import 'package:fluffychat/widgets/share_scaffold_dialog.dart';
|
|
||||||
|
|
||||||
class PublicRoomBottomSheet extends StatelessWidget {
|
class PublicRoomBottomSheet extends StatelessWidget {
|
||||||
final String? roomAlias;
|
final String? roomAlias;
|
||||||
|
|
@ -104,24 +102,9 @@ class PublicRoomBottomSheet extends StatelessWidget {
|
||||||
? null
|
? null
|
||||||
: [
|
: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () {
|
icon: const Icon(Icons.qr_code_rounded),
|
||||||
Navigator.of(context).pop();
|
|
||||||
showScaffoldDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) => ShareScaffoldDialog(
|
|
||||||
items: [TextShareItem(roomAlias)],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.forward_outlined),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
|
||||||
child: IconButton(
|
|
||||||
icon: Icon(Icons.adaptive.share_outlined),
|
|
||||||
onPressed: () => showQrCodeViewer(
|
onPressed: () => showQrCodeViewer(
|
||||||
context,
|
context,
|
||||||
roomAlias,
|
roomAlias,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue