From ea8e8a6e8bb74faa209fab401114805e06721220 Mon Sep 17 00:00:00 2001 From: poojakhatawate Date: Fri, 12 Jul 2024 14:10:20 +0530 Subject: [PATCH] demo_jul12 --- assets/interactionform.json | 511 ++++++++++++++++++ lib/main.dart | 20 +- .../interactionform/interaction_screen.dart | 152 ++++-- lib/ui_screen/interactionform/mockapi.dart | 212 +++++++- lib/ui_screen/new_contacts.dart | 264 +++++---- lib/ui_screen/new_profile.dart | 125 ----- lib/ui_screen/newformlist.dart | 103 ---- pubspec.yaml | 2 +- 8 files changed, 988 insertions(+), 401 deletions(-) create mode 100644 assets/interactionform.json diff --git a/assets/interactionform.json b/assets/interactionform.json new file mode 100644 index 0000000..dde4f61 --- /dev/null +++ b/assets/interactionform.json @@ -0,0 +1,511 @@ +{ + "data": [ + { + "id": "Form1", + "name": "Interaction Form", + "form-fields": [ + { + "sectionName": "Interaction Details", + "multiple": false, + "sectionList": [ + { + "name": "Interaction Date", + "id": "intdate_1", + "depid": "", + "widget": "text", + "input": "Date", + "validation": { + "isRequired": true + } + }, + { + "name": "Interaction Location", + "param": "interactionLocation", + "id": "intlocation_1", + "selectedValue": [], + "depid": "", + "widget": "dropdown", + "input": "dropdown", + "inputList": [ + { + "id": "1", + "name": "In office" + }, + { + "id": "2", + "name": "some" + }, + { + "id": "3", + "name": "Internal meetings" + }, + { + "id": "4", + "name": "Internal meetings2" + }, + { + "id": "5", + "name": "Out of Office" + }, + { + "id": "6", + "name": "Virtual" + } + ], + "validation": { + "isRequired": true + } + }, + { + "name": "Interaction Type", + "id": "inttype_11", + "depid": "", + "widget": "dropdown", + "input": "dropdown", + "inputList": [ + { + "id": "11", + "name": "Face to Face" + }, + { + "id": "12", + "name": "Lecture" + }, + { + "id": "13", + "name": "Mailing" + }, + { + "id": "14", + "name": "Other" + }, + { + "id": "15", + "name": "Phone" + } + ], + "validation": { + "isRequired": true + } + }, + { + "name": "Interaction Category", + "id": "intcategory_21", + "depid": "", + "widget": "radio", + "input": "radio", + "inputList": [ + { + "id": "21", + "name": "One to One" + }, + { + "id": "22", + "name": "Group" + } + ], + "validation": { + "isRequired": true + } + }, + { + "name": "Number of Attendees", + "id": "intattendees_2", + "depid": "", + "widget": "text", + "input": "number", + "validation": { + "isRequired": true + } + }, + { + "name": "Employee name", + "id": "intempname_31", + "depid": "", + "widget": "dropdown", + "input": "dropdown", + "inputList": [ + { + "id": "31", + "name": "Sarepta Manager" + }, + { + "id": "32", + "name": "Todd Truesdale" + } + ], + "validation": { + "isRequired": true + } + }, + { + "name": "Interaction ", + "id": "intcheck_121", + "depid": "", + "widget": "checkbox", + "input": "checkbox", + "inputList": [ + { + "id": "121", + "name": "One to One" + }, + { + "id": "122", + "name": "Group" + } + ], + "validation": { + "isRequired": true + } + }, + { + "name": "Number of Attendees", + "id": "intrange_122", + "depid": "", + "widget": "rangeslider", + "max": "100", + "min": "20", + "validation": { + "isRequired": true + } + } + ] + }, + { + "sectionName": "Discussion Topic", + "multiple": true, + "sectionList": [ + { + "name": "Product", + "id": "discproduct_41", + "depid": "", + "param": "product", + "widget": "dropdown", + "input": "dropdown", + "inputList": [ + { + "id": "41", + "name": "Product1" + }, + { + "id": "42", + "name": "Product2" + } + ], + "validation": { + "isRequired": true + } + }, + { + "name": "Discussion Type", + "id": "disctype_51", + "depid": "", + "widget": "autocomplete", + "input": "autocomplete", + "inputList": [ + { + "id": "51", + "name": "Face to Face" + }, + { + "id": "52", + "name": "Lecture" + }, + { + "id": "53", + "name": "Mailing" + }, + { + "id": "54", + "name": "Other" + }, + { + "id": "55", + "name": "Phone" + } + ], + "validation": { + "isRequired": true + } + }, + { + "name": "Discussion Topic", + "id": "disctopic_61", + "depid": "", + "widget": "multiselect", + "input": "multiselect", + "inputList": [ + { + "id": "61", + "name": "Face to Face" + }, + { + "id": "62", + "name": "Lecture" + }, + { + "id": "63", + "name": "Mailing" + }, + { + "id": "64", + "name": "Other" + }, + { + "id": "65", + "name": "Phone" + } + ], + "validation": { + "isRequired": true + } + } + ] + }, + { + "sectionName": "Attendees", + "multiple": true, + "sectionList": [ + { + "name": "HCP Name", + "id": "attendeeshcpname_3", + "depid": "", + "widget": "text", + "input": "text", + "validation": { + "isRequired": true + } + }, + { + "name": "Speciality", + "id": "attendeeshcpspeciality_4", + "depid": "", + "widget": "text", + "input": "text", + "validation": { + "isRequired": true + } + }, + { + "name": "Title", + "id": "attendeestitle_5", + "depid": "", + "widget": "text", + "input": "text", + "validation": { + "isRequired": true + } + } + ] + }, + { + "sectionName": "Other", + "multiple": false, + "sectionList": [ + { + "name": "Address1", + "id": "otheraddress1_12", + "depid": "", + "widget": "text", + "input": "primary", + "validation": { + "isRequired": true + } + }, + { + "name": "Address2", + "id": "otheraddress2_13", + "depid": "", + "widget": "text", + "input": "Hubli", + "validation": { + "isRequired": true + } + }, + { + "name": "Postal code", + "id": "otherpostal_14", + "depid": "", + "widget": "text", + "input": "number", + "validation": { + "isRequired": true + } + }, + { + "name": "Country", + "id": "othercountry_15", + "depid": "", + "widget": "dropdown", + "inputList": [ + { + "name": "India", + "id": "1" + }, + { + "name": "USA", + "id": "2" + }, + { + "name": "Nepal", + "id": "3" + } + ], + "validation": { + "isRequired": true + } + }, + { + "name": "State", + "id": "otherstate_16", + "depid": "othercountry_15", + "widget": "dropdown", + "inputList": [ + { + "name": "Karnataka", + "id": "1", + "pid": "1" + }, + { + "name": "Maharashtra", + "id": "2", + "pid": "1" + }, + { + "name": "Andhra Pradesh", + "id": "3", + "pid": "1" + }, + { + "name": "Karnataka", + "id": "4", + "pid": "1" + } + ], + "validation": { + "isRequired": true + } + }, + { + "name": "City", + "widget": "dropdown", + "id": "othercity_17", + "depid": "otherstate_16", + "inputList": [ + { + "name": "Hubli", + "id": "1", + "pid": "1" + }, + { + "name": "Bangalore", + "id": "2", + "pid": "1" + }, + { + "name": "Belgavi", + "id": "3", + "pid": "1" + } + ], + "validation": { + "isRequired": true + } + } + ] + }, + { + "sectionName": "Other Attendees", + "multiple": false, + "sectionList": [ + { + "name": "Attendee Name", + "id": "otherattendeename_18", + "depid": "", + "widget": "text", + "input": "text", + "validation": { + "isRequired": true + } + }, + { + "name": "Speciality", + "id": "otherattendeespeciality_19", + "depid": "", + "widget": "text", + "input": "text", + "validation": { + "isRequired": true + } + }, + { + "name": "Comments", + "id": "otherattendeecom_20", + "depid": "", + "widget": "text", + "input": "text", + "validation": { + "isRequired": true + } + } + ] + }, + { + "sectionName": "Attach Document(s)", + "multiple": true, + "sectionList": [ + { + "name": "Document Name", + "id": "documentName_21", + "depid": "", + "widget": "text", + "input": "text", + "validation": { + "isRequired": true + } + }, + { + "name": "Description", + "id": "documentDescription_21", + "depid": "", + "widget": "text", + "input": "text", + "validation": { + "isRequired": true + } + }, + { + "name": "Choose file", + "id": "chooseFile_22", + "depid": "", + "widget": "button", + "input": "chooseFile", + "validation": { + "isRequired": true, + "multipleFiles": true + } + } + ] + }, + { + "sectionName": "Notes", + "multiple": false, + "sectionList": [ + { + "name": "Comments", + "id": "notescomments_22", + "depid": "", + "widget": "text", + "input": "textArea", + "validation": { + "type": "maxchars", + "chars": "500", + "isRequired": true + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 7372550..d76c6a7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -141,7 +141,7 @@ class _MyHomePageState extends State { return Scaffold( body: DefaultTabController( - length: 3, + length: 1, child: Scaffold( drawerEnableOpenDragGesture: false, // Prevent user sliding open @@ -161,14 +161,14 @@ class _MyHomePageState extends State { unselectedLabelColor: Colors.grey, tabs: [ Tab( - text: 'Contacts', - ), - Tab( - text: 'Discover', - ), - Tab( - text: 'HCP Report', + text: '', ), + // Tab( + // text: 'Discover', + // ), + // Tab( + // text: 'HCP Report', + // ), ], ), ), @@ -181,8 +181,8 @@ class _MyHomePageState extends State { body: TabBarView( children: [ Center(child: const Contacts1()), - Center(child: Discover(outerTabValue)), - Center(child: DataTableDemo()), + // Center(child: Discover(outerTabValue)), + // Center(child: DataTableDemo()), ], // This trailing comma makes auto-formatting nicer for build methods. ), diff --git a/lib/ui_screen/interactionform/interaction_screen.dart b/lib/ui_screen/interactionform/interaction_screen.dart index 7816064..2fa3c47 100644 --- a/lib/ui_screen/interactionform/interaction_screen.dart +++ b/lib/ui_screen/interactionform/interaction_screen.dart @@ -45,6 +45,10 @@ class _InteractionScreenState extends State { String dropdownvalue = 'Select value'; String? fileName; final TextEditingController textEditingController = TextEditingController(); + + bool _isExpanded = false; + + late int _value; @override void initState() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { @@ -100,24 +104,38 @@ class _InteractionScreenState extends State { ), ), body: Column( - //mainAxisSize: MainAxisSize.min, + mainAxisSize: MainAxisSize.min, children: [ Expanded( child: ListView.builder( itemCount: provider.interactionReponseList.length, - padding: EdgeInsets.zero, cacheExtent: double.parse( provider.interactionReponseList.length.toString()), itemBuilder: (context, index) { var item = provider.interactionReponseList[index]; sectionList = item.sectionList; + return Column( children: [ Card( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0.0), + ), + elevation: 5, color: Constants.k2color, child: ExpansionTile( maintainState: true, backgroundColor: Constants.k2color, + onExpansionChanged: (bool expanded) { + setState(() { + _isExpanded = expanded; + }); + }, + trailing: Icon( + _isExpanded + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.white), // collapsedBackgroundColor: Color(0xFF2b9af3), initiallyExpanded: true, title: Stack( @@ -135,7 +153,7 @@ class _InteractionScreenState extends State { item.sectionName, style: const TextStyle( color: Colors.white, - fontWeight: FontWeight.bold, + fontWeight: FontWeight.normal, // fontSize: isTablet ? 18 : 14 ), )), @@ -171,7 +189,7 @@ class _InteractionScreenState extends State { }, icon: const Icon( Icons.add_circle_outline, - size: 30, + size: 24, color: Colors.white, ), ), @@ -374,6 +392,9 @@ class _InteractionScreenState extends State { child: Container( height: 80.0, width: 80.0, + + //child: + // Text(provider.interactionReponseList.toString()))) child: _offsetPopup(provider.interactionReponseList))) ], ), @@ -1417,61 +1438,84 @@ class _InteractionScreenState extends State { ); } - Widget _offsetPopup(List interactionReponseList) => - PopupMenuButton( - itemBuilder: (context) { - return List.generate(interactionReponseList.length, (index) { - var provider = - Provider.of(context, listen: false); + Widget _offsetPopup(List interactionReponseList) { + List trueElements = + interactionReponseList.where((element) => element.multiple).toList(); + print("trueElements_iss: $trueElements"); - var item = provider.interactionReponseList[index]; + return PopupMenuButton( + onSelected: (newValue) { + var provider = + Provider.of(context, listen: false); + setState(() { + _value = newValue; // it gives the value which is selected - return PopupMenuItem( - value: index, - child: item.multiple - ? GestureDetector( - onTap: () { - print("Clicked Section ${item.sectionName}"); - // provider.getSectionItem( - // item.sectionName, - // ); - //print("Clicked Section : ${sectionList}") - setState(() { - provider.getSectionItem( - item.sectionName, - ); - }); + var item = trueElements[_value]; - const DecoratedBox( - decoration: BoxDecoration( - // border: Border.all(color: Colors.black), - // borderRadius: BorderRadius.circular(10.0), - border: Border( - bottom: - BorderSide(width: 1.5, color: Colors.black), - //top: BorderSide(width: 1.5, color: Colors.black), - ), - ), + provider.getSectionItem( + item.sectionName, + ); + }); + print("Clicked Section111 $_value "); // add this property + print( + "interactionReponseList1 ${interactionReponseList} "); // add this property + }, + itemBuilder: (context) { + return List.generate(trueElements.length, (index) { + var provider = + Provider.of(context, listen: false); + + var item = trueElements[index]; + + print("itemitemitemitem_isss: ${item.multiple}"); + + return PopupMenuItem( + value: index, + child: item.multiple == true + ? GestureDetector( + onTap: () { + print("Clicked Section ${item.sectionName}"); + // provider.getSectionItem( + // item.sectionName, + // ); + //print("Clicked Section : ${sectionList}") + setState(() { + provider.getSectionItem( + item.sectionName, ); - }, - child: item.sectionName.isNotEmpty - ? Text(' ${item.sectionName}') - : SizedBox.shrink()) - : Container(), - ); - }); - }, - icon: Container( - height: double.infinity, - width: double.infinity, - decoration: const ShapeDecoration( - color: Color.fromARGB(255, 8, 39, 92), - shape: StadiumBorder( - side: BorderSide(color: Colors.white, width: 2), - ), + }); + + const DecoratedBox( + decoration: BoxDecoration( + // border: Border.all(color: Colors.black), + // borderRadius: BorderRadius.circular(10.0), + border: Border( + bottom: + BorderSide(width: 1.5, color: Colors.black), + //top: BorderSide(width: 1.5, color: Colors.black), + ), + ), + ); + }, + child: item.multiple == true + ? Text(' ${item.sectionName}') + : const SizedBox.shrink()) + : SizedBox.shrink(), + ); + }); + }, + icon: Container( + height: double.infinity, + width: double.infinity, + decoration: const ShapeDecoration( + color: Color.fromARGB(255, 8, 39, 92), + shape: StadiumBorder( + side: BorderSide(color: Colors.white, width: 2), ), - child: Icon(Icons.add, color: Colors.white), - )); + ), + child: Icon(Icons.add, color: Colors.white), + )); + } } diff --git a/lib/ui_screen/interactionform/mockapi.dart b/lib/ui_screen/interactionform/mockapi.dart index 4d4ed2b..15e5302 100644 --- a/lib/ui_screen/interactionform/mockapi.dart +++ b/lib/ui_screen/interactionform/mockapi.dart @@ -5,6 +5,7 @@ import 'dart:io'; import 'package:dio/dio.dart'; import 'package:dio/io.dart'; import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart'; +import 'package:flutter/services.dart'; import 'package:http_mock_adapter/http_mock_adapter.dart'; // import 'package:pwa_ios/model/interaction_config_data.dart'; @@ -13,16 +14,213 @@ class MockApiCall { print("Iam_getConfig"); // final dio = Dio(BaseOptions()); final dio = Dio(); + // (dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate = + // (HttpClient client) { + // client.badCertificateCallback = + // (X509Certificate cert, String host, int port) => true; + // return client; + // }; - final response = await dio.get('https://passvault.konectar.io/forms'); + //final response = await dio.get('https://passvault.konectar.io/forms'); - print("response1_isssss"); - // print(response.data.toString()); - // log(jsonEncode(response.data)); + // dynamic response = + // jsonDecode(await rootBundle.loadString("assets/interaction.json")); - final parsedJson = json.encode(response.data); - print(parsedJson); - return response.data; + // print("response1_isssss"); + // // print(response.data.toString()); + // // log(jsonEncode(response.data)); + + // final parsedJson = json.encode(response.data); + // print(parsedJson); + //return response.data; + return { + "success": true, + "message": "New form generated", + "data": [ + { + "id": "Form1", + "name": "Interaction Form", + "form-fields": [ + { + "sectionName": "Discussion Topic", + "multiple": true, + "sectionList": [ + { + "name": "Product", + "id": "discproduct_41", + "depid": "", + "param": "product", + "widget": "dropdown", + "input": "dropdown", + "inputList": [ + {"id": "41", "name": "Product1"}, + {"id": "42", "name": "Product2"} + ], + "validation": {"isRequired": true} + }, + { + "name": "Discussion Type", + "id": "disctype_51", + "depid": "", + "widget": "autocomplete", + "input": "autocomplete", + "inputList": [ + {"id": "51", "name": "Face to Face"}, + {"id": "52", "name": "Lecture"}, + {"id": "53", "name": "Mailing"}, + {"id": "54", "name": "Other"}, + {"id": "55", "name": "Phone"} + ], + "validation": {"isRequired": true} + }, + { + "name": "Discussion Topic", + "id": "disctopic_61", + "depid": "", + "widget": "multiselect", + "input": "multiselect", + "inputList": [ + {"id": "61", "name": "Face to Face"}, + {"id": "62", "name": "Lecture"}, + {"id": "63", "name": "Mailing"}, + {"id": "64", "name": "Other"}, + {"id": "65", "name": "Phone"} + ], + "validation": {"isRequired": true} + } + ] + }, + { + "sectionName": "Attendees", + "multiple": true, + "sectionList": [ + { + "name": "HCP Name", + "id": "attendeeshcpname_3", + "depid": "", + "widget": "text", + "input": "text", + "validation": {"isRequired": true} + }, + { + "name": "Speciality", + "id": "attendeeshcpspeciality_4", + "depid": "", + "widget": "text", + "input": "text", + "validation": {"isRequired": true} + }, + { + "name": "Title", + "id": "attendeestitle_5", + "depid": "", + "widget": "text", + "input": "text", + "validation": {"isRequired": true} + } + ] + }, + { + "sectionName": "Other", + "multiple": false, + "sectionList": [ + { + "name": "Address1", + "id": "otheraddress1_12", + "depid": "", + "widget": "text", + "input": "primary", + "validation": {"isRequired": true} + }, + { + "name": "Address2", + "id": "otheraddress2_13", + "depid": "", + "widget": "text", + "input": "Hubli", + "validation": {"isRequired": true} + }, + { + "name": "Postal code", + "id": "otherpostal_14", + "depid": "", + "widget": "text", + "input": "number", + "validation": {"isRequired": true} + }, + { + "name": "Country", + "id": "othercountry_15", + "depid": "", + "widget": "dropdown", + "inputList": [ + {"name": "India", "id": "1"}, + {"name": "USA", "id": "2"}, + {"name": "Nepal", "id": "3"} + ], + "validation": {"isRequired": true} + }, + { + "name": "State", + "id": "otherstate_16", + "depid": "othercountry_15", + "widget": "dropdown", + "inputList": [ + {"name": "Karnataka", "id": "1", "pid": "1"}, + {"name": "Maharashtra", "id": "2", "pid": "1"}, + {"name": "Andhra Pradesh", "id": "3", "pid": "1"}, + {"name": "Karnataka", "id": "4", "pid": "1"} + ], + "validation": {"isRequired": true} + }, + { + "name": "City", + "widget": "dropdown", + "id": "othercity_17", + "depid": "otherstate_16", + "inputList": [ + {"name": "Hubli", "id": "1", "pid": "1"}, + {"name": "Bangalore", "id": "2", "pid": "1"}, + {"name": "Belgavi", "id": "3", "pid": "1"} + ], + "validation": {"isRequired": true} + } + ] + }, + { + "sectionName": "Other Attendees", + "multiple": false, + "sectionList": [ + { + "name": "Attendee Name", + "id": "otherattendeename_18", + "depid": "", + "widget": "text", + "input": "text", + "validation": {"isRequired": true} + }, + { + "name": "Speciality", + "id": "otherattendeespeciality_19", + "depid": "", + "widget": "text", + "input": "text", + "validation": {"isRequired": true} + }, + { + "name": "Comments", + "id": "otherattendeecom_20", + "depid": "", + "widget": "text", + "input": "text", + "validation": {"isRequired": true} + } + ] + }, + ] + } + ] + }; } Future postConfigData(var jsonObj) async { diff --git a/lib/ui_screen/new_contacts.dart b/lib/ui_screen/new_contacts.dart index 49e2c0e..f401de8 100644 --- a/lib/ui_screen/new_contacts.dart +++ b/lib/ui_screen/new_contacts.dart @@ -125,107 +125,47 @@ class _Contacts1State extends State { ), ], ), - isOnline2 - ? Expanded( - child: ListView.builder( - itemCount: value.list.length, - itemBuilder: (BuildContext context, int index) { - var data = value.list[index]; - return Column( - children: [ - ListTile( - onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => Profile( - // text: data, - // ), - // ), - // ); - - Navigator.push( - context, - MaterialPageRoute( - builder: (_) => - NewProfile(text: data))); - }, - leading: data["img_path"] == null - ? ProfilePicture( - name: data["name"], - radius: 20, - fontsize: 12, - ) - : ClipOval( - child: SizedBox.fromSize( - size: Size.fromRadius(20), - child: Image.network( - data["img_path"], - fit: BoxFit.cover), - ), - ), - trailing: Text("Added by\nPooja k"), - title: Text( - "${data["name"]}", - style: const TextStyle( - fontSize: 18.0, - fontWeight: FontWeight.bold, - ), - ), - subtitle: Text( - "${data["speciality"]}\n${data["addr"]},", - style: const TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.normal, - ), - ), - ), - Divider(), - ], - ); - }, - ), - ) - : Expanded( - child: ListView.builder( - itemCount: _contactBox.values.length, - itemBuilder: (BuildContext context, int index) { - var data = _contactBox.get(index); - print(":data_is: $data"); - return ListTile( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => Profile( - text: data!, - ), - ), - ); - }, - leading: ProfilePicture( - name: data["name"], - radius: 20, - fontsize: 12, - ), - title: Text( - data["name"], - style: TextStyle( - fontSize: 18.0, - fontWeight: FontWeight.bold, - ), - ), - subtitle: Text( - "Added by Pooja.K", - style: TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.normal, - ), - ), - ); - }, - ), - ), + !_switchValue ? Listdisplay(value) : Listdisplay1(_contactBox) + // Expanded( + // child: ListView.builder( + // itemCount: _contactBox.values.length, + // itemBuilder: (BuildContext context, int index) { + // var data = _contactBox.get(index); + // print(":data_is: $data"); + // return ListTile( + // onTap: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => NewProfile( + // text: data!, + // ), + // ), + // ); + // }, + // leading: ProfilePicture( + // name: data["name"], + // radius: 20, + // fontsize: 12, + // ), + // title: Text( + // data["name"], + // style: TextStyle( + // fontSize: 18.0, + // fontWeight: FontWeight.bold, + // ), + // ), + // subtitle: Text( + // "Added by Pooja.K", + // style: TextStyle( + // fontSize: 14.0, + // fontWeight: FontWeight.normal, + // ), + // ), + // ); + // }, + // ), + // ), ], ); }, @@ -233,4 +173,126 @@ class _Contacts1State extends State { ), ); } + + Listdisplay(hcpProvider value) { + return Expanded( + child: ListView.builder( + itemCount: value.list.length, + itemBuilder: (BuildContext context, int index) { + var data = value.list[index]; + return Column( + children: [ + ListTile( + onTap: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => Profile( + // text: data, + // ), + // ), + // ); + + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => NewProfile(text: data))); + }, + leading: data["img_path"] == null + ? ProfilePicture( + name: data["name"], + radius: 20, + fontsize: 12, + ) + : ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(20), + child: Image.network(data["img_path"], + fit: BoxFit.cover), + ), + ), + trailing: Text("Added by\nPooja k"), + title: Text( + "${data["name"]}", + style: const TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + subtitle: Text( + "${data["speciality"]}\n${data["addr"]},", + style: const TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.normal, + ), + ), + ), + Divider(), + ], + ); + }, + ), + ); + } + + Listdisplay1(Box value) { + return Expanded( + child: ListView.builder( + itemCount: value.values.length, + itemBuilder: (BuildContext context, int index) { + var data = value.get(index); + return Column( + children: [ + ListTile( + onTap: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => Profile( + // text: data, + // ), + // ), + // ); + + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => NewProfile(text: data))); + }, + leading: data["img_path"] == null + ? ProfilePicture( + name: data["name"], + radius: 20, + fontsize: 12, + ) + : ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(20), + child: Image.network(data["img_path"], + fit: BoxFit.cover), + ), + ), + trailing: Text("Added by\nPooja k"), + title: Text( + "${data["name"]}", + style: const TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + subtitle: Text( + "${data["speciality"]}\n${data["addr"]},", + style: const TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.normal, + ), + ), + ), + Divider(), + ], + ); + }, + ), + ); + } } diff --git a/lib/ui_screen/new_profile.dart b/lib/ui_screen/new_profile.dart index 6d51845..6c499cb 100644 --- a/lib/ui_screen/new_profile.dart +++ b/lib/ui_screen/new_profile.dart @@ -1719,131 +1719,6 @@ class _NewProfileState extends State { ), ), ) - // : - // Card( - // surfaceTintColor: Colors.white, - // margin: EdgeInsets.symmetric( - // horizontal: 15.0, vertical: 5.0), - // clipBehavior: Clip.antiAlias, - // color: Colors.white, - // elevation: 5.0, - // child: Padding( - // padding: EdgeInsets.symmetric( - // horizontal: 1.0, vertical: 22.0), - // child: Row( - // children: [ - // Expanded( - // child: Column( - // children: [ - // Text( - // "Affliations", - // style: TextStyle( - // color: - // Color.fromARGB(255, 0, 71, 137), - // fontSize: 13.0, - // fontWeight: FontWeight.bold, - // ), - // ), - // SizedBox( - // height: 5.0, - // ), - // Text( - // widget.text["affiliations_count"] - // .toString(), - // style: TextStyle( - // fontSize: 13.0, - // color: - // Color.fromARGB(255, 0, 71, 137), - // ), - // ) - // ], - // ), - // ), - // Expanded( - // child: Column( - // children: [ - // Text( - // "Events", - // style: TextStyle( - // color: - // Color.fromARGB(255, 0, 71, 137), - // fontSize: 13.0, - // fontWeight: FontWeight.bold, - // ), - // ), - // SizedBox( - // height: 5.0, - // ), - // Text( - // widget.text["events_count"] - // .toString(), - // style: TextStyle( - // fontSize: 13.0, - // color: - // Color.fromARGB(255, 0, 71, 137), - // ), - // ) - // ], - // ), - // ), - // Expanded( - // child: Column( - // children: [ - // Text( - // "Publications", - // style: TextStyle( - // color: - // Color.fromARGB(255, 0, 71, 137), - // fontSize: 13.0, - // fontWeight: FontWeight.bold, - // ), - // ), - // SizedBox( - // height: 5.0, - // ), - // Text( - // widget.text["publications_count"] - // .toString(), - // style: TextStyle( - // fontSize: 13.0, - // color: - // Color.fromARGB(255, 0, 71, 137), - // ), - // ) - // ], - // ), - // ), - // Expanded( - // child: Column( - // children: [ - // Text( - // "Trails", - // style: TextStyle( - // color: - // Color.fromARGB(255, 0, 71, 137), - // fontSize: 13.0, - // fontWeight: FontWeight.bold, - // ), - // ), - // SizedBox( - // height: 5.0, - // ), - // Text( - // widget.text["publications_count"] - // .toString(), - // style: TextStyle( - // fontSize: 13.0, - // color: - // Color.fromARGB(255, 0, 71, 137), - // ), - // ) - // ], - // ), - // ), - // ], - // ), - // ), - // ) ], ), ], diff --git a/lib/ui_screen/newformlist.dart b/lib/ui_screen/newformlist.dart index 4ba4ee5..f9093ee 100644 --- a/lib/ui_screen/newformlist.dart +++ b/lib/ui_screen/newformlist.dart @@ -196,89 +196,6 @@ class _FormListState extends State { }, trailing: const Icon(Icons.arrow_forward_ios), ), - Divider(), - // ListTile( - // title: Row( - // children: [ - // Text( - // provider.intConfigDataList[index].name, - // ), - // const SizedBox( - // width: 20, - // ), - // IconButton( - // onPressed: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (BuildContext context) => - // InteractionScreen( - // index: index, - // form: provider - // .intConfigDataList[index].name, - // ))); - // }, - // icon: const Icon( - // Icons.arrow_circle_right_outlined, - // size: 30, - // color: Color.fromARGB(255, 8, 39, 92), - // ), - // ), - // ], - // ), - // trailing: provider.savedList.indexWhere((element) => - // element.form == - // provider.intConfigDataList[index].name) != - // -1 - // ? InkWell( - // onTap: () { - // print("inwesm Screenindex $index"); - - // if (getCount( - // provider.intConfigDataList[index].name, - // provider) != - // 0) { - // provider.savedList - // .where((element) => - // element.form == - // provider - // .intConfigDataList[index].name) - // .toList(); - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (BuildContext context) => - // SavedFormListScreen( - // formname: provider - // .intConfigDataList[index] - // .name, - // ))); - // } - // }, - // child: FittedBox( - // fit: BoxFit.scaleDown, - // child: Text( - // "${provider.savedList.where((element) => element.form == provider.intConfigDataList[index].name).length} record(s) saved", - // style: TextStyle( - // // fontSize: isTablet ? 18.0 : 14, - // fontSize: 18.0, - // color: Colors.blue.shade900), - // ), - // ), - // ) - // : const SizedBox.shrink(), - // onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (BuildContext context) => - // InteractionScreen( - // index: index, - // form: provider - // .intConfigDataList[index].name, - // ))); - // }, - // ), const Divider(), ], @@ -307,26 +224,6 @@ class _FormListState extends State { trailing: const Icon(Icons.arrow_forward_ios), ), Divider(), - // ListTile( - // title: const Text( - // "Interaction", - // style: TextStyle(fontSize: 18.0), - // ), - // onTap: () async { - // print("I am Interaction"); - // final ConfigDataProvider configDataProvider = - // ConfigDataProvider(); - - // await configDataProvider.initConfigUIData(); - // // Navigator.push(context, MaterialPageRoute(builder: (context)))=> InteractionScreen(); - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => InteractionListScreen())); - // }, - // trailing: const Icon(Icons.arrow_forward_ios), - // ), - ListTile( title: const Text( "Interaction", diff --git a/pubspec.yaml b/pubspec.yaml index 71a5443..2328bcb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -90,7 +90,7 @@ flutter: # To add assets to your application, add an assets section, like this: assets: - assets/konectar_white_logo.svg - # - images/a_dot_ham.jpeg + - assets/interactionform.json # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware