
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';

import 'package:twong/router/index.dart';
import 'package:twong/pages/order/order_list.dart';
import 'package:twong/pages/order/order_submit.dart';
import 'package:twong/pages/order/order_details.dart';

class OrderRouter {
  static Map<String, RouterData> get list {
    return {
      RouteNames.order: RouterData(
          auth: true,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(builder: (context) => OrderList(index: settings.arguments));
          }
      ),
      RouteNames.submitOrder: RouterData(
          auth: true,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(builder: (context) => OrderSubmitPage(settings.arguments));
          }
      ),
      RouteNames.orderDetails: RouterData(
          auth: true,
          page: ({BuildContext context, RouteSettings settings}) {
            return CupertinoPageRoute(builder: (context) => OrderDetailsPage(settings.arguments));
          }
      )
    };
  }
}