if in two column mode, open space details when active space is set
This commit is contained in:
parent
9501f6f964
commit
2b9c5ecc95
4 changed files with 906 additions and 83 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:fluffychat/pangea/pages/analytics/base_analytics.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:fluffychat/pangea/pages/analytics/base_analytics_page.dart';
|
||||
import '../../word_cloud/word_cloud_data.dart';
|
||||
import '../../word_cloud/word_cloud_shape.dart';
|
||||
import '../../word_cloud/word_cloud_tap.dart';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:adaptive_dialog/adaptive_dialog.dart';
|
||||
import 'package:fluffychat/config/themes.dart';
|
||||
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
||||
import 'package:fluffychat/pangea/extensions/pangea_room_extension.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
|
|
@ -18,7 +19,10 @@ void chatListHandleSpaceTap(
|
|||
) {
|
||||
void setActiveSpaceAndCloseChat() {
|
||||
controller.setActiveSpace(space.id);
|
||||
if (controller.activeChat != null &&
|
||||
|
||||
if (FluffyThemes.isColumnMode(context)) {
|
||||
context.push('/spaces/${space.id}');
|
||||
} else if (controller.activeChat != null &&
|
||||
!space.isFirstOrSecondChild(controller.activeChat!)) {
|
||||
context.go("/rooms");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// this is a workaround to allow navigation of spaces out from any widget.
|
||||
/// Reason is that we have no reliable way to listen on *query* changes of
|
||||
/// VRouter.
|
||||
///
|
||||
/// Time wasted: 3h
|
||||
abstract class SpaceNavigator {
|
||||
const SpaceNavigator._();
|
||||
|
||||
// TODO(TheOneWithTheBraid): adjust routing table in order to represent spaces
|
||||
// ... in any present path
|
||||
static final routeObserver = RouteObserver();
|
||||
|
||||
static final StreamController<String?> _controller =
|
||||
StreamController.broadcast();
|
||||
|
||||
static Stream<String?> get stream => _controller.stream;
|
||||
|
||||
static void navigateToSpace(String? spaceId) => _controller.add(spaceId);
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue