style: New modal bottom sheets

This commit is contained in:
Krille 2023-01-07 10:29:34 +01:00
commit 2df72b5d13
19 changed files with 328 additions and 355 deletions

View file

@ -22,6 +22,7 @@ import 'package:vrouter/vrouter.dart';
import 'package:fluffychat/pages/chat/chat_view.dart';
import 'package:fluffychat/pages/chat/event_info_dialog.dart';
import 'package:fluffychat/pages/chat/recording_dialog.dart';
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/event_extension.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/ios_badge_client_extension.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
@ -422,9 +423,8 @@ class ChatController extends State<Chat> {
}
void sendStickerAction() async {
final sticker = await showModalBottomSheet<ImagePackImageContent>(
final sticker = await showAdaptiveBottomSheet<ImagePackImageContent>(
context: context,
useRootNavigator: false,
builder: (c) => StickerPickerDialog(room: room!),
);
if (sticker == null) return;

View file

@ -5,6 +5,7 @@ import 'package:vrouter/vrouter.dart';
import 'package:fluffychat/pages/chat/chat.dart';
import 'package:fluffychat/pages/user_bottom_sheet/user_bottom_sheet.dart';
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
import 'package:fluffychat/widgets/avatar.dart';
@ -26,7 +27,7 @@ class ChatAppBarTitle extends StatelessWidget {
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: directChatMatrixID != null
? () => showModalBottomSheet(
? () => showAdaptiveBottomSheet(
context: context,
builder: (c) => UserBottomSheet(
user: room

View file

@ -10,6 +10,7 @@ import 'package:fluffychat/pages/chat/events/message.dart';
import 'package:fluffychat/pages/chat/seen_by_row.dart';
import 'package:fluffychat/pages/chat/typing_indicators.dart';
import 'package:fluffychat/pages/user_bottom_sheet/user_bottom_sheet.dart';
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/filtered_timeline_extension.dart';
import 'package:fluffychat/utils/platform_infos.dart';
@ -89,7 +90,7 @@ class ChatEventList extends StatelessWidget {
onSwipe: (direction) =>
controller.replyAction(replyTo: event),
onInfoTab: controller.showEventInfo,
onAvatarTab: (Event event) => showModalBottomSheet(
onAvatarTab: (Event event) => showAdaptiveBottomSheet(
context: context,
builder: (c) => UserBottomSheet(
user: event.senderFromMemoryOrFallback,

View file

@ -6,11 +6,12 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:matrix/matrix.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
import 'package:fluffychat/utils/date_time_extension.dart';
import 'package:fluffychat/widgets/avatar.dart';
extension EventInfoDialogExtension on Event {
void showInfoDialog(BuildContext context) => showModalBottomSheet(
void showInfoDialog(BuildContext context) => showAdaptiveBottomSheet(
context: context,
builder: (context) =>
EventInfoDialog(l10n: L10n.of(context)!, event: this),

View file

@ -5,6 +5,7 @@ import 'package:matrix/matrix.dart';
import 'package:matrix_link_text/link_text.dart';
import 'package:fluffychat/pages/chat/events/video_player.dart';
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
import 'package:fluffychat/utils/date_time_extension.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
import 'package:fluffychat/widgets/avatar.dart';
@ -52,7 +53,7 @@ class MessageContent extends StatelessWidget {
}
event.requestKey();
final sender = event.senderFromMemoryOrFallback;
await showModalBottomSheet(
await showAdaptiveBottomSheet(
context: context,
builder: (context) => Scaffold(
appBar: AppBar(