34 lines
1.1 KiB
Dart
34 lines
1.1 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
|
import 'package:responsive_builder/responsive_builder.dart';
|
|
|
|
import '../models/business.dart';
|
|
import '../models/product.dart';
|
|
import '../store/actions.dart';
|
|
import '../store/store.dart';
|
|
import '../widgets/desktop/desktop_product_detail_page.dart';
|
|
import '../widgets/mobile/mobile_product_detail_page.dart';
|
|
|
|
class ProductDetailPage extends StatelessWidget {
|
|
final Business business;
|
|
final Product product;
|
|
|
|
const ProductDetailPage({required this.business, required this.product, Key? key}) :
|
|
super(key: key);
|
|
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
store.dispatch(UpdateContext(context));
|
|
|
|
return ResponsiveBuilder(
|
|
builder: (context, sizingInformation) =>
|
|
ScreenTypeLayout.builder(
|
|
mobile: (context) => MobileProductDetailPage(business: business, product: product,),
|
|
tablet: (context) => DesktopProductDetailPage(business: business, product: product,),
|
|
desktop: (context) => DesktopProductDetailPage(business: business, product: product,),
|
|
),
|
|
);
|
|
}
|
|
|
|
} |