package com.ys.bdtp.adm.mvvm.ui.screen.main

import androidx.navigation.NavHostController

/**
 * 路由对象
 *
 * @author bai
 */
object Route {
    const val Flash = "flash"
    const val Login = "login"
    const val Project = "project"
    const val Task = "task"
    const val Tasks = "tasks"
    const val Offline = "offline"
    const val Cad = "cad"
}

/**
 * Flash 跳转到 Project 界面
 */
fun NavHostController.flashToProject() {
    navigate(Route.Project) {
        launchSingleTop = true
        popUpTo(Route.Flash) {
            inclusive = true
        }
    }
}

/**
 * Flash 跳转到 Login 界面
 */
fun NavHostController.flashToLogin() {
    navigate(Route.Login) {
        launchSingleTop = true
        popUpTo(Route.Flash) {
            inclusive = true
        }
    }
}

/**
 * Login 跳转到 Project 界面
 */
fun NavHostController.loginToProject() {
    navigate(Route.Project) {
        launchSingleTop = true
        popUpTo(Route.Login) {
            inclusive = true
        }
    }

}

/**
 * Project  跳转到 Login 界面
 */
fun NavHostController.projectToLogin() {
    navigate(Route.Login) {
        launchSingleTop = true
        popUpTo(Route.Project) {
            inclusive = true
        }
    }

}

/**
 * Task 跳转到 Login 界面
 */
fun NavHostController.taskToLogin() {
    navigate(Route.Login) {
        launchSingleTop = true
        popUpTo(Route.Task) {
            inclusive = true
        }
    }

}

