Add label to analytics request button (#3756)

* Add label to analytics request button

* make hideLabel default to value of mini

---------

Co-authored-by: ggurdin <ggurdin@gmail.com>
pull/2245/head
Kelrap 3 months ago committed by GitHub
parent a67a4fe325
commit f8d5d7da7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -49,6 +49,7 @@ class SpaceAnalyticsView extends StatelessWidget {
icon: Symbols.approval_delegation, icon: Symbols.approval_delegation,
onPressed: controller.requestAllAnalytics, onPressed: controller.requestAllAnalytics,
mini: mini, mini: mini,
hideLabel: false,
), ),
if (controller.room != null && if (controller.room != null &&
controller.availableAnalyticsRooms.isNotEmpty) controller.availableAnalyticsRooms.isNotEmpty)
@ -315,12 +316,14 @@ class _MenuButton extends StatelessWidget {
final VoidCallback onPressed; final VoidCallback onPressed;
final bool mini; final bool mini;
final bool? hideLabel;
const _MenuButton({ const _MenuButton({
required this.text, required this.text,
required this.icon, required this.icon,
required this.onPressed, required this.onPressed,
this.mini = false, this.mini = false,
this.hideLabel,
}); });
@override @override
@ -334,7 +337,7 @@ class _MenuButton extends StatelessWidget {
onTap: onPressed, onTap: onPressed,
child: Container( child: Container(
height: height, height: height,
width: mini ? height : null, width: hideLabel ?? mini ? height : null,
decoration: BoxDecoration( decoration: BoxDecoration(
color: theme.colorScheme.primaryContainer, color: theme.colorScheme.primaryContainer,
borderRadius: BorderRadius.circular(40), borderRadius: BorderRadius.circular(40),
@ -343,7 +346,7 @@ class _MenuButton extends StatelessWidget {
horizontal: !mini ? 8.0 : 4.0, horizontal: !mini ? 8.0 : 4.0,
vertical: 4.0, vertical: 4.0,
), ),
child: mini child: hideLabel ?? mini
? Icon( ? Icon(
icon, icon,
color: theme.colorScheme.onPrimaryContainer, color: theme.colorScheme.onPrimaryContainer,

Loading…
Cancel
Save