added class name to analytics title
This commit is contained in:
parent
e96c0e34db
commit
859c283ba3
2 changed files with 32 additions and 7 deletions
|
|
@ -9,6 +9,7 @@ import 'package:fluffychat/pangea/pages/analytics/base_analytics_view.dart';
|
|||
import 'package:fluffychat/pangea/pages/analytics/student_analytics/student_analytics.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:future_loading_dialog/future_loading_dialog.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import '../../../widgets/matrix.dart';
|
||||
import '../../controllers/pangea_controller.dart';
|
||||
|
|
@ -48,6 +49,13 @@ class BaseAnalyticsController extends State<BaseAnalyticsPage> {
|
|||
|
||||
bool isSelected(String chatOrStudentId) => chatOrStudentId == selected?.id;
|
||||
|
||||
Room? get activeSpace {
|
||||
if (widget.defaultSelected.type == AnalyticsEntryType.space) {
|
||||
return Matrix.of(context).client.getRoomById(widget.defaultSelected.id);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
|
|
|||
|
|
@ -62,22 +62,39 @@ class BaseAnalyticsView extends StatelessWidget {
|
|||
style: const TextStyle(decoration: TextDecoration.underline),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
if (controller.widget.selectedView == null) return;
|
||||
String route =
|
||||
final String route =
|
||||
"/rooms/${controller.widget.defaultSelected.type.route}";
|
||||
if (controller.widget.defaultSelected.type ==
|
||||
AnalyticsEntryType.space) {
|
||||
route += "/${controller.widget.defaultSelected.id}";
|
||||
}
|
||||
context.go(route);
|
||||
},
|
||||
),
|
||||
if (controller.activeSpace != null)
|
||||
const TextSpan(
|
||||
text: " > ",
|
||||
),
|
||||
if (controller.activeSpace != null)
|
||||
TextSpan(
|
||||
text: controller.activeSpace!.getLocalizedDisplayname(),
|
||||
style: const TextStyle(decoration: TextDecoration.underline),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
if (controller.widget.selectedView == null) return;
|
||||
String route =
|
||||
"/rooms/${controller.widget.defaultSelected.type.route}";
|
||||
if (controller.widget.defaultSelected.type ==
|
||||
AnalyticsEntryType.space) {
|
||||
route += "/${controller.widget.defaultSelected.id}";
|
||||
}
|
||||
context.go(route);
|
||||
},
|
||||
),
|
||||
if (controller.widget.selectedView != null)
|
||||
const TextSpan(
|
||||
text: " > ",
|
||||
),
|
||||
if (controller.widget.selectedView != null)
|
||||
TextSpan(text: controller.widget.selectedView!.string(context)),
|
||||
TextSpan(
|
||||
text: controller.widget.selectedView!.string(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue