build_app

This commit is contained in:
risadmin_prod 2025-06-30 12:22:59 +00:00
parent 80256f56d9
commit 8a49c7ed05
14 changed files with 35 additions and 646 deletions

View File

@ -75,6 +75,15 @@ addCustomMenu( "Child","Child", "Transcations");
addCustomMenu( "Testlist","Testlist", "Transcations"); addCustomMenu( "Testlist","Testlist", "Transcations");
addCustomMenu( "Testss","Testss", "Transcations");
addCustomMenu( "Child","Child", "Transcations");
addCustomMenu( "Testlist","Testlist", "Transcations");
addCustomMenu( "Testss","Testss", "Transcations"); addCustomMenu( "Testss","Testss", "Transcations");

View File

@ -26,8 +26,6 @@ import com.realnet.basicp1.Services.TestssService ;
@RequestMapping(value = "/Testss") @RequestMapping(value = "/Testss")
@CrossOrigin("*") @CrossOrigin("*")
@RestController @RestController
@ -48,8 +46,6 @@ public class TestssController {
@PostMapping("/Testss") @PostMapping("/Testss")
public Testss Savedata(@RequestBody Testss data) { public Testss Savedata(@RequestBody Testss data) {
Testss save = Service.Savedata(data) ; Testss save = Service.Savedata(data) ;
@ -62,8 +58,6 @@ public class TestssController {
System.out.println("data saved..." + save); System.out.println("data saved..." + save);
return save; return save;
@ -118,6 +112,4 @@ public class TestssController {
} }

View File

@ -26,8 +26,6 @@ import com.realnet.basicp1.Services.TestssService ;
@RequestMapping(value = "/token/Testss") @RequestMapping(value = "/token/Testss")
@CrossOrigin("*") @CrossOrigin("*")
@RestController @RestController
@ -48,8 +46,6 @@ public class tokenFree_TestssController {
@PostMapping("/Testss") @PostMapping("/Testss")
public Testss Savedata(@RequestBody Testss data) { public Testss Savedata(@RequestBody Testss data) {
Testss save = Service.Savedata(data) ; Testss save = Service.Savedata(data) ;
@ -62,8 +58,6 @@ public class tokenFree_TestssController {
System.out.println("data saved..." + save); System.out.println("data saved..." + save);
return save; return save;
@ -118,6 +112,4 @@ public class tokenFree_TestssController {
} }

View File

@ -14,8 +14,6 @@ import com.realnet.basicp1.Entity.Child;
@Entity @Entity
@Data @Data
public class Testss extends Extension { public class Testss extends Extension {
@ -50,11 +48,5 @@ private String qr_code;
private String dependent_dropdown_field;
} }

View File

@ -21,8 +21,6 @@ import java.util.*;
import com.realnet.basicp1.Entity.Testss; import com.realnet.basicp1.Entity.Testss;
@Repository @Repository

View File

@ -22,8 +22,6 @@ import com.realnet.users.entity1.AppUser;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service @Service
@ -43,8 +41,6 @@ private TestssRepository Repository;
public Testss Savedata(Testss data) { public Testss Savedata(Testss data) {
@ -56,8 +52,6 @@ public Testss Savedata(Testss data) {
data.setUpdatedBy(getUser().getUserId()); data.setUpdatedBy(getUser().getUserId());
data.setCreatedBy(getUser().getUserId()); data.setCreatedBy(getUser().getUserId());
data.setAccountId(getUser().getAccount().getAccount_id()); data.setAccountId(getUser().getAccount().getAccount_id());
@ -108,11 +102,6 @@ old.setChild(data.getChild());
old.setDependent_dropdown_field(data.getDependent_dropdown_field());
final Testss test = Repository.save(old); final Testss test = Repository.save(old);
data.setUpdatedBy(getUser().getUserId()); data.setUpdatedBy(getUser().getUserId());
return test;} return test;}
@ -126,8 +115,6 @@ final Testss test = Repository.save(old);
public AppUser getUser() { public AppUser getUser() {
AppUser user = userService.getLoggedInUser(); AppUser user = userService.getLoggedInUser();
return user; return user;

View File

@ -1,4 +1,4 @@
CREATE TABLE dbs.Testss(id BIGINT NOT NULL AUTO_INCREMENT, onetoone VARCHAR(400), bar_code VARCHAR(400), qr_code VARCHAR(400), value_list_field VARCHAR(400), datagrid_field VARCHAR(400), name VARCHAR(400), dependent_dropdown_field VARCHAR(400), PRIMARY KEY (id)); CREATE TABLE dbs.Testss(id BIGINT NOT NULL AUTO_INCREMENT, onetoone VARCHAR(400), bar_code VARCHAR(400), qr_code VARCHAR(400), value_list_field VARCHAR(400), datagrid_field VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id));
CREATE TABLE dbs.Testlist(id BIGINT NOT NULL AUTO_INCREMENT, active VARCHAR(400), description VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id)); CREATE TABLE dbs.Testlist(id BIGINT NOT NULL AUTO_INCREMENT, active VARCHAR(400), description VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id));

View File

@ -62,8 +62,6 @@ Future<List<Map<String, dynamic>>> getAllWithPagination(
Future<void> updateEntity( int entityId, Map<String, dynamic> entity) async { Future<void> updateEntity( int entityId, Map<String, dynamic> entity) async {
try { try {
await _helper.getPutApiResponse('$baseUrl/Testss/Testss/$entityId', await _helper.getPutApiResponse('$baseUrl/Testss/Testss/$entityId',
@ -91,33 +89,4 @@ Future<List<Map<String, dynamic>>> getAllWithPagination(
Future<List<Map<String, dynamic>>> getfirstName() async {
try {
final response = await _helper
.getGetApiResponse('$baseUrl/Name_ListFilter1/Name_ListFilter1');
final entities = (response as List).cast<Map<String, dynamic>>();
return entities;
} catch (e) {
throw Exception('Failed to get first dd: $e');
}
}
Future<List<Map<String, dynamic>>> getsecondName(String name) async {
try {
final response =
await _helper.getGetApiResponse('$baseUrl/Name_ListFilter1/Name_ListFilter11/$name');
final entities = (response as List).cast<Map<String, dynamic>>();
return entities;
} catch (e) {
throw Exception('Failed to get first dd: $e');
}
}
} }

View File

@ -45,8 +45,6 @@ import '../../../../Reuseable/reusable_dropdown_field.dart';
class testssCreateEntityScreen extends StatefulWidget { class testssCreateEntityScreen extends StatefulWidget {
const testssCreateEntityScreen({super.key}); const testssCreateEntityScreen({super.key});
@ -214,164 +212,6 @@ final provider =
} }
// first dropdown
List<Map<String, dynamic>> dependent_dropdown_fieldItems = [];
var selecteddependent_dropdown_fieldValue = ''; // Use nullable type Future<void> _load
Future<void> _loaddependent_dropdown_fieldItems() async {
try {
final selectTdata = await apiService.getfirstName();
print(' dependent_dropdown_field data is : $selectTdata');
// Handle null or empty dropdownData
if (selectTdata != null && selectTdata.isNotEmpty) {
setState(() {
dependent_dropdown_fieldItems = selectTdata;
});
} else {
print(' dependent_dropdown_field data is null or empty');
}
} catch (e) {
print('Failed to load dependent_dropdown_field items: $e');
}
}
Widget _buildDropdownDependent_dropdown_field(
String label,
List<Map<String, dynamic>> options,
String? value,
void Function(String?) onChanged,
void Function(String?) onSaved,
) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: DropdownButtonFormField<String>(
decoration: InputDecoration(
labelText: label,
labelStyle: TextStyle(
color: Colors.deepPurple,
),
contentPadding: const EdgeInsets.symmetric(horizontal: 16.0),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: BorderSide(color: Colors.deepPurple, width: 2),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: BorderSide(color: Colors.deepPurple, width: 2),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: BorderSide(color: Colors.deepPurpleAccent, width: 2),
),
),
value: value!.isEmpty ? null : value,
items: [
const DropdownMenuItem<String>(
value: '',
child: Text('Select dependent_dropdown_field'),
),
...options.map<DropdownMenuItem<String>>(
(item) {
return DropdownMenuItem<String>(
value: item['name'].toString(),
child: Text(
item['name'].toString(),
style: const TextStyle(fontSize: 16),
),
);
},
),
],
onChanged: onChanged,
onSaved: onSaved,
),
);
}
// dependentdropdown
List<Map<String, dynamic>> nameItems = [];
var selectednameValue = ''; // Use nullable type Future<void> _load
Future<void> _loadnameItems(String fieldName) async {
try {
final selectTdata = await apiService.getsecondName(fieldName);
print(' name data is : $selectTdata');
// Handle null or empty dropdownData
if (selectTdata != null && selectTdata.isNotEmpty) {
setState(() {
nameItems = selectTdata;
});
} else {
print(' name data is null or empty');
}
} catch (e) {
print('Failed to load name items: $e');
}
}
Widget _buildDropdownName(
String label,
List<Map<String, dynamic>> options,
String? value,
void Function(String?) onChanged,
void Function(String?) onSaved,
) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: DropdownButtonFormField<String>(
decoration: InputDecoration(
labelText: label,
labelStyle: TextStyle(
color: Colors.deepPurple,
),
contentPadding: const EdgeInsets.symmetric(horizontal: 16.0),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: BorderSide(color: Colors.deepPurple, width: 2),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: BorderSide(color: Colors.deepPurple, width: 2),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: BorderSide(color: Colors.deepPurpleAccent, width: 2),
),
),
value: value!.isEmpty ? null : value,
items: [
const DropdownMenuItem<String>(
value: '',
child: Text('Select Name'),
),
...options.map<DropdownMenuItem<String>>(
(item) {
return DropdownMenuItem<String>(
value: item.values.elementAt(1).toString(),
child: Text(
item.values.elementAt(1).toString(),
style: const TextStyle(fontSize: 16),
),
);
},
),
],
onChanged: onChanged,
onSaved: onSaved,
),
);
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -388,9 +228,6 @@ final provider =
_datagrid_fielddataFuture = datagrid_fieldfetchData(); // Initialize _dataFuture with the function _datagrid_fielddataFuture = datagrid_fieldfetchData(); // Initialize _dataFuture with the function
_loaddependent_dropdown_fieldItems();
} }
@ -456,8 +293,6 @@ Padding(
], ],
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
@ -562,79 +397,6 @@ Padding(
Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'Select an Dependent_dropdown_field:',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black),
),
const SizedBox(height: 12),
_buildDropdownDependent_dropdown_field(
'Dependent_dropdown_field',
dependent_dropdown_fieldItems,
selecteddependent_dropdown_fieldValue,
(value) {
setState(() {
selecteddependent_dropdown_fieldValue = value!;
_loadnameItems(selecteddependent_dropdown_fieldValue);
});
},
(value) {
setState(() {
formData['dependent_dropdown_field'] =
value?.isEmpty ?? true ? 'no value' : value!;
});
},
),
],
),
),
Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'Select an Name:',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black),
),
const SizedBox(height: 12),
_buildDropdownName(
'Name',
nameItems,
selectednameValue,
(value) {
setState(() {
selectednameValue = value!;
});
},
(value) {
setState(() {
formData['name_list'] =
value?.isEmpty ?? true ? 'no value' : value!;
});
},
),
],
),
),
const SizedBox(width: 8), const SizedBox(width: 8),
CustomButton( CustomButton(
height: getVerticalSize(50), height: getVerticalSize(50),
@ -654,8 +416,6 @@ Padding(
try { try {
print(formData); print(formData);
Map<String, dynamic> createdEntity = await provider.createEntity(formData); Map<String, dynamic> createdEntity = await provider.createEntity(formData);
@ -671,8 +431,6 @@ Padding(
Navigator.pop(context); Navigator.pop(context);
} catch (e) { } catch (e) {
// ignore: use_build_context_synchronously // ignore: use_build_context_synchronously
@ -753,8 +511,6 @@ FutureBuilder<List<Map<String, dynamic>>>(
SizedBox(height: 16), SizedBox(height: 16),
], ],
), ),
), ),

View File

@ -60,8 +60,6 @@ class _testss_entity_list_screenState extends State<testss_entity_list_screen> {
Future<void> fetchwithoutpaging() async { Future<void> fetchwithoutpaging() async {
try { try {
final provider = final provider =
@ -211,17 +209,7 @@ Future<void> fetchEntities() async {
entity['datagrid_field'].toString().toLowerCase().contains(keyword.toLowerCase()) || entity['datagrid_field'].toString().toLowerCase().contains(keyword.toLowerCase())
entity['dependent_dropdown_field'].toString().toLowerCase().contains(keyword.toLowerCase()) ||
entity['name_list'].toString().toLowerCase().contains(keyword.toLowerCase())
).toList(); ).toList();
@ -308,8 +296,6 @@ onTapArrowleft1(BuildContext context) {
], ],
), ], ), ],
), ),
@ -628,60 +614,6 @@ onTapArrowleft1(BuildContext context) {
Padding(
padding: getPadding(
top: 10,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Dependent Dropdown Field : ",
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroyMedium16,
),
Text(
entity['dependent_dropdown_field'].toString() ?? 'No Dependent Dropdown Field Available',
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroyMedium16Bluegray900,
),
],
),
),
Padding(
padding: getPadding(
top: 10,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Name : ",
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroyMedium16,
),
Text(
entity['name_list'].toString() ?? 'No Name Available',
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
style: AppStyle.txtGilroyMedium16Bluegray900,
),
],
),
),
], ],
), ),
), ),

