flutter_desktop: password menu

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2022-09-06 21:20:53 -07:00
parent a50482af5c
commit 70c4726766
8 changed files with 501 additions and 418 deletions

View File

@@ -1031,6 +1031,7 @@ class PopupMenuButton<T> extends StatefulWidget {
Key? key,
required this.itemBuilder,
this.initialValue,
this.onHover,
this.onSelected,
this.onCanceled,
this.tooltip,
@@ -1061,6 +1062,9 @@ class PopupMenuButton<T> extends StatefulWidget {
/// The value of the menu item, if any, that should be highlighted when the menu opens.
final T? initialValue;
/// Called when the user hovers this button.
final ValueChanged<bool>? onHover;
/// Called when the user selects a value from the popup menu created by this button.
///
/// If the popup menu is dismissed without selecting a value, [onCanceled] is
@@ -1273,18 +1277,20 @@ class PopupMenuButtonState<T> extends State<PopupMenuButton<T>> {
assert(debugCheckHasMaterialLocalizations(context));
if (widget.child != null)
if (widget.child != null) {
return Tooltip(
message:
widget.tooltip ?? MaterialLocalizations.of(context).showMenuTooltip,
child: InkWell(
onTap: widget.enabled ? showButtonMenu : null,
onHover: widget.onHover,
canRequestFocus: _canRequestFocus,
radius: widget.splashRadius,
enableFeedback: enableFeedback,
child: widget.child,
),
);
}
return IconButton(
icon: widget.icon ?? Icon(Icons.adaptive.more),