Revert "Updated feedback to include screenshot and drawings"
This reverts commit 7b3c0b4885
.
This commit is contained in:
@ -1,17 +1,18 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_split_view/flutter_split_view.dart';
|
||||
import 'package:persistent_bottom_nav_bar_v2/persistent-tab-view.dart';
|
||||
|
||||
class TalkNavigator {
|
||||
static bool hasSplitViewState(BuildContext context) => context.findAncestorStateOfType<SplitViewState>() != null;
|
||||
static bool isSecondaryVisible(BuildContext context) => hasSplitViewState(context) && SplitView.of(context).isSecondaryVisible;
|
||||
|
||||
static void pushSplitView(BuildContext context, Widget view, {bool onSecondaryScreen = false}) {
|
||||
static void pushSplitView(BuildContext context, Widget view, {bool overrideToSingleSubScreen = false}) {
|
||||
if(isSecondaryVisible(context)) {
|
||||
SplitViewState splitView = SplitView.of(context);
|
||||
onSecondaryScreen ? splitView.setSecondary(view) : splitView.push(view);
|
||||
overrideToSingleSubScreen ? splitView.setSecondary(view) : splitView.push(view);
|
||||
} else {
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) => view));
|
||||
pushNewScreen(context, screen: view, withNavBar: false);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user