feat(order info): added order info screen

This commit is contained in:
Username1548
2025-04-04 20:21:31 +07:00
parent 9715f4cac9
commit 748484cf8f
387 changed files with 16171 additions and 18199 deletions

View File

@@ -8,18 +8,18 @@ class ConsultationsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFFF0F2F5),
backgroundColor: const Color(0xFFF0F2F5),
appBar: AppBar(
title: Text('Консультации'),
title: const Text('Консультации'),
centerTitle: true,
shape: RoundedRectangleBorder(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadiusDirectional.vertical(
bottom: Radius.circular(12),
),
),
),
body: ListView.separated(
padding: EdgeInsets.symmetric(vertical: 12),
padding: const EdgeInsets.symmetric(vertical: 12),
itemBuilder: (context, index) => ConsultationCardWidget(
consultationsEntity: testData[index],
),

View File

@@ -1,155 +0,0 @@
import 'package:flutter/material.dart';
class InfoByOrderScreen extends StatefulWidget {
static const name = 'infoByOrderScreen';
static const path = '/info-by-order-screen';
const InfoByOrderScreen({super.key});
@override
State<InfoByOrderScreen> createState() => _InfoByOrderScreenState();
}
class _InfoByOrderScreenState extends State<InfoByOrderScreen> {
bool _isHelpExpanded = false;
@override
Widget build(BuildContext context) {
return Scaffold(
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(),
],
),
);
}
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)),
);
}
}

View File

@@ -42,7 +42,7 @@ class ConsultationCardWidget extends StatelessWidget {
children: [
Row(
children: [
CircleAvatar(
const CircleAvatar(
radius: 30,
),
const SizedBox(width: 12),
@@ -51,7 +51,7 @@ class ConsultationCardWidget extends StatelessWidget {
children: [
Text(
consultationsEntity.name,
style: TextStyle(
style: const TextStyle(
height: 1,
color: Color(0xFF323F4B),
fontSize: 16,
@@ -61,7 +61,7 @@ class ConsultationCardWidget extends StatelessWidget {
const SizedBox(height: 4),
Text(
consultationsEntity.planName,
style: TextStyle(
style: const TextStyle(
height: 1,
color: Color(0xFF88949F),
fontSize: 14,
@@ -89,14 +89,14 @@ class ConsultationCardWidget extends StatelessWidget {
),
),
const SizedBox(height: 12),
CustomDivider(),
const CustomDivider(),
const SizedBox(height: 12),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'День ${consultationsEntity.currentDayOfPlan} из ${consultationsEntity.totalDaysOfPlan}',
style: TextStyle(
style: const TextStyle(
height: 1,
color: Color(0xFF323F4B),
fontSize: 16,
@@ -116,7 +116,7 @@ class ConsultationCardWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
const Text(
'Легенда',
style: TextStyle(
height: 1,
@@ -130,7 +130,7 @@ class ConsultationCardWidget extends StatelessWidget {
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => _legendTitle(titles[index], legendColors[index]),
separatorBuilder: (context, index) => SizedBox(height: 16),
separatorBuilder: (context, index) => const SizedBox(height: 16),
itemCount: titles.length,
),
const SizedBox(height: 16),
@@ -139,7 +139,7 @@ class ConsultationCardWidget extends StatelessWidget {
),
);
},
child: Icon(
child: const Icon(
Icons.help_outline_rounded,
color: Color(0xFF323F4B),
size: 20,
@@ -157,11 +157,11 @@ class ConsultationCardWidget extends StatelessWidget {
headerVisible: false,
calendarFormat: CalendarFormat.week,
calendarStyle: CalendarStyle(
weekendDecoration: BoxDecoration(
weekendDecoration: const BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
),
defaultDecoration: BoxDecoration(
defaultDecoration: const BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
),
@@ -169,7 +169,7 @@ class ConsultationCardWidget extends StatelessWidget {
color: appTheme.blueA400,
shape: BoxShape.circle,
),
todayTextStyle: TextStyle(
todayTextStyle: const TextStyle(
color: Colors.black,
),
todayDecoration: BoxDecoration(
@@ -183,11 +183,11 @@ class ConsultationCardWidget extends StatelessWidget {
),
),
const SizedBox(height: 16),
CustomDivider(),
const CustomDivider(),
const SizedBox(height: 12),
Text(
'${consultationsEntity.paymentAmount} ₽',
style: TextStyle(
style: const TextStyle(
color: Color(0xFF019A3E),
fontSize: 20,
fontWeight: FontWeight.w600,
@@ -201,12 +201,12 @@ class ConsultationCardWidget extends StatelessWidget {
onTap: () {},
child: Ink(
width: MediaQuery.of(context).size.width - 32 - 52 - 8,
padding: EdgeInsets.all(16),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: appTheme.blueA400,
),
child: Center(
child: const Center(
child: Text(
'Комментировать отчёт',
style: TextStyle(
@@ -227,9 +227,9 @@ class ConsultationCardWidget extends StatelessWidget {
width: 52,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Color(0xFFF6F6F6),
color: const Color(0xFFF6F6F6),
),
child: Center(
child: const Center(
child: Icon(
Icons.chat_outlined,
size: 24,
@@ -261,7 +261,7 @@ class ConsultationCardWidget extends StatelessWidget {
Flexible(
child: Text(
text,
style: TextStyle(
style: const TextStyle(
height: 1,
fontSize: 16,
fontWeight: FontWeight.w500,