Feat: order info page

This commit is contained in:
2024-06-16 23:33:38 +03:00
parent 73fe273c75
commit 0a22b5c051
5 changed files with 480 additions and 47 deletions

View File

@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:gymlink_module_web/components/app_bar.dart';
import 'package:gymlink_module_web/components/heading.dart';
import 'package:gymlink_module_web/components/history_item_card.dart';
import 'package:gymlink_module_web/interfaces/items.dart';
import 'package:gymlink_module_web/tools/relative.dart';
import 'package:lazy_load_scrollview/lazy_load_scrollview.dart';
@@ -45,13 +46,16 @@ class HistoryPage extends StatefulWidget {
}
class _HistoryPageState extends State<HistoryPage> {
List<Map<String, String>> my_orders = [];
List<GymHistoryItem> my_orders = [];
late Timer _updateTimer;
@override
void initState() {
super.initState();
my_orders = orders;
my_orders = [
GymHistoryItem(
id: '123', date: '01.01.1970', sum: '120', photo: 'product.png')
];
ordersRefresh();
}
@@ -63,12 +67,8 @@ class _HistoryPageState extends State<HistoryPage> {
await Future.delayed(const Duration(milliseconds: 1000));
setState(() {
my_orders.add(
{
"image": "product.png",
"price": "120",
"id": "666666",
"date": "11.09.2001"
},
GymHistoryItem(
id: '123', date: '01.01.1970', sum: '120', photo: 'product.png'),
);
});
}
@@ -112,14 +112,13 @@ class _HistoryPageState extends State<HistoryPage> {
itemBuilder: (context, index) {
final item = my_orders[index];
return HistoryItemCard(
id: item['id']!,
cost: item['price']!,
date: item['date']!,
id: item.id,
cost: item.sum,
date: item.date,
image: Image(
image: AssetImage('assets/${item['image']!}'),
image: AssetImage('assets/${item.photo}'),
width: 50,
),
status: OrderStatus.completed,
);
},
),