Data not displayed properly on navigation [closed]

I have a parentview CreateReportView, it consist of two subviews which are accessed on the basis of navigation. My data is being properly saved and fetched between child view (create report detail view) and parentview (create report view) but when I navigate to NewUploadGalleryView my data vanishes, what could be the potential problem? I even changed my states variable to StateObject and ObservedObject respectively to maintain data consistency. My data remains fine when I perform navigation between create report detail and create report detail view but as soon as I navigate to NewuploadGallery and return back to createReportView to navigate into createReportDetailView my data resets

Here is my CreateReportView,

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>struct CreateReportView: View {
@Environment(.dismiss) var dismiss
@State private var showingNotifications = false
@State private var isDashboardView = true
@State private var isNotificationView = true
@State var navigateToSelection:Bool = false
@State var navigateToSectionDetail: Bool = false
@State var uploadButton:String?
var isGallery = false
var crTitle = ""
var selectedCat: CatModel? = nil
var selectedSubCat: CatModel? = nil
var aiData: JSON? = nil
@State private var loadingVC: LoadingVC?
@State private var ImageGallary = [CRFileModel]()
@State private var totalToUpload: Int?
@State private var isDraft = false
@State private var isEditSaveReport = false
@State var AILabels: Bool = false
@StateObject private var DashboardviewModel = NewDashBoardViewModel()
@StateObject private var viewModel = ContentViewModel()
@State private var selectedItems: [CRItemModel] = []
@Binding var parentSection: CRSectionModel?
@State private var toHide: Bool = false
@State private var toRecordwithAI: Bool = false
@StateObject private var createReportData = CreateReportData()
var body: some View {
VStack{
NewCustomNavBar(
title: "Create Report",
showBackButton: true,
onBack: {dismiss()},
onProfileTap: {},
showingNotifications: $showingNotifications,
notificationCount: DashboardviewModel.dashBoardModel?.unreadNotificationCount ?? 0,
isDashboardView: isDashboardView,
isNotificationView: isNotificationView
)
List{
VStack(spacing: 20) {
// Media Gallery Section
if isGallery{
NewMediaGallerysView(uploadButton: $uploadButton, minGalleryLimit: selectedSubCat?.galleryMin ?? 0, maxGalleryLimit: selectedSubCat?.galleryMax ?? 20, imageGalleryCount: CRModel.shared.imageGallery.count, selectedSubCat: selectedSubCat)
.onChange(of: uploadButton) { newValue in
if let new = newValue{
print("Button tapped with action: (new)")
print("---------------",CRModel.shared.imageGallery.count)
navigateToSelection = true
uploadButton = nil
}
}
.background(
Group{
NavigationLink(
destination: NewUploadGalleryView(imageGallary: viewModel.imageGallary ?? [CRFileModel](), selectedSubCat: selectedSubCat ?? CatModel(data: JSON()), createReportData: createReportData, parentSection: parentSection).environmentObject(createReportData)
.onDisappear {
// Refresh the count or data in the parent view
viewModel.getData(
selectedSubCat: selectedSubCat,
crTitle: crTitle,
selectedCat: selectedCat,
imageGallary: CRModel.shared.imageGallery
)
print("ON UPLOAD GALLERY DISMISS PARENT SECTION VALUE :(parentSection?.items.first?.textValue)")
print("paraaaaams: (CRModel.shared.getParams())")
},
isActive: $navigateToSelection,
label: { EmptyViewDesign() }
)
.hidden()
}
)
}
if aiData != nil {
if toHide == false {
PrimaryButton(title: "I am happy with it!")
.onTapGesture {
toHide = true
}
SecondaryButton(title: "Re Record with AI")
.onTapGesture {
toRecordwithAI = true
}
}
}
ForEach(viewModel.sections, id: .id) { item in
CreateReportListingView(sectionModel:item, aiData: AILabels)
.onTapGesture {
parentSection = item
navigateToSectionDetail = true
createReportData.items = item.items
}
}
} .listRowSeparator(.hidden) //.padding(.horizontal,20)
// .padding()
.background(Color(.systemBackground))
}.environmentObject(createReportData)
.listStyle(PlainListStyle())
.background(
NavigationLink(destination: CreateReportWithAIView(selectedCat: selectedCat ?? CatModel(data: JSON()), selectedSubCat: selectedSubCat ?? CatModel(data: JSON()), crTitle: crTitle), isActive: $toRecordwithAI){
EmptyViewDesign()
}.hidden()
)
.onAppear {
// for i in parentSection?.items ?? [CRItemModel](){
// print("items values onAppear = (i.textValue)")
//
// }
// if viewModel.createRport == nil {
viewModel.aiData = aiData
if viewModel.sections.isEmpty{
viewModel.getData(selectedSubCat: selectedSubCat, crTitle: crTitle, selectedCat: selectedCat, imageGallary: CRModel.shared.imageGallery) // Fetch data when the view appears
if aiData != nil{
AILabels = true
}
}
// } else {
// viewModel.populateCRModel(crModel: viewModel.createRport)
// }
print("paraaaaams: (CRModel.shared.getParams())")
print("ON CREATE REPORT APPEAR PARENT SECTION VALUE: (parentSection?.items.first?.textValue)")
}
.onDisappear{
for i in parentSection?.items ?? [CRItemModel]() {
print("CR_items values onDisappear = (i.textValue) (i.fieldValue) (i.files)")
print("FILESS ARE HERE: (i.files.contains(where: {$0.isLocalURL()}))")
print("ON CREATE REPORT DISAPPEAR PARENT SECTION VALUE: (parentSection?.items.first?.textValue)")
}
print("ON DISAPPEAR GALLERY COUNT: (CRModel.shared.imageGallery.count)")
}
HStack{
if viewModel.sections.count != 0{
Button(action: {
saveAsDraftReport()
}) {
CreateReportDraftButton(title: "Save as Draft")
}
Button(action: {
//createReport()
}){
let param = CRModel.shared.getParams()
if let params = param.params {
CreateReportCreateButton(title: "Create Report")
.onTapGesture {
print("Ready for create report")
}
}else if let error = param.error {
CreateReportCreateButtonGray(title: "Create Report")
.onTapGesture {
print("Not Ready for create report")
}
.disabled(true)
}
}
}
}.padding(.horizontal, 10)
// }.navigate(to: CreateReportDetailView(itemModel: selectedItems.first, items: selectedItems), when: $navigateToSectionDetail)
}.navigate(to: CreateReportDetailView(parentSection: $parentSection, createReportData: createReportData)
.environmentObject(createReportData),
when: $navigateToSectionDetail)
.navigate(to: NotificationsViews(showingNotifications: $showingNotifications), when: $showingNotifications)
.navigationBarBackButtonHidden()
</code>
<code>struct CreateReportView: View { @Environment(.dismiss) var dismiss @State private var showingNotifications = false @State private var isDashboardView = true @State private var isNotificationView = true @State var navigateToSelection:Bool = false @State var navigateToSectionDetail: Bool = false @State var uploadButton:String? var isGallery = false var crTitle = "" var selectedCat: CatModel? = nil var selectedSubCat: CatModel? = nil var aiData: JSON? = nil @State private var loadingVC: LoadingVC? @State private var ImageGallary = [CRFileModel]() @State private var totalToUpload: Int? @State private var isDraft = false @State private var isEditSaveReport = false @State var AILabels: Bool = false @StateObject private var DashboardviewModel = NewDashBoardViewModel() @StateObject private var viewModel = ContentViewModel() @State private var selectedItems: [CRItemModel] = [] @Binding var parentSection: CRSectionModel? @State private var toHide: Bool = false @State private var toRecordwithAI: Bool = false @StateObject private var createReportData = CreateReportData() var body: some View { VStack{ NewCustomNavBar( title: "Create Report", showBackButton: true, onBack: {dismiss()}, onProfileTap: {}, showingNotifications: $showingNotifications, notificationCount: DashboardviewModel.dashBoardModel?.unreadNotificationCount ?? 0, isDashboardView: isDashboardView, isNotificationView: isNotificationView ) List{ VStack(spacing: 20) { // Media Gallery Section if isGallery{ NewMediaGallerysView(uploadButton: $uploadButton, minGalleryLimit: selectedSubCat?.galleryMin ?? 0, maxGalleryLimit: selectedSubCat?.galleryMax ?? 20, imageGalleryCount: CRModel.shared.imageGallery.count, selectedSubCat: selectedSubCat) .onChange(of: uploadButton) { newValue in if let new = newValue{ print("Button tapped with action: (new)") print("---------------",CRModel.shared.imageGallery.count) navigateToSelection = true uploadButton = nil } } .background( Group{ NavigationLink( destination: NewUploadGalleryView(imageGallary: viewModel.imageGallary ?? [CRFileModel](), selectedSubCat: selectedSubCat ?? CatModel(data: JSON()), createReportData: createReportData, parentSection: parentSection).environmentObject(createReportData) .onDisappear { // Refresh the count or data in the parent view viewModel.getData( selectedSubCat: selectedSubCat, crTitle: crTitle, selectedCat: selectedCat, imageGallary: CRModel.shared.imageGallery ) print("ON UPLOAD GALLERY DISMISS PARENT SECTION VALUE :(parentSection?.items.first?.textValue)") print("paraaaaams: (CRModel.shared.getParams())") }, isActive: $navigateToSelection, label: { EmptyViewDesign() } ) .hidden() } ) } if aiData != nil { if toHide == false { PrimaryButton(title: "I am happy with it!") .onTapGesture { toHide = true } SecondaryButton(title: "Re Record with AI") .onTapGesture { toRecordwithAI = true } } } ForEach(viewModel.sections, id: .id) { item in CreateReportListingView(sectionModel:item, aiData: AILabels) .onTapGesture { parentSection = item navigateToSectionDetail = true createReportData.items = item.items } } } .listRowSeparator(.hidden) //.padding(.horizontal,20) // .padding() .background(Color(.systemBackground)) }.environmentObject(createReportData) .listStyle(PlainListStyle()) .background( NavigationLink(destination: CreateReportWithAIView(selectedCat: selectedCat ?? CatModel(data: JSON()), selectedSubCat: selectedSubCat ?? CatModel(data: JSON()), crTitle: crTitle), isActive: $toRecordwithAI){ EmptyViewDesign() }.hidden() ) .onAppear { // for i in parentSection?.items ?? [CRItemModel](){ // print("items values onAppear = (i.textValue)") // // } // if viewModel.createRport == nil { viewModel.aiData = aiData if viewModel.sections.isEmpty{ viewModel.getData(selectedSubCat: selectedSubCat, crTitle: crTitle, selectedCat: selectedCat, imageGallary: CRModel.shared.imageGallery) // Fetch data when the view appears if aiData != nil{ AILabels = true } } // } else { // viewModel.populateCRModel(crModel: viewModel.createRport) // } print("paraaaaams: (CRModel.shared.getParams())") print("ON CREATE REPORT APPEAR PARENT SECTION VALUE: (parentSection?.items.first?.textValue)") } .onDisappear{ for i in parentSection?.items ?? [CRItemModel]() { print("CR_items values onDisappear = (i.textValue) (i.fieldValue) (i.files)") print("FILESS ARE HERE: (i.files.contains(where: {$0.isLocalURL()}))") print("ON CREATE REPORT DISAPPEAR PARENT SECTION VALUE: (parentSection?.items.first?.textValue)") } print("ON DISAPPEAR GALLERY COUNT: (CRModel.shared.imageGallery.count)") } HStack{ if viewModel.sections.count != 0{ Button(action: { saveAsDraftReport() }) { CreateReportDraftButton(title: "Save as Draft") } Button(action: { //createReport() }){ let param = CRModel.shared.getParams() if let params = param.params { CreateReportCreateButton(title: "Create Report") .onTapGesture { print("Ready for create report") } }else if let error = param.error { CreateReportCreateButtonGray(title: "Create Report") .onTapGesture { print("Not Ready for create report") } .disabled(true) } } } }.padding(.horizontal, 10) // }.navigate(to: CreateReportDetailView(itemModel: selectedItems.first, items: selectedItems), when: $navigateToSectionDetail) }.navigate(to: CreateReportDetailView(parentSection: $parentSection, createReportData: createReportData) .environmentObject(createReportData), when: $navigateToSectionDetail) .navigate(to: NotificationsViews(showingNotifications: $showingNotifications), when: $showingNotifications) .navigationBarBackButtonHidden() </code>
struct CreateReportView: View {
    @Environment(.dismiss) var dismiss
    @State private var showingNotifications = false
    @State private var isDashboardView = true
    @State private var isNotificationView = true
    @State var navigateToSelection:Bool = false
    @State var navigateToSectionDetail: Bool = false
    @State var uploadButton:String?
    var isGallery = false
    var crTitle = ""
    var selectedCat: CatModel? = nil
    var selectedSubCat: CatModel? = nil
    var aiData: JSON? = nil
    @State private var loadingVC: LoadingVC?
    @State private var ImageGallary = [CRFileModel]()
    @State private var totalToUpload: Int?
    @State private var isDraft = false
    @State private var isEditSaveReport = false
    @State var AILabels: Bool = false
    @StateObject private var DashboardviewModel = NewDashBoardViewModel()
    @StateObject private var viewModel = ContentViewModel()
    @State private var selectedItems: [CRItemModel] = []
    @Binding var parentSection: CRSectionModel?
    @State private var toHide: Bool = false
    @State private var toRecordwithAI: Bool = false
    @StateObject private var createReportData = CreateReportData()

    var body: some View {
        
        VStack{
            NewCustomNavBar(
                title: "Create Report",
                showBackButton: true,
                onBack: {dismiss()},
                onProfileTap: {},
                showingNotifications: $showingNotifications,
                notificationCount: DashboardviewModel.dashBoardModel?.unreadNotificationCount ?? 0,
                isDashboardView: isDashboardView,
                isNotificationView: isNotificationView
            )
            List{
                VStack(spacing: 20) {
                    // Media Gallery Section
                    if isGallery{
                        NewMediaGallerysView(uploadButton: $uploadButton, minGalleryLimit: selectedSubCat?.galleryMin ?? 0, maxGalleryLimit: selectedSubCat?.galleryMax ?? 20, imageGalleryCount: CRModel.shared.imageGallery.count, selectedSubCat: selectedSubCat)
                            .onChange(of: uploadButton) { newValue in
                                if let new = newValue{
                                    print("Button tapped with action: (new)")
                                    print("---------------",CRModel.shared.imageGallery.count)
                                    navigateToSelection = true
                                    uploadButton = nil
                                }
                                
                            }
                            .background(
                                Group{
                                    NavigationLink(
                                        destination: NewUploadGalleryView(imageGallary: viewModel.imageGallary ?? [CRFileModel](), selectedSubCat: selectedSubCat ?? CatModel(data: JSON()), createReportData: createReportData, parentSection: parentSection).environmentObject(createReportData)
                                            .onDisappear {
                                                // Refresh the count or data in the parent view
                                                viewModel.getData(
                                                    selectedSubCat: selectedSubCat,
                                                    crTitle: crTitle,
                                                    selectedCat: selectedCat,
                                                    imageGallary: CRModel.shared.imageGallery
                                                )
                                                print("ON UPLOAD GALLERY DISMISS PARENT SECTION VALUE :(parentSection?.items.first?.textValue)")
                                                print("paraaaaams: (CRModel.shared.getParams())")
                                            },
                                        isActive: $navigateToSelection,
                                        label: { EmptyViewDesign() }
                                    )
                                    .hidden()
                                    
                                }
                                
                            )
                    }
                    if aiData != nil {
                        if toHide == false {
                            PrimaryButton(title: "I am happy with it!")
                                .onTapGesture {
                                    toHide = true
                                }
                            SecondaryButton(title: "Re Record with AI")
                                .onTapGesture {
                                    toRecordwithAI = true
                                }
                        }
                    }
                    ForEach(viewModel.sections, id: .id) { item in
                        
                        CreateReportListingView(sectionModel:item, aiData: AILabels)
                            .onTapGesture {
                                parentSection = item
                                navigateToSectionDetail = true
                                createReportData.items = item.items
                            }
                        
                    }
                    
                    
                    
                    
                    
                } .listRowSeparator(.hidden) //.padding(.horizontal,20)
                //   .padding()
                    .background(Color(.systemBackground))
            }.environmentObject(createReportData)
            .listStyle(PlainListStyle())
            .background(
                NavigationLink(destination: CreateReportWithAIView(selectedCat: selectedCat ?? CatModel(data: JSON()), selectedSubCat: selectedSubCat ?? CatModel(data: JSON()), crTitle: crTitle), isActive: $toRecordwithAI){
                    EmptyViewDesign()
                }.hidden()
            )
            .onAppear {
                //                    for i in parentSection?.items ?? [CRItemModel](){
                //                            print("items values onAppear = (i.textValue)")
                //
                //                        }
                //                if viewModel.createRport == nil {
                viewModel.aiData = aiData
                if viewModel.sections.isEmpty{
                    viewModel.getData(selectedSubCat: selectedSubCat, crTitle: crTitle, selectedCat: selectedCat, imageGallary: CRModel.shared.imageGallery) // Fetch data when the view appears
                    if aiData != nil{
                        AILabels = true
                    }
                }
                //                } else {
                //                    viewModel.populateCRModel(crModel: viewModel.createRport)
                //                }
                print("paraaaaams: (CRModel.shared.getParams())")
                print("ON CREATE REPORT APPEAR PARENT SECTION VALUE: (parentSection?.items.first?.textValue)")

            }
            .onDisappear{
                for i in parentSection?.items ?? [CRItemModel]() {
                    print("CR_items values onDisappear = (i.textValue) (i.fieldValue) (i.files)")
                    print("FILESS ARE HERE: (i.files.contains(where: {$0.isLocalURL()}))")
                    print("ON CREATE REPORT DISAPPEAR PARENT SECTION VALUE: (parentSection?.items.first?.textValue)")

                    
                }
                print("ON DISAPPEAR GALLERY COUNT: (CRModel.shared.imageGallery.count)")
            }
            HStack{
                if viewModel.sections.count != 0{
                    Button(action: {
                        saveAsDraftReport()
                    }) {
                        CreateReportDraftButton(title: "Save as Draft")
                    }
                    Button(action: {
                        //createReport()
                    }){
                        let param = CRModel.shared.getParams()
                        if let params = param.params {
                            CreateReportCreateButton(title: "Create Report")
                                .onTapGesture {
                                    print("Ready for create report")
                                }
                        }else if let error = param.error {
                            CreateReportCreateButtonGray(title: "Create Report")
                                .onTapGesture {
                                    print("Not Ready for create report")
                                }
                                .disabled(true)
                        }
                    }
                    
                }
            }.padding(.horizontal, 10)
            
            //        }.navigate(to: CreateReportDetailView(itemModel: selectedItems.first, items: selectedItems), when: $navigateToSectionDetail)
            
        }.navigate(to: CreateReportDetailView(parentSection: $parentSection, createReportData: createReportData)
            .environmentObject(createReportData),
                   when: $navigateToSectionDetail)
            .navigate(to: NotificationsViews(showingNotifications: $showingNotifications), when: $showingNotifications)
            .navigationBarBackButtonHidden()

Here is my CreateReportDetailView

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>struct CreateReportDetailView: View {
@Environment(.dismiss) var dismiss
@State private var showingNotifications = false
@State private var isDashboardView = true
@State private var isNotificationView = true
@StateObject private var DashboardviewModel = NewDashBoardViewModel()
//@State var items: [CRItemModel]
@Binding var parentSection: CRSectionModel!
@StateObject private var viewModel = ContentViewModel()
@State private var show360: Bool = false
@State private var selectedItem: CRItemModel? = nil
@State private var updatedText: String = "360 View"
@ObservedObject var createReportData: CreateReportData
var body: some View {
VStack {
NewCustomNavBar(
title: "Create Report Detail",
showBackButton: true,
onBack: { CRModel.shared.addModifiedSections()
dismiss() },
onProfileTap: {},
showingNotifications: $showingNotifications,
notificationCount: DashboardviewModel.dashBoardModel?.unreadNotificationCount ?? 0,
isDashboardView: isDashboardView,
isNotificationView: isNotificationView
)
ScrollView {
ForEach(Array(createReportData.items.enumerated()), id: .element.id) { index, item in
switch item.getType().rawValue {
case "TEXT":
let limitString = item.getFieldLimitString()
DescriptionInputView(item: $createReportData.items[index],
title:"(item.title) (item.matricSymbol != nil ? "((item.matricSymbol!))" : "")",
limitString: limitString, characterLimit: item.fieldLimits?.textLimit, mandatory: item.mandatory,
requiredDocument: item.documentRequired, requiredAudio: item.audioRequired,
requiredVideo: item.videoRequired, requiredImage: item.imageRequired, description: item.textValue ?? "", attachment: item.files, parentSection: parentSection
) .....
</code>
<code>struct CreateReportDetailView: View { @Environment(.dismiss) var dismiss @State private var showingNotifications = false @State private var isDashboardView = true @State private var isNotificationView = true @StateObject private var DashboardviewModel = NewDashBoardViewModel() //@State var items: [CRItemModel] @Binding var parentSection: CRSectionModel! @StateObject private var viewModel = ContentViewModel() @State private var show360: Bool = false @State private var selectedItem: CRItemModel? = nil @State private var updatedText: String = "360 View" @ObservedObject var createReportData: CreateReportData var body: some View { VStack { NewCustomNavBar( title: "Create Report Detail", showBackButton: true, onBack: { CRModel.shared.addModifiedSections() dismiss() }, onProfileTap: {}, showingNotifications: $showingNotifications, notificationCount: DashboardviewModel.dashBoardModel?.unreadNotificationCount ?? 0, isDashboardView: isDashboardView, isNotificationView: isNotificationView ) ScrollView { ForEach(Array(createReportData.items.enumerated()), id: .element.id) { index, item in switch item.getType().rawValue { case "TEXT": let limitString = item.getFieldLimitString() DescriptionInputView(item: $createReportData.items[index], title:"(item.title) (item.matricSymbol != nil ? "((item.matricSymbol!))" : "")", limitString: limitString, characterLimit: item.fieldLimits?.textLimit, mandatory: item.mandatory, requiredDocument: item.documentRequired, requiredAudio: item.audioRequired, requiredVideo: item.videoRequired, requiredImage: item.imageRequired, description: item.textValue ?? "", attachment: item.files, parentSection: parentSection ) ..... </code>
struct CreateReportDetailView: View {
    @Environment(.dismiss) var dismiss
    @State private var showingNotifications = false
    @State private var isDashboardView = true
    @State private var isNotificationView = true
    @StateObject private var DashboardviewModel = NewDashBoardViewModel()
    //@State var items: [CRItemModel]
   @Binding var parentSection: CRSectionModel!
    @StateObject private var viewModel = ContentViewModel()
    @State private var show360: Bool = false
    @State private var selectedItem: CRItemModel? = nil
    @State private var updatedText: String = "360 View"
    @ObservedObject var createReportData: CreateReportData
    
    
    var body: some View {
        VStack {
            NewCustomNavBar(
                title: "Create Report Detail",
                showBackButton: true,
                onBack: { CRModel.shared.addModifiedSections()
                    dismiss() },
                onProfileTap: {},
                showingNotifications: $showingNotifications,
                notificationCount: DashboardviewModel.dashBoardModel?.unreadNotificationCount ?? 0,
                isDashboardView: isDashboardView,
                isNotificationView: isNotificationView
            )
            ScrollView {
                ForEach(Array(createReportData.items.enumerated()), id: .element.id) { index, item in
                    switch item.getType().rawValue {
                    case "TEXT":
                        let limitString = item.getFieldLimitString()
                        DescriptionInputView(item: $createReportData.items[index],
                            title:"(item.title) (item.matricSymbol != nil ? "((item.matricSymbol!))" : "")",
                            limitString: limitString, characterLimit: item.fieldLimits?.textLimit, mandatory: item.mandatory,
                            requiredDocument: item.documentRequired, requiredAudio: item.audioRequired,
                                             requiredVideo: item.videoRequired, requiredImage: item.imageRequired, description: item.textValue ?? "", attachment: item.files, parentSection: parentSection
                        ) .....

Here is my NewUploadGalleryView

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>struct NewUploadGalleryView: View {
@FocusState private var activeTextField: UUID?
@State var imageGallary: [CRFileModel]
@State var selectedSubCat: CatModel
@State private var showingNotifications = false
@State private var isDashboardView = true
@State private var isNotificationView = true
@StateObject private var DashboardviewModel = NewDashBoardViewModel()
@Environment(.dismiss) var dismiss
@State var uploadButton: Bool = false
@State private var showToast = false
@State private var toastMessage = ""
@State private var uploadState: UploadState = .chooseFiles
@State var reload: Bool? = false
@State private var showingFullScreenImage: Bool = false
@State private var selectedImageUrl: String? // Store the URL of the tapped image
@State private var isProcessingTap = false
@State private var deletingItemID: UUID?
@ObservedObject var createReportData: CreateReportData
@StateObject private var viewModel = ContentViewModel()
let parentSection: CRSectionModel?
@EnvironmentObject private var networkMonitorUpdated: NetworkMonitorUpdated
....
</code>
<code>struct NewUploadGalleryView: View { @FocusState private var activeTextField: UUID? @State var imageGallary: [CRFileModel] @State var selectedSubCat: CatModel @State private var showingNotifications = false @State private var isDashboardView = true @State private var isNotificationView = true @StateObject private var DashboardviewModel = NewDashBoardViewModel() @Environment(.dismiss) var dismiss @State var uploadButton: Bool = false @State private var showToast = false @State private var toastMessage = "" @State private var uploadState: UploadState = .chooseFiles @State var reload: Bool? = false @State private var showingFullScreenImage: Bool = false @State private var selectedImageUrl: String? // Store the URL of the tapped image @State private var isProcessingTap = false @State private var deletingItemID: UUID? @ObservedObject var createReportData: CreateReportData @StateObject private var viewModel = ContentViewModel() let parentSection: CRSectionModel? @EnvironmentObject private var networkMonitorUpdated: NetworkMonitorUpdated .... </code>
struct NewUploadGalleryView: View {
    @FocusState private var activeTextField: UUID?
    
    @State var imageGallary: [CRFileModel]
    @State var selectedSubCat: CatModel
    @State private var showingNotifications = false
    @State private var isDashboardView = true
    @State private var isNotificationView = true
    @StateObject private var DashboardviewModel = NewDashBoardViewModel()
    @Environment(.dismiss) var dismiss
    @State var uploadButton: Bool = false
    @State private var showToast = false
    @State private var toastMessage = ""
    @State private var uploadState: UploadState = .chooseFiles
    @State var reload: Bool? = false
    @State private var showingFullScreenImage: Bool = false
    @State private var selectedImageUrl: String? // Store the URL of the tapped image
    @State private var isProcessingTap = false
    @State private var deletingItemID: UUID?
    @ObservedObject var createReportData: CreateReportData
    @StateObject private var viewModel = ContentViewModel()
    let parentSection: CRSectionModel?

    @EnvironmentObject private var networkMonitorUpdated: NetworkMonitorUpdated

....

6

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật