
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:twongCustomer/pages/login.dart';
import 'package:twongCustomer/pages/test.dart';
import 'package:twongCustomer/pages/userInfo.dart';
import 'package:twongCustomer/utils/events.dart';

import 'mainRoute.dart';
import '../pages/chat.dart';
import '../models/index.dart';
import '../pages/setting.dart';
import '../routes/homeRoute.dart';

class RouterUtils {
  static void toLogin(BuildContext context) {
    Future.delayed(Duration.zero, () {
    Navigator.push(context,
        new MaterialPageRoute(builder: (context) => new HomeRoute()));
    });
  }

  static void toSetting(BuildContext context) {
    Future.delayed(Duration.zero, () {
    Navigator.push(context,
        new CupertinoPageRoute(builder: (context) => new TestPage()));
    });
  }

  static void toMain(BuildContext context) {
    Future.delayed(Duration.zero, () {
    Navigator.push(context,
        new MaterialPageRoute(builder: (context) => new MainRoute()));
    });
  }

  static void toChat(BuildContext context, UserInfo user) {
      Future.delayed(Duration.zero, () {
    Navigator.push(context,
        new CupertinoPageRoute(builder: (context) => new ChatPage(user)));
      });
  }

  static void toUserInfo(BuildContext context, UserInfo user) {
    Future.delayed(Duration.zero, () {
      Navigator.push(context,
          new CupertinoPageRoute(builder: (context) => new UserInfoPage(user)));
    });
  }
}