200 lines
6.5 KiB
Dart
200 lines
6.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../core/constants/app_colors.dart';
|
|
import '../../core/constants/app_text_styles.dart';
|
|
import '../widgets/teacher_panel_scaffold.dart';
|
|
import 'course_page.dart';
|
|
import 'dashboard_page.dart';
|
|
import 'license_page.dart';
|
|
import 'transaction_page.dart';
|
|
|
|
class TicketPage extends StatelessWidget {
|
|
const TicketPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final isDesktop = MediaQuery.of(context).size.width > 900;
|
|
|
|
return TeacherPanelScaffold(
|
|
selectedMenu: PanelMenu.ticket,
|
|
onDashboardTap: () {
|
|
Navigator.of(context).pushReplacement(
|
|
MaterialPageRoute(builder: (context) => const DashboardPage()),
|
|
);
|
|
},
|
|
onCourseTap: () {
|
|
Navigator.of(context).pushReplacement(
|
|
MaterialPageRoute(builder: (context) => const CoursePage()),
|
|
);
|
|
},
|
|
onLicenseTap: () {
|
|
Navigator.of(context).pushReplacement(
|
|
MaterialPageRoute(builder: (context) => const PanelLicensePage()),
|
|
);
|
|
},
|
|
onTransactionTap: () {
|
|
Navigator.of(context).pushReplacement(
|
|
MaterialPageRoute(builder: (context) => const TransactionPage()),
|
|
);
|
|
},
|
|
onTicketTap: () {},
|
|
child: Padding(
|
|
padding: EdgeInsets.all(isDesktop ? 24 : 12),
|
|
child: Container(
|
|
decoration: BoxDecoration(
|
|
color: Colors.white.withValues(alpha: 0.35),
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
child: Column(
|
|
children: [
|
|
Padding(
|
|
padding: EdgeInsets.all(isDesktop ? 14 : 10),
|
|
child: Wrap(
|
|
spacing: 10,
|
|
runSpacing: 8,
|
|
children: [
|
|
SizedBox(
|
|
width: isDesktop ? 170 : double.infinity,
|
|
height: 36,
|
|
child: TextField(
|
|
decoration: InputDecoration(
|
|
hintText: 'جست و جو',
|
|
prefixIcon: const Icon(Icons.search, size: 18),
|
|
border: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(6),
|
|
borderSide: BorderSide(color: Colors.grey.shade400),
|
|
),
|
|
contentPadding: const EdgeInsets.symmetric(vertical: 8),
|
|
),
|
|
),
|
|
),
|
|
SizedBox(
|
|
width: isDesktop ? 130 : double.infinity,
|
|
height: 36,
|
|
child: ElevatedButton.icon(
|
|
onPressed: () {},
|
|
icon: const Icon(Icons.add, size: 18),
|
|
label: const Text('تیکت جدید'),
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor: const Color(0xFF56B33E),
|
|
foregroundColor: Colors.white,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Container(
|
|
margin: EdgeInsets.fromLTRB(
|
|
isDesktop ? 14 : 8,
|
|
0,
|
|
isDesktop ? 14 : 8,
|
|
isDesktop ? 14 : 8,
|
|
),
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
border: Border.all(color: Colors.black12),
|
|
borderRadius: BorderRadius.circular(8),
|
|
),
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
height: 46,
|
|
decoration: const BoxDecoration(
|
|
color: Color(0xFFD5D5D5),
|
|
borderRadius: BorderRadius.only(
|
|
topLeft: Radius.circular(8),
|
|
topRight: Radius.circular(8),
|
|
),
|
|
),
|
|
child: const Row(
|
|
children: [
|
|
_HeaderCell(title: 'عنوان', flex: 4),
|
|
_HeaderCell(title: 'واحد', flex: 3),
|
|
_HeaderCell(title: 'اولویت', flex: 3),
|
|
_HeaderCell(title: 'به روزرسانی', flex: 3),
|
|
],
|
|
),
|
|
),
|
|
const Expanded(
|
|
child: Center(
|
|
child: _EmptyTicketState(),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _HeaderCell extends StatelessWidget {
|
|
final String title;
|
|
final int flex;
|
|
|
|
const _HeaderCell({required this.title, required this.flex});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Expanded(
|
|
flex: flex,
|
|
child: Center(
|
|
child: Text(
|
|
title,
|
|
style: AppTextStyles.bodyLarge.copyWith(fontWeight: FontWeight.w700),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _EmptyTicketState extends StatelessWidget {
|
|
const _EmptyTicketState();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Container(
|
|
width: 340,
|
|
constraints: const BoxConstraints(maxWidth: 340),
|
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 20),
|
|
decoration: BoxDecoration(
|
|
color: Colors.grey.shade50,
|
|
borderRadius: BorderRadius.circular(12),
|
|
border: Border.all(color: Colors.grey.shade200),
|
|
),
|
|
child: Column(
|
|
children: [
|
|
Icon(
|
|
Icons.desktop_windows_outlined,
|
|
size: 120,
|
|
color: AppColors.sidebarBg.withValues(alpha: 0.7),
|
|
),
|
|
const SizedBox(height: 6),
|
|
Text(
|
|
'NO DATA',
|
|
style: AppTextStyles.headlineMedium.copyWith(
|
|
color: AppColors.sidebarBg,
|
|
fontSize: 18,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
const SizedBox(height: 22),
|
|
Text(
|
|
'هنوز اطلاعاتی وارد نشده است.',
|
|
style: AppTextStyles.bodyMedium.copyWith(color: AppColors.sidebarBg),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|