Skip to content

Commit

Permalink
Merge pull request #1021 from pangeachat/1016-border-radius-on-overla…
Browse files Browse the repository at this point in the history
…y-top-bar

added border radius to overlay header
  • Loading branch information
ggurdin authored Nov 15, 2024
2 parents cdce258 + 2106c5a commit 661a64f
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 54 deletions.
1 change: 1 addition & 0 deletions lib/pangea/widgets/chat/message_selection_overlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ class MessageOverlayController extends State<MessageSelectionOverlay>
),
),
Material(
type: MaterialType.transparency,
child: OverlayHeader(controller: widget.chatController),
),
],
Expand Down
3 changes: 2 additions & 1 deletion lib/pangea/widgets/chat/overlay_footer.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/config/themes.dart';
import 'package:fluffychat/pages/chat/chat.dart';
import 'package:fluffychat/pages/chat/chat_input_row.dart';
Expand Down Expand Up @@ -31,7 +32,7 @@ class OverlayFooter extends StatelessWidget {
clipBehavior: Clip.hardEdge,
color: Theme.of(context).colorScheme.surfaceContainerHighest,
borderRadius: const BorderRadius.all(
Radius.circular(24),
Radius.circular(AppConfig.borderRadius),
),
child: ChatInputRow(controller),
),
Expand Down
117 changes: 64 additions & 53 deletions lib/pangea/widgets/chat/overlay_header.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/pages/chat/chat.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
Expand All @@ -14,63 +15,73 @@ class OverlayHeader extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
AppBar(
actionsIconTheme: IconThemeData(
return Container(
padding: const EdgeInsets.symmetric(horizontal: 20),
decoration: BoxDecoration(
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(AppConfig.borderRadius),
bottomRight: Radius.circular(AppConfig.borderRadius),
),
color: Theme.of(context).appBarTheme.backgroundColor,
),
height: Theme.of(context).appBarTheme.toolbarHeight ?? 56,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
IconButton(
icon: const Icon(Symbols.forward),
tooltip: L10n.of(context)!.forward,
onPressed: controller.forwardEventsAction,
color: Theme.of(context).colorScheme.primary,
),
actions: [
if (controller.selectedEvents.length == 1 &&
controller.selectedEvents.single.messageType == MessageTypes.Text)
IconButton(
icon: const Icon(Symbols.forward),
tooltip: L10n.of(context)!.forward,
onPressed: controller.forwardEventsAction,
icon: const Icon(Icons.copy_outlined),
tooltip: L10n.of(context)!.copy,
onPressed: controller.copyEventsAction,
color: Theme.of(context).colorScheme.primary,
),
if (controller.selectedEvents.length == 1 &&
controller.selectedEvents.single.messageType ==
MessageTypes.Text)
IconButton(
icon: const Icon(Icons.copy_outlined),
tooltip: L10n.of(context)!.copy,
onPressed: controller.copyEventsAction,
),
if (controller.canPinSelectedEvents)
IconButton(
icon: const Icon(Icons.push_pin_outlined),
onPressed: controller.pinEvent,
tooltip: L10n.of(context)!.pinMessage,
),
if (controller.canEditSelectedEvents)
IconButton(
icon: const Icon(Icons.edit_outlined),
tooltip: L10n.of(context)!.edit,
onPressed: controller.editSelectedEventAction,
),
if (controller.canRedactSelectedEvents)
IconButton(
icon: const Icon(Icons.delete_outlined),
tooltip: L10n.of(context)!.redactMessage,
onPressed: controller.redactEventsAction,
),
if (controller.selectedEvents.length == 1)
IconButton(
icon: const Icon(Icons.shield_outlined),
tooltip: L10n.of(context)!.reportMessage,
onPressed: controller.reportEventAction,
),
if (controller.selectedEvents.length == 1)
IconButton(
icon: const Icon(Icons.info_outlined),
tooltip: L10n.of(context)!.messageInfo,
onPressed: () {
controller.showEventInfo();
controller.clearSelectedEvents();
},
),
],
),
],
if (controller.canPinSelectedEvents)
IconButton(
icon: const Icon(Icons.push_pin_outlined),
onPressed: controller.pinEvent,
tooltip: L10n.of(context)!.pinMessage,
color: Theme.of(context).colorScheme.primary,
),
if (controller.canEditSelectedEvents)
IconButton(
icon: const Icon(Icons.edit_outlined),
tooltip: L10n.of(context)!.edit,
onPressed: controller.editSelectedEventAction,
color: Theme.of(context).colorScheme.primary,
),
if (controller.canRedactSelectedEvents)
IconButton(
icon: const Icon(Icons.delete_outlined),
tooltip: L10n.of(context)!.redactMessage,
onPressed: controller.redactEventsAction,
color: Theme.of(context).colorScheme.primary,
),
if (controller.selectedEvents.length == 1)
IconButton(
icon: const Icon(Icons.shield_outlined),
tooltip: L10n.of(context)!.reportMessage,
onPressed: controller.reportEventAction,
color: Theme.of(context).colorScheme.primary,
),
if (controller.selectedEvents.length == 1)
IconButton(
icon: const Icon(Icons.info_outlined),
tooltip: L10n.of(context)!.messageInfo,
color: Theme.of(context).colorScheme.primary,
onPressed: () {
controller.showEventInfo();
controller.clearSelectedEvents();
},
),
],
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class MultipleChoiceActivityState extends State<MultipleChoiceActivity> {

final content = Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
practiceActivity.content.question,
Expand Down

0 comments on commit 661a64f

Please sign in to comment.