diff --git a/testflutter28-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java b/testflutter28-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java index 7e38c51..99445b4 100644 --- a/testflutter28-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java +++ b/testflutter28-back-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java @@ -72,6 +72,9 @@ public class BuilderService { addCustomMenu( "Forma", "Transcations"); +addCustomMenu( "Forma", "Transcations"); + + System.out.println("dashboard and menu inserted..."); diff --git a/testflutter28-db-d/authsec_mysql/mysql/wf_table/wf_table.sql b/testflutter28-db-d/authsec_mysql/mysql/wf_table/wf_table.sql index f88ae7a..a91ee9e 100755 --- a/testflutter28-db-d/authsec_mysql/mysql/wf_table/wf_table.sql +++ b/testflutter28-db-d/authsec_mysql/mysql/wf_table/wf_table.sql @@ -1,2 +1,2 @@ -CREATE TABLE db.Forma(id BIGINT NOT NULL AUTO_INCREMENT, datagg VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id)); +CREATE TABLE db.Forma(id BIGINT NOT NULL AUTO_INCREMENT, valuelist VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id)); diff --git a/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/FormaView/Forma_create_entity_screen.dart b/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/FormaView/Forma_create_entity_screen.dart index d9eb74f..c7f4a45 100644 --- a/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/FormaView/Forma_create_entity_screen.dart +++ b/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/FormaView/Forma_create_entity_screen.dart @@ -53,13 +53,11 @@ final Map formData = {}; final TextEditingController nameController = TextEditingController(); - late Future>> _dataggdataFuture; // Data from fetchData + late Future>> _valuelistdataFuture; // Data from fetchData - Future>> dataggfetchData() async { + Future>> valuelistfetchData() async { -final provider = - Provider.of(context, listen: false); - final resp = await provider.getdataggGrid(); + final resp = await apiService.getEntities(); if (resp != null) { return resp; @@ -69,13 +67,102 @@ final provider = } + + void showvaluelistDialog(BuildContext context) { + showDialog( + context: context, + builder: (BuildContext context) { + return SingleChildScrollView( + child: AlertDialog( + title: const Text('Select a record'), + content: FutureBuilder>>( + future: _valuelistdataFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center(child: CircularProgressIndicator()); + } else if (snapshot.hasError) { + return Center(child: Text('Error: ${snapshot.error}')); + } else if (!snapshot.hasData || snapshot.data!.isEmpty) { + return const Center(child: Text('No data available..')); + } else { +final List columnsToShow = [ + + + + + 'name', + + + ]; + return SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: DataTable( + columnSpacing: 30, + headingRowColor: MaterialStateColor.resolveWith( + (states) => Colors.blue.shade100), + dataRowColor: MaterialStateColor.resolveWith( + (states) => Colors.white), + dividerThickness: 0.5, + columns: columnsToShow + .map( + (key) => DataColumn( + label: Text( + key, + style: const TextStyle( + fontWeight: FontWeight.bold, fontSize: 16), + ), + ), + ) + .toList(), + rows: snapshot.data!.map((item) { + return DataRow( + cells: columnsToShow.map((key) { + return DataCell( + Text( + item[key].toString(), + style: const TextStyle(fontSize: 14), + ), + onTap: () { + setState(() { + + + nameController.text = item['name'] ?? ''; + + + // Add more fields as needed + }); + Navigator.pop(context); + }, + ); + }).toList()); + }).toList(), + ), + ); + } + }, + ), + actions: [ + TextButton( + child: const Text('Close'), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ), + ); + }, + ); + } + + @override void initState() { super.initState(); final provider = Provider.of(context, listen: false); - _dataggdataFuture = dataggfetchData(); // Initialize _dataFuture with the function + _valuelistdataFuture = valuelistfetchData(); // Initialize _dataFuture with the function } @@ -100,7 +187,14 @@ final provider = centerTitle: true, title: AppbarTitle(text: "Create Forma"), - + actions: [ + IconButton( + icon: const Icon(Icons.grid_on), + onPressed: () { + showvaluelistDialog(context); + }, + ), + ], ), body: SingleChildScrollView( @@ -171,52 +265,6 @@ final provider = ), - SizedBox(height: 16), - -FutureBuilder>>( - future: _dataggdataFuture, - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return const Center(child: CircularProgressIndicator()); - } else if (snapshot.hasError) { - return Center(child: Text('Error: ${snapshot.error}')); - } else if (!snapshot.hasData || snapshot.data!.isEmpty) { - return const Center(child: Text('No data available..')); - } else { - final keys = snapshot.data!.first.keys.toList(); - - return SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: DataTable( - columnSpacing: 30, - headingRowColor: MaterialStateColor.resolveWith((states) => Colors.blue.shade100), - dataRowColor: MaterialStateColor.resolveWith((states) => Colors.white), - dividerThickness: 0.5, - columns: keys.map( - (key) => DataColumn( - label: Text( - key, - style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 16), - ), - ), - ) - .toList(), - rows: snapshot.data!.map((item) { - return DataRow(cells: keys.map((key) { - return DataCell( - Text( - item[key].toString(), - style: const TextStyle(fontSize: 14), - ), - ); - }).toList()); - }).toList(), - ), - ); - } - }, - ), - SizedBox(height: 16), ], diff --git a/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/FormaView/Forma_entity_list_screen.dart b/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/FormaView/Forma_entity_list_screen.dart index 1ba72b2..edb6984 100644 --- a/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/FormaView/Forma_entity_list_screen.dart +++ b/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/FormaView/Forma_entity_list_screen.dart @@ -172,15 +172,11 @@ Future fetchEntities() async { - entity['name'].toString().toLowerCase().contains(keyword.toLowerCase()) || + entity['name'].toString().toLowerCase().contains(keyword.toLowerCase()) - - entity['datagg'].toString().toLowerCase().contains(keyword.toLowerCase()) - - ).toList(); }); } diff --git a/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/FormaView/Forma_update_entity_screen.dart b/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/FormaView/Forma_update_entity_screen.dart index e29b8fe..8df9d20 100644 --- a/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/FormaView/Forma_update_entity_screen.dart +++ b/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/FormaView/Forma_update_entity_screen.dart @@ -38,7 +38,7 @@ class _formaUpdateEntityScreenState extends State { - + @override @@ -47,7 +47,7 @@ class _formaUpdateEntityScreenState extends State { final provider = Provider.of(context, listen: false); - + } @@ -95,7 +95,26 @@ class _formaUpdateEntityScreenState extends State { SizedBox(height: 16), + Padding( + padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + ElevatedButton( + onPressed: () { + // Save changes logic here + + + Navigator.pop(context); + // Implement API call to update data + }, + child: Text('Save'), + ), + ], + ), + ), CustomButton( diff --git a/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/Forma_Repo/Forma_repo_screen.dart b/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/Forma_Repo/Forma_repo_screen.dart index 4851f02..e6a9bee 100644 --- a/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/Forma_Repo/Forma_repo_screen.dart +++ b/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/Forma_Repo/Forma_repo_screen.dart @@ -61,14 +61,6 @@ class FormaRepoScreen { } - Future getdataggGrid() async { - try { - String apiUrl = "$baseUrl/Forma_ListFilter1/Forma_ListFilter1"; - final response = await _helper.getGetApiResponse(apiUrl); - return response; - } catch (e) { - throw Exception('Failed to Upload datagg: $e'); - } - } + } diff --git a/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/Forma_viewModel/Forma_view_model_screen.dart b/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/Forma_viewModel/Forma_view_model_screen.dart index c1be350..f5a7def 100644 --- a/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/Forma_viewModel/Forma_view_model_screen.dart +++ b/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/Entity/basic/Forma/Forma_viewModel/Forma_view_model_screen.dart @@ -100,21 +100,6 @@ class FormaViewModelScreen extends ChangeNotifier{ } - late List> dataggdataFuture = - []; // Data from fetchData - Future>> getdataggGrid() async { - - try { - final value = await repo.getdataggGrid(); - dataggdataFuture = (value as List) - .map((item) => item as Map) - .toList(); - - return dataggdataFuture; - } catch (e) { - throw Exception('Failed to get all: $e'); - } - } } \ No newline at end of file diff --git a/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/commans/widgets/custome_drawer.dart b/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/commans/widgets/custome_drawer.dart index d2b406a..d840060 100644 --- a/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/commans/widgets/custome_drawer.dart +++ b/testflutter28-front-f/authsec_flutterNewUi/base_project/lib/commans/widgets/custome_drawer.dart @@ -1,5 +1,6 @@ -import '../../Entity/basic/Forma/FormaView/Forma_entity_list_screen.dart'; -import '../../Entity/basic/Forma/Forma_viewModel/Forma_view_model_screen.dart'; + +import '../../Entity/basic/Forma/FormaView/Forma_entity_list_screen.dart'; +import '../../Entity/basic/Forma/Forma_viewModel/Forma_view_model_screen.dart'; import 'package:base_project/utils/image_constant.dart'; import 'package:base_project/commans/widgets/custome_drawe_item.dart'; @@ -73,22 +74,24 @@ Navigator.pushNamed(context, RouteNames.changePasswordView); ), // NEW MENU -DrawerItem( - color: AppColors.primary, - icon: Icons.chat_bubble, - title: 'Forma', - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => ChangeNotifierProvider( - create: (context) => FormaViewModelScreen(), - child: forma_entity_list_screen(), - ), - ), - ); - }, - ), + + +DrawerItem( +color: AppColors.primary, +icon: Icons.chat_bubble, +title: 'Forma', +onTap: () { +Navigator.push( +context, +MaterialPageRoute( +builder: (context) => ChangeNotifierProvider( +create: (context) => FormaViewModelScreen(), +child: forma_entity_list_screen(), +), +), +); +}, +), DrawerItem(