chore: shrink space analytics buttons at wider screen width (#3733)

pull/2245/head
ggurdin 3 months ago committed by GitHub
parent 506e069997
commit 6b15e45fa8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -39,16 +39,20 @@ class SpaceAnalyticsView extends StatelessWidget {
child: Column(
spacing: isColumnMode ? 24.0 : 12.0,
children: [
Row(
LayoutBuilder(
builder: (context, constraints) {
final mini = constraints.maxWidth <= 550;
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
spacing: isColumnMode ? 12.0 : 4.0,
spacing: !mini ? 12.0 : 4.0,
children: [
_MenuButton(
text: L10n.of(context).requestAll,
icon: Symbols.approval_delegation,
onPressed: controller.requestAllAnalytics,
mini: mini,
),
if (controller.room != null &&
controller.availableAnalyticsRooms.isNotEmpty)
@ -65,12 +69,12 @@ class SpaceAnalyticsView extends StatelessWidget {
),
);
},
mini: !isColumnMode,
mini: mini,
),
],
),
Row(
spacing: isColumnMode ? 12.0 : 4.0,
spacing: !mini ? 12.0 : 4.0,
children: [
if (controller.lastUpdatedString != null)
Text(
@ -79,7 +83,7 @@ class SpaceAnalyticsView extends StatelessWidget {
),
textAlign: TextAlign.end,
style: TextStyle(
fontSize: isColumnMode ? 12.0 : 8.0,
fontSize: !mini ? 12.0 : 8.0,
color: theme.disabledColor,
),
),
@ -87,22 +91,23 @@ class SpaceAnalyticsView extends StatelessWidget {
text: L10n.of(context).refresh,
icon: Symbols.refresh,
onPressed: controller.refresh,
mini: !isColumnMode,
mini: mini,
),
DropdownButtonHideUnderline(
child: DropdownButton2<LanguageModel>(
customButton: Container(
height: isColumnMode ? 36.0 : 26.0,
height: !mini ? 36.0 : 26.0,
decoration: BoxDecoration(
color: theme.colorScheme.primaryContainer,
borderRadius: BorderRadius.circular(40),
),
padding: EdgeInsets.symmetric(
horizontal: isColumnMode ? 8.0 : 4.0,
horizontal: !mini ? 8.0 : 4.0,
vertical: 4.0,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
if (controller.selectedLanguage != null)
Text(
@ -111,15 +116,16 @@ class SpaceAnalyticsView extends StatelessWidget {
controller
.selectedLanguage!.displayName,
style: TextStyle(
color:
theme.colorScheme.onPrimaryContainer,
fontSize: isColumnMode ? 16.0 : 12.0,
color: theme
.colorScheme.onPrimaryContainer,
fontSize: !mini ? 16.0 : 12.0,
),
),
Icon(
Icons.arrow_drop_down,
color: theme.colorScheme.onPrimaryContainer,
size: isColumnMode ? 24.0 : 14.0,
color:
theme.colorScheme.onPrimaryContainer,
size: !mini ? 24.0 : 14.0,
),
],
),
@ -153,6 +159,8 @@ class SpaceAnalyticsView extends StatelessWidget {
],
),
],
);
},
),
controller.initialized
? Table(
@ -306,9 +314,8 @@ class _MenuButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final isColumnMode = FluffyThemes.isColumnMode(context);
final height = isColumnMode ? 36.0 : 26.0;
final height = !mini ? 36.0 : 26.0;
return InkWell(
borderRadius: BorderRadius.circular(40),
@ -321,14 +328,14 @@ class _MenuButton extends StatelessWidget {
borderRadius: BorderRadius.circular(40),
),
padding: EdgeInsets.symmetric(
horizontal: isColumnMode ? 8.0 : 4.0,
horizontal: !mini ? 8.0 : 4.0,
vertical: 4.0,
),
child: mini
? Icon(
icon,
color: theme.colorScheme.onPrimaryContainer,
size: isColumnMode ? 24.0 : 14.0,
size: !mini ? 24.0 : 14.0,
)
: Row(
spacing: 4.0,
@ -336,13 +343,13 @@ class _MenuButton extends StatelessWidget {
Icon(
icon,
color: theme.colorScheme.onPrimaryContainer,
size: isColumnMode ? 24.0 : 14.0,
size: !mini ? 24.0 : 14.0,
),
Text(
text,
style: TextStyle(
color: theme.colorScheme.onPrimaryContainer,
fontSize: isColumnMode ? 16.0 : 12.0,
fontSize: !mini ? 16.0 : 12.0,
),
),
],

Loading…
Cancel
Save