type 'Null' is not a subtype of type 'String' in type cast
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:shopify_flutter/models/src/checkout/mailing_address/mailing_address.dart';
part 'customer.freezed.dart';
part 'customer.g.dart';
@freezed
/// The cart customer
class Customer with _$Customer {
const Customer._();
/// The cart customer constructor
factory Customer({
required String? id,
required String email,
required String phone,
required String firstName,
required String lastName,
required String displayName,
required MailingAddress? defaultAddress,
required dynamic numberOfOrders,
required bool? acceptsMarketing,
}) = _Customer;
/// The cart customer from json
factory Customer.fromJson(Map<String, dynamic> json) =>
_$CustomerFromJson(json);
}
Phone number is require field and we getting this null from API so I don't think all the field is required from model because we don't know which field is getting null from API. Please fix it ASAP.
type 'Null' is not a subtype of type 'String' in type cast
Phone number is require field and we getting this null from API so I don't think all the field is required from model because we don't know which field is getting null from API. Please fix it ASAP.