From 30ba5bd0627e683aed2da54f1f1bfe4768835c05 Mon Sep 17 00:00:00 2001 From: risadmin_prod Date: Mon, 31 Mar 2025 07:02:22 +0000 Subject: [PATCH] build_app --- .../Testtt_create_entity_screen.dart | 343 ++++++------------ .../TestttView/Testtt_entity_list_screen.dart | 24 +- .../Testtt_update_entity_screen.dart | 11 + .../Testtt_Repo/Testtt_repo_screen.dart | 10 +- .../Testtt_view_model_screen.dart | 15 - .../lib/commans/widgets/custome_drawer.dart | 3 + .../Builders/Services/BuilderService.java | 3 + .../java/com/realnet/forma/Entity/Testtt.java | 2 +- .../realnet/forma/Services/TestttService.java | 2 +- .../authsec_mysql/mysql/wf_table/wf_table.sql | 2 +- 10 files changed, 146 insertions(+), 269 deletions(-) diff --git a/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/TestttView/Testtt_create_entity_screen.dart b/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/TestttView/Testtt_create_entity_screen.dart index 9297b30..454d328 100644 --- a/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/TestttView/Testtt_create_entity_screen.dart +++ b/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/TestttView/Testtt_create_entity_screen.dart @@ -55,126 +55,66 @@ final Map formData = {}; final TextEditingController nameController = TextEditingController(); - late Future>> _value_list_fielddataFuture; // Data from fetchData + late final Function(String) onPaymentSelectedcheckout_field; - Future>> value_list_fieldfetchData() async { - -final provider = - Provider.of(context, listen: false); - final resp = await provider.getEntities(); - - if (resp != null) { - return resp; - } else { - throw Exception('Failed to load data: '); - } - - } - - - void showvalue_list_fieldDialog(BuildContext context) { +void _showPaymentOptionscheckout_field() { showDialog( context: context, builder: (BuildContext context) { - return SingleChildScrollView( - child: AlertDialog( - title: const Text('Select a record'), - content: FutureBuilder>>( - future: _value_list_fielddataFuture, - 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: () { + return AlertDialog( + title: Text('Select Payment Method'), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + GestureDetector( + onTap: () { + onPaymentSelectedcheckout_field('Paytm'); Navigator.of(context).pop(); }, + child: Column( + children: [ + Image.asset( + 'assets/images/paytm1.png', // Replace with the path to your Paytm image + height: 80, + ), + Text('Paytm'), + ], + ), + ), + SizedBox(height: 20), + GestureDetector( + onTap: () { + onPaymentSelectedcheckout_field('Razorpay'); + Navigator.of(context).pop(); + }, + child: Column( + children: [ + Image.asset( + 'assets/images/razorpay.png', // Replace with the path to your Razorpay image + height: 80, + ), + Text('Razorpay'), + ], + ), ), ], ), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text('Close'), + ), + ], ); }, ); } - late Future>> _datagdataFuture; // Data from fetchData + final TextEditingController approved_fieldController = TextEditingController(); - Future>> datagfetchData() async { - -final provider = - Provider.of(context, listen: false); - final resp = await provider.getdatagGrid(); - - if (resp != null) { - return resp; - } else { - throw Exception('Failed to load data: '); - } - - } @override void initState() { @@ -182,10 +122,8 @@ final provider = final provider = Provider.of(context, listen: false); - _value_list_fielddataFuture = value_list_fieldfetchData(); // Initialize _dataFuture with the function - _datagdataFuture = datagfetchData(); // Initialize _dataFuture with the function } @@ -210,40 +148,7 @@ final provider = centerTitle: true, title: AppbarTitle(text: "Create Testtt"), -Padding( - padding: const EdgeInsets.only(right: 10), - child: InkWell( - onTap: () { - showvalue_list_fieldDialog(context); - }, - borderRadius: BorderRadius.circular(12), - child: Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - gradient: const LinearGradient( - colors: [Colors.deepPurple, Colors.purpleAccent], - begin: Alignment.topLeft, - end: Alignment.bottomRight, - ), - borderRadius: BorderRadius.circular(12), - boxShadow: [ - BoxShadow( - color: Colors.deepPurpleAccent.withOpacity(0.3), - spreadRadius: 2, - blurRadius: 8, - offset: const Offset(0, 3), - ), - ], - ), - child: const Icon( - Icons.grid_on, - color: Colors.white, - size: 28, - ), - ), - ), - ), - + @@ -268,111 +173,67 @@ Padding( - +Column( + children: [ + Center( + child: SizedBox( + height: MediaQuery.of(context).size.height*0.2, + child: LottieBuilder.network('https://lottie.host/87ee095f-c45e-4171-afc6-c2dd90def749/FdaBGpEjHs.json',repeat: false,frameRate: FrameRate(120),), + ), + ), + Text("Successfull!",style: GoogleFonts.getFont('Lato',color: Colors.black,fontSize: 26,fontWeight: FontWeight.bold),), + Text("Transaction successful of \$340",style: GoogleFonts.getFont('Lato',color: Colors.grey,fontSize: 18,fontWeight: FontWeight.w500),), + SizedBox(height: 30,), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 10.0), + child: Divider(color: Colors.grey,thickness: 0.5,), + ), + ListTile( + leading: Text("Transaction Number",style:GoogleFonts.getFont('Lato',color: Colors.grey,fontSize: 16,fontWeight: FontWeight.w400),), + trailing: Text("123 456 789",style:GoogleFonts.getFont('Lato',color: Colors.black,fontSize: 16,fontWeight: FontWeight.bold),), + ), + ListTile( + leading: Text("Date",style:GoogleFonts.getFont('Lato',color: Colors.grey,fontSize: 16,fontWeight: FontWeight.w400),), + trailing: Text("20 May 2023 | 10:09",style:GoogleFonts.getFont('Lato',color: Colors.black,fontSize: 16,fontWeight: FontWeight.bold),), + ), + ListTile( + leading: Text("Status",style:GoogleFonts.getFont('Lato',color: Colors.grey,fontSize: 16,fontWeight: FontWeight.w400),), + trailing: IntrinsicWidth( + child: Container( + decoration: BoxDecoration( + color: Colors.greenAccent.withOpacity(0.3), + borderRadius: BorderRadius.circular(18) + ), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + const Icon(Icons.check,color: Colors.green,), + Text("success",style:GoogleFonts.getFont('Lato',color: Colors.greenAccent.shade700,fontSize: 16,fontWeight: FontWeight.bold),), + ], + ), + )), + ), + ), + ListTile( + leading: Text("Type of Transaction",style:GoogleFonts.getFont('Lato',color: Colors.grey,fontSize: 16,fontWeight: FontWeight.w400),), + trailing: Text("Credit card",style:GoogleFonts.getFont('Lato',color: Colors.black,fontSize: 16,fontWeight: FontWeight.bold),), + ), + ListTile( + leading: Text("Total",style:GoogleFonts.getFont('Lato',color: Colors.grey,fontSize: 16,fontWeight: FontWeight.w400),), + trailing: Text("\$340",style:GoogleFonts.getFont('Lato',color: Colors.black,fontSize: 16,fontWeight: FontWeight.bold),), + ), + ], + ), const SizedBox(width: 8), - CustomButton( +CustomButton( height: getVerticalSize(50), - text: "Submit", + text: "Checkout", margin: getMargin(top: 24, bottom: 5), - onTap: () async { - if (_formKey.currentState!.validate()) { - _formKey.currentState!.save(); - - - - - - - - try { - print(formData); - Map createdEntity = await provider.createEntity(formData); - - - - - - - - - Navigator.pop(context); - } catch (e) { - // ignore: use_build_context_synchronously - showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - title: const Text('Error'), - content: Text('Failed to create Testtt: $e'), - actions: [ - TextButton( - child: const Text('OK'), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - ], - ); - }, - ); - } - } - }, - ), - - - - - SizedBox(height: 16), - -FutureBuilder>>( - future: _datagdataFuture, - 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), - - - ], + onTap: _showPaymentOptionscheckout_field, + ), ], ), ), ), diff --git a/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/TestttView/Testtt_entity_list_screen.dart b/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/TestttView/Testtt_entity_list_screen.dart index aee2459..bc7184c 100644 --- a/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/TestttView/Testtt_entity_list_screen.dart +++ b/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/TestttView/Testtt_entity_list_screen.dart @@ -182,7 +182,7 @@ Future fetchEntities() async { - entity['datag'].toString().toLowerCase().contains(keyword.toLowerCase()) + entity['approved_field'].toString().toLowerCase().contains(keyword.toLowerCase()) ).toList(); @@ -524,6 +524,28 @@ onTapArrowleft1(BuildContext context) { + Padding( + padding: getPadding( + top: 10, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Approved Field : ", + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.left, + style: AppStyle.txtGilroyMedium16, + ), + Text( + entity['approved_field'].toString() ?? 'No Approved Field Available', + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.left, + style: AppStyle.txtGilroyMedium16Bluegray900, + ), + ], + ), + ), ], diff --git a/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/TestttView/Testtt_update_entity_screen.dart b/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/TestttView/Testtt_update_entity_screen.dart index 7b75af9..92211d2 100644 --- a/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/TestttView/Testtt_update_entity_screen.dart +++ b/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/TestttView/Testtt_update_entity_screen.dart @@ -104,6 +104,17 @@ class _testttUpdateEntityScreenState extends State { + ReusableTextField( + + label: "Please Enter Approved Field", + initialValue: widget.entity['approved_field'] ?? '', + + // ValidationProperties + onSaved: (value) => widget.entity['approved_field'] = value, +), + + SizedBox(height: 16), + CustomButton( diff --git a/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/Testtt_Repo/Testtt_repo_screen.dart b/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/Testtt_Repo/Testtt_repo_screen.dart index 371a302..3ff353b 100644 --- a/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/Testtt_Repo/Testtt_repo_screen.dart +++ b/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/Testtt_Repo/Testtt_repo_screen.dart @@ -63,14 +63,6 @@ class TestttRepoScreen { - Future getdatagGrid() async { - try { - String apiUrl = "$baseUrl/Testtt_ListFilter1/Testtt_ListFilter1"; - final response = await _helper.getGetApiResponse(apiUrl); - return response; - } catch (e) { - throw Exception('Failed to Upload datag: $e'); - } - } + } diff --git a/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/Testtt_viewModel/Testtt_view_model_screen.dart b/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/Testtt_viewModel/Testtt_view_model_screen.dart index d9fd002..c8941d9 100644 --- a/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/Testtt_viewModel/Testtt_view_model_screen.dart +++ b/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/Entity/forma/Testtt/Testtt_viewModel/Testtt_view_model_screen.dart @@ -102,21 +102,6 @@ class TestttViewModelScreen extends ChangeNotifier{ - late List> datagdataFuture = - []; // Data from fetchData - Future>> getdatagGrid() async { - - try { - final value = await repo.getdatagGrid(); - datagdataFuture = (value as List) - .map((item) => item as Map) - .toList(); - - return datagdataFuture; - } catch (e) { - throw Exception('Failed to get all: $e'); - } - } } \ No newline at end of file diff --git a/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/commans/widgets/custome_drawer.dart b/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/commans/widgets/custome_drawer.dart index 6fe0741..f85264d 100644 --- a/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/commans/widgets/custome_drawer.dart +++ b/test31march3-demot1-f/authsec_flutterNewUi/base_project/lib/commans/widgets/custome_drawer.dart @@ -1,4 +1,5 @@ + import '../../Entity/forma/Testtt/TestttView/Testtt_entity_list_screen.dart'; import '../../Entity/forma/Testtt/Testtt_viewModel/Testtt_view_model_screen.dart'; @@ -76,6 +77,8 @@ Navigator.pushNamed(context, RouteNames.changePasswordView); // NEW MENU + + DrawerItem( color: AppColors.primary, icon: Icons.chat_bubble, diff --git a/test31march3-test2-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java b/test31march3-test2-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java index e863753..ee79af9 100644 --- a/test31march3-test2-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java +++ b/test31march3-test2-b/authsec_springboot/backend/src/main/java/com/realnet/Builders/Services/BuilderService.java @@ -72,6 +72,9 @@ public class BuilderService { addCustomMenu( "Testtt", "Transcations"); +addCustomMenu( "Testtt", "Transcations"); + + addCustomMenu( "Testtt", "Transcations"); diff --git a/test31march3-test2-b/authsec_springboot/backend/src/main/java/com/realnet/forma/Entity/Testtt.java b/test31march3-test2-b/authsec_springboot/backend/src/main/java/com/realnet/forma/Entity/Testtt.java index 267d7d7..54d4d31 100644 --- a/test31march3-test2-b/authsec_springboot/backend/src/main/java/com/realnet/forma/Entity/Testtt.java +++ b/test31march3-test2-b/authsec_springboot/backend/src/main/java/com/realnet/forma/Entity/Testtt.java @@ -26,7 +26,7 @@ private String name; - +private String approved_field_status; } diff --git a/test31march3-test2-b/authsec_springboot/backend/src/main/java/com/realnet/forma/Services/TestttService.java b/test31march3-test2-b/authsec_springboot/backend/src/main/java/com/realnet/forma/Services/TestttService.java index 0123df1..f4b123f 100644 --- a/test31march3-test2-b/authsec_springboot/backend/src/main/java/com/realnet/forma/Services/TestttService.java +++ b/test31march3-test2-b/authsec_springboot/backend/src/main/java/com/realnet/forma/Services/TestttService.java @@ -75,7 +75,7 @@ old.setName(data.getName()); - +old.setApproved_field_status(data.getApproved_field_status()); final Testtt test = Repository.save(old); data.setUpdatedBy(getUser().getUserId()); diff --git a/test31march3-testdb-d/authsec_mysql/mysql/wf_table/wf_table.sql b/test31march3-testdb-d/authsec_mysql/mysql/wf_table/wf_table.sql index 4586bd6..2dd0cac 100755 --- a/test31march3-testdb-d/authsec_mysql/mysql/wf_table/wf_table.sql +++ b/test31march3-testdb-d/authsec_mysql/mysql/wf_table/wf_table.sql @@ -1,2 +1,2 @@ -CREATE TABLE testdb.Testtt(id BIGINT NOT NULL AUTO_INCREMENT, datag VARCHAR(400), value_list_field VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id)); +CREATE TABLE testdb.Testtt(id BIGINT NOT NULL AUTO_INCREMENT, checkout_field VARCHAR(400), approved_field VARCHAR(400), name VARCHAR(400), PRIMARY KEY (id));