build_app
This commit is contained in:
		
							parent
							
								
									63b4432a18
								
							
						
					
					
						commit
						ea4e10f926
					
				@ -69,6 +69,12 @@ public class BuilderService {
 | 
				
			|||||||
		executeDump(true);
 | 
							executeDump(true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// ADD OTHER SERVICE
 | 
							// ADD OTHER SERVICE
 | 
				
			||||||
 | 
					addCustomMenu( "Testlist","Testlist",  "Transcations"); 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					addCustomMenu( "Formb","Formb",  "Transcations"); 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		System.out.println("dashboard and menu inserted...");
 | 
							System.out.println("dashboard and menu inserted...");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -0,0 +1,122 @@
 | 
				
			|||||||
 | 
					package com.realnet.basic1.Controllers;
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					import org.springframework.beans.factory.annotation.Autowired;
 | 
				
			||||||
 | 
					 import org.springframework.web.bind.annotation.*;
 | 
				
			||||||
 | 
					import org.springframework.web.multipart.MultipartFile;
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.core.JsonProcessingException;
 | 
				
			||||||
 | 
					import org.springframework.web.bind.annotation.CrossOrigin;
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.databind.JsonMappingException;
 | 
				
			||||||
 | 
					import com.realnet.config.EmailService;
 | 
				
			||||||
 | 
					import com.realnet.users.entity1.AppUser;
 | 
				
			||||||
 | 
					import com.realnet.users.service1.AppUserServiceImpl;
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.databind.ObjectMapper;
 | 
				
			||||||
 | 
					import org.springframework.data.domain.*;
 | 
				
			||||||
 | 
					import com.realnet.fnd.response.EntityResponse;
 | 
				
			||||||
 | 
					import org.springframework.http.*;
 | 
				
			||||||
 | 
					import org.springframework.beans.factory.annotation.*;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Entity.Formb;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Services.FormbService ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.realnet.basic1.Entity.Formb;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@RequestMapping(value = "/Formb")
 | 
				
			||||||
 | 
					 @CrossOrigin("*") 
 | 
				
			||||||
 | 
					@RestController
 | 
				
			||||||
 | 
					public class FormbController {
 | 
				
			||||||
 | 
						@Autowired
 | 
				
			||||||
 | 
						private FormbService Service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Value("${projectPath}")
 | 
				
			||||||
 | 
						private String projectPath;
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@PostMapping("/Formb")
 | 
				
			||||||
 | 
							  public Formb Savedata(@RequestBody Formb data) {
 | 
				
			||||||
 | 
							Formb save = Service.Savedata(data)	;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							System.out.println("data saved..." + save);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 return save;
 | 
				
			||||||
 | 
						  }
 | 
				
			||||||
 | 
					@PutMapping("/Formb/{id}")
 | 
				
			||||||
 | 
						public  Formb update(@RequestBody Formb data,@PathVariable Integer id ) {
 | 
				
			||||||
 | 
							Formb update = Service.update(data,id);
 | 
				
			||||||
 | 
							System.out.println("data update..." + update);
 | 
				
			||||||
 | 
							return update;
 | 
				
			||||||
 | 
						}	 
 | 
				
			||||||
 | 
					//	get all with pagination
 | 
				
			||||||
 | 
						@GetMapping("/Formb/getall/page")
 | 
				
			||||||
 | 
						public Page<Formb> getall(@RequestParam(value = "page", required = false) Integer page,
 | 
				
			||||||
 | 
								@RequestParam(value = "size", required = false) Integer size) {
 | 
				
			||||||
 | 
							Pageable paging = PageRequest.of(page, size);
 | 
				
			||||||
 | 
							Page<Formb> get = Service.getAllWithPagination(paging);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						}	
 | 
				
			||||||
 | 
						@GetMapping("/Formb")
 | 
				
			||||||
 | 
						public List<Formb> getdetails() {
 | 
				
			||||||
 | 
							 List<Formb> get = Service.getdetails();		
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					// get all without authentication 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@GetMapping("/token/Formb")
 | 
				
			||||||
 | 
						public List<Formb> getallwioutsec() {
 | 
				
			||||||
 | 
							 List<Formb> get = Service.getdetails();		
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					@GetMapping("/Formb/{id}")
 | 
				
			||||||
 | 
						public  Formb  getdetailsbyId(@PathVariable Integer id ) {
 | 
				
			||||||
 | 
							Formb  get = Service.getdetailsbyId(id);
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					@DeleteMapping("/Formb/{id}")
 | 
				
			||||||
 | 
						public  ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
 | 
				
			||||||
 | 
						Service.delete_by_id(id);
 | 
				
			||||||
 | 
								return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@PostMapping("/Formb/Formb_insert")
 | 
				
			||||||
 | 
						public Formb insertFormb(@RequestBody Formb data) {
 | 
				
			||||||
 | 
							Formb insertaction = Service.insertFormb(data);
 | 
				
			||||||
 | 
							return insertaction;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,21 @@
 | 
				
			|||||||
 | 
					package com.realnet.basic1.Controllers;
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					import org.springframework.beans.factory.annotation.Autowired;
 | 
				
			||||||
 | 
					 import org.springframework.web.bind.annotation.*;
 | 
				
			||||||
 | 
					import org.springframework.http.*;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Entity.Formb;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Services.FormbInsertService5;
 | 
				
			||||||
 | 
					@RequestMapping(value = "/Formb")
 | 
				
			||||||
 | 
					@RestController
 | 
				
			||||||
 | 
					public class FormbInsertController5{
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Autowired
 | 
				
			||||||
 | 
						private FormbInsertService5 Service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@PostMapping("/Formb_insert") 
 | 
				
			||||||
 | 
						public  ResponseEntity<?> insert(@RequestBody Formb formb) {
 | 
				
			||||||
 | 
							Formb insertaction = Service.insertaction(formb);
 | 
				
			||||||
 | 
							return new ResponseEntity<>(insertaction, HttpStatus.OK);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,99 @@
 | 
				
			|||||||
 | 
					package com.realnet.basic1.Controllers;
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					import org.springframework.beans.factory.annotation.Autowired;
 | 
				
			||||||
 | 
					 import org.springframework.web.bind.annotation.*;
 | 
				
			||||||
 | 
					import org.springframework.web.multipart.MultipartFile;
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.core.JsonProcessingException;
 | 
				
			||||||
 | 
					import org.springframework.web.bind.annotation.CrossOrigin;
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.databind.JsonMappingException;
 | 
				
			||||||
 | 
					import com.realnet.config.EmailService;
 | 
				
			||||||
 | 
					import com.realnet.users.entity1.AppUser;
 | 
				
			||||||
 | 
					import com.realnet.users.service1.AppUserServiceImpl;
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.databind.ObjectMapper;
 | 
				
			||||||
 | 
					import org.springframework.data.domain.*;
 | 
				
			||||||
 | 
					import com.realnet.fnd.response.EntityResponse;
 | 
				
			||||||
 | 
					import org.springframework.http.*;
 | 
				
			||||||
 | 
					import org.springframework.beans.factory.annotation.*;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Entity.Testlist;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Services.TestlistService ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@RequestMapping(value = "/Testlist")
 | 
				
			||||||
 | 
					 @CrossOrigin("*") 
 | 
				
			||||||
 | 
					@RestController
 | 
				
			||||||
 | 
					public class TestlistController {
 | 
				
			||||||
 | 
						@Autowired
 | 
				
			||||||
 | 
						private TestlistService Service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Value("${projectPath}")
 | 
				
			||||||
 | 
						private String projectPath;
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@PostMapping("/Testlist")
 | 
				
			||||||
 | 
							  public Testlist Savedata(@RequestBody Testlist data) {
 | 
				
			||||||
 | 
							Testlist save = Service.Savedata(data)	;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							System.out.println("data saved..." + save);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 return save;
 | 
				
			||||||
 | 
						  }
 | 
				
			||||||
 | 
					@PutMapping("/Testlist/{id}")
 | 
				
			||||||
 | 
						public  Testlist update(@RequestBody Testlist data,@PathVariable Integer id ) {
 | 
				
			||||||
 | 
							Testlist update = Service.update(data,id);
 | 
				
			||||||
 | 
							System.out.println("data update..." + update);
 | 
				
			||||||
 | 
							return update;
 | 
				
			||||||
 | 
						}	 
 | 
				
			||||||
 | 
					//	get all with pagination
 | 
				
			||||||
 | 
						@GetMapping("/Testlist/getall/page")
 | 
				
			||||||
 | 
						public Page<Testlist> getall(@RequestParam(value = "page", required = false) Integer page,
 | 
				
			||||||
 | 
								@RequestParam(value = "size", required = false) Integer size) {
 | 
				
			||||||
 | 
							Pageable paging = PageRequest.of(page, size);
 | 
				
			||||||
 | 
							Page<Testlist> get = Service.getAllWithPagination(paging);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						}	
 | 
				
			||||||
 | 
						@GetMapping("/Testlist")
 | 
				
			||||||
 | 
						public List<Testlist> getdetails() {
 | 
				
			||||||
 | 
							 List<Testlist> get = Service.getdetails();		
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					// get all without authentication 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@GetMapping("/token/Testlist")
 | 
				
			||||||
 | 
						public List<Testlist> getallwioutsec() {
 | 
				
			||||||
 | 
							 List<Testlist> get = Service.getdetails();		
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					@GetMapping("/Testlist/{id}")
 | 
				
			||||||
 | 
						public  Testlist  getdetailsbyId(@PathVariable Integer id ) {
 | 
				
			||||||
 | 
							Testlist  get = Service.getdetailsbyId(id);
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					@DeleteMapping("/Testlist/{id}")
 | 
				
			||||||
 | 
						public  ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
 | 
				
			||||||
 | 
						Service.delete_by_id(id);
 | 
				
			||||||
 | 
								return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,24 @@
 | 
				
			|||||||
 | 
					package com.realnet.basic1.Controllers;
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					import org.springframework.beans.factory.annotation.Autowired;
 | 
				
			||||||
 | 
					 import org.springframework.web.bind.annotation.*;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Entity.Testlist_ListFilter1;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Services.Testlist_ListFilter1Service ;
 | 
				
			||||||
 | 
					@RequestMapping(value = "/Testlist_ListFilter1")
 | 
				
			||||||
 | 
					@RestController
 | 
				
			||||||
 | 
					public class Testlist_ListFilter1Controller {
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Autowired
 | 
				
			||||||
 | 
						private Testlist_ListFilter1Service Service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							@GetMapping("/Testlist_ListFilter1")
 | 
				
			||||||
 | 
						public List<Testlist_ListFilter1> getlist() {
 | 
				
			||||||
 | 
							 List<Testlist_ListFilter1> get = Service.getlistbuilder();		
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
							@GetMapping("/Testlist_ListFilter11")
 | 
				
			||||||
 | 
						public List<Testlist_ListFilter1> getlistwithparam( ) {
 | 
				
			||||||
 | 
							 List<Testlist_ListFilter1> get = Service.getlistbuilderparam( );		
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,122 @@
 | 
				
			|||||||
 | 
					package com.realnet.basic1.Controllers;
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					import org.springframework.beans.factory.annotation.Autowired;
 | 
				
			||||||
 | 
					 import org.springframework.web.bind.annotation.*;
 | 
				
			||||||
 | 
					import org.springframework.web.multipart.MultipartFile;
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.core.JsonProcessingException;
 | 
				
			||||||
 | 
					import org.springframework.web.bind.annotation.CrossOrigin;
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.databind.JsonMappingException;
 | 
				
			||||||
 | 
					import com.realnet.config.EmailService;
 | 
				
			||||||
 | 
					import com.realnet.users.entity1.AppUser;
 | 
				
			||||||
 | 
					import com.realnet.users.service1.AppUserServiceImpl;
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.databind.ObjectMapper;
 | 
				
			||||||
 | 
					import org.springframework.data.domain.*;
 | 
				
			||||||
 | 
					import com.realnet.fnd.response.EntityResponse;
 | 
				
			||||||
 | 
					import org.springframework.http.*;
 | 
				
			||||||
 | 
					import org.springframework.beans.factory.annotation.*;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Entity.Formb;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Services.FormbService ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.realnet.basic1.Entity.Formb;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@RequestMapping(value = "/token/Formb")
 | 
				
			||||||
 | 
					 @CrossOrigin("*") 
 | 
				
			||||||
 | 
					@RestController
 | 
				
			||||||
 | 
					public class tokenFree_FormbController {
 | 
				
			||||||
 | 
						@Autowired
 | 
				
			||||||
 | 
						private FormbService Service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Value("${projectPath}")
 | 
				
			||||||
 | 
						private String projectPath;
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@PostMapping("/Formb")
 | 
				
			||||||
 | 
							  public Formb Savedata(@RequestBody Formb data) {
 | 
				
			||||||
 | 
							Formb save = Service.Savedata(data)	;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							System.out.println("data saved..." + save);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 return save;
 | 
				
			||||||
 | 
						  }
 | 
				
			||||||
 | 
					@PutMapping("/Formb/{id}")
 | 
				
			||||||
 | 
						public  Formb update(@RequestBody Formb data,@PathVariable Integer id ) {
 | 
				
			||||||
 | 
							Formb update = Service.update(data,id);
 | 
				
			||||||
 | 
							System.out.println("data update..." + update);
 | 
				
			||||||
 | 
							return update;
 | 
				
			||||||
 | 
						}	 
 | 
				
			||||||
 | 
					//	get all with pagination
 | 
				
			||||||
 | 
						@GetMapping("/Formb/getall/page")
 | 
				
			||||||
 | 
						public Page<Formb> getall(@RequestParam(value = "page", required = false) Integer page,
 | 
				
			||||||
 | 
								@RequestParam(value = "size", required = false) Integer size) {
 | 
				
			||||||
 | 
							Pageable paging = PageRequest.of(page, size);
 | 
				
			||||||
 | 
							Page<Formb> get = Service.getAllWithPagination(paging);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						}	
 | 
				
			||||||
 | 
						@GetMapping("/Formb")
 | 
				
			||||||
 | 
						public List<Formb> getdetails() {
 | 
				
			||||||
 | 
							 List<Formb> get = Service.getdetails();		
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					// get all without authentication 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@GetMapping("/token/Formb")
 | 
				
			||||||
 | 
						public List<Formb> getallwioutsec() {
 | 
				
			||||||
 | 
							 List<Formb> get = Service.getdetails();		
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					@GetMapping("/Formb/{id}")
 | 
				
			||||||
 | 
						public  Formb  getdetailsbyId(@PathVariable Integer id ) {
 | 
				
			||||||
 | 
							Formb  get = Service.getdetailsbyId(id);
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					@DeleteMapping("/Formb/{id}")
 | 
				
			||||||
 | 
						public  ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
 | 
				
			||||||
 | 
						Service.delete_by_id(id);
 | 
				
			||||||
 | 
								return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@PostMapping("/Formb/Formb_insert")
 | 
				
			||||||
 | 
						public Formb insertFormb(@RequestBody Formb data) {
 | 
				
			||||||
 | 
							Formb insertaction = Service.insertFormb(data);
 | 
				
			||||||
 | 
							return insertaction;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,99 @@
 | 
				
			|||||||
 | 
					package com.realnet.basic1.Controllers;
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					import org.springframework.beans.factory.annotation.Autowired;
 | 
				
			||||||
 | 
					 import org.springframework.web.bind.annotation.*;
 | 
				
			||||||
 | 
					import org.springframework.web.multipart.MultipartFile;
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.core.JsonProcessingException;
 | 
				
			||||||
 | 
					import org.springframework.web.bind.annotation.CrossOrigin;
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.databind.JsonMappingException;
 | 
				
			||||||
 | 
					import com.realnet.config.EmailService;
 | 
				
			||||||
 | 
					import com.realnet.users.entity1.AppUser;
 | 
				
			||||||
 | 
					import com.realnet.users.service1.AppUserServiceImpl;
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.databind.ObjectMapper;
 | 
				
			||||||
 | 
					import org.springframework.data.domain.*;
 | 
				
			||||||
 | 
					import com.realnet.fnd.response.EntityResponse;
 | 
				
			||||||
 | 
					import org.springframework.http.*;
 | 
				
			||||||
 | 
					import org.springframework.beans.factory.annotation.*;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Entity.Testlist;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Services.TestlistService ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@RequestMapping(value = "/token/Testlist")
 | 
				
			||||||
 | 
					 @CrossOrigin("*") 
 | 
				
			||||||
 | 
					@RestController
 | 
				
			||||||
 | 
					public class tokenFree_TestlistController {
 | 
				
			||||||
 | 
						@Autowired
 | 
				
			||||||
 | 
						private TestlistService Service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Value("${projectPath}")
 | 
				
			||||||
 | 
						private String projectPath;
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@PostMapping("/Testlist")
 | 
				
			||||||
 | 
							  public Testlist Savedata(@RequestBody Testlist data) {
 | 
				
			||||||
 | 
							Testlist save = Service.Savedata(data)	;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							System.out.println("data saved..." + save);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 return save;
 | 
				
			||||||
 | 
						  }
 | 
				
			||||||
 | 
					@PutMapping("/Testlist/{id}")
 | 
				
			||||||
 | 
						public  Testlist update(@RequestBody Testlist data,@PathVariable Integer id ) {
 | 
				
			||||||
 | 
							Testlist update = Service.update(data,id);
 | 
				
			||||||
 | 
							System.out.println("data update..." + update);
 | 
				
			||||||
 | 
							return update;
 | 
				
			||||||
 | 
						}	 
 | 
				
			||||||
 | 
					//	get all with pagination
 | 
				
			||||||
 | 
						@GetMapping("/Testlist/getall/page")
 | 
				
			||||||
 | 
						public Page<Testlist> getall(@RequestParam(value = "page", required = false) Integer page,
 | 
				
			||||||
 | 
								@RequestParam(value = "size", required = false) Integer size) {
 | 
				
			||||||
 | 
							Pageable paging = PageRequest.of(page, size);
 | 
				
			||||||
 | 
							Page<Testlist> get = Service.getAllWithPagination(paging);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						}	
 | 
				
			||||||
 | 
						@GetMapping("/Testlist")
 | 
				
			||||||
 | 
						public List<Testlist> getdetails() {
 | 
				
			||||||
 | 
							 List<Testlist> get = Service.getdetails();		
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					// get all without authentication 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@GetMapping("/token/Testlist")
 | 
				
			||||||
 | 
						public List<Testlist> getallwioutsec() {
 | 
				
			||||||
 | 
							 List<Testlist> get = Service.getdetails();		
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					@GetMapping("/Testlist/{id}")
 | 
				
			||||||
 | 
						public  Testlist  getdetailsbyId(@PathVariable Integer id ) {
 | 
				
			||||||
 | 
							Testlist  get = Service.getdetailsbyId(id);
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					@DeleteMapping("/Testlist/{id}")
 | 
				
			||||||
 | 
						public  ResponseEntity<?> delete_by_id(@PathVariable Integer id ) {
 | 
				
			||||||
 | 
						Service.delete_by_id(id);
 | 
				
			||||||
 | 
								return new ResponseEntity<>(new EntityResponse("Deleted"), HttpStatus.OK);
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,24 @@
 | 
				
			|||||||
 | 
					package com.realnet.basic1.Controllers;
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					import org.springframework.beans.factory.annotation.Autowired;
 | 
				
			||||||
 | 
					 import org.springframework.web.bind.annotation.*;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Entity.Testlist_ListFilter1;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Services.Testlist_ListFilter1Service ;
 | 
				
			||||||
 | 
					@RequestMapping(value = "/token/Testlist_ListFilter1")
 | 
				
			||||||
 | 
					@RestController
 | 
				
			||||||
 | 
					public class tokenFree_Testlist_ListFilter1Controller {
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						@Autowired
 | 
				
			||||||
 | 
						private Testlist_ListFilter1Service Service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							@GetMapping("/Testlist_ListFilter1")
 | 
				
			||||||
 | 
						public List<Testlist_ListFilter1> getlist() {
 | 
				
			||||||
 | 
							 List<Testlist_ListFilter1> get = Service.getlistbuilder();		
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
							@GetMapping("/Testlist_ListFilter11")
 | 
				
			||||||
 | 
						public List<Testlist_ListFilter1> getlistwithparam( ) {
 | 
				
			||||||
 | 
							 List<Testlist_ListFilter1> get = Service.getlistbuilderparam( );		
 | 
				
			||||||
 | 
							return get;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,40 @@
 | 
				
			|||||||
 | 
					package com.realnet.basic1.Entity;
 | 
				
			||||||
 | 
					 import lombok.*;
 | 
				
			||||||
 | 
					import com.realnet.WhoColumn.Entity.Extension; 
 | 
				
			||||||
 | 
					 import javax.persistence.*;
 | 
				
			||||||
 | 
					 import java.time.LocalDateTime;
 | 
				
			||||||
 | 
					 import java.util.*;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 @Entity 
 | 
				
			||||||
 | 
					 @Data
 | 
				
			||||||
 | 
					 public class    Formb extends Extension { 
 | 
				
			||||||
 | 
					 /**
 | 
				
			||||||
 | 
						 * 
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						private static final long serialVersionUID = 1L;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 @Id
 | 
				
			||||||
 | 
					 @GeneratedValue(strategy = GenerationType.IDENTITY)
 | 
				
			||||||
 | 
					 private Integer id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					private String  namem;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					private String survey_formbs;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,33 @@
 | 
				
			|||||||
 | 
					package com.realnet.basic1.Entity;
 | 
				
			||||||
 | 
					 import lombok.*;
 | 
				
			||||||
 | 
					import com.realnet.WhoColumn.Entity.Extension; 
 | 
				
			||||||
 | 
					 import javax.persistence.*;
 | 
				
			||||||
 | 
					 import java.time.LocalDateTime;
 | 
				
			||||||
 | 
					 import java.util.*;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 @Entity 
 | 
				
			||||||
 | 
					 @Data
 | 
				
			||||||
 | 
					 public class    Testlist extends Extension { 
 | 
				
			||||||
 | 
					 /**
 | 
				
			||||||
 | 
						 * 
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						private static final long serialVersionUID = 1L;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 @Id
 | 
				
			||||||
 | 
					 @GeneratedValue(strategy = GenerationType.IDENTITY)
 | 
				
			||||||
 | 
					 private Integer id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					private String  name;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Column(length = 2000)
 | 
				
			||||||
 | 
					private String description;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					private Boolean active;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,14 @@
 | 
				
			|||||||
 | 
					package com.realnet.basic1.Entity;
 | 
				
			||||||
 | 
					 import lombok.*;
 | 
				
			||||||
 | 
					 import javax.persistence.*;
 | 
				
			||||||
 | 
					 import java.time.LocalDateTime;
 | 
				
			||||||
 | 
					 import java.util.*;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 @Data
 | 
				
			||||||
 | 
					 public class    Testlist_ListFilter1 { 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 private Integer id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 private String name;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,34 @@
 | 
				
			|||||||
 | 
					package com.realnet.basic1.Repository;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.springframework.data.domain.Page;
 | 
				
			||||||
 | 
					import org.springframework.data.domain.Pageable;
 | 
				
			||||||
 | 
					import org.springframework.data.jpa.repository.JpaRepository;
 | 
				
			||||||
 | 
					import org.springframework.data.jpa.repository.Query;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.springframework.stereotype.Repository; 
 | 
				
			||||||
 | 
					import java.util.*;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.realnet.basic1.Entity.Formb;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Repository
 | 
				
			||||||
 | 
					public interface  FormbRepository  extends  JpaRepository<Formb, Integer>  { 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Query(value = "select * from formb where  created_by=?1", nativeQuery = true)
 | 
				
			||||||
 | 
						List<Formb> findAll(Long creayedBy);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Query(value = "select * from formb where  created_by=?1", nativeQuery = true)
 | 
				
			||||||
 | 
						Page<Formb> findAll( Long creayedBy,Pageable page);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,30 @@
 | 
				
			|||||||
 | 
					package com.realnet.basic1.Repository;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.springframework.data.domain.Page;
 | 
				
			||||||
 | 
					import org.springframework.data.domain.Pageable;
 | 
				
			||||||
 | 
					import org.springframework.data.jpa.repository.JpaRepository;
 | 
				
			||||||
 | 
					import org.springframework.data.jpa.repository.Query;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.springframework.stereotype.Repository; 
 | 
				
			||||||
 | 
					import java.util.*;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.realnet.basic1.Entity.Testlist;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Repository
 | 
				
			||||||
 | 
					public interface  TestlistRepository  extends  JpaRepository<Testlist, Integer>  { 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Query(value = "select * from testlist where  created_by=?1", nativeQuery = true)
 | 
				
			||||||
 | 
						List<Testlist> findAll(Long creayedBy);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Query(value = "select * from testlist where  created_by=?1", nativeQuery = true)
 | 
				
			||||||
 | 
						Page<Testlist> findAll( Long creayedBy,Pageable page);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,31 @@
 | 
				
			|||||||
 | 
					package com.realnet.basic1.Services;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Repository.FormbRepository;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Entity.Formb;
 | 
				
			||||||
 | 
					 import java.util.List;
 | 
				
			||||||
 | 
					import com.realnet.users.entity1.AppUser;
 | 
				
			||||||
 | 
					import com.realnet.users.service1.AppUserServiceImpl;
 | 
				
			||||||
 | 
					import org.springframework.beans.factory.annotation.Autowired;
 | 
				
			||||||
 | 
						import org.springframework.stereotype.Service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Service
 | 
				
			||||||
 | 
					 public class FormbInsertService5 {
 | 
				
			||||||
 | 
					@Autowired
 | 
				
			||||||
 | 
					private FormbRepository Repository;
 | 
				
			||||||
 | 
					@Autowired
 | 
				
			||||||
 | 
						private AppUserServiceImpl userService; 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public Formb insertaction(Formb formb	) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						formb.setUpdatedBy(getUser().getUserId());
 | 
				
			||||||
 | 
							formb.setCreatedBy(getUser().getUserId());
 | 
				
			||||||
 | 
							formb.setAccountId(getUser().getAccount().getAccount_id()); 
 | 
				
			||||||
 | 
						final Formb save = Repository.save(formb);
 | 
				
			||||||
 | 
							return save;
 | 
				
			||||||
 | 
					} 
 | 
				
			||||||
 | 
					public AppUser getUser() {
 | 
				
			||||||
 | 
							AppUser user = userService.getLoggedInUser();
 | 
				
			||||||
 | 
							return user;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						}}
 | 
				
			||||||
@ -0,0 +1,131 @@
 | 
				
			|||||||
 | 
					package com.realnet.basic1.Services;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Repository.FormbRepository;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Entity.Formb
 | 
				
			||||||
 | 
					;import java.util.*;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.springframework.beans.factory.annotation.Autowired;
 | 
				
			||||||
 | 
					import com.realnet.SequenceGenerator.Service.SequenceService;
 | 
				
			||||||
 | 
					import org.springframework.data.domain.Page;
 | 
				
			||||||
 | 
					import com.realnet.realm.Entity.Realm;
 | 
				
			||||||
 | 
					import com.realnet.realm.Services.RealmService;
 | 
				
			||||||
 | 
					import org.springframework.data.domain.Pageable;
 | 
				
			||||||
 | 
					import org.springframework.http.*;
 | 
				
			||||||
 | 
					import com.realnet.users.service1.AppUserServiceImpl;
 | 
				
			||||||
 | 
					import com.realnet.users.entity1.AppUser;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.realnet.basic1.Entity.Formb;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.realnet.basic1.Repository.FormbRepository;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						import org.springframework.stereotype.Service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Service
 | 
				
			||||||
 | 
					 public class FormbService {
 | 
				
			||||||
 | 
					@Autowired
 | 
				
			||||||
 | 
					private FormbRepository Repository;
 | 
				
			||||||
 | 
						@Autowired
 | 
				
			||||||
 | 
						private AppUserServiceImpl userService; 
 | 
				
			||||||
 | 
					@Autowired
 | 
				
			||||||
 | 
						private RealmService realmService;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public Formb Savedata(Formb data) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						data.setUpdatedBy(getUser().getUserId());
 | 
				
			||||||
 | 
							data.setCreatedBy(getUser().getUserId());
 | 
				
			||||||
 | 
							data.setAccountId(getUser().getAccount().getAccount_id());
 | 
				
			||||||
 | 
					Formb save = Repository.save(data);
 | 
				
			||||||
 | 
									return save;	
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//	get all with pagination
 | 
				
			||||||
 | 
						public Page<Formb> getAllWithPagination(Pageable page) {
 | 
				
			||||||
 | 
							return Repository.findAll( getUser().getUserId(),page);
 | 
				
			||||||
 | 
						}			
 | 
				
			||||||
 | 
					public List<Formb> getdetails() {  
 | 
				
			||||||
 | 
							List<Realm> realm = realmService.findByUserId(getUser().getUserId());
 | 
				
			||||||
 | 
					List<Formb> all = Repository.findAll(getUser().getUserId());
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							return all ;		}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public Formb getdetailsbyId(Integer id) {
 | 
				
			||||||
 | 
						return Repository.findById(id).get();
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public void delete_by_id(Integer id) {
 | 
				
			||||||
 | 
					 Repository.deleteById(id);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public Formb update(Formb data,Integer id) {
 | 
				
			||||||
 | 
						Formb old = Repository.findById(id).get();
 | 
				
			||||||
 | 
					old.setNamem(data.getNamem());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					old.setSurvey_formbs(data.getSurvey_formbs());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					final Formb test = Repository.save(old);
 | 
				
			||||||
 | 
							data.setUpdatedBy(getUser().getUserId());
 | 
				
			||||||
 | 
					  return test;} 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//	Insert Action
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Autowired
 | 
				
			||||||
 | 
						private FormbRepository formbinsertrepository;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public Formb insertFormb(Formb data) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					data.setUpdatedBy(getUser().getUserId());
 | 
				
			||||||
 | 
							data.setCreatedBy(getUser().getUserId());
 | 
				
			||||||
 | 
							data.setAccountId(getUser().getAccount().getAccount_id());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							final Formb save = formbinsertrepository.save(data);
 | 
				
			||||||
 | 
							return save;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 public AppUser getUser() {
 | 
				
			||||||
 | 
							AppUser user = userService.getLoggedInUser();
 | 
				
			||||||
 | 
							return user;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						}}
 | 
				
			||||||
@ -0,0 +1,93 @@
 | 
				
			|||||||
 | 
					package com.realnet.basic1.Services;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Repository.TestlistRepository;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Entity.Testlist
 | 
				
			||||||
 | 
					;import java.util.*;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.springframework.beans.factory.annotation.Autowired;
 | 
				
			||||||
 | 
					import com.realnet.SequenceGenerator.Service.SequenceService;
 | 
				
			||||||
 | 
					import org.springframework.data.domain.Page;
 | 
				
			||||||
 | 
					import com.realnet.realm.Entity.Realm;
 | 
				
			||||||
 | 
					import com.realnet.realm.Services.RealmService;
 | 
				
			||||||
 | 
					import org.springframework.data.domain.Pageable;
 | 
				
			||||||
 | 
					import org.springframework.http.*;
 | 
				
			||||||
 | 
					import com.realnet.users.service1.AppUserServiceImpl;
 | 
				
			||||||
 | 
					import com.realnet.users.entity1.AppUser;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						import org.springframework.stereotype.Service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Service
 | 
				
			||||||
 | 
					 public class TestlistService {
 | 
				
			||||||
 | 
					@Autowired
 | 
				
			||||||
 | 
					private TestlistRepository Repository;
 | 
				
			||||||
 | 
						@Autowired
 | 
				
			||||||
 | 
						private AppUserServiceImpl userService; 
 | 
				
			||||||
 | 
					@Autowired
 | 
				
			||||||
 | 
						private RealmService realmService;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public Testlist Savedata(Testlist data) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						data.setUpdatedBy(getUser().getUserId());
 | 
				
			||||||
 | 
							data.setCreatedBy(getUser().getUserId());
 | 
				
			||||||
 | 
							data.setAccountId(getUser().getAccount().getAccount_id());
 | 
				
			||||||
 | 
					Testlist save = Repository.save(data);
 | 
				
			||||||
 | 
									return save;	
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//	get all with pagination
 | 
				
			||||||
 | 
						public Page<Testlist> getAllWithPagination(Pageable page) {
 | 
				
			||||||
 | 
							return Repository.findAll( getUser().getUserId(),page);
 | 
				
			||||||
 | 
						}			
 | 
				
			||||||
 | 
					public List<Testlist> getdetails() {  
 | 
				
			||||||
 | 
							List<Realm> realm = realmService.findByUserId(getUser().getUserId());
 | 
				
			||||||
 | 
					List<Testlist> all = Repository.findAll(getUser().getUserId());
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							return all ;		}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public Testlist getdetailsbyId(Integer id) {
 | 
				
			||||||
 | 
						return Repository.findById(id).get();
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public void delete_by_id(Integer id) {
 | 
				
			||||||
 | 
					 Repository.deleteById(id);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public Testlist update(Testlist data,Integer id) {
 | 
				
			||||||
 | 
						Testlist old = Repository.findById(id).get();
 | 
				
			||||||
 | 
					old.setName(data.getName());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					old.setDescription(data.getDescription());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					old.setActive (data.getActive());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					final Testlist test = Repository.save(old);
 | 
				
			||||||
 | 
							data.setUpdatedBy(getUser().getUserId());
 | 
				
			||||||
 | 
					  return test;} 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 public AppUser getUser() {
 | 
				
			||||||
 | 
							AppUser user = userService.getLoggedInUser();
 | 
				
			||||||
 | 
							return user;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						}}
 | 
				
			||||||
@ -0,0 +1,51 @@
 | 
				
			|||||||
 | 
					package com.realnet.basic1.Services;
 | 
				
			||||||
 | 
					import java.util.*;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Repository.TestlistRepository;
 | 
				
			||||||
 | 
					import com.realnet.basic1.Entity.Testlist;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.realnet.basic1.Entity.Testlist_ListFilter1;
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.springframework.beans.factory.annotation.Autowired;
 | 
				
			||||||
 | 
						import org.springframework.stereotype.Service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Service
 | 
				
			||||||
 | 
					 public class Testlist_ListFilter1Service {
 | 
				
			||||||
 | 
					@Autowired
 | 
				
			||||||
 | 
					private TestlistRepository Repository;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 public   List<Testlist_ListFilter1>   getlistbuilder() {
 | 
				
			||||||
 | 
						List<Testlist> list= Repository.findAll();
 | 
				
			||||||
 | 
							ArrayList<Testlist_ListFilter1> l = new ArrayList<>();
 | 
				
			||||||
 | 
							for (Testlist data : list) {
 | 
				
			||||||
 | 
					boolean isactive = data.getActive();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									if (isactive) {{	
 | 
				
			||||||
 | 
					Testlist_ListFilter1 dummy = new Testlist_ListFilter1();
 | 
				
			||||||
 | 
								dummy.setId(data.getId());
 | 
				
			||||||
 | 
					  dummy.setName(data.getName());
 | 
				
			||||||
 | 
						l.add(dummy);
 | 
				
			||||||
 | 
					}} 
 | 
				
			||||||
 | 
					} 		
 | 
				
			||||||
 | 
					return l;}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 public   List<Testlist_ListFilter1>   getlistbuilderparam( ) {
 | 
				
			||||||
 | 
						List<Testlist> list= Repository.findAll();
 | 
				
			||||||
 | 
							ArrayList<Testlist_ListFilter1> l = new ArrayList<>();
 | 
				
			||||||
 | 
							for (Testlist data : list) {
 | 
				
			||||||
 | 
					boolean isactive = data.getActive();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									if (isactive) {{	
 | 
				
			||||||
 | 
					Testlist_ListFilter1 dummy = new Testlist_ListFilter1();
 | 
				
			||||||
 | 
								dummy.setId(data.getId());
 | 
				
			||||||
 | 
					  dummy.setName(data.getName());
 | 
				
			||||||
 | 
						l.add(dummy);
 | 
				
			||||||
 | 
					}} 
 | 
				
			||||||
 | 
					} 		
 | 
				
			||||||
 | 
					return l;}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,92 @@
 | 
				
			|||||||
 | 
					import 'dart:typed_data';
 | 
				
			||||||
 | 
					import 'package:dio/dio.dart';
 | 
				
			||||||
 | 
					import 'package:http_parser/http_parser.dart';
 | 
				
			||||||
 | 
					import '../../../../resources/api_constants.dart';
 | 
				
			||||||
 | 
					import '../../../../data/network/base_network_service.dart';
 | 
				
			||||||
 | 
					import '../../../../data/network/network_api_service.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class FormbApiService {
 | 
				
			||||||
 | 
					  final String baseUrl = ApiConstants.baseUrl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      final BaseNetworkService _helper = NetworkApiService();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   Future<List<Map<String, dynamic>>> getEntities() async {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      final response = await _helper.getGetApiResponse('$baseUrl/Formb/Formb');
 | 
				
			||||||
 | 
					      final entities = (response as List).cast<Map<String, dynamic>>();
 | 
				
			||||||
 | 
					      return entities;
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      throw Exception('Failed to get all entities: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					Future<List<Map<String, dynamic>>> getAllWithPagination(
 | 
				
			||||||
 | 
					       int page, int size) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					            final response =
 | 
				
			||||||
 | 
					          await _helper.getGetApiResponse('$baseUrl/Formb/Formb/getall/page?page=$page&size=$size');
 | 
				
			||||||
 | 
					      final entities =
 | 
				
			||||||
 | 
					          (response['content'] as List).cast<Map<String, dynamic>>();
 | 
				
			||||||
 | 
					      return entities;
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      throw Exception('Failed to get all without pagination: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  Future<Map<String, dynamic>> createEntity(
 | 
				
			||||||
 | 
					       Map<String, dynamic> entity) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					            print("in post api$entity");
 | 
				
			||||||
 | 
					      final response =
 | 
				
			||||||
 | 
					          await _helper.getPostApiResponse('$baseUrl/Formb/Formb', entity);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      print(entity);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      // Assuming the response is a Map<String, dynamic>
 | 
				
			||||||
 | 
					      Map<String, dynamic> responseData = response;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      return responseData;
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      throw Exception('Failed to create entity: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<void> updateEntity( int entityId, Map<String, dynamic> entity) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					     await _helper.getPutApiResponse('$baseUrl/Formb/Formb/$entityId',
 | 
				
			||||||
 | 
					      entity);                print(entity);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      throw Exception('Failed to update entity: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<void> deleteEntity( int entityId) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					 await _helper.getDeleteApiResponse('$baseUrl/Formb/Formb/$entityId');
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      throw Exception('Failed to delete entity: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,86 @@
 | 
				
			|||||||
 | 
					// ignore_for_file: use_build_context_synchronously
 | 
				
			||||||
 | 
					import 'dart:convert';
 | 
				
			||||||
 | 
					import 'package:flutter/material.dart';
 | 
				
			||||||
 | 
					import 'package:file_picker/file_picker.dart';
 | 
				
			||||||
 | 
					import 'package:image_picker/image_picker.dart';
 | 
				
			||||||
 | 
					import 'package:provider/provider.dart';
 | 
				
			||||||
 | 
					import '../Formb_viewModel/Formb_view_model_screen.dart';
 | 
				
			||||||
 | 
					import 'Formb_fields.dart';import 'package:base_project/BuilderField/shared/ui/entity_screens.dart';
 | 
				
			||||||
 | 
					import '../../../../utils/image_constant.dart';
 | 
				
			||||||
 | 
					import '../../../../utils/size_utils.dart';
 | 
				
			||||||
 | 
					import '../../../../theme/app_style.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/appbar_image.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/appbar_title.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/custom_app_bar.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/custom_button.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/custom_text_form_field.dart'; 
 | 
				
			||||||
 | 
					import '../../../../widgets/custom_dropdown_field.dart';
 | 
				
			||||||
 | 
					import 'dart:math';
 | 
				
			||||||
 | 
					import 'package:qr_flutter/qr_flutter.dart';
 | 
				
			||||||
 | 
					import 'package:barcode_widget/barcode_widget.dart';
 | 
				
			||||||
 | 
					import 'package:intl/intl.dart';
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					import 'package:autocomplete_textfield/autocomplete_textfield.dart';
 | 
				
			||||||
 | 
					import 'package:http/http.dart' as http;
 | 
				
			||||||
 | 
					import 'package:flutter/services.dart';
 | 
				
			||||||
 | 
					import 'package:image_picker/image_picker.dart';
 | 
				
			||||||
 | 
					import 'package:fluttertoast/fluttertoast.dart';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_date_picker_field.dart';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_date_time_picker_field.dart'
 | 
				
			||||||
 | 
					;import 'package:multi_select_flutter/multi_select_flutter.dart';
 | 
				
			||||||
 | 
					import 'package:just_audio/just_audio.dart';
 | 
				
			||||||
 | 
					import 'package:video_player/video_player.dart';
 | 
				
			||||||
 | 
					import 'package:google_fonts/google_fonts.dart';
 | 
				
			||||||
 | 
					import 'package:lottie/lottie.dart';
 | 
				
			||||||
 | 
					import '../../../../utils/toast_messages/toast_message_util.dart';
 | 
				
			||||||
 | 
					import 'dart:io';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_text_field.dart';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_dropdown_field.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class FormbCreateEntityScreen extends StatefulWidget {
 | 
				
			||||||
 | 
					  const FormbCreateEntityScreen({super.key});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @override
 | 
				
			||||||
 | 
					  _FormbCreateEntityScreenState createState() => _FormbCreateEntityScreenState();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class _FormbCreateEntityScreenState extends State<FormbCreateEntityScreen> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					final Map<String, dynamic> formData = {};
 | 
				
			||||||
 | 
					  final _formKey = GlobalKey<FormState>();
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  @override
 | 
				
			||||||
 | 
					  Widget build(BuildContext context) {
 | 
				
			||||||
 | 
					    return Consumer<FormbViewModelScreen>(
 | 
				
			||||||
 | 
					      builder: (context, viewModel, child) {
 | 
				
			||||||
 | 
					        return EntityCreateScreen(
 | 
				
			||||||
 | 
					          fields: FormbFields.getFields(context),
 | 
				
			||||||
 | 
					          onSubmit: (data) => _handleSubmit(data),
 | 
				
			||||||
 | 
					          title: 'Formb',
 | 
				
			||||||
 | 
					          isLoading: viewModel.isLoading,
 | 
				
			||||||
 | 
					          errorMessage:
 | 
				
			||||||
 | 
					              viewModel.errorMessage.isNotEmpty ? viewModel.errorMessage : null,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<void> _handleSubmit(Map<String, dynamic> formData) async {
 | 
				
			||||||
 | 
					    final provider =
 | 
				
			||||||
 | 
					        Provider.of<FormbViewModelScreen>(context, listen: false);
 | 
				
			||||||
 | 
					    final success = await provider.createEntity(formData);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (success && mounted) {
 | 
				
			||||||
 | 
					      Navigator.pop(context);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,94 @@
 | 
				
			|||||||
 | 
					// ignore_for_file: use_build_context_synchronously
 | 
				
			||||||
 | 
					import 'package:flutter/material.dart';
 | 
				
			||||||
 | 
					import 'package:provider/provider.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/ui/entity_details.dart';
 | 
				
			||||||
 | 
					import '../Formb_viewModel/Formb_view_model_screen.dart';
 | 
				
			||||||
 | 
					import 'Formb_update_entity_screen.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class FormbDetailsScreen extends StatefulWidget {
 | 
				
			||||||
 | 
					  final Map<String, dynamic> entity;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const FormbDetailsScreen({
 | 
				
			||||||
 | 
					    super.key,
 | 
				
			||||||
 | 
					    required this.entity,
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @override
 | 
				
			||||||
 | 
					  State<FormbDetailsScreen> createState() => _FormbDetailsScreenState();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class _FormbDetailsScreenState extends State<FormbDetailsScreen> {
 | 
				
			||||||
 | 
					  void _navigateToUpdateScreen(Map<String, dynamic> entity) {
 | 
				
			||||||
 | 
					    Navigator.push(
 | 
				
			||||||
 | 
					      context,
 | 
				
			||||||
 | 
					      MaterialPageRoute(
 | 
				
			||||||
 | 
					        builder: (context) => ChangeNotifierProvider(
 | 
				
			||||||
 | 
					          create: (context) => FormbViewModelScreen(),
 | 
				
			||||||
 | 
					          child: FormbUpdateEntityScreen(entity: entity),
 | 
				
			||||||
 | 
					        ),
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					    ).then((_) {
 | 
				
			||||||
 | 
					      // Refresh the details screen with updated data
 | 
				
			||||||
 | 
					      setState(() {});
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void _showDeleteDialog(Map<String, dynamic> entity) {
 | 
				
			||||||
 | 
					    showDialog(
 | 
				
			||||||
 | 
					      context: context,
 | 
				
			||||||
 | 
					      builder: (BuildContext context) {
 | 
				
			||||||
 | 
					        return AlertDialog(
 | 
				
			||||||
 | 
					          title: const Text('Confirm Deletion'),
 | 
				
			||||||
 | 
					          content: const Text('Are you sure you want to delete this Formb?'),
 | 
				
			||||||
 | 
					          actions: [
 | 
				
			||||||
 | 
					            TextButton(
 | 
				
			||||||
 | 
					              child: const Text('Cancel'),
 | 
				
			||||||
 | 
					              onPressed: () {
 | 
				
			||||||
 | 
					                Navigator.of(context).pop();
 | 
				
			||||||
 | 
					              },
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
 | 
					            TextButton(
 | 
				
			||||||
 | 
					              child: const Text('Delete'),
 | 
				
			||||||
 | 
					              onPressed: () async {
 | 
				
			||||||
 | 
					                Navigator.of(context).pop();
 | 
				
			||||||
 | 
					                final vm =
 | 
				
			||||||
 | 
					                    Provider.of<FormbViewModelScreen>(context, listen: false);
 | 
				
			||||||
 | 
					                final success = await vm.deleteEntity(entity['id']);
 | 
				
			||||||
 | 
					                if (success && mounted) {
 | 
				
			||||||
 | 
					                  Navigator.pop(context); // Go back to list
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					              },
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
 | 
					          ],
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @override
 | 
				
			||||||
 | 
					  Widget build(BuildContext context) {
 | 
				
			||||||
 | 
					    return Consumer<FormbViewModelScreen>(
 | 
				
			||||||
 | 
					      builder: (context, viewModel, child) {
 | 
				
			||||||
 | 
					        return EntityDetails(
 | 
				
			||||||
 | 
					          entity: widget.entity,
 | 
				
			||||||
 | 
					          onEdit: (entity) => _navigateToUpdateScreen(entity),
 | 
				
			||||||
 | 
					          onDelete: (entity) => _showDeleteDialog(entity),
 | 
				
			||||||
 | 
					          title: 'Formb',
 | 
				
			||||||
 | 
					          displayFields: [
 | 
				
			||||||
 | 
					  {'key': 'namem', 'label': 'Namem', 'type': 'text'},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  {'key': 'survey_formbs', 'label': 'Survey Formbs', 'type': 'survey'},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  {'key': 'value_list_fields', 'label': 'Value List Fields', 'type': 'value_list'},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  {'key': 'formb', 'label': 'Formb', 'type': 'button'},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          ],
 | 
				
			||||||
 | 
					          isLoading: viewModel.isLoading,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,153 @@
 | 
				
			|||||||
 | 
					// ignore_for_file: use_build_context_synchronously
 | 
				
			||||||
 | 
					import 'package:flutter/material.dart';
 | 
				
			||||||
 | 
					import 'package:intl/intl.dart';
 | 
				
			||||||
 | 
					import 'package:base_project/BuilderField/shared/ui/entity_list.dart';
 | 
				
			||||||
 | 
					import 'Formb_create_entity_screen.dart';
 | 
				
			||||||
 | 
					import 'Formb_update_entity_screen.dart';
 | 
				
			||||||
 | 
					import '../Formb_viewModel/Formb_view_model_screen.dart';
 | 
				
			||||||
 | 
					import 'Formb_details_screen.dart';import 'package:flutter/services.dart';
 | 
				
			||||||
 | 
					import 'package:speech_to_text/speech_to_text.dart' as stt;
 | 
				
			||||||
 | 
					import '../../../../theme/app_style.dart';
 | 
				
			||||||
 | 
					import '../../../../utils/size_utils.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/custom_icon_button.dart';
 | 
				
			||||||
 | 
					import '../../../../utils/image_constant.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/appbar_image.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/appbar_title.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/custom_app_bar.dart';
 | 
				
			||||||
 | 
					import '../../../../theme/app_decoration.dart';
 | 
				
			||||||
 | 
					import 'package:multi_select_flutter/multi_select_flutter.dart';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_text_field.dart';
 | 
				
			||||||
 | 
					import 'package:provider/provider.dart';
 | 
				
			||||||
 | 
					import '../../../../utils/toast_messages/toast_message_util.dart';
 | 
				
			||||||
 | 
					import 'package:fluttertoast/fluttertoast.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class Formb_entity_list_screen extends StatefulWidget {
 | 
				
			||||||
 | 
					  static const String routeName = '/entity-list';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @override
 | 
				
			||||||
 | 
					  _Formb_entity_list_screenState createState() => _Formb_entity_list_screenState();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class _Formb_entity_list_screenState extends State<Formb_entity_list_screen> {
 | 
				
			||||||
 | 
					  @override
 | 
				
			||||||
 | 
					  void initState() {
 | 
				
			||||||
 | 
					    super.initState();
 | 
				
			||||||
 | 
					    _loadData();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void _loadData() {
 | 
				
			||||||
 | 
					    WidgetsBinding.instance.addPostFrameCallback((_) {
 | 
				
			||||||
 | 
					      if (mounted) {
 | 
				
			||||||
 | 
					        final vm = Provider.of<FormbViewModelScreen>(context, listen: false);
 | 
				
			||||||
 | 
					        vm.getAllWithPagination(refresh: true);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void _navigateToCreateScreen() {
 | 
				
			||||||
 | 
					    Navigator.push(
 | 
				
			||||||
 | 
					      context,
 | 
				
			||||||
 | 
					      MaterialPageRoute(
 | 
				
			||||||
 | 
					        builder: (context) => ChangeNotifierProvider(
 | 
				
			||||||
 | 
					          create: (context) => FormbViewModelScreen(),
 | 
				
			||||||
 | 
					          child: const FormbCreateEntityScreen(),
 | 
				
			||||||
 | 
					        ),
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					    ).then((_) {
 | 
				
			||||||
 | 
					      final vm = Provider.of<FormbViewModelScreen>(context, listen: false);
 | 
				
			||||||
 | 
					      vm.refreshData();
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void _navigateToUpdateScreen(Map<String, dynamic> entity) {
 | 
				
			||||||
 | 
					    Navigator.push(
 | 
				
			||||||
 | 
					      context,
 | 
				
			||||||
 | 
					      MaterialPageRoute(
 | 
				
			||||||
 | 
					        builder: (context) => ChangeNotifierProvider(
 | 
				
			||||||
 | 
					          create: (context) => FormbViewModelScreen(),
 | 
				
			||||||
 | 
					          child: FormbUpdateEntityScreen(entity: entity),
 | 
				
			||||||
 | 
					        ),
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					    ).then((_) {
 | 
				
			||||||
 | 
					      final vm = Provider.of<FormbViewModelScreen>(context, listen: false);
 | 
				
			||||||
 | 
					      vm.refreshData();
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void _navigateToDetailsScreen(Map<String, dynamic> entity) {
 | 
				
			||||||
 | 
					    Navigator.push(
 | 
				
			||||||
 | 
					      context,
 | 
				
			||||||
 | 
					      MaterialPageRoute(
 | 
				
			||||||
 | 
					        builder: (context) => ChangeNotifierProvider(
 | 
				
			||||||
 | 
					          create: (context) => FormbViewModelScreen(),
 | 
				
			||||||
 | 
					          child: FormbDetailsScreen(entity: entity),
 | 
				
			||||||
 | 
					        ),
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void _showDeleteDialog(Map<String, dynamic> entity) {
 | 
				
			||||||
 | 
					    showDialog(
 | 
				
			||||||
 | 
					      context: context,
 | 
				
			||||||
 | 
					      builder: (BuildContext context) {
 | 
				
			||||||
 | 
					        return AlertDialog(
 | 
				
			||||||
 | 
					          title: const Text('Confirm Deletion'),
 | 
				
			||||||
 | 
					          content: const Text('Are you sure you want to delete this Formb?'),
 | 
				
			||||||
 | 
					          actions: [
 | 
				
			||||||
 | 
					            TextButton(
 | 
				
			||||||
 | 
					              child: const Text('Cancel'),
 | 
				
			||||||
 | 
					              onPressed: () {
 | 
				
			||||||
 | 
					                Navigator.of(context).pop();
 | 
				
			||||||
 | 
					              },
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
 | 
					            TextButton(
 | 
				
			||||||
 | 
					              child: const Text('Delete'),
 | 
				
			||||||
 | 
					              onPressed: () async {
 | 
				
			||||||
 | 
					                Navigator.of(context).pop();
 | 
				
			||||||
 | 
					                final vm =
 | 
				
			||||||
 | 
					                    Provider.of<FormbViewModelScreen>(context, listen: false);
 | 
				
			||||||
 | 
					                await vm.deleteEntity(entity['id']);
 | 
				
			||||||
 | 
					              },
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
 | 
					          ],
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @override
 | 
				
			||||||
 | 
					  Widget build(BuildContext context) {
 | 
				
			||||||
 | 
					    return Consumer<FormbViewModelScreen>(
 | 
				
			||||||
 | 
					      builder: (context, viewModel, child) {
 | 
				
			||||||
 | 
					        return EntityList(
 | 
				
			||||||
 | 
					          entities: viewModel.filteredList,
 | 
				
			||||||
 | 
					          isLoading: viewModel.isLoading,
 | 
				
			||||||
 | 
					          errorMessage:
 | 
				
			||||||
 | 
					              viewModel.errorMessage.isNotEmpty ? viewModel.errorMessage : null,
 | 
				
			||||||
 | 
					          hasMoreData: viewModel.hasMoreData,
 | 
				
			||||||
 | 
					          searchQuery: viewModel.searchQuery,
 | 
				
			||||||
 | 
					          onSearchChanged: (query) => viewModel.searchformb(query),
 | 
				
			||||||
 | 
					          onEdit: (entity) => _navigateToUpdateScreen(entity),
 | 
				
			||||||
 | 
					          onDelete: (entity) => _showDeleteDialog(entity),
 | 
				
			||||||
 | 
					          onTap: (entity) => _navigateToDetailsScreen(entity),
 | 
				
			||||||
 | 
					          onRefresh: () => viewModel.refreshData(),
 | 
				
			||||||
 | 
					          onLoadMore: () => viewModel.getAllWithPagination(),
 | 
				
			||||||
 | 
					          title: 'Formb',
 | 
				
			||||||
 | 
					          onAddNew: _navigateToCreateScreen,
 | 
				
			||||||
 | 
					          displayFields: [
 | 
				
			||||||
 | 
					  {'key': 'namem', 'label': 'Namem', 'type': 'text'},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  {'key': 'survey_formbs', 'label': 'Survey Formbs', 'type': 'survey'},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  {'key': 'value_list_fields', 'label': 'Value List Fields', 'type': 'value_list'},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  {'key': 'formb', 'label': 'Formb', 'type': 'button'},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          ],
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,103 @@
 | 
				
			|||||||
 | 
					import 'package:base_project/BuilderField/shared/fields/number_field.dart';
 | 
				
			||||||
 | 
					import 'package:base_project/BuilderField/shared/fields/password_field.dart';
 | 
				
			||||||
 | 
					import 'package:base_project/BuilderField/shared/fields/phone_field.dart';
 | 
				
			||||||
 | 
					import 'package:base_project/BuilderField/shared/fields/custom_text_field.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/base_field.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/date_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/datetime_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/email_field.dart';
 | 
				
			||||||
 | 
					import 'package:base_project/BuilderField/shared/fields/url_field.dart';
 | 
				
			||||||
 | 
					import 'package:flutter/material.dart';
 | 
				
			||||||
 | 
					import 'package:provider/provider.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/custom_text_field.dart' as shared_text;
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/one_to_one_relation_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/calculated_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/one_to_many_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/value_list_picker_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/captcha_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/switch_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/url_field.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/audio_upload_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/checkbox_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/file_upload_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/image_upload_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/radio_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/video_upload_field.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/autocomplete_dropdown_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/autocomplete_multiselect_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/one_to_one_relation_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/data_grid_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/dropdown_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/dynamic_dropdown_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/dynamic_multiselect_dropdown_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/static_multiselect_field.dart';import '../Formb_viewModel/Formb_view_model_screen.dart';/// Field definitions for Formb entity
 | 
				
			||||||
 | 
					/// This defines the structure and validation for Formb forms
 | 
				
			||||||
 | 
					class FormbFields {
 | 
				
			||||||
 | 
					  /// Get field definitions for Formb entity
 | 
				
			||||||
 | 
					  static List<BaseField> getFields(BuildContext context) {
 | 
				
			||||||
 | 
					    final viewModel =
 | 
				
			||||||
 | 
					        Provider.of<FormbViewModelScreen>(context, listen: false);
 | 
				
			||||||
 | 
					    return [
 | 
				
			||||||
 | 
					      // Basic Information
 | 
				
			||||||
 | 
					 CustomTextField(
 | 
				
			||||||
 | 
					        fieldKey: 'namem',
 | 
				
			||||||
 | 
					        label: 'Namem',
 | 
				
			||||||
 | 
					        hint: 'Enter Namem',
 | 
				
			||||||
 | 
					        isRequired: true,
 | 
				
			||||||
 | 
					        maxLength: 50,
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 CustomTextField(
 | 
				
			||||||
 | 
					        fieldKey: 'survey_formbs',
 | 
				
			||||||
 | 
					        label: 'Survey Formbs',
 | 
				
			||||||
 | 
					        hint: 'Enter Survey Formbs',
 | 
				
			||||||
 | 
					        isRequired: true,
 | 
				
			||||||
 | 
					        maxLength: 50,
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 3) Value list picker â fill fields from selection (provide your loader)
 | 
				
			||||||
 | 
					      ValueListPickerField(
 | 
				
			||||||
 | 
					        fieldKey: 'value_list_fields',
 | 
				
			||||||
 | 
					        label: 'Value List Fields',
 | 
				
			||||||
 | 
					       optionsLoader: () async {
 | 
				
			||||||
 | 
					           try {
 | 
				
			||||||
 | 
					            final response = viewModel.FormbList;
 | 
				
			||||||
 | 
					            return response;
 | 
				
			||||||
 | 
					          } catch (e) {
 | 
				
			||||||
 | 
					            // Return empty list if API fails
 | 
				
			||||||
 | 
					            return <Map<String, dynamic>>[];
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        fillMappings: const {
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					          'namem': 'namem',
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					         
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  DataGridField(
 | 
				
			||||||
 | 
					        fieldKey: 'datagrid_fieldss',
 | 
				
			||||||
 | 
					        label: 'datagrid Fieldss',
 | 
				
			||||||
 | 
					        dataLoader: () => viewModel.getdatagrid_fieldssGrid(),
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 CustomTextField(
 | 
				
			||||||
 | 
					        fieldKey: 'formb',
 | 
				
			||||||
 | 
					        label: 'Formb',
 | 
				
			||||||
 | 
					        hint: 'Enter Formb',
 | 
				
			||||||
 | 
					        isRequired: true,
 | 
				
			||||||
 | 
					        maxLength: 50,
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ];
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,81 @@
 | 
				
			|||||||
 | 
					// ignore_for_file: use_build_context_synchronously
 | 
				
			||||||
 | 
					import 'dart:convert';
 | 
				
			||||||
 | 
					import 'package:provider/provider.dart';
 | 
				
			||||||
 | 
					import '../Formb_viewModel/Formb_view_model_screen.dart';
 | 
				
			||||||
 | 
					import 'package:base_project/BuilderField/shared/ui/entity_screens.dart';
 | 
				
			||||||
 | 
					import 'Formb_fields.dart';import '../../../../utils/image_constant.dart';
 | 
				
			||||||
 | 
					import '../../../../utils/size_utils.dart';
 | 
				
			||||||
 | 
					import '../../../../theme/app_style.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/appbar_image.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/appbar_title.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/custom_app_bar.dart';
 | 
				
			||||||
 | 
					import 'package:barcode_widget/barcode_widget.dart';
 | 
				
			||||||
 | 
					import 'package:fluttertoast/fluttertoast.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/custom_button.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/custom_text_form_field.dart';
 | 
				
			||||||
 | 
					import 'package:flutter/material.dart';
 | 
				
			||||||
 | 
					import 'package:autocomplete_textfield/autocomplete_textfield.dart';
 | 
				
			||||||
 | 
					import 'package:qr_flutter/qr_flutter.dart';
 | 
				
			||||||
 | 
					import 'package:intl/intl.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import 'dart:math';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_text_field.dart';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_date_picker_field.dart';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_date_time_picker_field.dart';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_dropdown_field.dart';
 | 
				
			||||||
 | 
					import 'package:flutter/services.dart';
 | 
				
			||||||
 | 
					class FormbUpdateEntityScreen extends StatefulWidget {
 | 
				
			||||||
 | 
					    final Map<String, dynamic> entity;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  FormbUpdateEntityScreen({required this.entity});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @override
 | 
				
			||||||
 | 
					  _FormbUpdateEntityScreenState createState() => _FormbUpdateEntityScreenState();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class _FormbUpdateEntityScreenState extends State<FormbUpdateEntityScreen> {
 | 
				
			||||||
 | 
					  final _formKey = GlobalKey<FormState>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@override
 | 
				
			||||||
 | 
					  Widget build(BuildContext context) {
 | 
				
			||||||
 | 
					    return Consumer<FormbViewModelScreen>(
 | 
				
			||||||
 | 
					      builder: (context, viewModel, child) {
 | 
				
			||||||
 | 
					// Start with all fields, then remove upload fields (generic filter by keys)
 | 
				
			||||||
 | 
					        final Set<String> hiddenKeys = { 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 };
 | 
				
			||||||
 | 
					        final fields = FormbFields.getFields(context)
 | 
				
			||||||
 | 
					            .where((f) => !hiddenKeys.contains(f.fieldKey))
 | 
				
			||||||
 | 
					            .toList();        return EntityUpdateScreen(
 | 
				
			||||||
 | 
					          fields: fields,
 | 
				
			||||||
 | 
					          initialData: widget.entity,
 | 
				
			||||||
 | 
					          onSubmit: (data) => _handleSubmit(data),
 | 
				
			||||||
 | 
					          title: 'Formb',
 | 
				
			||||||
 | 
					          isLoading: viewModel.isLoading,
 | 
				
			||||||
 | 
					          errorMessage:
 | 
				
			||||||
 | 
					              viewModel.errorMessage.isNotEmpty ? viewModel.errorMessage : null,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<void> _handleSubmit(Map<String, dynamic> formData) async {
 | 
				
			||||||
 | 
					    final provider =
 | 
				
			||||||
 | 
					        Provider.of<FormbViewModelScreen>(context, listen: false);
 | 
				
			||||||
 | 
					    final success = await provider.updateEntity(widget.entity['id'], formData);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (success && mounted) {
 | 
				
			||||||
 | 
					      Navigator.pop(context);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,98 @@
 | 
				
			|||||||
 | 
					import 'package:dio/dio.dart';
 | 
				
			||||||
 | 
					import '../../../../data/network/base_network_service.dart';
 | 
				
			||||||
 | 
					import '../../../../data/network/network_api_service.dart';
 | 
				
			||||||
 | 
					import '../../../../resources/api_constants.dart';
 | 
				
			||||||
 | 
					import 'package:base_project/data/response/api_response.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class FormbRepoScreen {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  final String baseUrl = ApiConstants.baseUrl;
 | 
				
			||||||
 | 
					  final BaseNetworkService _helper = NetworkApiService();
 | 
				
			||||||
 | 
					  final String _endpointPath = '/Formb/Formb';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<ApiResponse<List<Map<String, dynamic>>>> getEntities() async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      final response =
 | 
				
			||||||
 | 
					          await _helper.getGetApiResponse('$baseUrl$_endpointPath');
 | 
				
			||||||
 | 
					      return ApiResponse.success(response as List<Map<String, dynamic>>);
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      return ApiResponse.error('Failed to get all entities: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<ApiResponse<List<Map<String, dynamic>>>> getAllWithPagination(
 | 
				
			||||||
 | 
					      int page, int size) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      final response = await _helper.getGetApiResponse(
 | 
				
			||||||
 | 
					          '$baseUrl$_endpointPath/getall/page?page=$page&size=$size');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (response is Map<String, dynamic> && response['content'] is List) {
 | 
				
			||||||
 | 
					        final List<Map<String, dynamic>> entities =
 | 
				
			||||||
 | 
					            (response['content'] as List).cast<Map<String, dynamic>>().toList();
 | 
				
			||||||
 | 
					        return ApiResponse.success(entities);
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        return ApiResponse.error('Invalid response format');
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      return ApiResponse.error('Failed to get all without pagination: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<ApiResponse<Map<String, dynamic>>> createEntity(
 | 
				
			||||||
 | 
					      Map<String, dynamic> entity) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      print("in post api$entity");
 | 
				
			||||||
 | 
					      final response =
 | 
				
			||||||
 | 
					          await _helper.getPostApiResponse('$baseUrl$_endpointPath', entity);
 | 
				
			||||||
 | 
					      return ApiResponse.success(response as Map<String, dynamic>);
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      return ApiResponse.error('Failed to create entity: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<ApiResponse<Map<String, dynamic>>> updateEntity(
 | 
				
			||||||
 | 
					      int entityId, Map<String, dynamic> entity) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      final response = await _helper.getPutApiResponse(
 | 
				
			||||||
 | 
					          '$baseUrl$_endpointPath/$entityId', entity);
 | 
				
			||||||
 | 
					      return ApiResponse.success(response as Map<String, dynamic>);
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      return ApiResponse.error('Failed to update entity: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<ApiResponse<void>> deleteEntity(int entityId) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      await _helper.getDeleteApiResponse('$baseUrl$_endpointPath/$entityId');
 | 
				
			||||||
 | 
					      return ApiResponse.success(null);
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      return ApiResponse.error('Failed to delete entity: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 Future<dynamic> getdatagrid_fieldssGrid() async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      String apiUrl = "$baseUrl/Testlist_ListFilter1/Testlist_ListFilter1";
 | 
				
			||||||
 | 
					      final response = await _helper.getGetApiResponse(apiUrl);
 | 
				
			||||||
 | 
					      return response;
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      throw Exception('Failed to Upload datagrid Fieldss: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 Future<dynamic> insertformb(Map<String, dynamic> entity) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      String apiUrl = "$baseUrl/Formb/Formb_insert";
 | 
				
			||||||
 | 
					      final response = await _helper.getPostApiResponse(apiUrl,entity);
 | 
				
			||||||
 | 
					      return response;
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      throw Exception('Failed to Insert: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,360 @@
 | 
				
			|||||||
 | 
					import 'package:base_project/data/response/status.dart';
 | 
				
			||||||
 | 
					import 'dart:typed_data';
 | 
				
			||||||
 | 
					import 'package:dio/dio.dart';
 | 
				
			||||||
 | 
					import 'package:http_parser/http_parser.dart';
 | 
				
			||||||
 | 
					import '../../../../utils/toast_messages/toast_message_util.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/utils/entity_field_store.dart';
 | 
				
			||||||
 | 
					import 'package:flutter/material.dart';
 | 
				
			||||||
 | 
					import '../Formb_Repo/Formb_repo_screen.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class FormbViewModelScreen extends ChangeNotifier{
 | 
				
			||||||
 | 
					  final FormbRepoScreen repo = FormbRepoScreen();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					  // State variables
 | 
				
			||||||
 | 
					  List<Map<String, dynamic>> _formbList = [];
 | 
				
			||||||
 | 
					  List<Map<String, dynamic>> _filteredList = [];
 | 
				
			||||||
 | 
					  bool _isLoading = false;
 | 
				
			||||||
 | 
					  String _errorMessage = '';
 | 
				
			||||||
 | 
					  int _currentPage = 0;
 | 
				
			||||||
 | 
					  int _pageSize = 10;
 | 
				
			||||||
 | 
					  bool _hasMoreData = true;
 | 
				
			||||||
 | 
					  String _searchQuery = '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Getters
 | 
				
			||||||
 | 
					  List<Map<String, dynamic>> get formbList => _formbList;
 | 
				
			||||||
 | 
					  List<Map<String, dynamic>> get filteredList => _filteredList;
 | 
				
			||||||
 | 
					  bool get isLoading => _isLoading;
 | 
				
			||||||
 | 
					  String get errorMessage => _errorMessage;
 | 
				
			||||||
 | 
					  bool get hasMoreData => _hasMoreData;
 | 
				
			||||||
 | 
					  String get searchQuery => _searchQuery;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Set loading state
 | 
				
			||||||
 | 
					  void _setLoading(bool loading) {
 | 
				
			||||||
 | 
					    _isLoading = loading;
 | 
				
			||||||
 | 
					    notifyListeners();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Set error message
 | 
				
			||||||
 | 
					  void _setError(String error) {
 | 
				
			||||||
 | 
					    _errorMessage = error;
 | 
				
			||||||
 | 
					    notifyListeners();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Clear error
 | 
				
			||||||
 | 
					  void clearError() {
 | 
				
			||||||
 | 
					    _errorMessage = '';
 | 
				
			||||||
 | 
					    notifyListeners();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Get formb list
 | 
				
			||||||
 | 
					  Future<void> getEntities() async {
 | 
				
			||||||
 | 
					    _setLoading(true);
 | 
				
			||||||
 | 
					    _setError('');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      final response = await repo.getEntities();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (response.status == Status.SUCCESS) {
 | 
				
			||||||
 | 
					        _formbList = response.data ?? [];
 | 
				
			||||||
 | 
					        _filteredList = List.from(_formbList);
 | 
				
			||||||
 | 
					        _currentPage = 0;
 | 
				
			||||||
 | 
					        _hasMoreData = true;
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        _setError(response.message ?? 'Failed to fetch formb list');
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      _setError('Failed to fetch formb list: $e');
 | 
				
			||||||
 | 
					    } finally {
 | 
				
			||||||
 | 
					      _setLoading(false);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Get formb list with pagination
 | 
				
			||||||
 | 
					  Future<void> getAllWithPagination({bool refresh = false}) async {
 | 
				
			||||||
 | 
					    if (refresh) {
 | 
				
			||||||
 | 
					      _currentPage = 0;
 | 
				
			||||||
 | 
					      _formbList.clear();
 | 
				
			||||||
 | 
					      _filteredList.clear();
 | 
				
			||||||
 | 
					      _hasMoreData = true;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!_hasMoreData || _isLoading) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    _setLoading(true);
 | 
				
			||||||
 | 
					    _setError('');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      final response = await repo.getAllWithPagination(_currentPage, _pageSize);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (response.status == Status.SUCCESS) {
 | 
				
			||||||
 | 
					        final newItems = response.data ?? [];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (refresh) {
 | 
				
			||||||
 | 
					          _formbList = newItems;
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					          _formbList.addAll(newItems);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        _filteredList = List.from(_formbList);
 | 
				
			||||||
 | 
					        _currentPage++;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Check if we have more data
 | 
				
			||||||
 | 
					        _hasMoreData = newItems.length == _pageSize;
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        _setError(response.message ?? 'Failed to fetch Formb list');
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      _setError('Failed to fetch formb list: $e');
 | 
				
			||||||
 | 
					    } finally {
 | 
				
			||||||
 | 
					      _setLoading(false);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Create Formb
 | 
				
			||||||
 | 
					  Future<bool> createEntity(Map<String, dynamic> entity) async {
 | 
				
			||||||
 | 
					    _setLoading(true);
 | 
				
			||||||
 | 
					    _setError('');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      final response = await repo.createEntity(entity);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (response.status == Status.SUCCESS) {
 | 
				
			||||||
 | 
					// Get the response ID for image upload
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        final responseId = response.data!['id'].toString();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					          message: 'formb created successfully',
 | 
				
			||||||
 | 
					          toastType: ToastType.success,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Refresh the list
 | 
				
			||||||
 | 
					        await getEntities();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return true;
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        _setError(response.message ?? 'Failed to create Formb');
 | 
				
			||||||
 | 
					        ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					          message: response.message ?? 'Failed to create Formb',
 | 
				
			||||||
 | 
					          toastType: ToastType.error,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					        return false;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      _setError('Failed to create formb: $e');
 | 
				
			||||||
 | 
					      ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					        message: 'Failed to create Formb: $e',
 | 
				
			||||||
 | 
					        toastType: ToastType.error,
 | 
				
			||||||
 | 
					      );
 | 
				
			||||||
 | 
					      return false;
 | 
				
			||||||
 | 
					    } finally {
 | 
				
			||||||
 | 
					      _setLoading(false);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Update formb
 | 
				
			||||||
 | 
					  Future<bool> updateEntity(int id, Map<String, dynamic> entity) async {
 | 
				
			||||||
 | 
					    _setLoading(true);
 | 
				
			||||||
 | 
					    _setError('');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      final response = await repo.updateEntity(id, entity);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (response.status == Status.SUCCESS) {
 | 
				
			||||||
 | 
					        ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					          message: 'Formb updated successfully',
 | 
				
			||||||
 | 
					          toastType: ToastType.success,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Update the item in the list
 | 
				
			||||||
 | 
					        final index = _formbList.indexWhere((item) => item['id'] == id);
 | 
				
			||||||
 | 
					        if (index != -1) {
 | 
				
			||||||
 | 
					          _formbList[index] = response.data!;
 | 
				
			||||||
 | 
					          _filteredList = List.from(_formbList);
 | 
				
			||||||
 | 
					          notifyListeners();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        return true;
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        _setError(response.message ?? 'Failed to update Formb');
 | 
				
			||||||
 | 
					        ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					          message: response.message ?? 'Failed to update Formb',
 | 
				
			||||||
 | 
					          toastType: ToastType.error,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					        return false;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      _setError('Failed to update formb: $e');
 | 
				
			||||||
 | 
					      ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					        message: 'Failed to update Formb: $e',
 | 
				
			||||||
 | 
					        toastType: ToastType.error,
 | 
				
			||||||
 | 
					      );
 | 
				
			||||||
 | 
					      return false;
 | 
				
			||||||
 | 
					    } finally {
 | 
				
			||||||
 | 
					      _setLoading(false);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Delete formb
 | 
				
			||||||
 | 
					  Future<bool> deleteEntity(int id) async {
 | 
				
			||||||
 | 
					    _setLoading(true);
 | 
				
			||||||
 | 
					    _setError('');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      final response = await repo.deleteEntity(id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (response.status == Status.SUCCESS) {
 | 
				
			||||||
 | 
					        ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					          message: 'Formb deleted successfully',
 | 
				
			||||||
 | 
					          toastType: ToastType.success,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Remove the item from the list
 | 
				
			||||||
 | 
					        _formbList.removeWhere((item) => item['id'] == id);
 | 
				
			||||||
 | 
					        _filteredList = List.from(_formbList);
 | 
				
			||||||
 | 
					        notifyListeners();
 | 
				
			||||||
 | 
					        return true;
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        _setError(response.message ?? 'Failed to delete Formb');
 | 
				
			||||||
 | 
					        ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					          message: response.message ?? 'Failed to delete Formb',
 | 
				
			||||||
 | 
					          toastType: ToastType.error,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					        return false;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      _setError('Failed to delete formb: $e');
 | 
				
			||||||
 | 
					      ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					        message: 'Failed to delete Formb: $e',
 | 
				
			||||||
 | 
					        toastType: ToastType.error,
 | 
				
			||||||
 | 
					      );
 | 
				
			||||||
 | 
					      return false;
 | 
				
			||||||
 | 
					    } finally {
 | 
				
			||||||
 | 
					      _setLoading(false);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Search formb
 | 
				
			||||||
 | 
					  void searchformb(String query) {
 | 
				
			||||||
 | 
					    _searchQuery = query;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (query.isEmpty) {
 | 
				
			||||||
 | 
					      _filteredList = List.from(_formbList);
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      _filteredList = _formbList.where((item) {
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					             
 | 
				
			||||||
 | 
					(item['namem']?.toString().toLowerCase().contains(query.toLowerCase()) ??false) ||
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					             
 | 
				
			||||||
 | 
					(item['survey_formbs']?.toString().toLowerCase().contains(query.toLowerCase()) ??false) ||
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					             
 | 
				
			||||||
 | 
					(item['datagrid_fieldss']?.toString().toLowerCase().contains(query.toLowerCase()) ??false) 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					;
 | 
				
			||||||
 | 
					      }).toList();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    notifyListeners();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Clear search
 | 
				
			||||||
 | 
					  void clearSearch() {
 | 
				
			||||||
 | 
					    _searchQuery = '';
 | 
				
			||||||
 | 
					    _filteredList = List.from(_formbList);
 | 
				
			||||||
 | 
					    notifyListeners();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Refresh data
 | 
				
			||||||
 | 
					  Future<void> refreshData() async {
 | 
				
			||||||
 | 
					    await getAllWithPagination(refresh: true);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  late List<Map<String, dynamic>> datagrid_fieldssdataFuture =
 | 
				
			||||||
 | 
					      []; // Data from fetchData
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 Future<List<Map<String, dynamic>>>   getdatagrid_fieldssGrid() async {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      try {
 | 
				
			||||||
 | 
					     final value = await repo.getdatagrid_fieldssGrid();
 | 
				
			||||||
 | 
					        datagrid_fieldssdataFuture =  (value as List)
 | 
				
			||||||
 | 
					            .map((item) => item as Map<String, dynamic>)
 | 
				
			||||||
 | 
					            .toList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   return datagrid_fieldssdataFuture;
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      throw Exception('Failed to get all: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 Future<Map<String, dynamic>> insertformb(Map<String, dynamic> entity) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      print("Entity is  $entity");
 | 
				
			||||||
 | 
					      final responseData =
 | 
				
			||||||
 | 
					          await repo.insertformb(entity) as Map<String, dynamic>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      print(entity);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      return responseData;
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      throw Exception('Failed to Insert formb: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,84 @@
 | 
				
			|||||||
 | 
					import 'dart:typed_data';
 | 
				
			||||||
 | 
					import 'package:dio/dio.dart';
 | 
				
			||||||
 | 
					import 'package:http_parser/http_parser.dart';
 | 
				
			||||||
 | 
					import '../../../../resources/api_constants.dart';
 | 
				
			||||||
 | 
					import '../../../../data/network/base_network_service.dart';
 | 
				
			||||||
 | 
					import '../../../../data/network/network_api_service.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class TestlistApiService {
 | 
				
			||||||
 | 
					  final String baseUrl = ApiConstants.baseUrl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      final BaseNetworkService _helper = NetworkApiService();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   Future<List<Map<String, dynamic>>> getEntities() async {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      final response = await _helper.getGetApiResponse('$baseUrl/Testlist/Testlist');
 | 
				
			||||||
 | 
					      final entities = (response as List).cast<Map<String, dynamic>>();
 | 
				
			||||||
 | 
					      return entities;
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      throw Exception('Failed to get all entities: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					Future<List<Map<String, dynamic>>> getAllWithPagination(
 | 
				
			||||||
 | 
					       int page, int size) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					            final response =
 | 
				
			||||||
 | 
					          await _helper.getGetApiResponse('$baseUrl/Testlist/Testlist/getall/page?page=$page&size=$size');
 | 
				
			||||||
 | 
					      final entities =
 | 
				
			||||||
 | 
					          (response['content'] as List).cast<Map<String, dynamic>>();
 | 
				
			||||||
 | 
					      return entities;
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      throw Exception('Failed to get all without pagination: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  Future<Map<String, dynamic>> createEntity(
 | 
				
			||||||
 | 
					       Map<String, dynamic> entity) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					            print("in post api$entity");
 | 
				
			||||||
 | 
					      final response =
 | 
				
			||||||
 | 
					          await _helper.getPostApiResponse('$baseUrl/Testlist/Testlist', entity);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      print(entity);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      // Assuming the response is a Map<String, dynamic>
 | 
				
			||||||
 | 
					      Map<String, dynamic> responseData = response;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      return responseData;
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      throw Exception('Failed to create entity: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<void> updateEntity( int entityId, Map<String, dynamic> entity) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					     await _helper.getPutApiResponse('$baseUrl/Testlist/Testlist/$entityId',
 | 
				
			||||||
 | 
					      entity);                print(entity);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      throw Exception('Failed to update entity: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<void> deleteEntity( int entityId) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					 await _helper.getDeleteApiResponse('$baseUrl/Testlist/Testlist/$entityId');
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      throw Exception('Failed to delete entity: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,82 @@
 | 
				
			|||||||
 | 
					// ignore_for_file: use_build_context_synchronously
 | 
				
			||||||
 | 
					import 'dart:convert';
 | 
				
			||||||
 | 
					import 'package:flutter/material.dart';
 | 
				
			||||||
 | 
					import 'package:file_picker/file_picker.dart';
 | 
				
			||||||
 | 
					import 'package:image_picker/image_picker.dart';
 | 
				
			||||||
 | 
					import 'package:provider/provider.dart';
 | 
				
			||||||
 | 
					import '../Testlist_viewModel/Testlist_view_model_screen.dart';
 | 
				
			||||||
 | 
					import 'Testlist_fields.dart';import 'package:base_project/BuilderField/shared/ui/entity_screens.dart';
 | 
				
			||||||
 | 
					import '../../../../utils/image_constant.dart';
 | 
				
			||||||
 | 
					import '../../../../utils/size_utils.dart';
 | 
				
			||||||
 | 
					import '../../../../theme/app_style.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/appbar_image.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/appbar_title.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/custom_app_bar.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/custom_button.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/custom_text_form_field.dart'; 
 | 
				
			||||||
 | 
					import '../../../../widgets/custom_dropdown_field.dart';
 | 
				
			||||||
 | 
					import 'dart:math';
 | 
				
			||||||
 | 
					import 'package:qr_flutter/qr_flutter.dart';
 | 
				
			||||||
 | 
					import 'package:barcode_widget/barcode_widget.dart';
 | 
				
			||||||
 | 
					import 'package:intl/intl.dart';
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					import 'package:autocomplete_textfield/autocomplete_textfield.dart';
 | 
				
			||||||
 | 
					import 'package:http/http.dart' as http;
 | 
				
			||||||
 | 
					import 'package:flutter/services.dart';
 | 
				
			||||||
 | 
					import 'package:image_picker/image_picker.dart';
 | 
				
			||||||
 | 
					import 'package:fluttertoast/fluttertoast.dart';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_date_picker_field.dart';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_date_time_picker_field.dart'
 | 
				
			||||||
 | 
					;import 'package:multi_select_flutter/multi_select_flutter.dart';
 | 
				
			||||||
 | 
					import 'package:just_audio/just_audio.dart';
 | 
				
			||||||
 | 
					import 'package:video_player/video_player.dart';
 | 
				
			||||||
 | 
					import 'package:google_fonts/google_fonts.dart';
 | 
				
			||||||
 | 
					import 'package:lottie/lottie.dart';
 | 
				
			||||||
 | 
					import '../../../../utils/toast_messages/toast_message_util.dart';
 | 
				
			||||||
 | 
					import 'dart:io';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_text_field.dart';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_dropdown_field.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class TestlistCreateEntityScreen extends StatefulWidget {
 | 
				
			||||||
 | 
					  const TestlistCreateEntityScreen({super.key});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @override
 | 
				
			||||||
 | 
					  _TestlistCreateEntityScreenState createState() => _TestlistCreateEntityScreenState();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class _TestlistCreateEntityScreenState extends State<TestlistCreateEntityScreen> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					final Map<String, dynamic> formData = {};
 | 
				
			||||||
 | 
					  final _formKey = GlobalKey<FormState>();
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  @override
 | 
				
			||||||
 | 
					  Widget build(BuildContext context) {
 | 
				
			||||||
 | 
					    return Consumer<TestlistViewModelScreen>(
 | 
				
			||||||
 | 
					      builder: (context, viewModel, child) {
 | 
				
			||||||
 | 
					        return EntityCreateScreen(
 | 
				
			||||||
 | 
					          fields: TestlistFields.getFields(context),
 | 
				
			||||||
 | 
					          onSubmit: (data) => _handleSubmit(data),
 | 
				
			||||||
 | 
					          title: 'Testlist',
 | 
				
			||||||
 | 
					          isLoading: viewModel.isLoading,
 | 
				
			||||||
 | 
					          errorMessage:
 | 
				
			||||||
 | 
					              viewModel.errorMessage.isNotEmpty ? viewModel.errorMessage : null,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<void> _handleSubmit(Map<String, dynamic> formData) async {
 | 
				
			||||||
 | 
					    final provider =
 | 
				
			||||||
 | 
					        Provider.of<TestlistViewModelScreen>(context, listen: false);
 | 
				
			||||||
 | 
					    final success = await provider.createEntity(formData);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (success && mounted) {
 | 
				
			||||||
 | 
					      Navigator.pop(context);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,90 @@
 | 
				
			|||||||
 | 
					// ignore_for_file: use_build_context_synchronously
 | 
				
			||||||
 | 
					import 'package:flutter/material.dart';
 | 
				
			||||||
 | 
					import 'package:provider/provider.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/ui/entity_details.dart';
 | 
				
			||||||
 | 
					import '../Testlist_viewModel/Testlist_view_model_screen.dart';
 | 
				
			||||||
 | 
					import 'Testlist_update_entity_screen.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class TestlistDetailsScreen extends StatefulWidget {
 | 
				
			||||||
 | 
					  final Map<String, dynamic> entity;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const TestlistDetailsScreen({
 | 
				
			||||||
 | 
					    super.key,
 | 
				
			||||||
 | 
					    required this.entity,
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @override
 | 
				
			||||||
 | 
					  State<TestlistDetailsScreen> createState() => _TestlistDetailsScreenState();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class _TestlistDetailsScreenState extends State<TestlistDetailsScreen> {
 | 
				
			||||||
 | 
					  void _navigateToUpdateScreen(Map<String, dynamic> entity) {
 | 
				
			||||||
 | 
					    Navigator.push(
 | 
				
			||||||
 | 
					      context,
 | 
				
			||||||
 | 
					      MaterialPageRoute(
 | 
				
			||||||
 | 
					        builder: (context) => ChangeNotifierProvider(
 | 
				
			||||||
 | 
					          create: (context) => TestlistViewModelScreen(),
 | 
				
			||||||
 | 
					          child: TestlistUpdateEntityScreen(entity: entity),
 | 
				
			||||||
 | 
					        ),
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					    ).then((_) {
 | 
				
			||||||
 | 
					      // Refresh the details screen with updated data
 | 
				
			||||||
 | 
					      setState(() {});
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void _showDeleteDialog(Map<String, dynamic> entity) {
 | 
				
			||||||
 | 
					    showDialog(
 | 
				
			||||||
 | 
					      context: context,
 | 
				
			||||||
 | 
					      builder: (BuildContext context) {
 | 
				
			||||||
 | 
					        return AlertDialog(
 | 
				
			||||||
 | 
					          title: const Text('Confirm Deletion'),
 | 
				
			||||||
 | 
					          content: const Text('Are you sure you want to delete this Testlist?'),
 | 
				
			||||||
 | 
					          actions: [
 | 
				
			||||||
 | 
					            TextButton(
 | 
				
			||||||
 | 
					              child: const Text('Cancel'),
 | 
				
			||||||
 | 
					              onPressed: () {
 | 
				
			||||||
 | 
					                Navigator.of(context).pop();
 | 
				
			||||||
 | 
					              },
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
 | 
					            TextButton(
 | 
				
			||||||
 | 
					              child: const Text('Delete'),
 | 
				
			||||||
 | 
					              onPressed: () async {
 | 
				
			||||||
 | 
					                Navigator.of(context).pop();
 | 
				
			||||||
 | 
					                final vm =
 | 
				
			||||||
 | 
					                    Provider.of<TestlistViewModelScreen>(context, listen: false);
 | 
				
			||||||
 | 
					                final success = await vm.deleteEntity(entity['id']);
 | 
				
			||||||
 | 
					                if (success && mounted) {
 | 
				
			||||||
 | 
					                  Navigator.pop(context); // Go back to list
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					              },
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
 | 
					          ],
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @override
 | 
				
			||||||
 | 
					  Widget build(BuildContext context) {
 | 
				
			||||||
 | 
					    return Consumer<TestlistViewModelScreen>(
 | 
				
			||||||
 | 
					      builder: (context, viewModel, child) {
 | 
				
			||||||
 | 
					        return EntityDetails(
 | 
				
			||||||
 | 
					          entity: widget.entity,
 | 
				
			||||||
 | 
					          onEdit: (entity) => _navigateToUpdateScreen(entity),
 | 
				
			||||||
 | 
					          onDelete: (entity) => _showDeleteDialog(entity),
 | 
				
			||||||
 | 
					          title: 'Testlist',
 | 
				
			||||||
 | 
					          displayFields: [
 | 
				
			||||||
 | 
					  {'key': 'name', 'label': 'Name', 'type': 'text'},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  {'key': 'description', 'label': 'Description', 'type': 'textarea'},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  {'key': 'active', 'label': 'Active', 'type': 'toggle_switch'},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          ],
 | 
				
			||||||
 | 
					          isLoading: viewModel.isLoading,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,149 @@
 | 
				
			|||||||
 | 
					// ignore_for_file: use_build_context_synchronously
 | 
				
			||||||
 | 
					import 'package:flutter/material.dart';
 | 
				
			||||||
 | 
					import 'package:intl/intl.dart';
 | 
				
			||||||
 | 
					import 'package:base_project/BuilderField/shared/ui/entity_list.dart';
 | 
				
			||||||
 | 
					import 'Testlist_create_entity_screen.dart';
 | 
				
			||||||
 | 
					import 'Testlist_update_entity_screen.dart';
 | 
				
			||||||
 | 
					import '../Testlist_viewModel/Testlist_view_model_screen.dart';
 | 
				
			||||||
 | 
					import 'Testlist_details_screen.dart';import 'package:flutter/services.dart';
 | 
				
			||||||
 | 
					import 'package:speech_to_text/speech_to_text.dart' as stt;
 | 
				
			||||||
 | 
					import '../../../../theme/app_style.dart';
 | 
				
			||||||
 | 
					import '../../../../utils/size_utils.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/custom_icon_button.dart';
 | 
				
			||||||
 | 
					import '../../../../utils/image_constant.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/appbar_image.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/appbar_title.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/custom_app_bar.dart';
 | 
				
			||||||
 | 
					import '../../../../theme/app_decoration.dart';
 | 
				
			||||||
 | 
					import 'package:multi_select_flutter/multi_select_flutter.dart';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_text_field.dart';
 | 
				
			||||||
 | 
					import 'package:provider/provider.dart';
 | 
				
			||||||
 | 
					import '../../../../utils/toast_messages/toast_message_util.dart';
 | 
				
			||||||
 | 
					import 'package:fluttertoast/fluttertoast.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class Testlist_entity_list_screen extends StatefulWidget {
 | 
				
			||||||
 | 
					  static const String routeName = '/entity-list';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @override
 | 
				
			||||||
 | 
					  _Testlist_entity_list_screenState createState() => _Testlist_entity_list_screenState();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class _Testlist_entity_list_screenState extends State<Testlist_entity_list_screen> {
 | 
				
			||||||
 | 
					  @override
 | 
				
			||||||
 | 
					  void initState() {
 | 
				
			||||||
 | 
					    super.initState();
 | 
				
			||||||
 | 
					    _loadData();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void _loadData() {
 | 
				
			||||||
 | 
					    WidgetsBinding.instance.addPostFrameCallback((_) {
 | 
				
			||||||
 | 
					      if (mounted) {
 | 
				
			||||||
 | 
					        final vm = Provider.of<TestlistViewModelScreen>(context, listen: false);
 | 
				
			||||||
 | 
					        vm.getAllWithPagination(refresh: true);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void _navigateToCreateScreen() {
 | 
				
			||||||
 | 
					    Navigator.push(
 | 
				
			||||||
 | 
					      context,
 | 
				
			||||||
 | 
					      MaterialPageRoute(
 | 
				
			||||||
 | 
					        builder: (context) => ChangeNotifierProvider(
 | 
				
			||||||
 | 
					          create: (context) => TestlistViewModelScreen(),
 | 
				
			||||||
 | 
					          child: const TestlistCreateEntityScreen(),
 | 
				
			||||||
 | 
					        ),
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					    ).then((_) {
 | 
				
			||||||
 | 
					      final vm = Provider.of<TestlistViewModelScreen>(context, listen: false);
 | 
				
			||||||
 | 
					      vm.refreshData();
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void _navigateToUpdateScreen(Map<String, dynamic> entity) {
 | 
				
			||||||
 | 
					    Navigator.push(
 | 
				
			||||||
 | 
					      context,
 | 
				
			||||||
 | 
					      MaterialPageRoute(
 | 
				
			||||||
 | 
					        builder: (context) => ChangeNotifierProvider(
 | 
				
			||||||
 | 
					          create: (context) => TestlistViewModelScreen(),
 | 
				
			||||||
 | 
					          child: TestlistUpdateEntityScreen(entity: entity),
 | 
				
			||||||
 | 
					        ),
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					    ).then((_) {
 | 
				
			||||||
 | 
					      final vm = Provider.of<TestlistViewModelScreen>(context, listen: false);
 | 
				
			||||||
 | 
					      vm.refreshData();
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void _navigateToDetailsScreen(Map<String, dynamic> entity) {
 | 
				
			||||||
 | 
					    Navigator.push(
 | 
				
			||||||
 | 
					      context,
 | 
				
			||||||
 | 
					      MaterialPageRoute(
 | 
				
			||||||
 | 
					        builder: (context) => ChangeNotifierProvider(
 | 
				
			||||||
 | 
					          create: (context) => TestlistViewModelScreen(),
 | 
				
			||||||
 | 
					          child: TestlistDetailsScreen(entity: entity),
 | 
				
			||||||
 | 
					        ),
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void _showDeleteDialog(Map<String, dynamic> entity) {
 | 
				
			||||||
 | 
					    showDialog(
 | 
				
			||||||
 | 
					      context: context,
 | 
				
			||||||
 | 
					      builder: (BuildContext context) {
 | 
				
			||||||
 | 
					        return AlertDialog(
 | 
				
			||||||
 | 
					          title: const Text('Confirm Deletion'),
 | 
				
			||||||
 | 
					          content: const Text('Are you sure you want to delete this Testlist?'),
 | 
				
			||||||
 | 
					          actions: [
 | 
				
			||||||
 | 
					            TextButton(
 | 
				
			||||||
 | 
					              child: const Text('Cancel'),
 | 
				
			||||||
 | 
					              onPressed: () {
 | 
				
			||||||
 | 
					                Navigator.of(context).pop();
 | 
				
			||||||
 | 
					              },
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
 | 
					            TextButton(
 | 
				
			||||||
 | 
					              child: const Text('Delete'),
 | 
				
			||||||
 | 
					              onPressed: () async {
 | 
				
			||||||
 | 
					                Navigator.of(context).pop();
 | 
				
			||||||
 | 
					                final vm =
 | 
				
			||||||
 | 
					                    Provider.of<TestlistViewModelScreen>(context, listen: false);
 | 
				
			||||||
 | 
					                await vm.deleteEntity(entity['id']);
 | 
				
			||||||
 | 
					              },
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
 | 
					          ],
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @override
 | 
				
			||||||
 | 
					  Widget build(BuildContext context) {
 | 
				
			||||||
 | 
					    return Consumer<TestlistViewModelScreen>(
 | 
				
			||||||
 | 
					      builder: (context, viewModel, child) {
 | 
				
			||||||
 | 
					        return EntityList(
 | 
				
			||||||
 | 
					          entities: viewModel.filteredList,
 | 
				
			||||||
 | 
					          isLoading: viewModel.isLoading,
 | 
				
			||||||
 | 
					          errorMessage:
 | 
				
			||||||
 | 
					              viewModel.errorMessage.isNotEmpty ? viewModel.errorMessage : null,
 | 
				
			||||||
 | 
					          hasMoreData: viewModel.hasMoreData,
 | 
				
			||||||
 | 
					          searchQuery: viewModel.searchQuery,
 | 
				
			||||||
 | 
					          onSearchChanged: (query) => viewModel.searchtestlist(query),
 | 
				
			||||||
 | 
					          onEdit: (entity) => _navigateToUpdateScreen(entity),
 | 
				
			||||||
 | 
					          onDelete: (entity) => _showDeleteDialog(entity),
 | 
				
			||||||
 | 
					          onTap: (entity) => _navigateToDetailsScreen(entity),
 | 
				
			||||||
 | 
					          onRefresh: () => viewModel.refreshData(),
 | 
				
			||||||
 | 
					          onLoadMore: () => viewModel.getAllWithPagination(),
 | 
				
			||||||
 | 
					          title: 'Testlist',
 | 
				
			||||||
 | 
					          onAddNew: _navigateToCreateScreen,
 | 
				
			||||||
 | 
					          displayFields: [
 | 
				
			||||||
 | 
					  {'key': 'name', 'label': 'Name', 'type': 'text'},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  {'key': 'description', 'label': 'Description', 'type': 'textarea'},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  {'key': 'active', 'label': 'Active', 'type': 'toggle_switch'},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          ],
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,70 @@
 | 
				
			|||||||
 | 
					import 'package:base_project/BuilderField/shared/fields/number_field.dart';
 | 
				
			||||||
 | 
					import 'package:base_project/BuilderField/shared/fields/password_field.dart';
 | 
				
			||||||
 | 
					import 'package:base_project/BuilderField/shared/fields/phone_field.dart';
 | 
				
			||||||
 | 
					import 'package:base_project/BuilderField/shared/fields/custom_text_field.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/base_field.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/date_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/datetime_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/email_field.dart';
 | 
				
			||||||
 | 
					import 'package:base_project/BuilderField/shared/fields/url_field.dart';
 | 
				
			||||||
 | 
					import 'package:flutter/material.dart';
 | 
				
			||||||
 | 
					import 'package:provider/provider.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/custom_text_field.dart' as shared_text;
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/one_to_one_relation_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/calculated_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/one_to_many_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/value_list_picker_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/captcha_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/switch_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/url_field.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/audio_upload_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/checkbox_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/file_upload_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/image_upload_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/radio_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/video_upload_field.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/autocomplete_dropdown_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/autocomplete_multiselect_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/one_to_one_relation_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/data_grid_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/dropdown_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/dynamic_dropdown_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/dynamic_multiselect_dropdown_field.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/fields/static_multiselect_field.dart';import '../Testlist_viewModel/Testlist_view_model_screen.dart';/// Field definitions for Testlist entity
 | 
				
			||||||
 | 
					/// This defines the structure and validation for Testlist forms
 | 
				
			||||||
 | 
					class TestlistFields {
 | 
				
			||||||
 | 
					  /// Get field definitions for Testlist entity
 | 
				
			||||||
 | 
					  static List<BaseField> getFields(BuildContext context) {
 | 
				
			||||||
 | 
					    final viewModel =
 | 
				
			||||||
 | 
					        Provider.of<TestlistViewModelScreen>(context, listen: false);
 | 
				
			||||||
 | 
					    return [
 | 
				
			||||||
 | 
					      // Basic Information
 | 
				
			||||||
 | 
					 CustomTextField(
 | 
				
			||||||
 | 
					        fieldKey: 'name',
 | 
				
			||||||
 | 
					        label: 'Name',
 | 
				
			||||||
 | 
					        hint: 'Enter Name',
 | 
				
			||||||
 | 
					        isRequired: true,
 | 
				
			||||||
 | 
					        maxLength: 50,
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CustomTextField(
 | 
				
			||||||
 | 
					        fieldKey: 'description',
 | 
				
			||||||
 | 
					        label: 'Description',
 | 
				
			||||||
 | 
					        hint: 'Enter Description',
 | 
				
			||||||
 | 
					        isRequired: false,
 | 
				
			||||||
 | 
					        maxLength: 1000,
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 SwitchField(
 | 
				
			||||||
 | 
					        fieldKey: 'active',
 | 
				
			||||||
 | 
					        label: 'Active',
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ];
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,77 @@
 | 
				
			|||||||
 | 
					// ignore_for_file: use_build_context_synchronously
 | 
				
			||||||
 | 
					import 'dart:convert';
 | 
				
			||||||
 | 
					import 'package:provider/provider.dart';
 | 
				
			||||||
 | 
					import '../Testlist_viewModel/Testlist_view_model_screen.dart';
 | 
				
			||||||
 | 
					import 'package:base_project/BuilderField/shared/ui/entity_screens.dart';
 | 
				
			||||||
 | 
					import 'Testlist_fields.dart';import '../../../../utils/image_constant.dart';
 | 
				
			||||||
 | 
					import '../../../../utils/size_utils.dart';
 | 
				
			||||||
 | 
					import '../../../../theme/app_style.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/appbar_image.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/appbar_title.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/app_bar/custom_app_bar.dart';
 | 
				
			||||||
 | 
					import 'package:barcode_widget/barcode_widget.dart';
 | 
				
			||||||
 | 
					import 'package:fluttertoast/fluttertoast.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/custom_button.dart';
 | 
				
			||||||
 | 
					import '../../../../widgets/custom_text_form_field.dart';
 | 
				
			||||||
 | 
					import 'package:flutter/material.dart';
 | 
				
			||||||
 | 
					import 'package:autocomplete_textfield/autocomplete_textfield.dart';
 | 
				
			||||||
 | 
					import 'package:qr_flutter/qr_flutter.dart';
 | 
				
			||||||
 | 
					import 'package:intl/intl.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import 'dart:math';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_text_field.dart';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_date_picker_field.dart';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_date_time_picker_field.dart';
 | 
				
			||||||
 | 
					import '../../../../Reuseable/reusable_dropdown_field.dart';
 | 
				
			||||||
 | 
					import 'package:flutter/services.dart';
 | 
				
			||||||
 | 
					class TestlistUpdateEntityScreen extends StatefulWidget {
 | 
				
			||||||
 | 
					    final Map<String, dynamic> entity;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  TestlistUpdateEntityScreen({required this.entity});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @override
 | 
				
			||||||
 | 
					  _TestlistUpdateEntityScreenState createState() => _TestlistUpdateEntityScreenState();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class _TestlistUpdateEntityScreenState extends State<TestlistUpdateEntityScreen> {
 | 
				
			||||||
 | 
					  final _formKey = GlobalKey<FormState>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@override
 | 
				
			||||||
 | 
					  Widget build(BuildContext context) {
 | 
				
			||||||
 | 
					    return Consumer<TestlistViewModelScreen>(
 | 
				
			||||||
 | 
					      builder: (context, viewModel, child) {
 | 
				
			||||||
 | 
					// Start with all fields, then remove upload fields (generic filter by keys)
 | 
				
			||||||
 | 
					        final Set<String> hiddenKeys = { 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 };
 | 
				
			||||||
 | 
					        final fields = TestlistFields.getFields(context)
 | 
				
			||||||
 | 
					            .where((f) => !hiddenKeys.contains(f.fieldKey))
 | 
				
			||||||
 | 
					            .toList();        return EntityUpdateScreen(
 | 
				
			||||||
 | 
					          fields: fields,
 | 
				
			||||||
 | 
					          initialData: widget.entity,
 | 
				
			||||||
 | 
					          onSubmit: (data) => _handleSubmit(data),
 | 
				
			||||||
 | 
					          title: 'Testlist',
 | 
				
			||||||
 | 
					          isLoading: viewModel.isLoading,
 | 
				
			||||||
 | 
					          errorMessage:
 | 
				
			||||||
 | 
					              viewModel.errorMessage.isNotEmpty ? viewModel.errorMessage : null,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<void> _handleSubmit(Map<String, dynamic> formData) async {
 | 
				
			||||||
 | 
					    final provider =
 | 
				
			||||||
 | 
					        Provider.of<TestlistViewModelScreen>(context, listen: false);
 | 
				
			||||||
 | 
					    final success = await provider.updateEntity(widget.entity['id'], formData);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (success && mounted) {
 | 
				
			||||||
 | 
					      Navigator.pop(context);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,78 @@
 | 
				
			|||||||
 | 
					import 'package:dio/dio.dart';
 | 
				
			||||||
 | 
					import '../../../../data/network/base_network_service.dart';
 | 
				
			||||||
 | 
					import '../../../../data/network/network_api_service.dart';
 | 
				
			||||||
 | 
					import '../../../../resources/api_constants.dart';
 | 
				
			||||||
 | 
					import 'package:base_project/data/response/api_response.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class TestlistRepoScreen {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  final String baseUrl = ApiConstants.baseUrl;
 | 
				
			||||||
 | 
					  final BaseNetworkService _helper = NetworkApiService();
 | 
				
			||||||
 | 
					  final String _endpointPath = '/Testlist/Testlist';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<ApiResponse<List<Map<String, dynamic>>>> getEntities() async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      final response =
 | 
				
			||||||
 | 
					          await _helper.getGetApiResponse('$baseUrl$_endpointPath');
 | 
				
			||||||
 | 
					      return ApiResponse.success(response as List<Map<String, dynamic>>);
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      return ApiResponse.error('Failed to get all entities: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<ApiResponse<List<Map<String, dynamic>>>> getAllWithPagination(
 | 
				
			||||||
 | 
					      int page, int size) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      final response = await _helper.getGetApiResponse(
 | 
				
			||||||
 | 
					          '$baseUrl$_endpointPath/getall/page?page=$page&size=$size');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (response is Map<String, dynamic> && response['content'] is List) {
 | 
				
			||||||
 | 
					        final List<Map<String, dynamic>> entities =
 | 
				
			||||||
 | 
					            (response['content'] as List).cast<Map<String, dynamic>>().toList();
 | 
				
			||||||
 | 
					        return ApiResponse.success(entities);
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        return ApiResponse.error('Invalid response format');
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      return ApiResponse.error('Failed to get all without pagination: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<ApiResponse<Map<String, dynamic>>> createEntity(
 | 
				
			||||||
 | 
					      Map<String, dynamic> entity) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      print("in post api$entity");
 | 
				
			||||||
 | 
					      final response =
 | 
				
			||||||
 | 
					          await _helper.getPostApiResponse('$baseUrl$_endpointPath', entity);
 | 
				
			||||||
 | 
					      return ApiResponse.success(response as Map<String, dynamic>);
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      return ApiResponse.error('Failed to create entity: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<ApiResponse<Map<String, dynamic>>> updateEntity(
 | 
				
			||||||
 | 
					      int entityId, Map<String, dynamic> entity) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      final response = await _helper.getPutApiResponse(
 | 
				
			||||||
 | 
					          '$baseUrl$_endpointPath/$entityId', entity);
 | 
				
			||||||
 | 
					      return ApiResponse.success(response as Map<String, dynamic>);
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      return ApiResponse.error('Failed to update entity: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Future<ApiResponse<void>> deleteEntity(int entityId) async {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      await _helper.getDeleteApiResponse('$baseUrl$_endpointPath/$entityId');
 | 
				
			||||||
 | 
					      return ApiResponse.success(null);
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      return ApiResponse.error('Failed to delete entity: $e');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,305 @@
 | 
				
			|||||||
 | 
					import 'package:base_project/data/response/status.dart';
 | 
				
			||||||
 | 
					import 'dart:typed_data';
 | 
				
			||||||
 | 
					import 'package:dio/dio.dart';
 | 
				
			||||||
 | 
					import 'package:http_parser/http_parser.dart';
 | 
				
			||||||
 | 
					import '../../../../utils/toast_messages/toast_message_util.dart';
 | 
				
			||||||
 | 
					import '../../../../BuilderField/shared/utils/entity_field_store.dart';
 | 
				
			||||||
 | 
					import 'package:flutter/material.dart';
 | 
				
			||||||
 | 
					import '../Testlist_Repo/Testlist_repo_screen.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class TestlistViewModelScreen extends ChangeNotifier{
 | 
				
			||||||
 | 
					  final TestlistRepoScreen repo = TestlistRepoScreen();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					  // State variables
 | 
				
			||||||
 | 
					  List<Map<String, dynamic>> _testlistList = [];
 | 
				
			||||||
 | 
					  List<Map<String, dynamic>> _filteredList = [];
 | 
				
			||||||
 | 
					  bool _isLoading = false;
 | 
				
			||||||
 | 
					  String _errorMessage = '';
 | 
				
			||||||
 | 
					  int _currentPage = 0;
 | 
				
			||||||
 | 
					  int _pageSize = 10;
 | 
				
			||||||
 | 
					  bool _hasMoreData = true;
 | 
				
			||||||
 | 
					  String _searchQuery = '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Getters
 | 
				
			||||||
 | 
					  List<Map<String, dynamic>> get testlistList => _testlistList;
 | 
				
			||||||
 | 
					  List<Map<String, dynamic>> get filteredList => _filteredList;
 | 
				
			||||||
 | 
					  bool get isLoading => _isLoading;
 | 
				
			||||||
 | 
					  String get errorMessage => _errorMessage;
 | 
				
			||||||
 | 
					  bool get hasMoreData => _hasMoreData;
 | 
				
			||||||
 | 
					  String get searchQuery => _searchQuery;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Set loading state
 | 
				
			||||||
 | 
					  void _setLoading(bool loading) {
 | 
				
			||||||
 | 
					    _isLoading = loading;
 | 
				
			||||||
 | 
					    notifyListeners();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Set error message
 | 
				
			||||||
 | 
					  void _setError(String error) {
 | 
				
			||||||
 | 
					    _errorMessage = error;
 | 
				
			||||||
 | 
					    notifyListeners();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Clear error
 | 
				
			||||||
 | 
					  void clearError() {
 | 
				
			||||||
 | 
					    _errorMessage = '';
 | 
				
			||||||
 | 
					    notifyListeners();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Get testlist list
 | 
				
			||||||
 | 
					  Future<void> getEntities() async {
 | 
				
			||||||
 | 
					    _setLoading(true);
 | 
				
			||||||
 | 
					    _setError('');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      final response = await repo.getEntities();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (response.status == Status.SUCCESS) {
 | 
				
			||||||
 | 
					        _testlistList = response.data ?? [];
 | 
				
			||||||
 | 
					        _filteredList = List.from(_testlistList);
 | 
				
			||||||
 | 
					        _currentPage = 0;
 | 
				
			||||||
 | 
					        _hasMoreData = true;
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        _setError(response.message ?? 'Failed to fetch testlist list');
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      _setError('Failed to fetch testlist list: $e');
 | 
				
			||||||
 | 
					    } finally {
 | 
				
			||||||
 | 
					      _setLoading(false);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Get testlist list with pagination
 | 
				
			||||||
 | 
					  Future<void> getAllWithPagination({bool refresh = false}) async {
 | 
				
			||||||
 | 
					    if (refresh) {
 | 
				
			||||||
 | 
					      _currentPage = 0;
 | 
				
			||||||
 | 
					      _testlistList.clear();
 | 
				
			||||||
 | 
					      _filteredList.clear();
 | 
				
			||||||
 | 
					      _hasMoreData = true;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!_hasMoreData || _isLoading) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    _setLoading(true);
 | 
				
			||||||
 | 
					    _setError('');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      final response = await repo.getAllWithPagination(_currentPage, _pageSize);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (response.status == Status.SUCCESS) {
 | 
				
			||||||
 | 
					        final newItems = response.data ?? [];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (refresh) {
 | 
				
			||||||
 | 
					          _testlistList = newItems;
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					          _testlistList.addAll(newItems);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        _filteredList = List.from(_testlistList);
 | 
				
			||||||
 | 
					        _currentPage++;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Check if we have more data
 | 
				
			||||||
 | 
					        _hasMoreData = newItems.length == _pageSize;
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        _setError(response.message ?? 'Failed to fetch Testlist list');
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      _setError('Failed to fetch testlist list: $e');
 | 
				
			||||||
 | 
					    } finally {
 | 
				
			||||||
 | 
					      _setLoading(false);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Create Testlist
 | 
				
			||||||
 | 
					  Future<bool> createEntity(Map<String, dynamic> entity) async {
 | 
				
			||||||
 | 
					    _setLoading(true);
 | 
				
			||||||
 | 
					    _setError('');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      final response = await repo.createEntity(entity);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (response.status == Status.SUCCESS) {
 | 
				
			||||||
 | 
					// Get the response ID for image upload
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        final responseId = response.data!['id'].toString();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					          message: 'testlist created successfully',
 | 
				
			||||||
 | 
					          toastType: ToastType.success,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Refresh the list
 | 
				
			||||||
 | 
					        await getEntities();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return true;
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        _setError(response.message ?? 'Failed to create Testlist');
 | 
				
			||||||
 | 
					        ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					          message: response.message ?? 'Failed to create Testlist',
 | 
				
			||||||
 | 
					          toastType: ToastType.error,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					        return false;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      _setError('Failed to create testlist: $e');
 | 
				
			||||||
 | 
					      ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					        message: 'Failed to create Testlist: $e',
 | 
				
			||||||
 | 
					        toastType: ToastType.error,
 | 
				
			||||||
 | 
					      );
 | 
				
			||||||
 | 
					      return false;
 | 
				
			||||||
 | 
					    } finally {
 | 
				
			||||||
 | 
					      _setLoading(false);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Update testlist
 | 
				
			||||||
 | 
					  Future<bool> updateEntity(int id, Map<String, dynamic> entity) async {
 | 
				
			||||||
 | 
					    _setLoading(true);
 | 
				
			||||||
 | 
					    _setError('');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      final response = await repo.updateEntity(id, entity);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (response.status == Status.SUCCESS) {
 | 
				
			||||||
 | 
					        ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					          message: 'Testlist updated successfully',
 | 
				
			||||||
 | 
					          toastType: ToastType.success,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Update the item in the list
 | 
				
			||||||
 | 
					        final index = _testlistList.indexWhere((item) => item['id'] == id);
 | 
				
			||||||
 | 
					        if (index != -1) {
 | 
				
			||||||
 | 
					          _testlistList[index] = response.data!;
 | 
				
			||||||
 | 
					          _filteredList = List.from(_testlistList);
 | 
				
			||||||
 | 
					          notifyListeners();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        return true;
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        _setError(response.message ?? 'Failed to update Testlist');
 | 
				
			||||||
 | 
					        ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					          message: response.message ?? 'Failed to update Testlist',
 | 
				
			||||||
 | 
					          toastType: ToastType.error,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					        return false;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      _setError('Failed to update testlist: $e');
 | 
				
			||||||
 | 
					      ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					        message: 'Failed to update Testlist: $e',
 | 
				
			||||||
 | 
					        toastType: ToastType.error,
 | 
				
			||||||
 | 
					      );
 | 
				
			||||||
 | 
					      return false;
 | 
				
			||||||
 | 
					    } finally {
 | 
				
			||||||
 | 
					      _setLoading(false);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Delete testlist
 | 
				
			||||||
 | 
					  Future<bool> deleteEntity(int id) async {
 | 
				
			||||||
 | 
					    _setLoading(true);
 | 
				
			||||||
 | 
					    _setError('');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      final response = await repo.deleteEntity(id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (response.status == Status.SUCCESS) {
 | 
				
			||||||
 | 
					        ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					          message: 'Testlist deleted successfully',
 | 
				
			||||||
 | 
					          toastType: ToastType.success,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Remove the item from the list
 | 
				
			||||||
 | 
					        _testlistList.removeWhere((item) => item['id'] == id);
 | 
				
			||||||
 | 
					        _filteredList = List.from(_testlistList);
 | 
				
			||||||
 | 
					        notifyListeners();
 | 
				
			||||||
 | 
					        return true;
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        _setError(response.message ?? 'Failed to delete Testlist');
 | 
				
			||||||
 | 
					        ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					          message: response.message ?? 'Failed to delete Testlist',
 | 
				
			||||||
 | 
					          toastType: ToastType.error,
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					        return false;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					      _setError('Failed to delete testlist: $e');
 | 
				
			||||||
 | 
					      ToastMessageUtil.showToast(
 | 
				
			||||||
 | 
					        message: 'Failed to delete Testlist: $e',
 | 
				
			||||||
 | 
					        toastType: ToastType.error,
 | 
				
			||||||
 | 
					      );
 | 
				
			||||||
 | 
					      return false;
 | 
				
			||||||
 | 
					    } finally {
 | 
				
			||||||
 | 
					      _setLoading(false);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Search testlist
 | 
				
			||||||
 | 
					  void searchtestlist(String query) {
 | 
				
			||||||
 | 
					    _searchQuery = query;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (query.isEmpty) {
 | 
				
			||||||
 | 
					      _filteredList = List.from(_testlistList);
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      _filteredList = _testlistList.where((item) {
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					             
 | 
				
			||||||
 | 
					(item['name']?.toString().toLowerCase().contains(query.toLowerCase()) ??false) ||
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					             
 | 
				
			||||||
 | 
					(item['description']?.toString().toLowerCase().contains(query.toLowerCase()) ??false) ||
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(item['active']?.toString().toLowerCase().contains(query.toLowerCase()) ??false) 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					;
 | 
				
			||||||
 | 
					      }).toList();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    notifyListeners();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Clear search
 | 
				
			||||||
 | 
					  void clearSearch() {
 | 
				
			||||||
 | 
					    _searchQuery = '';
 | 
				
			||||||
 | 
					    _filteredList = List.from(_testlistList);
 | 
				
			||||||
 | 
					    notifyListeners();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Refresh data
 | 
				
			||||||
 | 
					  Future<void> refreshData() async {
 | 
				
			||||||
 | 
					    await getAllWithPagination(refresh: true);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -1,3 +1,9 @@
 | 
				
			|||||||
 | 
					import '../../Entity/basic1/Testlist/TestlistView/Testlist_entity_list_screen.dart';
 | 
				
			||||||
 | 
					import '../../Entity/basic1/Testlist/Testlist_viewModel/Testlist_view_model_screen.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import '../../Entity/basic1/Formb/FormbView/Formb_entity_list_screen.dart';
 | 
				
			||||||
 | 
					import '../../Entity/basic1/Formb/Formb_viewModel/Formb_view_model_screen.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import 'package:base_project/core/constants/ui_constants.dart';
 | 
					import 'package:base_project/core/constants/ui_constants.dart';
 | 
				
			||||||
import 'package:base_project/core/theme/color_scheme.dart';
 | 
					import 'package:base_project/core/theme/color_scheme.dart';
 | 
				
			||||||
import 'package:base_project/routes/route_names.dart';
 | 
					import 'package:base_project/routes/route_names.dart';
 | 
				
			||||||
@ -88,6 +94,40 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
 | 
				
			|||||||
// NEW ITEMS
 | 
					// NEW ITEMS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// NEW MENU
 | 
					// NEW MENU
 | 
				
			||||||
 | 
					 DrawerItem(
 | 
				
			||||||
 | 
					      icon: Icons.data_object,
 | 
				
			||||||
 | 
					      title: 'Testlist Management',
 | 
				
			||||||
 | 
					      subtitle: 'Manage Testlist entities',
 | 
				
			||||||
 | 
					      onTap: (context) {
 | 
				
			||||||
 | 
					        Navigator.push(
 | 
				
			||||||
 | 
					          context,
 | 
				
			||||||
 | 
					          MaterialPageRoute(
 | 
				
			||||||
 | 
					            builder: (context) => ChangeNotifierProvider(
 | 
				
			||||||
 | 
					              create: (context) => TestlistViewModelScreen(),
 | 
				
			||||||
 | 
					              child: Testlist_entity_list_screen(),
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
 | 
					          ),
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    ),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					DrawerItem(
 | 
				
			||||||
 | 
					icon: Icons.data_object,
 | 
				
			||||||
 | 
					title: 'Formb Management',
 | 
				
			||||||
 | 
					subtitle: 'Manage Formb entities',
 | 
				
			||||||
 | 
					onTap: (context) {
 | 
				
			||||||
 | 
					Navigator.push(
 | 
				
			||||||
 | 
					context,
 | 
				
			||||||
 | 
					MaterialPageRoute(
 | 
				
			||||||
 | 
					builder: (context) => ChangeNotifierProvider(
 | 
				
			||||||
 | 
					create: (context) => FormbViewModelScreen(),
 | 
				
			||||||
 | 
					child: Formb_entity_list_screen(),
 | 
				
			||||||
 | 
					),
 | 
				
			||||||
 | 
					),
 | 
				
			||||||
 | 
					);
 | 
				
			||||||
 | 
					},
 | 
				
			||||||
 | 
					),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@override
 | 
					@override
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										4
									
								
								test023ad-testddf-d/authsec_mysql/mysql/wf_table/wf_table.sql
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										4
									
								
								test023ad-testddf-d/authsec_mysql/mysql/wf_table/wf_table.sql
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,4 @@
 | 
				
			|||||||
 | 
					CREATE TABLE testddf.Formb(id BIGINT NOT NULL AUTO_INCREMENT, button_field_insert VARCHAR(400), namem VARCHAR(400), survey_formbs VARCHAR(400), value_list_fields VARCHAR(400), datagrid_fieldss VARCHAR(400),  PRIMARY KEY (id));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CREATE TABLE testddf.Testlist(id BIGINT NOT NULL AUTO_INCREMENT, active VARCHAR(400), description VARCHAR(400), name VARCHAR(400),  PRIMARY KEY (id));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user