pushOrPushNamed<T extends Object?> static method

Future<T?> pushOrPushNamed<T extends Object?>(
  1. BuildContext context,
  2. String pushName,
  3. ChatUIKitViewArguments arguments
)

路由跳转,如果没有初始化,则使用 MaterialPageRoute 进行跳转。

Implementation

static Future<T?> pushOrPushNamed<T extends Object?>(
  BuildContext context,
  String pushName,
  ChatUIKitViewArguments arguments,
) {
  // addPushName(pushName);
  if (hasInit) {
    return Navigator.of(context).pushNamed(
      pushName,
      arguments: arguments,
    );
  } else {
    return Navigator.of(context).push(
      MaterialPageRoute(
        builder: (context) {
          return ChatUIKitRouteNames.getWidgetFromName(
            pushName,
            arguments,
          );
        },
      ),
    );
  }
}