You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@CopyWith(
constructor:'_',
skipFields:true,
)
classAppProduct {
/// The id of the product.finalint id;
/// The name of the product.finalString name;
/// The description of the product.finalString? description;
/// The original price of the product.finaldouble originalPrice;
/// The discounted price of the product.finaldouble? discountedPrice;
/// The category id of the product.finalint categoryId;
/// The subcategory id of the product.finalint? subcategoryId;
/// The image URL of the product.finalString imageURL;
/// The type of the product.// ignore: invalid_annotation_target@JsonKey(
fromJson:ProductType.productTypeFromProductTypeId,
toJson:ProductType.productTypeToProductTypeId,
name:'productTypeId',
)
finalProductType productType;
/// Whether the product is a favorite or not. This will be null if there is /// no user logged in.finalbool isFavorite;
/// The variant options of the product.// ignore: invalid_annotation_target@JsonKey(
name:'variants',
fromJson:Variant.fromJsonList,
toJson:Variant.toJsonList,
)
finalList<Variant>? variants;
/// Maps the id of a single-choice-option variant to the id of the selected option of that variant.@JsonKey(
name:'singleSelectionOptions',
defaultValue: {},
includeToJson:true,
includeFromJson:true,
)
finalMap<int, int> _singleSelectionOptions;
/// Maps the id of a multiple-choice-option variant to the ids of the selected options of that variant.@JsonKey(
name:'multipleSelectionOptions',
defaultValue: {},
includeToJson:true,
includeFromJson:true,
)
finalMap<int, List<int>> _multipleSelectionOptions;
AppProduct._(
this._singleSelectionOptions,
this._multipleSelectionOptions, {
requiredthis.id,
requiredthis.name,
this.description,
requiredthis.originalPrice,
this.discountedPrice,
requiredthis.categoryId,
this.subcategoryId,
requiredthis.imageURL,
requiredthis.productType,
requiredthis.isFavorite,
this.variants,
}) {
_ensureRequiredOptionsSelected();
}
}
The IDE reports no erros in the generated code, but when trying to run the app, I get this error and the app can't start:
lib/services/api/product_management_service/app_product/app_product.g.dart:17:20: Error: An optional named parameter can't start with '_'.
Map<int, int>? _singleSelectionOptions,
^^^^^^^^^^^^^^^^^^^^^^^
lib/services/api/product_management_service/app_product/app_product.g.dart:18:26: Error: An optional named parameter can't start with '_'.
Map<int, List<int>>? _multipleSelectionOptions,
^^^^^^^^^^^^^^^^^^^^^^^^^
lib/services/api/product_management_service/app_product/app_product.g.dart:48:13: Error: An optional named parameter can't start with '_'.
Object? _singleSelectionOptions = const $CopyWithPlaceholder(),
^^^^^^^^^^^^^^^^^^^^^^^
lib/services/api/product_management_service/app_product/app_product.g.dart:49:13: Error: An optional named parameter can't start with '_'.
Object? _multipleSelectionOptions = const $CopyWithPlaceholder(),
^^^^^^^^^^^^^^^^^^^^^^^^^
The text was updated successfully, but these errors were encountered:
I have this class
The IDE reports no erros in the generated code, but when trying to run the app, I get this error and the app can't start:
The text was updated successfully, but these errors were encountered: