getCustomerOrders method

  1. @override
Future<List<Map<String, dynamic>>?> getCustomerOrders()
override

Get customer orders.

Retrieves the order history for the currently authenticated customer. Requires customer authentication.

Returns a list of maps containing order data, or null if not authenticated or failed.

Implementation

@override
Future<List<Map<String, dynamic>>?> getCustomerOrders() async {
  try {
    final result = await methodChannel.invokeMethod<List<dynamic>>(
      'getCustomerOrders',
    );
    if (result != null) {
      return result.cast<Map<String, dynamic>>();
    }
    return null;
  } catch (e) {
    _error = e.toString();
    return null;
  }
}