null safety

This commit is contained in:
Phaung Phaung
2021-09-10 16:48:20 +06:30
parent 52fe4b4568
commit 0f84fec2f7
12 changed files with 103 additions and 106 deletions

View File

@@ -78,7 +78,7 @@ class _LocalPopupMenuButtonState extends State<LocalPopupMenuButton> {
children: <Widget>[
Icon(
widget.buttonIcon ?? Icons.filter_list,
color: widget.buttonColor ?? primaryColor,
color: widget.buttonColor,
),
hightlight
? Positioned(
@@ -98,14 +98,12 @@ class _LocalPopupMenuButtonState extends State<LocalPopupMenuButton> {
)),
itemBuilder: (BuildContext context) {
return popmenus.map((LocalPopupMenu choice) {
if (choice == null) return null;
return PopupMenuItem<LocalPopupMenu>(
value: choice,
child: Row(
children: <Widget>[
LocalText(context, choice.textKey,
color:
choice?.enabled ?? true ? primaryColor : Colors.grey),
LocalText(context, choice.textKey ?? "",
color: choice.enabled ? primaryColor : Colors.grey),
SizedBox(
width: 10,
),
@@ -124,8 +122,8 @@ class _LocalPopupMenuButtonState extends State<LocalPopupMenuButton> {
bool _needHighlight() {
popmenus.forEach((e) {
if (e == null) return false;
if (e.selected && e.highlight) return true;
if (e == null) return;
if (e.selected && e.highlight) return;
});
return false;
}