
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:twong/pages/user/account.dart';
import 'package:twong/pages/user/account_edit.dart';
import 'package:twong/pages/user/bill_record.dart';
import 'package:twong/pages/user/cash_draw.dart';
import 'package:twong/pages/user/cash_record.dart';
import 'package:twong/pages/user/consume_record.dart';
import 'package:twong/pages/user/integral_record.dart';
import 'package:twong/pages/user/message_details.dart';
import 'package:twong/pages/promotion/promotion.dart';
import 'package:twong/pages/promotion/promotion_order.dart';
import 'package:twong/pages/promotion/promotion_poster.dart';
import 'package:twong/pages/promotion/promotion_record.dart';
import 'package:twong/pages/promotion/promotion_spread.dart';
import 'package:twong/pages/user/private.dart';
import 'package:twong/pages/user/recharge.dart';
import 'package:twong/pages/user/recharge_record.dart';
import 'package:twong/pages/user/vip_center.dart';

import 'package:twong/router/base.dart';
import 'package:twong/pages/user/help.dart';
import 'package:twong/pages/user/about.dart';
import 'package:twong/pages/user/favours.dart';
import 'package:twong/pages/user/friends.dart';
import 'package:twong/pages/user/message.dart';
import 'package:twong/pages/user/setting.dart';
import 'package:twong/pages/address/address_list.dart';
import 'package:twong/pages/address/address_edit.dart';

class UserRouter {
  static Map<String, RouterData> get list {
    return {
      RouteNames.setting: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(builder: (context) => SettingPage());
          }
      ),
      RouteNames.message: RouterData(
          auth: true,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(builder: (context) => MessagePage());
          }
      ),
      RouteNames.messageDetails: RouterData(
          auth: true,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(builder: (context) => MessageDetailsPage(settings.arguments));
          }
      ),
      RouteNames.favours: RouterData(
          auth: true,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(builder: (context) => FavoursPage());
          }
      ),
      RouteNames.friends: RouterData(
          auth: true,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(builder: (context) => FriendsPage());
          }
      ),
      RouteNames.help: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(builder: (context) => HelpPage());
          }
      ),
      RouteNames.about: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(builder: (context) => AboutPage());
          }
      ),
      RouteNames.logout: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(builder: (context) => AboutPage());
          }
      ),

      RouteNames.address: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(builder: (context) => AddressPage());
          }
      ),

      RouteNames.editAddress: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(
                builder: (context) => EditAddressPage(settings.arguments));
          }
      ),

      RouteNames.vipCenter: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(
                builder: (context) => VipCenterPage());
          }
      ),

      RouteNames.promotion: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(
                builder: (context) => PromotionPage());
          }
      ),

      RouteNames.cashDraw: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(
                builder: (context) => CashDrawPage());
          }
      ),

      RouteNames.cashRecord: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(
                builder: (context) => CashRecordPage());
          }
      ),

      RouteNames.promotionPoster: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(
                builder: (context) => PromotionPosterPage());
          }
      ),

      RouteNames.promotionOrder: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(
                builder: (context) => PromotionOrderPage());
          }
      ),

      RouteNames.promotionRecord: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(
                builder: (context) => PromotionRecordPage());
          }
      ),

      RouteNames.promotionSpread: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(
                builder: (context) => PromotionSpreadPage());
          }
      ),

      RouteNames.account: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(
                builder: (context) => AccountPage());
          }
      ),

      RouteNames.accountEdit: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(
                builder: (context) => AccountEditPage(settings.arguments));
          }
      ),

      RouteNames.private: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(
                builder: (context) => PrivatePage());
          }
      ),

      RouteNames.recharge: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(
                builder: (context) => RechargePage());
          }
      ),
      RouteNames.billRecord: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(
                builder: (context) => BillRecordPage(idx: settings.arguments));
          }
      ),
      RouteNames.integralRecord: RouterData(
          auth: false,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(
                builder: (context) => IntegralRecordPage());
          }
      ),
    };
  }
}