101 lines
3.8 KiB
Dart
101 lines
3.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:gymlink_module_web/components/app_bar.dart';
|
|
import 'package:gymlink_module_web/components/heading.dart';
|
|
|
|
//TODO: Сделать получение инфы через объект
|
|
class DetailPage extends StatelessWidget {
|
|
final String name;
|
|
final String description;
|
|
final String price;
|
|
final String id;
|
|
final Image image;
|
|
const DetailPage(
|
|
{super.key,
|
|
required this.name,
|
|
required this.description,
|
|
required this.price,
|
|
required this.id,
|
|
required this.image});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: const GymLinkAppBar(),
|
|
body: Column(mainAxisAlignment: MainAxisAlignment.start, children: [
|
|
GymLinkHeader(title: '$name - $id'),
|
|
Expanded(
|
|
child: SingleChildScrollView(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(20),
|
|
child: SizedBox(
|
|
width: MediaQuery.sizeOf(context).width,
|
|
height: MediaQuery.sizeOf(context).height,
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
children: [
|
|
image,
|
|
Padding(
|
|
padding:
|
|
const EdgeInsetsDirectional.fromSTEB(0, 30, 60, 60),
|
|
child: SizedBox(
|
|
width: 340,
|
|
height: MediaQuery.sizeOf(context).height,
|
|
child: Card(
|
|
elevation: 4,
|
|
color: const Color(0xFFF2F3F9),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(16),
|
|
),
|
|
child: Padding(
|
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
20, 15, 10, 15),
|
|
child: Text(
|
|
description,
|
|
style: Theme.of(context).textTheme.bodyMedium,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Align(
|
|
alignment: const AlignmentDirectional(0, -1),
|
|
child: Padding(
|
|
padding:
|
|
const EdgeInsetsDirectional.fromSTEB(0, 60, 0, 0),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Text(
|
|
'Стоимость $price',
|
|
style: Theme.of(context).textTheme.bodyLarge,
|
|
),
|
|
ElevatedButton(
|
|
onPressed: () => {},
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor:
|
|
Theme.of(context).primaryColor,
|
|
shape: const RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.all(
|
|
Radius.circular(50),
|
|
),
|
|
),
|
|
foregroundColor: Colors.white,
|
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
|
34, 10, 34, 10)),
|
|
child: const Text('Добавить в корзину'),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
]),
|
|
);
|
|
}
|
|
}
|