fluffychat/lib/pangea/chat_settings/widgets/download_space_analytics_button.dart
Kelrap f3f87dfcde
Hide mobile download (#3543)
* Use correct route when join class by link

* Hide room download buttons if not web
2025-07-23 14:07:35 -04:00

48 lines
1.3 KiB
Dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:matrix/matrix.dart';
import 'package:fluffychat/l10n/l10n.dart';
import 'package:fluffychat/pangea/spaces/widgets/download_space_analytics_dialog.dart';
class DownloadSpaceAnalyticsButton extends StatelessWidget {
final Room space;
const DownloadSpaceAnalyticsButton({
super.key,
required this.space,
});
@override
Widget build(BuildContext context) {
if (!kIsWeb) {
return const SizedBox.shrink();
}
final iconColor = Theme.of(context).textTheme.bodyLarge!.color;
return Column(
children: [
ListTile(
onTap: () {
showDialog(
context: context,
builder: (context) => DownloadAnalyticsDialog(space: space),
);
},
leading: CircleAvatar(
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
foregroundColor: iconColor,
child: const Icon(Icons.download_outlined),
),
title: Text(
L10n.of(context).downloadSpaceAnalytics,
style: TextStyle(
color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),
),
],
);
}
}