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

import '../store/actions.dart';
import '../store/store.dart';
import '../widgets/desktop/desktop_order_detail.dart';
import '../widgets/mobile/mobile_order_detail.dart';

class OrderDetail extends StatelessWidget {
  final int orderId;
  final bool fromOrders;

  const OrderDetail(this.orderId, {this.fromOrders = false, Key? key}) :
      super(key: key);

  @override
  Widget build(BuildContext context) {
    store.dispatch(UpdateContext(context));

    return ResponsiveBuilder(
      builder: (context, sizingInformation) =>
          ScreenTypeLayout(
            mobile: MobileOrderDetail(orderId, fromOrders: fromOrders,),
            tablet: DesktopOrderDetail(orderId, fromOrders: fromOrders,),
            desktop: DesktopOrderDetail(orderId, fromOrders: fromOrders,),
          ),
    );
  }

}