aboutsummaryrefslogtreecommitdiff
path: root/lib/widgets/common/basic/popup/container.dart
blob: 30a0323c37d112e49d9941ef4f4d14e6c459ca74 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import 'package:flutter/material.dart';

class PopupMenuItemContainer<T> extends PopupMenuEntry<T> {
  final Widget child;

  const PopupMenuItemContainer({
    super.key,
    this.height = kMinInteractiveDimension,
    required this.child,
  });

  @override
  final double height;

  @override
  bool represents(void value) => false;

  @override
  State<PopupMenuItemContainer> createState() => _PopupMenuItemContainerState();
}

class _PopupMenuItemContainerState extends State<PopupMenuItemContainer> {
  @override
  Widget build(BuildContext context) {
    return TooltipTheme(
      data: TooltipTheme.of(context).copyWith(
        preferBelow: false,
      ),
      child: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 16),
        child: widget.child,
      ),
    );
  }
}