1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-10-23 15:03:22 +00:00
comunicmobile/lib/ui/routes/main_route/main_route.dart

48 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
/// Abstract main application route
///
/// This mixin contains methods available in all display modes
///
/// @author Pierre Hubert
/// Main controller key statically shared across application
///
/// Do not use it directly to avoid context leak, instead use the access method
/// [MainController.of]
final mainControllerKey = GlobalKey<MainController>();
mixin MainRoute implements StatefulWidget {}
/// Public interface of home controller
mixin MainController implements State<MainRoute> {
/// Get current instance of Home controller
static MainController of(BuildContext context) {
assert(context != null); // A future implementation might need context again
return mainControllerKey.currentState;
}
/// Open user page
void openUserPage(int userID);
void openUserAccessDeniedPage(int userID);
/// Open a specific group page specified by its [groupID]
void openGroup(int groupID);
/// Display the list of friends of a user
void openUserFriendsList(int userID);
/// Pop current page. Last page can not be popped
void popPage();
/// Push a new widget
void push(Widget w, {bool hideNavBar});
/// Open a conversation
void openConversation(int convID, {fullScreen: false});
/// Start a call for a given conversation
void startCall(int convID);
}