aman-satu-flutter/lib/views/work/tabs/sell_view.dart

71 lines
2.3 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import 'package:flutter/material.dart';
import 'package:satu/core/services/navigator_service.dart';
import 'package:satu/core/utils/locator.dart';
import 'package:satu/routes/route_names.dart';
import 'package:satu/shared/app_colors.dart';
import 'package:satu/views/work/tabs/component/product_list_item.dart';
import 'package:satu/views/work/tabs/component/products_app_bar.dart';
import 'package:satu/views/work/tabs/component/products_header_bar.dart';
class SellView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: ProductsAppBar(
title: 'Продажа',
actions: actions(),
elevation: 2.0,
child: ProductHeaderBar(
count: 14,
sum: 25000,
),
backgroundColor: backgroundColor,
childHeight: 80,
),
body: Column(
children: [
//ProductHeaderBar(count: 14, sum: 25000,),
Expanded(
child: ListView.builder(
physics: BouncingScrollPhysics(),
itemCount: 5,
itemBuilder: (BuildContext context, int index) {
return ProductListItem(
ean: '1234567890123',
isOdd: index % 2 == 0,
name:
'Хлеб ржаной который необходимо покупать каждый раз когда придет мысль об этом - ${index + 1}. ',
price: 75,
count: 15,
categoryName: 'Хлебобулочные изделия',
);
},
),
),
],
),
);
}
List<Widget> actions() {
return [
Padding(
padding: const EdgeInsets.all(8.0),
child: IconButton(
icon: Icon(Icons.add_box, size: 30.0, color: yellowColor),
onPressed: () {
locator<NavigatorService>().push(AddProductViewRoute);
}),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: IconButton(
icon: Icon(Icons.camera_enhance_rounded, size: 30.0, color: yellowColor),
onPressed: () {
locator<NavigatorService>().push(AddByBarcodeViewRoute);
}),
)
];
}
}