2024-07-24 12:14:17 +00:00
|
|
|
import 'package:cargo/configs/configs.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
2024-08-15 05:49:01 +00:00
|
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
2024-07-24 12:14:17 +00:00
|
|
|
|
2024-08-19 06:02:02 +00:00
|
|
|
import '../../application/order_detail_bloc/order_detail_bloc.dart';
|
2024-07-24 12:14:17 +00:00
|
|
|
import '../../core/core.dart';
|
2024-08-19 06:02:02 +00:00
|
|
|
import '../../domain/entities/order/order.dart';
|
2024-07-29 07:35:53 +00:00
|
|
|
import '../widgets/map/clustering.dart';
|
2024-07-24 12:14:17 +00:00
|
|
|
import '../widgets/widgets.dart';
|
|
|
|
|
|
2024-08-15 05:49:01 +00:00
|
|
|
class OrderDetailsScreen extends StatefulWidget {
|
|
|
|
|
final OrderEntity order;
|
|
|
|
|
const OrderDetailsScreen({super.key, required this.order});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
State<OrderDetailsScreen> createState() => _OrderDetailsScreenState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _OrderDetailsScreenState extends State<OrderDetailsScreen> {
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
context.read<OrderDetailBloc>().add(GetRoutes(widget.order.cargoId));
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
2024-07-24 12:14:17 +00:00
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
App.init(context);
|
|
|
|
|
return Scaffold(
|
|
|
|
|
backgroundColor: AppColors.surface,
|
|
|
|
|
appBar: AppBar(
|
|
|
|
|
iconTheme: const IconThemeData(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
backgroundColor: AppColors.primary,
|
|
|
|
|
title: Text(
|
2024-08-19 06:02:02 +00:00
|
|
|
'Sargyt ${widget.order.name}',
|
2024-07-24 12:14:17 +00:00
|
|
|
style: AppText.h2!.copyWith(color: Colors.white),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
body: CustomScrollView(
|
|
|
|
|
slivers: [
|
|
|
|
|
/// map
|
2024-07-29 07:35:53 +00:00
|
|
|
SliverToBoxAdapter(
|
|
|
|
|
child: SizedBox(
|
2024-08-19 06:02:02 +00:00
|
|
|
height: AppDimensions.normalize(130),
|
2024-07-29 07:35:53 +00:00
|
|
|
child: const ClusteringPage(),
|
|
|
|
|
),
|
2024-07-24 12:14:17 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
|
|
/// info text
|
|
|
|
|
SliverToBoxAdapter(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: Space.all(1, 1),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
2024-08-19 04:50:22 +00:00
|
|
|
'Sargyt barada maglumat №${widget.order.no}',
|
2024-07-24 12:14:17 +00:00
|
|
|
style: AppText.b1b,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
/// gap
|
|
|
|
|
Space.y!,
|
|
|
|
|
|
|
|
|
|
/// info card
|
2024-08-19 04:50:22 +00:00
|
|
|
InfoCard(order: widget.order),
|
2024-07-24 12:14:17 +00:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
/// current location info
|
|
|
|
|
SliverToBoxAdapter(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: Space.all(1, 1),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
'Gatnaw yoly',
|
|
|
|
|
style: AppText.b1b,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
/// gap
|
|
|
|
|
Space.y!,
|
|
|
|
|
|
2024-07-29 12:30:30 +00:00
|
|
|
/// location card
|
2024-08-15 05:49:01 +00:00
|
|
|
LocationCard(cargoId: widget.order.cargoId)
|
2024-07-24 12:14:17 +00:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|