mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 21:09:21 +00:00
Can create new conversations
This commit is contained in:
parent
27176531cf
commit
c262e40e81
@ -37,7 +37,7 @@ abstract class MainController extends State<MainRoute> {
|
|||||||
///
|
///
|
||||||
/// If the current route is not the main route, we pop one page
|
/// If the current route is not the main route, we pop one page
|
||||||
void popPage() {
|
void popPage() {
|
||||||
if(!ModalRoute.of(context).isCurrent)
|
if (!ModalRoute.of(context).isCurrent)
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
else
|
else
|
||||||
doPopPage();
|
doPopPage();
|
||||||
@ -48,7 +48,7 @@ abstract class MainController extends State<MainRoute> {
|
|||||||
void doPopPage();
|
void doPopPage();
|
||||||
|
|
||||||
/// Push a new widget
|
/// Push a new widget
|
||||||
void push(Widget w, {bool hideNavBar});
|
void push(Widget w, {bool hideNavBar, bool allowAsDialog});
|
||||||
|
|
||||||
/// Open a conversation
|
/// Open a conversation
|
||||||
void openConversation(int convID, {fullScreen: false});
|
void openConversation(int convID, {fullScreen: false});
|
||||||
|
@ -243,7 +243,7 @@ class _MainRouteState extends MainController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void push(Widget w, {bool hideNavBar = false}) {
|
void push(Widget w, {bool hideNavBar = false, bool allowAsDialog}) {
|
||||||
_pushPage(CurrPage(
|
_pushPage(CurrPage(
|
||||||
BarCallbackActions.OPEN_CUSTOM_WIDGET,
|
BarCallbackActions.OPEN_CUSTOM_WIDGET,
|
||||||
args: {"widget": w},
|
args: {"widget": w},
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:comunic/ui/dialogs/screen_dialog.dart';
|
||||||
import 'package:comunic/ui/routes/main_route/main_route.dart';
|
import 'package:comunic/ui/routes/main_route/main_route.dart';
|
||||||
import 'package:comunic/ui/widgets/tablet_mode/conversations/conversations_area_widget.dart';
|
import 'package:comunic/ui/widgets/tablet_mode/conversations/conversations_area_widget.dart';
|
||||||
import 'package:comunic/ui/widgets/tablet_mode/current_user_panel.dart';
|
import 'package:comunic/ui/widgets/tablet_mode/current_user_panel.dart';
|
||||||
@ -89,7 +90,12 @@ class _TabletRouteState extends MainController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void push(Widget w, {bool hideNavBar}) {
|
void push(Widget w, {bool hideNavBar, bool allowAsDialog}) {
|
||||||
|
if (allowAsDialog == true) {
|
||||||
|
showScreenDialog(context, w);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: implement push
|
// TODO: implement push
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,7 +116,9 @@ class _ConversationScreenState extends SafeState<ConversationsListScreen> {
|
|||||||
|
|
||||||
/// Create a new conversation
|
/// Create a new conversation
|
||||||
void _createConversation() {
|
void _createConversation() {
|
||||||
MainController.of(context).push(CreateConversationScreen());
|
MainController.of(context)
|
||||||
|
.push(CreateConversationScreen(), allowAsDialog: true);
|
||||||
|
if (widget.onOpen != null) widget.onOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Handle conversations updated requests
|
/// Handle conversations updated requests
|
||||||
|
Loading…
Reference in New Issue
Block a user