Files
CityCards_Customer_Flutter/lib/postcard/blocs/postcard_creation_state.dart

153 lines
4.7 KiB
Dart

import 'package:citycards_customer/postcard/blocs/postcard_creation_bloc.dart';
class PostcardCreationState {
final PostcardStep currentStep;
final String? imagePath;
final String? originalImagePath;
final String? filter;
final String? message;
final bool isGift;
/// True while the "Write your message" button is processing the filter
/// before navigating to the next step.
final bool isProcessingSave;
/// Flips to true (then immediately back to false via copyWith) to signal
/// the view that processing finished and it should navigate to the next step.
final bool filterProcessingDone;
final String? selectedFont;
final String? errorMessage;
final String? pcTitle;
final String? fullName;
final String? emailId;
final String? phoneNumber;
final String? isdCode;
final String address;
final String? city;
final String? country;
final String? state;
final String? zipCode;
final String? pcNumber;
// User's profile data (for "Buy for Myself" option)
final String? userProfileFullName;
final String? userProfileEmail;
final String? userProfilePhone;
final String? userProfileAddress;
final String? userProfileCity;
final String? userProfileState;
final String? userProfileZipCode;
final String? userProfileCountry;
// Sender fields (for gift mode)
final String? senderName;
final String? senderCity;
final String? senderCountry;
const PostcardCreationState({
required this.currentStep,
this.imagePath,
this.originalImagePath,
this.filter,
this.message,
this.isGift = false,
this.isProcessingSave = false,
this.filterProcessingDone = false,
this.selectedFont,
this.errorMessage,
this.pcTitle,
this.fullName,
this.emailId,
this.phoneNumber,
this.isdCode,
this.city,
this.country,
this.state,
this.zipCode,
this.pcNumber,
required this.address,
this.userProfileFullName,
this.userProfileEmail,
this.userProfilePhone,
this.userProfileAddress,
this.userProfileCity,
this.userProfileState,
this.userProfileZipCode,
this.userProfileCountry,
this.senderName,
this.senderCity,
this.senderCountry,
});
PostcardCreationState copyWith({
PostcardStep? currentStep,
String? imagePath,
String? originalImagePath,
String? filter,
String? message,
bool? isGift,
bool? isProcessingSave,
bool? filterProcessingDone,
String? selectedFont,
String? errorMessage,
String? pcTitle,
String? fullName,
String? emailId,
String? phoneNumber,
String? isdCode,
String? address,
String? city,
String? country,
String? state,
String? zipCode,
String? pcNumber,
String? userProfileFullName,
String? userProfileEmail,
String? userProfilePhone,
String? userProfileAddress,
String? userProfileCity,
String? userProfileState,
String? userProfileZipCode,
String? userProfileCountry,
String? senderName,
String? senderCity,
String? senderCountry,
}) {
return PostcardCreationState(
currentStep: currentStep ?? this.currentStep,
imagePath: imagePath ?? this.imagePath,
originalImagePath: originalImagePath ?? this.originalImagePath,
filter: filter ?? this.filter,
message: message ?? this.message,
isGift: isGift ?? this.isGift,
isProcessingSave: isProcessingSave ?? this.isProcessingSave,
filterProcessingDone: filterProcessingDone ?? this.filterProcessingDone,
selectedFont: selectedFont ?? this.selectedFont,
errorMessage: errorMessage,
pcTitle: pcTitle ?? this.pcTitle,
fullName: fullName ?? this.fullName,
emailId: emailId ?? this.emailId,
phoneNumber: phoneNumber ?? this.phoneNumber,
isdCode: isdCode ?? this.isdCode,
address: address ?? this.address,
city: city ?? this.city,
country: country ?? this.country,
state: state ?? this.state,
zipCode: zipCode ?? this.zipCode,
pcNumber: pcNumber ?? this.pcNumber,
userProfileFullName: userProfileFullName ?? this.userProfileFullName,
userProfileEmail: userProfileEmail ?? this.userProfileEmail,
userProfilePhone: userProfilePhone ?? this.userProfilePhone,
userProfileAddress: userProfileAddress ?? this.userProfileAddress,
userProfileCity: userProfileCity ?? this.userProfileCity,
userProfileState: userProfileState ?? this.userProfileState,
userProfileZipCode: userProfileZipCode ?? this.userProfileZipCode,
userProfileCountry: userProfileCountry ?? this.userProfileCountry,
senderName: senderName ?? this.senderName,
senderCity: senderCity ?? this.senderCity,
senderCountry: senderCountry ?? this.senderCountry,
);
}
}