
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.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.dart';
import 'package:twong/pages/address/editAddress.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.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));
          }
      )
    };
  }
}