Merge pull request #520 from pangeachat/fix-analytics-overflow

Fix analytics overflow
pull/1384/head
ggurdin 1 year ago committed by GitHub
commit ea44994218
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -13,36 +13,40 @@ class AnalyticsViewButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return PopupMenuButton<BarChartViewSelection>(
tooltip: L10n.of(context)!.changeAnalyticsView,
initialValue: value,
onSelected: (BarChartViewSelection? view) {
if (view == null) {
debugPrint("when is view null?");
return;
}
onChange(view);
},
itemBuilder: (BuildContext context) => BarChartViewSelection.values
.map<PopupMenuEntry<BarChartViewSelection>>(
(BarChartViewSelection view) {
return PopupMenuItem<BarChartViewSelection>(
value: view,
child: Text(view.string(context)),
);
}).toList(),
child: TextButton.icon(
label: Text(
value.string(context),
style: TextStyle(
return Flexible(
child: PopupMenuButton<BarChartViewSelection>(
tooltip: L10n.of(context)!.changeAnalyticsView,
initialValue: value,
onSelected: (BarChartViewSelection? view) {
if (view == null) {
debugPrint("when is view null?");
return;
}
onChange(view);
},
itemBuilder: (BuildContext context) => BarChartViewSelection.values
.map<PopupMenuEntry<BarChartViewSelection>>(
(BarChartViewSelection view) {
return PopupMenuItem<BarChartViewSelection>(
value: view,
child: Text(
view.string(context),
),
);
}).toList(),
child: TextButton.icon(
label: Text(
value.string(context),
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
),
),
icon: Icon(
value.icon,
color: Theme.of(context).colorScheme.onSurface,
),
onPressed: null,
),
icon: Icon(
value.icon,
color: Theme.of(context).colorScheme.onSurface,
),
onPressed: null,
),
);
}

@ -14,35 +14,37 @@ class TimeSpanMenuButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return PopupMenuButton<TimeSpan>(
tooltip: L10n.of(context)!.changeDateRange,
initialValue: value,
onSelected: (TimeSpan? timeSpan) {
if (timeSpan == null) {
debugPrint("when is timeSpan null?");
return;
}
onChange(timeSpan);
},
itemBuilder: (BuildContext context) =>
TimeSpan.values.map<PopupMenuEntry<TimeSpan>>((TimeSpan timeSpan) {
return PopupMenuItem<TimeSpan>(
value: timeSpan,
child: Text(timeSpan.string(context)),
);
}).toList(),
child: TextButton.icon(
label: Text(
value.string(context),
style: TextStyle(
return Flexible(
child: PopupMenuButton<TimeSpan>(
tooltip: L10n.of(context)!.changeDateRange,
initialValue: value,
onSelected: (TimeSpan? timeSpan) {
if (timeSpan == null) {
debugPrint("when is timeSpan null?");
return;
}
onChange(timeSpan);
},
itemBuilder: (BuildContext context) =>
TimeSpan.values.map<PopupMenuEntry<TimeSpan>>((TimeSpan timeSpan) {
return PopupMenuItem<TimeSpan>(
value: timeSpan,
child: Text(timeSpan.string(context)),
);
}).toList(),
child: TextButton.icon(
label: Text(
value.string(context),
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
),
),
icon: Icon(
Icons.calendar_month_outlined,
color: Theme.of(context).colorScheme.onSurface,
),
onPressed: null,
),
icon: Icon(
Icons.calendar_month_outlined,
color: Theme.of(context).colorScheme.onSurface,
),
onPressed: null,
),
);
}

Loading…
Cancel
Save