fixed issue update profile
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:grocery_app/src/common_widget/network_image.dart';
|
||||
import 'package:grocery_app/src/data/myOrder.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class OrderDetailsScreen extends StatefulWidget {
|
||||
final Datum order;
|
||||
@@ -13,6 +14,20 @@ class OrderDetailsScreen extends StatefulWidget {
|
||||
|
||||
class _OrderDetailsScreenState extends State<OrderDetailsScreen> {
|
||||
int currentStep = 1;
|
||||
String convertUtcToIst(String utcTime) {
|
||||
// Parse the UTC time string
|
||||
DateTime utcDateTime = DateTime.parse(utcTime).toUtc();
|
||||
|
||||
// Convert to IST (UTC +5:30)
|
||||
DateTime istDateTime =
|
||||
utcDateTime.add(const Duration(hours: 5, minutes: 30));
|
||||
|
||||
// Format the IST datetime with AM/PM
|
||||
String formattedDateTime =
|
||||
DateFormat("dd-MM-yyyy hh:mm a").format(istDateTime);
|
||||
|
||||
return formattedDateTime; // Example: 11-02-2025 10:44 AM
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -54,7 +69,7 @@ class _OrderDetailsScreenState extends State<OrderDetailsScreen> {
|
||||
Text(widget.order.deliveryAddress!.addressLine ?? " ",
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
|
||||
SizedBox(height: 5),
|
||||
Text(widget.order.createdAt.toString()),
|
||||
Text(convertUtcToIst(widget.order.createdAt.toString())),
|
||||
SizedBox(height: 5),
|
||||
Text(
|
||||
"Status: ${_getStatusText(widget.order.orderStatus)}",
|
||||
|
||||
Reference in New Issue
Block a user