Some relative stuff

This commit is contained in:
2024-05-11 23:27:01 +03:00
parent 57ff8a59e8
commit 75bfc7ea6b
10 changed files with 200 additions and 19 deletions

View File

@@ -4,6 +4,7 @@ import 'package:gymlink_module_web/components/item_card.dart';
import 'package:gymlink_module_web/pages/basket.dart';
import 'package:gymlink_module_web/pages/detail.dart';
import 'package:gymlink_module_web/pages/order_history.dart';
import 'package:gymlink_module_web/tools/relative.dart';
import 'package:url_launcher/url_launcher.dart';
const List<Map<String, String>> testData = [
@@ -111,9 +112,7 @@ class _MainPageState extends State<MainPage> {
),
),
),
const Spacer(
flex: 2,
),
getSpacer(context: context, flex: 2),
ElevatedButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(

View File

@@ -2,36 +2,32 @@ 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/tools/relative.dart';
List<Map<String, String>> orders = [
{
"image": "product.png",
"price": "120",
"id": "34fa3126-bfaf-5dec-8f4a-b246c097ef73",
"date": "11.09.2001"
},
{"image": "product.png", "price": "120", "id": "66", "date": "11.09.2001"},
{
"image": "product.png",
"price": "150",
"id": "34a26e82-7656-5e98-a44a-c2d01d0b1ad1123",
"id": "56",
"date": "11.09.2001",
},
{
"image": "product.png",
"price": "250",
"id": "4fb204b7-3f9e-52a2-bed1-415c00a31a37123",
"id": "98",
"date": "11.09.2001",
},
{
"image": "product.png",
"price": "300",
"id": "09b2f5bb-683e-5c39-ae89-b8e152fa8bcf123",
"id": "50",
"date": "11.09.2001",
},
{
"image": "product.png",
"price": "100",
"id": "cd1b6817-db94-5394-be1d-af88af79749f123",
"id": "30",
"date": "11.09.2001",
}
];
@@ -40,6 +36,7 @@ class HistoryPage extends StatelessWidget {
const HistoryPage({
super.key,
});
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -69,7 +66,7 @@ class HistoryPage extends StatelessWidget {
},
),
),
const Spacer(),
getSpacer(context: context)
],
),
),

26
lib/pages/order_pay.dart Normal file
View File

@@ -0,0 +1,26 @@
import 'dart:ui_web' as ui;
import 'package:flutter/material.dart';
import 'package:universal_html/html.dart';
class OrderPayPage extends StatelessWidget {
const OrderPayPage({super.key});
@override
Widget build(BuildContext context) {
registerHtmlElementView();
return const HtmlElementView(
viewType: 'payment-html',
);
}
void registerHtmlElementView() {
ui.platformViewRegistry.registerViewFactory(
'payment-html',
(int viewId) => IFrameElement()
..src = 'payment.html'
..style.width = '100%'
..style.height = '500px'
..style.border = 'none');
}
}