View File

@ -78,164 +78,6 @@ onSaved: (value) {
// first dropdown
List<Map<String, dynamic>> dependent_dropdown_fieldItems = [];
var selecteddependent_dropdown_fieldValue = ''; // Use nullable type Future<void> _load
Future<void> _loaddependent_dropdown_fieldItems() async {
try {
final selectTdata = await apiService.getfirstName();
print(' dependent_dropdown_field data is : $selectTdata');
// Handle null or empty dropdownData
if (selectTdata != null && selectTdata.isNotEmpty) {
setState(() {
dependent_dropdown_fieldItems = selectTdata;
});
} else {
print(' dependent_dropdown_field data is null or empty');
}
} catch (e) {
print('Failed to load dependent_dropdown_field items: $e');
}
}
Widget _buildDropdownDependent_dropdown_field(
String label,
List<Map<String, dynamic>> options,
String? value,
void Function(String?) onChanged,
void Function(String?) onSaved,
) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: DropdownButtonFormField<String>(
decoration: InputDecoration(
labelText: label,
labelStyle: TextStyle(
color: Colors.deepPurple,
),
contentPadding: const EdgeInsets.symmetric(horizontal: 16.0),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: BorderSide(color: Colors.deepPurple, width: 2),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: BorderSide(color: Colors.deepPurple, width: 2),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: BorderSide(color: Colors.deepPurpleAccent, width: 2),
),
),
value: value!.isEmpty ? null : value,
items: [
const DropdownMenuItem<String>(
value: '',
child: Text('Select dependent_dropdown_field'),
),
...options.map<DropdownMenuItem<String>>(
(item) {
return DropdownMenuItem<String>(
value: item['name'].toString(),
child: Text(
item['name'].toString(),
style: const TextStyle(fontSize: 16),
),
);
},
),
],
onChanged: onChanged,
onSaved: onSaved,
),
);
}
// dependentdropdown
List<Map<String, dynamic>> nameItems = [];
var selectednameValue = ''; // Use nullable type Future<void> _load
Future<void> _loadnameItems(String fieldName) async {
try {
final selectTdata = await apiService.getsecondName(fieldName);
print(' name data is : $selectTdata');
// Handle null or empty dropdownData
if (selectTdata != null && selectTdata.isNotEmpty) {
setState(() {
nameItems = selectTdata;
});
} else {
print(' name data is null or empty');
}
} catch (e) {
print('Failed to load name items: $e');
}
}
Widget _buildDropdownName(
String label,
List<Map<String, dynamic>> options,
String? value,
void Function(String?) onChanged,
void Function(String?) onSaved,
) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: DropdownButtonFormField<String>(
decoration: InputDecoration(
labelText: label,
labelStyle: TextStyle(
color: Colors.deepPurple,
),
contentPadding: const EdgeInsets.symmetric(horizontal: 16.0),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: BorderSide(color: Colors.deepPurple, width: 2),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: BorderSide(color: Colors.deepPurple, width: 2),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: BorderSide(color: Colors.deepPurpleAccent, width: 2),
),
),
value: value!.isEmpty ? null : value,
items: [
const DropdownMenuItem<String>(
value: '',
child: Text('Select Name'),
),
...options.map<DropdownMenuItem<String>>(
(item) {
return DropdownMenuItem<String>(
value: item.values.elementAt(1).toString(),
child: Text(
item.values.elementAt(1).toString(),
style: const TextStyle(fontSize: 16),
),
);
},
),
],
onChanged: onChanged,
onSaved: onSaved,
),
);
}
@override @override
void initState() { void initState() {
@ -251,9 +93,6 @@ onSaved: (value) {
_loaddependent_dropdown_fieldItems();
} }
@ -284,8 +123,6 @@ onSaved: (value) {
], ],
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
@ -404,79 +241,6 @@ Padding(
Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'Select an Dependent_dropdown_field:',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black),
),
const SizedBox(height: 12),
_buildDropdownDependent_dropdown_field(
'Dependent_dropdown_field',
dependent_dropdown_fieldItems,
selecteddependent_dropdown_fieldValue,
(value) {
setState(() {
selecteddependent_dropdown_fieldValue = value!;
_loadnameItems(selecteddependent_dropdown_fieldValue);
});
},
(value) {
setState(() {
widget.entity['dependent_dropdown_field'] =
value?.isEmpty ?? true ? 'no value' : value!;
});
},
),
],
),
),
Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'Select an Name:',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black),
),
const SizedBox(height: 12),
_buildDropdownName(
'Name',
nameItems,
selectednameValue,
(value) {
setState(() {
selectednameValue = value!;
});
},
(value) {
setState(() {
widget.entity['name_list'] =
value?.isEmpty ?? true ? 'no value' : value!;
});
},
),
],
),
),
CustomButton( CustomButton(
height: getVerticalSize(50), height: getVerticalSize(50),
text: "Update", text: "Update",
@ -495,8 +259,6 @@ Padding(
try { try {
await provider.updateEntity( await provider.updateEntity(
widget.entity[ widget.entity[
@ -513,8 +275,6 @@ Padding(
Navigator.pop(context); Navigator.pop(context);
} catch (e) { } catch (e) {
// ignore: use_build_context_synchronously // ignore: use_build_context_synchronously

View File

@ -123,6 +123,4 @@ class TestssViewModelScreen extends ChangeNotifier{
} }
} }
} }

View File

@ -1,3 +1,5 @@
import '../../Entity/basicp1/Testlist/TestlistView/Testlist_entity_list_screen.dart'; import '../../Entity/basicp1/Testlist/TestlistView/Testlist_entity_list_screen.dart';
import '../../Entity/basicp1/Testlist/Testlist_viewModel/Testlist_view_model_screen.dart'; import '../../Entity/basicp1/Testlist/Testlist_viewModel/Testlist_view_model_screen.dart';
@ -76,22 +78,26 @@ Navigator.pushNamed(context, RouteNames.changePasswordView);
), ),
// NEW MENU // NEW MENU
DrawerItem( DrawerItem(
color: AppColors.primary, color: AppColors.primary,
icon: Icons.chat_bubble, icon: Icons.chat_bubble,
title: 'Testlist', title: 'Testlist',
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => ChangeNotifierProvider( builder: (context) => ChangeNotifierProvider(
create: (context) => TestlistViewModelScreen(), create: (context) => TestlistViewModelScreen(),
child: testlist_entity_list_screen(), child: testlist_entity_list_screen(),
), ),
), ),
); );
}, },
), ),
DrawerItem( DrawerItem(
color: AppColors.primary, color: AppColors.primary,