refact, remote toolbar menu, sub menu
Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
parent
317bc21a1b
commit
02c9d3fe2c
@ -126,6 +126,23 @@ class _ToolbarTheme {
|
|||||||
? EdgeInsets.fromLTRB(4, 12, 4, 12)
|
? EdgeInsets.fromLTRB(4, 12, 4, 12)
|
||||||
: EdgeInsets.fromLTRB(6, 14, 6, 14);
|
: EdgeInsets.fromLTRB(6, 14, 6, 14);
|
||||||
static const double menuButtonBorderRadius = 3.0;
|
static const double menuButtonBorderRadius = 3.0;
|
||||||
|
|
||||||
|
static final defaultMenuStyle = MenuStyle(
|
||||||
|
side: MaterialStateProperty.all(BorderSide(
|
||||||
|
width: 1,
|
||||||
|
color: MyTheme.currentThemeMode() == ThemeMode.light
|
||||||
|
? _ToolbarTheme.bordLight
|
||||||
|
: _ToolbarTheme.bordDark,
|
||||||
|
)),
|
||||||
|
shape: MaterialStatePropertyAll(RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(_ToolbarTheme.menuBorderRadius))),
|
||||||
|
padding: MaterialStateProperty.all(_ToolbarTheme.menuPadding),
|
||||||
|
);
|
||||||
|
static final defaultMenuButtonStyle = ButtonStyle(
|
||||||
|
backgroundColor: MaterialStatePropertyAll(Colors.transparent),
|
||||||
|
padding: MaterialStatePropertyAll(EdgeInsets.zero),
|
||||||
|
overlayColor: MaterialStatePropertyAll(Colors.transparent),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef DismissFunc = void Function();
|
typedef DismissFunc = void Function();
|
||||||
@ -1658,23 +1675,8 @@ class _IconSubmenuButtonState extends State<_IconSubmenuButton> {
|
|||||||
width: _ToolbarTheme.buttonSize,
|
width: _ToolbarTheme.buttonSize,
|
||||||
height: _ToolbarTheme.buttonSize,
|
height: _ToolbarTheme.buttonSize,
|
||||||
child: SubmenuButton(
|
child: SubmenuButton(
|
||||||
menuStyle: widget.menuStyle ??
|
menuStyle: widget.menuStyle ?? _ToolbarTheme.defaultMenuStyle,
|
||||||
MenuStyle(
|
style: _ToolbarTheme.defaultMenuButtonStyle,
|
||||||
side: MaterialStateProperty.all(BorderSide(
|
|
||||||
width: 1,
|
|
||||||
color: MyTheme.currentThemeMode() == ThemeMode.light
|
|
||||||
? _ToolbarTheme.bordLight
|
|
||||||
: _ToolbarTheme.bordDark,
|
|
||||||
)),
|
|
||||||
shape: MaterialStatePropertyAll(RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(
|
|
||||||
_ToolbarTheme.menuBorderRadius))),
|
|
||||||
padding:
|
|
||||||
MaterialStateProperty.all(_ToolbarTheme.menuPadding)),
|
|
||||||
style: ButtonStyle(
|
|
||||||
backgroundColor: MaterialStatePropertyAll(Colors.transparent),
|
|
||||||
padding: MaterialStatePropertyAll(EdgeInsets.zero),
|
|
||||||
overlayColor: MaterialStatePropertyAll(Colors.transparent)),
|
|
||||||
onHover: (value) => setState(() {
|
onHover: (value) => setState(() {
|
||||||
hover = value;
|
hover = value;
|
||||||
}),
|
}),
|
||||||
@ -1716,6 +1718,7 @@ class _SubmenuButton extends StatelessWidget {
|
|||||||
child: child,
|
child: child,
|
||||||
menuChildren:
|
menuChildren:
|
||||||
menuChildren.map((e) => _buildPointerTrackWidget(e, ffi)).toList(),
|
menuChildren.map((e) => _buildPointerTrackWidget(e, ffi)).toList(),
|
||||||
|
menuStyle: _ToolbarTheme.defaultMenuStyle,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user