You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
235 lines
7.5 KiB
235 lines
7.5 KiB
|
3 months ago
|
import 'package:flutter/material.dart';
|
||
|
|
import 'package:supplier_new/orders/edit_order_requests.dart';
|
||
|
|
|
||
|
|
class AcceptOrderRequests extends StatefulWidget {
|
||
|
|
var order;
|
||
|
|
AcceptOrderRequests({this.order});
|
||
|
|
@override
|
||
|
|
State<AcceptOrderRequests> createState() => _AcceptOrderRequestsState();
|
||
|
|
}
|
||
|
|
|
||
|
|
class _AcceptOrderRequestsState extends State<AcceptOrderRequests> {
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return Scaffold(
|
||
|
|
backgroundColor: Colors.white,
|
||
|
|
|
||
|
|
appBar: AppBar(
|
||
|
|
backgroundColor: Colors.white,
|
||
|
|
elevation: 0,
|
||
|
|
leading: IconButton(
|
||
|
|
icon: const Icon(Icons.arrow_back, color: Colors.black),
|
||
|
|
onPressed: () => Navigator.pop(context),
|
||
|
|
),
|
||
|
|
actions: [
|
||
|
|
IconButton(
|
||
|
|
icon: const Icon(Icons.help_outline, color: Colors.black),
|
||
|
|
onPressed: () {},
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
|
||
|
|
body: SingleChildScrollView(
|
||
|
|
child: Column(
|
||
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||
|
|
children: [
|
||
|
|
/// 🔹 Top Card with Image
|
||
|
|
Stack(
|
||
|
|
children: [
|
||
|
|
ClipRRect(
|
||
|
|
borderRadius: BorderRadius.circular(12),
|
||
|
|
child: Image.asset(
|
||
|
|
"images/building.png", // replace with network image
|
||
|
|
height: 180,
|
||
|
|
width: double.infinity,
|
||
|
|
fit: BoxFit.cover,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
|
||
|
|
/// Status Chip
|
||
|
|
Positioned(
|
||
|
|
top: 12,
|
||
|
|
left: 12,
|
||
|
|
child: Container(
|
||
|
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||
|
|
decoration: BoxDecoration(
|
||
|
|
color: Colors.blue.withOpacity(0.1),
|
||
|
|
borderRadius: BorderRadius.circular(8),
|
||
|
|
),
|
||
|
|
child: const Text(
|
||
|
|
"New",
|
||
|
|
style: TextStyle(
|
||
|
|
color: Colors.blue,
|
||
|
|
fontWeight: FontWeight.w600,
|
||
|
|
fontSize: 12,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
|
||
|
|
/// Title + Location + Distance
|
||
|
|
Padding(
|
||
|
|
padding: const EdgeInsets.all(12),
|
||
|
|
child: Column(
|
||
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||
|
|
children: const [
|
||
|
|
Text(
|
||
|
|
"Club Kohinoor",
|
||
|
|
style: TextStyle(
|
||
|
|
fontSize: 18,
|
||
|
|
fontWeight: FontWeight.w600,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
SizedBox(height: 4),
|
||
|
|
Text(
|
||
|
|
"Banjara Hills, Hyderabad • 5.5 Km",
|
||
|
|
style: TextStyle(
|
||
|
|
fontSize: 13,
|
||
|
|
color: Colors.grey,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
|
||
|
|
const Divider(),
|
||
|
|
|
||
|
|
/// 🔹 Order Details
|
||
|
|
Padding(
|
||
|
|
padding: const EdgeInsets.all(12),
|
||
|
|
child: Column(
|
||
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||
|
|
children: [
|
||
|
|
const Text(
|
||
|
|
"ORDER DETAILS",
|
||
|
|
style: TextStyle(
|
||
|
|
fontSize: 14,
|
||
|
|
fontWeight: FontWeight.w600,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
const SizedBox(height: 12),
|
||
|
|
|
||
|
|
_detailRow("Tanker Price", "₹ ${widget.order.quoted_amount}"),
|
||
|
|
_detailRow("Water Type", " ${widget.order.type_of_water}"),
|
||
|
|
_detailRow("Date of Delivery", "${widget.order.time}"),
|
||
|
|
_detailRow("Capacity", "${widget.order.capacity}"),
|
||
|
|
_detailRow("Time of Delivery", "${widget.order.averageTime}"),
|
||
|
|
_detailRow("Quantity", "${widget.order.quantity}"),
|
||
|
|
_detailRow("Advance", "10%"),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
|
||
|
|
const Divider(),
|
||
|
|
|
||
|
|
/// 🔹 Additional Details
|
||
|
|
const Padding(
|
||
|
|
padding: EdgeInsets.all(12),
|
||
|
|
child: Text(
|
||
|
|
"ADDITIONAL DETAILS\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit, "
|
||
|
|
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "
|
||
|
|
"Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut "
|
||
|
|
"aliquip ex ea commodo consequat.",
|
||
|
|
style: TextStyle(fontSize: 13, color: Colors.black87, height: 1.4),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
|
||
|
|
const Divider(),
|
||
|
|
|
||
|
|
/// 🔹 Payment Summary
|
||
|
|
Padding(
|
||
|
|
padding: const EdgeInsets.all(12),
|
||
|
|
child: Column(
|
||
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||
|
|
children: [
|
||
|
|
const Text(
|
||
|
|
"PAYMENT SUMMARY",
|
||
|
|
style: TextStyle(
|
||
|
|
fontSize: 14,
|
||
|
|
fontWeight: FontWeight.w600,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
const SizedBox(height: 12),
|
||
|
|
_detailRow("Tanker Price", "₹ 1,500"),
|
||
|
|
_detailRow("Advance", "10%"),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
|
||
|
|
const SizedBox(height: 80), // space for bottom buttons
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
|
||
|
|
/// 🔹 Bottom Action Buttons
|
||
|
|
bottomNavigationBar: Container(
|
||
|
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||
|
|
decoration: BoxDecoration(
|
||
|
|
color: Colors.white,
|
||
|
|
border: Border(top: BorderSide(color: Colors.grey.shade300)),
|
||
|
|
),
|
||
|
|
child: Row(
|
||
|
|
children: [
|
||
|
|
Expanded(
|
||
|
|
child: OutlinedButton(
|
||
|
|
onPressed: () {
|
||
|
|
|
||
|
|
Navigator.push(
|
||
|
|
context,
|
||
|
|
MaterialPageRoute(
|
||
|
|
builder: (_) => EditOrderRequests(order: widget.order,advance:"10%" ,),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
|
||
|
|
},
|
||
|
|
child: const Text("Edit Order"),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
const SizedBox(width: 8),
|
||
|
|
Expanded(
|
||
|
|
child: OutlinedButton(
|
||
|
|
style: OutlinedButton.styleFrom(
|
||
|
|
foregroundColor: Colors.red,
|
||
|
|
side: const BorderSide(color: Colors.red),
|
||
|
|
),
|
||
|
|
onPressed: () {},
|
||
|
|
child: const Text("Reject"),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
const SizedBox(width: 8),
|
||
|
|
Expanded(
|
||
|
|
child: ElevatedButton(
|
||
|
|
style: ElevatedButton.styleFrom(
|
||
|
|
backgroundColor: Colors.green,
|
||
|
|
foregroundColor: Colors.white,
|
||
|
|
),
|
||
|
|
onPressed: () {},
|
||
|
|
child: const Text("Accept"),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
/// 🔹 Helper widget for rows
|
||
|
|
Widget _detailRow(String title, String value) {
|
||
|
|
return Padding(
|
||
|
|
padding: const EdgeInsets.symmetric(vertical: 6),
|
||
|
|
child: Row(
|
||
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||
|
|
children: [
|
||
|
|
Text(title,
|
||
|
|
style: const TextStyle(fontSize: 13, color: Colors.grey)),
|
||
|
|
Text(value,
|
||
|
|
style: const TextStyle(
|
||
|
|
fontSize: 13, fontWeight: FontWeight.w600)),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|