conditional top padding for practice tooltips
This commit is contained in:
parent
392b3e31c6
commit
4bbcd5fb49
1 changed files with 30 additions and 22 deletions
|
|
@ -395,28 +395,6 @@ class MessageSelectionPositionerState extends State<MessageSelectionPositioner>
|
|||
alignment:
|
||||
ownMessage ? Alignment.centerRight : Alignment.centerLeft,
|
||||
children: [
|
||||
Positioned(
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: ListenableBuilder(
|
||||
listenable: widget.overlayController.practiceController,
|
||||
builder: (context, _) {
|
||||
final instruction = widget.overlayController
|
||||
.practiceController.practiceMode.instruction;
|
||||
if (instruction != null) {
|
||||
return InstructionsInlineTooltip(
|
||||
instructionsEnum: widget.overlayController
|
||||
.practiceController.practiceMode.instruction!,
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
animate: false,
|
||||
);
|
||||
}
|
||||
|
||||
return const SizedBox();
|
||||
},
|
||||
),
|
||||
),
|
||||
ValueListenableBuilder(
|
||||
valueListenable: _startedTransition,
|
||||
builder: (context, started, __) {
|
||||
|
|
@ -458,6 +436,36 @@ class MessageSelectionPositionerState extends State<MessageSelectionPositioner>
|
|||
selectedToken: widget.overlayController.selectedToken,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: switch (MediaQuery.heightOf(context)) {
|
||||
< 700 => 0,
|
||||
> 900 => 160,
|
||||
_ => 80,
|
||||
},
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: ListenableBuilder(
|
||||
listenable:
|
||||
widget.overlayController.practiceController,
|
||||
builder: (context, _) {
|
||||
final instruction = widget.overlayController
|
||||
.practiceController.practiceMode.instruction;
|
||||
if (instruction != null) {
|
||||
return InstructionsInlineTooltip(
|
||||
instructionsEnum: widget
|
||||
.overlayController
|
||||
.practiceController
|
||||
.practiceMode
|
||||
.instruction!,
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
animate: false,
|
||||
);
|
||||
}
|
||||
|
||||
return const SizedBox();
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue