1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-30 00:36:28 +00:00
comunicmobile/lib/utils/navigation_utils.dart

29 lines
740 B
Dart
Raw Normal View History

2019-11-02 11:46:17 +00:00
import 'package:comunic/ui/routes/single_post_route.dart';
2019-06-10 12:24:34 +00:00
import 'package:comunic/ui/routes/user_page_route.dart';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
/// Navigation utilities
///
/// @author Pierre HUBERT
/// Open the page of a user
void openUserPage({@required int userID, @required BuildContext context}) {
assert(userID != null);
assert(context != null);
Navigator.of(context).push(
MaterialPageRoute(
builder: (c) => UserPageRoute(
2019-11-02 11:46:17 +00:00
userID: userID,
),
2019-06-10 12:24:34 +00:00
),
);
}
2019-11-02 11:46:17 +00:00
/// Open a post in full screen
void openPostFullScreen(int postID, BuildContext context) {
Navigator.of(context)
.push(MaterialPageRoute(builder: (c) => SinglePostRoute(postID: postID)));
}