fixed issue update profile

This commit is contained in:
2025-02-12 00:37:02 +05:30
parent ad7903d1e3
commit cec162176e
18 changed files with 2011 additions and 196 deletions

View File

@@ -7,6 +7,7 @@ import 'package:grocery_app/src/logic/provider/order_provider.dart';
import 'package:grocery_app/utils/constants/assets_constant.dart';
import 'package:grocery_app/utils/constants/color_constant.dart';
import 'package:grocery_app/utils/extensions/extensions.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
@@ -22,6 +23,21 @@ class _MyOrderScreenState extends State<MyOrderScreen> {
super.initState();
}
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) {
return Scaffold(
@@ -134,7 +150,7 @@ class _MyOrderScreenState extends State<MyOrderScreen> {
],
),
SizedBox(height: 10),
Text(order.createdAt.toString(),
Text(convertUtcToIst(order.updatedAt.toString()),
style: TextStyle(color: Colors.grey)),
SizedBox(height: 5),
Row(