feat: info by order screen

This commit is contained in:
mso7nueh
2025-03-19 13:32:23 +03:00
parent 70eaa0e0da
commit f97da886b4
4 changed files with 239 additions and 391 deletions

View File

@@ -1,26 +1,155 @@
import 'package:eatvio_app/core/app_colors.dart';
import 'package:eatvio_app/features/diets/presentation/widgets/author_card.dart';
import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart';
import 'package:eatvio_app/generated/l10n.dart';
import 'package:flutter/material.dart';
class InfoByOrderScreen extends StatelessWidget {
class InfoByOrderScreen extends StatefulWidget {
static const name = 'infoByOrderScreen';
static const path = '/info-by-order-screen';
const InfoByOrderScreen({super.key});
@override
Widget build(BuildContext context) {
final s = S.of(context);
State<InfoByOrderScreen> createState() => _InfoByOrderScreenState();
}
class _InfoByOrderScreenState extends State<InfoByOrderScreen> {
bool _isHelpExpanded = false;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.scaffoldBackgroundColor,
appBar: AppBar(
title: Text(s.infoAboutOrder),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.vertical(bottom: Radius.circular(12))),
appBar: AppBar(title: Text("Информация о заказе"), leading: IconButton(icon: Icon(Icons.arrow_back), onPressed: () {})),
body: ListView(
padding: EdgeInsets.all(16.0),
children: [
_buildProfileSection(),
SizedBox(height: 10),
_buildOrderStatus(),
SizedBox(height: 20),
_buildPlanDetails(),
SizedBox(height: 20),
_buildOptionDetails(),
SizedBox(height: 20),
_buildOrderProgress(),
SizedBox(height: 20),
_buildHelpSection(),
SizedBox(height: 20),
_buildCancelButton(),
],
),
body: AuthorCard(author: Author(authorSlug: 'authorSlug', authorName: 'authorName', authorProfileIcon: '', authorIsMe: false), title: 'asdasd'),
);
}
Widget _buildProfileSection() {
return Row(
children: [
CircleAvatar(
radius: 30,
backgroundImage: AssetImage('assets/profile.jpg'), // Замените на реальный путь
),
SizedBox(width: 10),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Дмитрий Коваль", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16)),
Text("Консультант 128-й в рейтинге", style: TextStyle(color: Colors.grey)),
],
),
],
);
}
Widget _buildOrderStatus() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Статус заказа", style: TextStyle(fontWeight: FontWeight.bold)),
Chip(label: Text("Заказ оплачен", style: TextStyle(color: Colors.white)), backgroundColor: Colors.green),
],
),
Text("Сумма заказа: 2500₽"),
Text("Время выполнения плана: 7 дней"),
],
);
}
Widget _buildPlanDetails() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Название плана", style: TextStyle(fontWeight: FontWeight.bold)),
Text("В мире, где технологии становятся все более..."),
SizedBox(height: 10),
Image.asset('assets/plan_image.jpg', height: 150, fit: BoxFit.cover),
],
);
}
Widget _buildOptionDetails() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Название опции", style: TextStyle(fontWeight: FontWeight.bold)),
Text("Поддержка 24/7"),
Text("Составление индивидуальной диеты"),
Text("Длинное название опции..."),
],
);
}
Widget _buildOrderProgress() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Этапы заказа", style: TextStyle(fontWeight: FontWeight.bold)),
ListTile(leading: Icon(Icons.check_circle, color: Colors.green), title: Text("Заказ создан")),
ListTile(leading: Icon(Icons.check_circle, color: Colors.green), title: Text("Выбрана дата старта")),
ListTile(leading: Icon(Icons.check_circle, color: Colors.green), title: Text("Заказ оплачен")),
ListTile(leading: Icon(Icons.radio_button_unchecked, color: Colors.grey), title: Text("В процессе")),
ListTile(leading: Icon(Icons.radio_button_unchecked, color: Colors.grey), title: Text("Завершен")),
],
);
}
Widget _buildHelpSection() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ListTile(
leading: Icon(Icons.help_outline),
title: Text("Помощь", style: TextStyle(fontWeight: FontWeight.bold)),
trailing: Icon(_isHelpExpanded ? Icons.expand_less : Icons.expand_more),
onTap: () {
setState(() {
_isHelpExpanded = !_isHelpExpanded;
});
},
),
if (_isHelpExpanded) ...[
Padding(
padding: EdgeInsets.symmetric(horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Продавец не отвечает на мои сообщения", style: TextStyle(fontWeight: FontWeight.bold)),
Text("Ответ некоторых продавцов может занять больше времени, чем вы ожидали..."),
SizedBox(height: 10),
Text("Работа, которую сдал продавец, отличалась от описания", style: TextStyle(fontWeight: FontWeight.bold)),
Text("У вас есть три дня, чтобы проверить сданную на проверку работу..."),
],
),
),
],
],
);
}
Widget _buildCancelButton() {
return ElevatedButton(
style: ElevatedButton.styleFrom(backgroundColor: Colors.red, padding: EdgeInsets.symmetric(vertical: 15)),
onPressed: () {},
child: Text("Отменить заказ", style: TextStyle(color: Colors.white)),
);
}
}