diff --git a/fonts/SourceSerif4-ExtraLight.ttf b/fonts/SourceSerif4-ExtraLight.ttf new file mode 100644 index 0000000..6ff0eb7 Binary files /dev/null and b/fonts/SourceSerif4-ExtraLight.ttf differ diff --git a/fonts/SourceSerif4-Italic.ttf b/fonts/SourceSerif4-Italic.ttf new file mode 100644 index 0000000..6fc0375 Binary files /dev/null and b/fonts/SourceSerif4-Italic.ttf differ diff --git a/fonts/SourceSerif4-Light.ttf b/fonts/SourceSerif4-Light.ttf new file mode 100644 index 0000000..acf7063 Binary files /dev/null and b/fonts/SourceSerif4-Light.ttf differ diff --git a/fonts/SourceSerif4-Regular.ttf b/fonts/SourceSerif4-Regular.ttf new file mode 100644 index 0000000..bd14f6c Binary files /dev/null and b/fonts/SourceSerif4-Regular.ttf differ diff --git a/fonts/SourceSerif4-SemiBold.ttf b/fonts/SourceSerif4-SemiBold.ttf new file mode 100644 index 0000000..b22bc9f Binary files /dev/null and b/fonts/SourceSerif4-SemiBold.ttf differ diff --git a/lib/constants.dart b/lib/constants.dart index 739bfde..c528845 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -7,3 +7,240 @@ class Constants { static const url = 'http://192.168.2.143:8085/api'; //static const url = 'http://192.168.153.50:8082/api'; } + + + // adds spacing between the text and image + // Flexible( + // flex: 1, + // child: Padding( + // padding: const EdgeInsets.only( + // left: 1.0, right: 1.0), + // child: Card( + // elevation: 5, + // shape: RoundedRectangleBorder( + // borderRadius: + // BorderRadius.circular(0.0), + // ), + // color: const Color.fromARGB( + // 255, 0, 71, 137), + // child: ExpansionTile( + // maintainState: true, + // onExpansionChanged: + // (bool expanded) { + // setState(() { + // _isExpanded = expanded; + // }); + // }, + // backgroundColor: + // const Color.fromARGB( + // 255, 0, 71, 137), + // trailing: Icon( + // _isExpanded + // ? Icons.keyboard_arrow_up + // : Icons + // .keyboard_arrow_down, + // color: Colors.white), + // // collapsedBackgroundColor: Color(0xFF2b9af3), + // initiallyExpanded: true, + // title: Row( + // //mainAxisSize: MainAxisSize.min, + // children: [ + // // GestureDetector( + + // Text1( + // title: + // "Medical Insight", + // txtcolor: Colors.white, + // fontweight: + // FontWeight.normal, + // txtfont: 17.0), + // // ), + // const SizedBox( + // width: 8.0, + // ), + // Text1( + // title: "4", + // txtfont: 18.0, + // txtcolor: + // const Color.fromARGB( + // 255, 60, 82, 102), + // ) + // ], + // ), + // children: [ + // Container( + // height: MediaQuery.of(context) + // .size + // .height / + // 5, + // color: Colors.white, + // child: Consumer< + // MediacalInsightProvider>( + // builder: (context, value, + // child) { + // return Column( + // children: [ + + // Expanded( + // child: + // ListView.builder( + // physics: + // const ScrollPhysics(), + // // scrollDirection: Axis.vertical, + // shrinkWrap: + // true, + // itemCount: value + // .med + // .length, + // itemBuilder: + // (context, + // index) { + // item = value + // .med[ + // index]; + + // print( + // "Item_Medical_insight ${item['Therapeutic Area']}"); + // return Padding( + // padding: const EdgeInsets + // .all( + // 8.0), + // child: + // Card( + // margin: + // EdgeInsets.zero, + + // elevation: + // 4, + // surfaceTintColor: + // Colors.white, + // shape: + // RoundedRectangleBorder( + // borderRadius: + // BorderRadius.zero, + // ), + + // // shape: RoundedRectangleBorder( + // // side: BorderSide(color: Colors.black, width: 1), + // // borderRadius: BorderRadius.only( + // // bottomRight: Radius.circular(30)), + // // ), + // child: + // SizedBox( + // width: + // MediaQuery.sizeOf(context).width, + // child: + // ListTile( + // dense: + // true, + // title: + // Column( + // // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // // Text( + // // "Acute neurology is the therapeutic area of the medical insight for Product A. The age of treatment is the topic of interest for this source type publication."), + + // RichText( + // text: TextSpan( + // text: '', + // style: DefaultTextStyle.of(context).style, + // children: const [ + // TextSpan(text: 'Acute neurology ', style: TextStyle(fontWeight: FontWeight.bold)), + // // TextSpan( + // // text: ' therapeutic area ', + // // style: TextStyle( + // // fontWeight: + // // FontWeight.bold)), + // TextSpan(text: 'is the therapeutic area of the medical insight for '), + // TextSpan(text: 'Product A. The age of treatment', style: TextStyle(fontWeight: FontWeight.bold)), + // TextSpan(text: ' is the topic of interest for this source type'), + // TextSpan(text: ' publication.', style: TextStyle(fontWeight: FontWeight.bold)), + // ], + // ), + // ), + + // const Padding( + // padding: EdgeInsets.all(8.0), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Row( + // children: [ + // Icon( + // Icons.person, + // size: 20, + // ), + // Text( + // "pooja", + // style: TextStyle(fontSize: 14.0), + // ) + // ], + // ), + // Row( + // children: [ + // Icon( + // Icons.calendar_today, + // size: 20, + // ), + // Text( + // "11/11/2022 ", + // style: TextStyle(fontSize: 14.0), + // ) + // ], + // ) + // ], + // ), + // ), + // ], + // ), + // ), + // ), + // // shape: BorderRadius.only(bottomRight: Radius.circular(50)), + // ), + // ); + // }), + // ) + // ], + // ); + // }), + // ), + // Container( + // color: Colors.white, + // child: Align( + // alignment: Alignment.center, + // child: Padding( + // padding: + // const EdgeInsets.all( + // 8.0), + // child: OutlinedButton( + // onPressed: () { + + // }, + // child: Text( + // 'Show More', + // style: TextStyle( + // color: Constants + // .k2color), + // ), + // style: OutlinedButton + // .styleFrom( + // shape: + // RoundedRectangleBorder( + // borderRadius: + // BorderRadius + // .circular( + // 12), + // ), + // ), + // ), + // ), + // ), + // ) + // ]), + // ), + // ), + // ), + + // SizedBox( + // height: 10.0, + // ), \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index f07cb85..6da1a80 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -99,11 +99,13 @@ class _MyAppState extends State { debugShowCheckedModeBanner: false, title: 'Flutter Demo', theme: ThemeData( + fontFamily: 'SourceSerif', appBarTheme: const AppBarTheme( backgroundColor: Color.fromARGB(255, 0, 71, 132), foregroundColor: Colors.white //here you can give the text color )), - home: const MyHomePage(title: 'Discover Module'), + home: Contacts1(), + // home: const MyHomePage(title: 'Discover Module'), // home: const MedicalInsight(), ); } diff --git a/lib/ui_screen/interactionform/edit_interaction_screen.dart b/lib/ui_screen/interactionform/edit_interaction_screen.dart index aeaf60b..7016997 100644 --- a/lib/ui_screen/interactionform/edit_interaction_screen.dart +++ b/lib/ui_screen/interactionform/edit_interaction_screen.dart @@ -107,6 +107,7 @@ class _EditInteractionScreenState extends State { child: OrientationBuilder(builder: (context, orientation) { return SafeArea( child: Scaffold( + backgroundColor: Colors.white, appBar: AppBar( title: Text( widget.saveInteraction.id, diff --git a/lib/ui_screen/interactionform/view_forms_list.dart b/lib/ui_screen/interactionform/view_forms_list.dart index fcfc416..ddb2643 100644 --- a/lib/ui_screen/interactionform/view_forms_list.dart +++ b/lib/ui_screen/interactionform/view_forms_list.dart @@ -4,6 +4,7 @@ import 'package:discover_module/ui_screen/interactionform/util.dart'; import 'package:discover_module/ui_screen/interactionform/view_interaction_screen.dart'; import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; import 'package:discover_module/ui_screen/new_editinteraction.dart'; +import 'package:discover_module/ui_screen/new_viewinteraction.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -86,7 +87,7 @@ class _SavedFormListScreenState extends State { context, MaterialPageRoute( builder: (BuildContext context) => - ViewInteractionScreen( + ViewInteractionScreen1( saveInteraction: provider.savedList[index], ))); @@ -144,7 +145,7 @@ class _SavedFormListScreenState extends State { context, MaterialPageRoute( builder: (BuildContext context) => - ViewInteractionScreen( + ViewInteractionScreen1( saveInteraction: provider.savedList[index], ))); diff --git a/lib/ui_screen/medical_insight.dart b/lib/ui_screen/medical_insight.dart index d7e7f45..594f93e 100644 --- a/lib/ui_screen/medical_insight.dart +++ b/lib/ui_screen/medical_insight.dart @@ -433,14 +433,14 @@ import 'package:flutter/widgets.dart'; import 'package:provider/provider.dart'; import 'package:adoptive_calendar/adoptive_calendar.dart'; -class MedicalInsight extends StatefulWidget { - const MedicalInsight({super.key}); +class MedicalInsight1 extends StatefulWidget { + const MedicalInsight1({super.key}); @override - State createState() => _MedicalInsightState(); + State createState() => _MedicalInsightState(); } -class _MedicalInsightState extends State { +class _MedicalInsightState extends State { final List> cardData = [ {'id': 'ID ', 'number': 'MI1688128025', 'id1': "jjj", 'number1': '265'}, {'id': 'ID ', 'number': 20}, @@ -459,6 +459,10 @@ class _MedicalInsightState extends State { bool calview = false; String? start, end; + + final TextEditingController startController = TextEditingController(); + final TextEditingController endController = TextEditingController(); + @override void initState() { actionKey = GlobalKey(); @@ -484,7 +488,9 @@ class _MedicalInsightState extends State { textDirection: TextDirection.ltr, child: SafeArea( child: Scaffold( - backgroundColor: const Color.fromARGB(255, 222, 237, 247), + // backgroundColor: const Color.fromARGB(255, 222, 237, 247), + backgroundColor: const Color.fromARGB(255, 246, 248, 252), + appBar: AppBar( title: const Text('Medical Insight'), actions: [ @@ -526,18 +532,40 @@ class _MedicalInsightState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - OutlinedButton( - onPressed: () { - _selectDate(context); - }, - child: - start == null ? Text('Start Date') : Text(start!), + // OutlinedButton( + // onPressed: () { + // _selectDate(context); + // }, + // child: + // start == null ? Text('Start Date') : Text(start!), + // ), + Expanded( + flex: 1, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: TextFormField( + controller: startController, + decoration: InputDecoration( + isDense: true, + border: OutlineInputBorder(), + hintText: "ff", + labelText: + startController.text ?? 'Start Date'), + // focusNode: AlwaysDisabledFocusNode(), + onTap: () { + _selectDate(context); + }, + ), + ), ), - OutlinedButton( - onPressed: () { - _selectDate1(context); - }, - child: end == null ? Text('Start Date') : Text(end!), + Expanded( + flex: 1, + child: OutlinedButton( + onPressed: () { + _selectDate1(context); + }, + child: end == null ? Text('Start Date') : Text(end!), + ), ), ], ), @@ -566,12 +594,12 @@ class _MedicalInsightState extends State { Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - OutlinedButton( - style: OutlinedButton.styleFrom( - backgroundColor: Constants.k2color, - foregroundColor: Colors.white), - onPressed: () {}, - child: Text("Create Medical Insight")) + // OutlinedButton( + // style: OutlinedButton.styleFrom( + // backgroundColor: Constants.k2color, + // foregroundColor: Colors.white), + // onPressed: () {}, + // child: Text("Create Medical Insight")) ], ), Expanded( @@ -592,7 +620,14 @@ class _MedicalInsightState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Card( + margin: EdgeInsets.zero, + + elevation: 4, surfaceTintColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.zero, + ), + // shape: RoundedRectangleBorder( // side: BorderSide(color: Colors.black, width: 1), // borderRadius: BorderRadius.only( @@ -601,6 +636,7 @@ class _MedicalInsightState extends State { child: SizedBox( width: MediaQuery.sizeOf(context).width, child: ListTile( + dense: true, title: Column( // crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -609,20 +645,26 @@ class _MedicalInsightState extends State { RichText( text: TextSpan( - text: 'Acute neurology is the', + text: '', style: DefaultTextStyle.of(context) .style, children: const [ TextSpan( - text: ' therapeutic area ', + text: 'Acute neurology ', style: TextStyle( fontWeight: FontWeight.bold)), + // TextSpan( + // text: ' therapeutic area ', + // style: TextStyle( + // fontWeight: + // FontWeight.bold)), TextSpan( text: - 'of the medical insight for Product A.'), + 'is the therapeutic area of the medical insight for '), TextSpan( - text: 'The age of treatment', + text: + 'Product A. The age of treatment', style: TextStyle( fontWeight: FontWeight.bold)), @@ -638,11 +680,11 @@ class _MedicalInsightState extends State { ), ), - Padding( - padding: const EdgeInsets.all(8.0), + const Padding( + padding: EdgeInsets.all(8.0), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceAround, + MainAxisAlignment.spaceBetween, children: [ Row( children: [ @@ -898,7 +940,7 @@ class _MedicalInsightState extends State { String convertedDateTime = "${picked.year.toString()}-${picked.month.toString().padLeft(2, '0')}-${picked.day.toString().padLeft(2, '0')}"; // widget.textController.value = TextEditingValue(text: picked.toString()); - textController.value = TextEditingValue(text: convertedDateTime); + startController.value = TextEditingValue(text: convertedDateTime); start = convertedDateTime; ; diff --git a/lib/ui_screen/new_contacts.dart b/lib/ui_screen/new_contacts.dart index 0bfca71..77b9626 100644 --- a/lib/ui_screen/new_contacts.dart +++ b/lib/ui_screen/new_contacts.dart @@ -595,6 +595,7 @@ import 'package:discover_module/constants.dart'; import 'package:discover_module/provider_class/hcp%20_provider.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; import 'package:provider/provider.dart'; import 'package:flutter/services.dart'; import 'package:flutter_profile_picture/flutter_profile_picture.dart'; @@ -635,6 +636,16 @@ class _Contacts1State extends State { return SafeArea( child: Scaffold( + backgroundColor: const Color.fromARGB(255, 246, 248, 252), + appBar: AppBar( + automaticallyImplyLeading: false, + title: SvgPicture.asset( + 'assets/konectar_white_logo.svg', + width: 100.0, + // color: Colors.white, + colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + ), body: Consumer( builder: (context, hcpProvider, child) { List displayedHCPList = diff --git a/lib/ui_screen/new_profile.dart b/lib/ui_screen/new_profile.dart index 6362626..606205f 100644 --- a/lib/ui_screen/new_profile.dart +++ b/lib/ui_screen/new_profile.dart @@ -3,6 +3,7 @@ import 'package:discover_module/custom_widget/text.dart'; import 'package:discover_module/hive_fun.dart'; import 'package:discover_module/provider_class/affiliationsprovider.dart'; import 'package:discover_module/provider_class/events_provider.dart'; +import 'package:discover_module/provider_class/medicalinsightprovider.dart'; import 'package:discover_module/provider_class/publications_provider.dart'; import 'package:discover_module/provider_class/trials_provider.dart'; import 'package:discover_module/ui_screen/affiliation_data.dart'; @@ -13,10 +14,13 @@ import 'package:discover_module/ui_screen/interactionform/edit_interaction_scree import 'package:discover_module/ui_screen/interactionform/interaction_screen.dart'; import 'package:discover_module/ui_screen/interactionform/interactionlistscreen.dart'; import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; +import 'package:discover_module/ui_screen/interactionform/model/medical_insight.dart'; import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; +import 'package:discover_module/ui_screen/interactionform/util.dart'; import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart'; import 'package:discover_module/ui_screen/interactionform/view_interaction_screen.dart'; import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; +import 'package:discover_module/ui_screen/medical_insight.dart'; import 'package:discover_module/ui_screen/new_editinteraction.dart'; import 'package:discover_module/ui_screen/newformlist.dart'; import 'package:discover_module/ui_screen/publication_data.dart'; @@ -42,10 +46,13 @@ class _NewProfileState extends State { List publication_data = []; List event_data = []; List trial_data = []; + List medinsightData = []; List viewformData = []; bool _isExpanded = false; + + var item; // final ScrollController controller = ScrollController(); // final ScrollController controller2 = ScrollController(); @@ -101,12 +108,17 @@ class _NewProfileState extends State { final trialslist = trials.trialsinfo; + var med = Provider.of(context, listen: false); + await med.medicalinsightdata(); + final medlist = med.trialsinfo; + setState(() { affiliation_data = affilist; publication_data = publist; event_data = eventlist; viewformData = form.savedList; trial_data = trialslist; + medinsightData = medlist; }); print("Affiliations_data_is: $affilist"); @@ -129,12 +141,12 @@ class _NewProfileState extends State { Widget build(BuildContext context) { return SafeArea( child: Scaffold( - //backgroundColor: Color.fromARGB(255, 200, 222, 241), - backgroundColor: Color.fromARGB(255, 237, 230, 230), + backgroundColor: Color.fromARGB(255, 246, 248, 252), + // backgroundColor: Color.fromARGB(255, 237, 230, 230), appBar: AppBar( - //backgroundColor: Colors.transparent, - title: const Text('Profile'), - ), + // backgroundColor: Color.fromARGB(255, 246, 248, 252), + //title: const Text('Profile'), + ), body: ListView( children: [ Column( @@ -323,45 +335,38 @@ class _NewProfileState extends State { const SizedBox( height: 8.0, ), + Align( + alignment: Alignment.centerLeft, + child: Padding( + padding: const EdgeInsets.only(left: 15.0), + child: Text1( + title: "Profile Summarry", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 18.0), + ), + ), + + Align( + alignment: Alignment.centerLeft, + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Text1( + title: widget.text!["summarry"], + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 15.0), + ), + ), // isonline // ? Container( width: MediaQuery.of(context).size.width, - child: Card( - elevation: 4, - clipBehavior: Clip.antiAliasWithSaveLayer, - surfaceTintColor: Colors.white, - // shape: RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular(0.0), - // ), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30.0)), + child: Padding( + padding: const EdgeInsets.all(0.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // const Text( - // "Profile Summarry", - // style: TextStyle( - // fontSize: 20.0, fontWeight: FontWeight.bold), - // ), - Padding( - padding: const EdgeInsets.all(12.0), - child: Text1( - title: "Profile Summarry", - txtcolor: Colors.black, - fontweight: FontWeight.normal, - txtfont: 18.0), - ), - - Padding( - padding: const EdgeInsets.all(12.0), - child: Text1( - title: widget.text!["summarry"], - txtcolor: Colors.black, - fontweight: FontWeight.normal, - txtfont: 15.0), - ), Padding( padding: EdgeInsets.all(0.0), @@ -371,203 +376,8 @@ class _NewProfileState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - // const SizedBox(height: 10), - // Flexible( - // flex: 1, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 1.0, right: 1.0), - // child: Card( - // elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular(0.0), - // ), - // color: const Color.fromARGB( - // 255, 0, 71, 137), - // child: ExpansionTile( - // maintainState: true, - // // onExpansionChanged: - // // (bool expanded) { - // // setState(() { - // // _isExpanded = expanded; - // // }); - // // }, - // backgroundColor: - // const Color.fromARGB( - // 255, 0, 71, 137), - // collapsedIconColor: Colors.white, - // // trailing: Icon( - // // _isExpanded - // // ? Icons.keyboard_arrow_up - // // : Icons - // // .keyboard_arrow_down, - // // color: Colors.white), - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // initiallyExpanded: true, - // title: Row( - // //mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Affiliations", - // txtcolor: Colors.white, - // fontweight: - // FontWeight.normal, - // txtfont: 17.0), - // const SizedBox( - // width: 8.0, - // ), - // // Text1( - // // title: widget - // // .text![ - // // "affiliations_count"] - // // .toString(), - // // txtfont: 18.0, - // // txtcolor: - // // const Color - // // .fromARGB( - // // 255, - // // 60, - // // 82, - // // 102), - // // ) - // ], - // ), - // children: [ - // SingleChildScrollView( - // scrollDirection: - // Axis.horizontal, - // child: Container( - // width: - // MediaQuery.of(context) - // .size - // .width, - // color: Colors.white, - // child: DataTable( - // columns: const [ - // DataColumn( - // label: Expanded( - // child: Text( - // 'sl no'))), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Organization Name'), - // )), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Department'))), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Role'))), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Time Frame'))), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Org Type'))), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Eng Type'))), - // // Add more columns as needed - // ], - // rows: List.generate( - // affiliation_data.length, - // (index) => DataRow( - // cells: [ - // DataCell(Text( - // affiliation_data[ - // index] - // ['id'] - // .toString())), - // DataCell(Text( - // affiliation_data[ - // index] - // [ - // 'org_name'] - // .toString())), - // DataCell(Text( - // affiliation_data[ - // index] - // ['dept'] - // .toString())), - // DataCell(Text( - // affiliation_data[ - // index] - // ['role'] - // .toString())), - // DataCell(Text( - // affiliation_data[ - // index] - // [ - // 'time_frame'] - // .toString())), - // DataCell(Text( - // affiliation_data[ - // index] - // [ - // 'org_type'] - // .toString())), - // DataCell(Text( - // affiliation_data[ - // index] - // [ - // 'emg_type'] - // .toString())), - // // Add more DataCells as needed - // ], - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all( - // 8.0), - // child: OutlinedButton( - // onPressed: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (_) => - // AffiliationsData())); - // }, - // child: - // Text('Show More'), - // style: OutlinedButton - // .styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), - Flexible( flex: 1, - // height: - // 200, // Set a fixed height or use constraints as needed - child: Padding( padding: const EdgeInsets.only( left: 1.0, right: 1.0), @@ -614,7 +424,7 @@ class _NewProfileState extends State { width: 8.0, ), Text1( - title: "4", + title: "(4)", txtcolor: Colors.white, fontweight: FontWeight.normal, @@ -639,38 +449,45 @@ class _NewProfileState extends State { .width), color: Colors.white, child: DataTable( + showCheckboxColumn: + false, columns: const [ - DataColumn( - label: Expanded( - child: Text( - '', - softWrap: - true))), + // DataColumn( + // label: Expanded( + // child: Text( + // '', + // softWrap: + // true))), DataColumn( label: Expanded( child: Text( - 'Organization Name'), + 'Organization Name', + style: TextStyle( + fontWeight: + FontWeight + .w500), + ), )), - DataColumn( - label: Expanded( - child: Text( - 'Department'))), - DataColumn( - label: Expanded( - child: Text( - 'Role'))), + // DataColumn( + // label: Expanded( + // child: Text( + // 'Department'))), + // DataColumn( + // label: Expanded( + // child: Text( + // 'Role'))), DataColumn( label: Expanded( child: Text( 'Time Frame'))), - DataColumn( - label: Expanded( - child: Text( - 'Org Type'))), - DataColumn( - label: Expanded( - child: Text( - 'Eng Type'))), + // DataColumn( + // label: Expanded( + // child: Text( + // 'Org Type'))), + // DataColumn( + // label: Expanded( + // child: Text( + // 'Eng Type'))), // Add more columns as needed ], @@ -678,14 +495,38 @@ class _NewProfileState extends State { affiliation_data .length, (index) => DataRow( - cells: [ - DataCell(Text( + onSelectChanged: + (value) { + // =======> Use onSelectChanged for tab + print( + "message ${affiliation_data[index]}"); + + bottomshet( affiliation_data[ - index] - ['id'] - .toString(), - softWrap: - true)), + index]); + }, + color: MaterialStateProperty + .resolveWith< + Color?>((Set< + MaterialState> + states) { + if (index + .isEven) { + return Colors + .grey + .withOpacity( + 0.1); + } + return null; + }), + cells: [ + // DataCell(Text( + // affiliation_data[ + // index] + // ['id'] + // .toString(), + // softWrap: + // true)), DataCell(Text( affiliation_data[ index] @@ -694,22 +535,22 @@ class _NewProfileState extends State { .toString(), softWrap: true)), - DataCell(Text( - affiliation_data[ - index] - [ - 'dept'] - .toString(), - softWrap: - true)), - DataCell(Text( - affiliation_data[ - index] - [ - 'role'] - .toString(), - softWrap: - true)), + // DataCell(Text( + // affiliation_data[ + // index] + // [ + // 'dept'] + // .toString(), + // softWrap: + // true)), + // DataCell(Text( + // affiliation_data[ + // index] + // [ + // 'role'] + // .toString(), + // softWrap: + // true)), DataCell(Text( affiliation_data[ index] @@ -718,22 +559,22 @@ class _NewProfileState extends State { .toString(), softWrap: true)), - DataCell(Text( - affiliation_data[ - index] - [ - 'org_type'] - .toString(), - softWrap: - true)), - DataCell(Text( - affiliation_data[ - index] - [ - 'emg_type'] - .toString(), - softWrap: - true)), + // DataCell(Text( + // affiliation_data[ + // index] + // [ + // 'org_type'] + // .toString(), + // softWrap: + // true)), + // DataCell(Text( + // affiliation_data[ + // index] + // [ + // 'emg_type'] + // .toString(), + // softWrap: + // true)), // Add more DataCells as needed ], @@ -1437,6 +1278,260 @@ class _NewProfileState extends State { ), ), // adds spacing between the text and image + SizedBox( + height: 10.0, + ), + + Flexible( + flex: 1, + child: Padding( + padding: const EdgeInsets.only( + left: 1.0, right: 1.0), + child: Card( + elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(0.0), + ), + color: const Color.fromARGB( + 255, 0, 71, 137), + child: ExpansionTile( + maintainState: true, + onExpansionChanged: + (bool expanded) { + setState(() { + _isExpanded = expanded; + }); + }, + backgroundColor: + const Color.fromARGB( + 255, 0, 71, 137), + trailing: Icon( + _isExpanded + ? Icons.keyboard_arrow_up + : Icons + .keyboard_arrow_down, + color: Colors.white), + // collapsedBackgroundColor: Color(0xFF2b9af3), + initiallyExpanded: true, + // initiallyExpanded: true, + title: Row( + mainAxisAlignment: + MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + children: [ + Text1( + title: "Medical Insight", + txtcolor: Colors.white, + fontweight: + FontWeight.normal, + txtfont: 17.0), + const SizedBox( + width: 8.0, + ), + Text1( + title: "3", + txtcolor: Colors.white, + fontweight: + FontWeight.normal, + txtfont: 17.0), + ], + ), + children: [ + Container( + width: MediaQuery.of(context) + .size + .width, + + /// 5, + color: Colors.white, + child: Consumer< + MediacalInsightProvider>( + builder: + (BuildContext context, + value, + Widget? child) { + print( + "med1 : ${value.med.length}"); + + if (value.med.length != 0) { + return ListView.builder( + physics: + const ScrollPhysics(), + // scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: value.med + .take(2) + .length, + itemBuilder: + (context, index) { + item = value + .med[index]; + + print( + "Item_Medical_insight ${item['Therapeutic Area']}"); + return Padding( + padding: + const EdgeInsets + .all(8.0), + child: Card( + margin: + EdgeInsets + .zero, + + elevation: 4, + surfaceTintColor: + Colors + .white, + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius + .zero, + ), + + // shape: RoundedRectangleBorder( + // side: BorderSide(color: Colors.black, width: 1), + // borderRadius: BorderRadius.only( + // bottomRight: Radius.circular(30)), + // ), + child: SizedBox( + width: MediaQuery + .sizeOf( + context) + .width, + child: + ListTile( + dense: true, + title: + Column( + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // Text( + // "Acute neurology is the therapeutic area of the medical insight for Product A. The age of treatment is the topic of interest for this source type publication."), + + RichText( + text: + TextSpan( + text: + '', + style: + DefaultTextStyle.of(context).style, + children: const [ + TextSpan(text: 'Acute neurology ', style: TextStyle(fontWeight: FontWeight.bold)), + // TextSpan( + // text: ' therapeutic area ', + // style: TextStyle( + // fontWeight: + // FontWeight.bold)), + TextSpan(text: 'is the therapeutic area of the medical insight for '), + TextSpan(text: 'Product A. The age of treatment', style: TextStyle(fontWeight: FontWeight.bold)), + TextSpan(text: ' is the topic of interest for this source type'), + TextSpan(text: ' publication.', style: TextStyle(fontWeight: FontWeight.bold)), + ], + ), + ), + + const Padding( + padding: + EdgeInsets.all(8.0), + child: + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Icon( + Icons.person, + size: 20, + ), + Text( + "pooja", + style: TextStyle(fontSize: 14.0), + ) + ], + ), + Row( + children: [ + Icon( + Icons.calendar_today, + size: 20, + ), + Text( + "11/11/2022 ", + style: TextStyle(fontSize: 14.0), + ) + ], + ) + ], + ), + ), + ], + ), + ), + ), + // shape: BorderRadius.only(bottomRight: Radius.circular(50)), + ), + ); + }); + } else { + return Container( + color: Colors.white, + width: MediaQuery.of( + context) + .size + .width, + child: Column( + children: [ + Text("No records"), + ], + ), + ); + } + }), + ), + Container( + color: Colors.white, + child: Align( + alignment: Alignment.center, + child: Padding( + padding: + const EdgeInsets.all( + 8.0), + child: OutlinedButton( + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => + const MedicalInsight1())); + }, + child: Text( + 'Show More', + style: TextStyle( + color: Constants + .k2color), + ), + style: OutlinedButton + .styleFrom( + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius + .circular( + 12), + ), + ), + ), + ), + ), + ) + ]), + ), + ), + ), + SizedBox( height: 10.0, ), @@ -1520,20 +1615,6 @@ class _NewProfileState extends State { const SizedBox( width: 8.0, ), - // Text1( - // title: widget - // .text![ - // "affiliations_count"] - // .toString(), - // txtfont: 18.0, - // txtcolor: - // const Color - // .fromARGB( - // 255, - // 60, - // 82, - // 102), - // ) ], ), children: [ @@ -1565,6 +1646,8 @@ class _NewProfileState extends State { .length, itemBuilder: (context, index) { + print( + "Indexxxxxx $index"); return Column( children: [ ListTile( @@ -1608,7 +1691,7 @@ class _NewProfileState extends State { Navigator.push( context, MaterialPageRoute( - builder: (BuildContext context) => EditInteractionScreen1( + builder: (BuildContext context) => EditInteractionScreen( saveInteraction: provider.savedList[index], ))) }); @@ -1718,12 +1801,8 @@ class _NewProfileState extends State { ))); } }, - child: Text( - 'Show More', - style: TextStyle( - color: Constants - .k2color), - ), + child: + Text('Show More'), style: OutlinedButton .styleFrom( shape: @@ -1836,14 +1915,233 @@ class _NewProfileState extends State { ScaffoldMessenger.of(context).showSnackBar(snackBar); //scaffoldKeyLogin.currentState!.showSnackBar(snackBar); } + + Widget makeDismissible({required DraggableScrollableSheet child}) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () => Navigator.of(context).pop(), + child: GestureDetector( + onTap: () {}, + child: child, + ), + ); + } + + void bottomshet(affiliation_data) { + // print("Aff_index_data: ${affiliation_data}"); + showModalBottomSheet( + // isScrollControlled: + // true, + context: context, + + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: const BoxConstraints( + maxWidth: double.infinity, + ), + + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(20), + ), + ), + clipBehavior: Clip.antiAliasWithSaveLayer, + // sheetAnimationStyle: _animationStyle, + builder: (BuildContext context) { + return + // makeDismissible( + // child: + DraggableScrollableSheet( + expand: false, + // initialChildSize: + // 0.7, + // maxChildSize: + // 1, + // minChildSize: + // 0.5, + builder: (BuildContext context, ScrollController scrollController) { + return Container( + width: MediaQuery.of(context).size.width, + color: Colors.white, + // decoration: + // BoxDecoration(borderRadius: BorderRadius.circular(10)), + // child: ListView( + // children: [ + + // ], + // ), + + child: Column( + children: [ + Expanded( + child: ListView.builder( + controller: scrollController, + itemCount: 1, + itemBuilder: (BuildContext context, int index) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // Row( + // children: [ + // Text( + // "Affiliation", + // style: TextStyle(fontSize: 20.0), + // ) + // ], + // ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 8.0, top: 28.0), + child: Text( + "Organization Name", + style: TextStyle(fontSize: 12.0), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: Text( + affiliation_data['org_name'], + style: TextStyle(fontSize: 14.0), + ), + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 8.0, top: 18.0), + child: Text( + "Department", + style: TextStyle(fontSize: 12.0), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: Text( + affiliation_data['dept'], + style: TextStyle(fontSize: 14.0), + ), + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 8.0, top: 18.0), + child: Text( + "Role", + style: TextStyle(fontSize: 12.0), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: Text( + affiliation_data['role'], + style: TextStyle(fontSize: 14.0), + ), + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 8.0, top: 18.0), + child: Text( + "Time Frame", + style: TextStyle(fontSize: 12.0), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: Text( + affiliation_data['time_frame'], + style: TextStyle(fontSize: 14.0), + ), + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 8.0, top: 18.0), + child: Text( + "Oraganization Type", + style: TextStyle(fontSize: 12.0), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: Text( + affiliation_data['org_type'], + style: TextStyle(fontSize: 14.0), + ), + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 8.0, top: 18.0), + child: Text( + "Eng Type", + style: TextStyle(fontSize: 12.0), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: Text( + affiliation_data['emg_type'], + style: TextStyle(fontSize: 14.0), + ), + ) + ], + ), + ], + ); + }, + ), + ), + ], + ), + // child: ListView.builder( + // controller: scrollController, + // itemCount: 1, + // itemBuilder: (BuildContext context, int index) { + // return ListTile(title: Text(affiliation_data['org_name'])); + // }, + // ), + ); + }, + ); + //); + }, + ); + } } - - +// import 'package:discover_module/constants.dart'; // import 'package:discover_module/custom_widget/text.dart'; // import 'package:discover_module/hive_fun.dart'; // import 'package:discover_module/provider_class/affiliationsprovider.dart'; // import 'package:discover_module/provider_class/events_provider.dart'; +// import 'package:discover_module/provider_class/medicalinsightprovider.dart'; // import 'package:discover_module/provider_class/publications_provider.dart'; // import 'package:discover_module/provider_class/trials_provider.dart'; // import 'package:discover_module/ui_screen/affiliation_data.dart'; @@ -1854,10 +2152,13 @@ class _NewProfileState extends State { // import 'package:discover_module/ui_screen/interactionform/interaction_screen.dart'; // import 'package:discover_module/ui_screen/interactionform/interactionlistscreen.dart'; // import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/medical_insight.dart'; // import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; // import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart'; // import 'package:discover_module/ui_screen/interactionform/view_interaction_screen.dart'; // import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; +// import 'package:discover_module/ui_screen/medical_insight.dart'; +// import 'package:discover_module/ui_screen/new_editinteraction.dart'; // import 'package:discover_module/ui_screen/newformlist.dart'; // import 'package:discover_module/ui_screen/publication_data.dart'; // import 'package:expandable/expandable.dart'; @@ -1882,10 +2183,13 @@ class _NewProfileState extends State { // List publication_data = []; // List event_data = []; // List trial_data = []; +// List medinsightData = []; // List viewformData = []; // bool _isExpanded = false; + +// var item; // // final ScrollController controller = ScrollController(); // // final ScrollController controller2 = ScrollController(); @@ -1895,15 +2199,28 @@ class _NewProfileState extends State { // // TODO: implement initState // super.initState(); // print("pooja123"); +// //init(); // getaffiliations(); // getuserdetails(); + // print("Widget_isssIndex_iss ${widget.text}"); // print( // "Widget_isssIndex_iss ${widget.text!["id"]},${widget.text!["name"]},${widget.text!["img_path"]}"); // } +// init() async { +// await Provider.of(context, listen: false) +// .initConfigData(); +// final data = +// await Provider.of(context, listen: false); + +// // if(data.g) +// data.getRecords("form-3 demo"); +// // setState(() {}); +// } + // getaffiliations() async { // var affiliations = // Provider.of(context, listen: false); @@ -1928,12 +2245,17 @@ class _NewProfileState extends State { // final trialslist = trials.trialsinfo; +// var med = Provider.of(context, listen: false); +// await med.medicalinsightdata(); +// final medlist = med.trialsinfo; + // setState(() { // affiliation_data = affilist; // publication_data = publist; // event_data = eventlist; // viewformData = form.savedList; // trial_data = trialslist; +// medinsightData = medlist; // }); // print("Affiliations_data_is: $affilist"); @@ -1956,12 +2278,12 @@ class _NewProfileState extends State { // Widget build(BuildContext context) { // return SafeArea( // child: Scaffold( -// //backgroundColor: Color.fromARGB(255, 200, 222, 241), -// backgroundColor: Color.fromARGB(255, 237, 230, 230), +// backgroundColor: Color.fromARGB(255, 246, 248, 252), +// // backgroundColor: Color.fromARGB(255, 237, 230, 230), // appBar: AppBar( -// //backgroundColor: Colors.transparent, -// title: const Text('Profile'), -// ), +// // backgroundColor: Color.fromARGB(255, 246, 248, 252), +// //title: const Text('Profile'), +// ), // body: ListView( // children: [ // Column( @@ -1989,7 +2311,7 @@ class _NewProfileState extends State { // child: SizedBox.fromSize( // size: Size.fromRadius(48), // Image radius // child: Image.network(widget.text!["img_path"], -// fit: BoxFit.cover), +// fit: BoxFit.fill), // ), // )), // Column( @@ -2150,20 +2472,35 @@ class _NewProfileState extends State { // const SizedBox( // height: 8.0, // ), +// Align( +// alignment: Alignment.centerLeft, +// child: Padding( +// padding: const EdgeInsets.only(left: 15.0), +// child: Text1( +// title: "Profile Summarry", +// txtcolor: Colors.black, +// fontweight: FontWeight.normal, +// txtfont: 18.0), +// ), +// ), + +// Align( +// alignment: Alignment.centerLeft, +// child: Padding( +// padding: const EdgeInsets.all(15.0), +// child: Text1( +// title: widget.text!["summarry"], +// txtcolor: Colors.black, +// fontweight: FontWeight.normal, +// txtfont: 15.0), +// ), +// ), // // isonline // // ? // Container( // width: MediaQuery.of(context).size.width, -// child: Card( -// elevation: 4, -// clipBehavior: Clip.antiAliasWithSaveLayer, -// surfaceTintColor: Colors.white, -// // shape: RoundedRectangleBorder( -// // borderRadius: -// // BorderRadius.circular(0.0), -// // ), -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(30.0)), +// child: Padding( +// padding: const EdgeInsets.all(0.0), // child: Column( // crossAxisAlignment: CrossAxisAlignment.start, // children: [ @@ -2172,23 +2509,23 @@ class _NewProfileState extends State { // // style: TextStyle( // // fontSize: 20.0, fontWeight: FontWeight.bold), // // ), -// Padding( -// padding: const EdgeInsets.all(12.0), -// child: Text1( -// title: "Profile Summarry", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 18.0), -// ), +// // Padding( +// // padding: const EdgeInsets.all(12.0), +// // child: Text1( +// // title: "Profile Summarry", +// // txtcolor: Colors.black, +// // fontweight: FontWeight.normal, +// // txtfont: 18.0), +// // ), -// Padding( -// padding: const EdgeInsets.all(12.0), -// child: Text1( -// title: widget.text!["summarry"], -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 15.0), -// ), +// // Padding( +// // padding: const EdgeInsets.all(12.0), +// // child: Text1( +// // title: widget.text!["summarry"], +// // txtcolor: Colors.black, +// // fontweight: FontWeight.normal, +// // txtfont: 15.0), +// // ), // Padding( // padding: EdgeInsets.all(0.0), @@ -2586,8 +2923,12 @@ class _NewProfileState extends State { // builder: (_) => // AffiliationsData())); // }, -// child: -// Text('Show More'), +// child: Text( +// 'Show More', +// style: TextStyle( +// color: Constants +// .k2color), +// ), // style: OutlinedButton // .styleFrom( // shape: @@ -2706,10 +3047,14 @@ class _NewProfileState extends State { // color: Colors.white, // child: DataTable( // columns: const [ +// // DataColumn( +// // label: Expanded( +// // child: Text( +// // 'sl no'))), // DataColumn( // label: Expanded( // child: Text( -// 'sl no'))), +// ''))), // DataColumn( // label: Expanded( // child: Text( @@ -2800,8 +3145,12 @@ class _NewProfileState extends State { // builder: (_) => // PublicationsData())); // }, -// child: -// Text('Show More'), +// child: Text( +// 'Show More', +// style: TextStyle( +// color: Constants +// .k2color), +// ), // style: OutlinedButton // .styleFrom( // shape: @@ -2905,7 +3254,7 @@ class _NewProfileState extends State { // DataColumn( // label: Expanded( // child: Text( -// 'sl no', +// '', // softWrap: // true))), // DataColumn( @@ -2998,8 +3347,12 @@ class _NewProfileState extends State { // builder: (_) => // EventsData())); // }, -// child: -// Text('Show More'), +// child: Text( +// 'Show More', +// style: TextStyle( +// color: Constants +// .k2color), +// ), // style: OutlinedButton // .styleFrom( // shape: @@ -3073,6 +3426,12 @@ class _NewProfileState extends State { // const SizedBox( // width: 8.0, // ), +// Text1( +// title: "4", +// txtcolor: Colors.white, +// fontweight: +// FontWeight.normal, +// txtfont: 17.0), // ], // ), // children: [ @@ -3217,8 +3576,12 @@ class _NewProfileState extends State { // builder: (_) => // EventsData())); // }, -// child: -// Text('Show More'), +// child: Text( +// 'Show More', +// style: TextStyle( +// color: Constants +// .k2color), +// ), // style: OutlinedButton // .styleFrom( // shape: @@ -3238,6 +3601,486 @@ class _NewProfileState extends State { // ), // ), // adds spacing between the text and image +// SizedBox( +// height: 10.0, +// ), + +// // Flexible( +// // flex: 1, +// // child: Padding( +// // padding: const EdgeInsets.only( +// // left: 1.0, right: 1.0), +// // child: Card( +// // elevation: 5, +// // shape: RoundedRectangleBorder( +// // borderRadius: +// // BorderRadius.circular(0.0), +// // ), +// // color: const Color.fromARGB( +// // 255, 0, 71, 137), +// // child: ExpansionTile( +// // maintainState: true, +// // onExpansionChanged: +// // (bool expanded) { +// // setState(() { +// // _isExpanded = expanded; +// // }); +// // }, +// // backgroundColor: +// // const Color.fromARGB( +// // 255, 0, 71, 137), +// // trailing: Icon( +// // _isExpanded +// // ? Icons.keyboard_arrow_up +// // : Icons +// // .keyboard_arrow_down, +// // color: Colors.white), +// // // collapsedBackgroundColor: Color(0xFF2b9af3), +// // initiallyExpanded: true, +// // title: Row( +// // //mainAxisSize: MainAxisSize.min, +// // children: [ +// // // GestureDetector( + +// // Text1( +// // title: "Medical Insight", +// // txtcolor: Colors.white, +// // fontweight: +// // FontWeight.normal, +// // txtfont: 17.0), +// // // ), +// // const SizedBox( +// // width: 8.0, +// // ), +// // Text1( +// // title: "4", +// // txtfont: 18.0, +// // txtcolor: +// // const Color.fromARGB( +// // 255, 60, 82, 102), +// // ) +// // ], +// // ), +// // children: [ +// // Container( +// // height: MediaQuery.of(context) +// // .size +// // .height, +// // color: Colors.white, +// // child: Consumer< +// // MediacalInsightProvider>( +// // builder: (context, value, +// // child) { +// // return Column( +// // children: [ +// // Expanded( +// // child: +// // ListView.builder( +// // physics: +// // const ScrollPhysics(), +// // // scrollDirection: Axis.vertical, +// // shrinkWrap: +// // true, +// // itemCount: value +// // .med +// // .length, +// // itemBuilder: +// // (context, +// // index) { +// // item = value +// // .med[ +// // index]; + +// // print( +// // "Item_Medical_insight ${item['Therapeutic Area']}"); +// // return Padding( +// // padding: const EdgeInsets +// // .all( +// // 8.0), +// // child: +// // Card( +// // margin: +// // EdgeInsets.zero, + +// // elevation: +// // 4, +// // surfaceTintColor: +// // Colors.white, +// // shape: +// // RoundedRectangleBorder( +// // borderRadius: +// // BorderRadius.zero, +// // ), + +// // // shape: RoundedRectangleBorder( +// // // side: BorderSide(color: Colors.black, width: 1), +// // // borderRadius: BorderRadius.only( +// // // bottomRight: Radius.circular(30)), +// // // ), +// // child: +// // SizedBox( +// // width: +// // MediaQuery.sizeOf(context).width, +// // child: +// // ListTile( +// // dense: +// // true, +// // title: +// // Column( +// // // crossAxisAlignment: CrossAxisAlignment.center, +// // children: [ +// // // Text( +// // // "Acute neurology is the therapeutic area of the medical insight for Product A. The age of treatment is the topic of interest for this source type publication."), + +// // RichText( +// // text: TextSpan( +// // text: '', +// // style: DefaultTextStyle.of(context).style, +// // children: const [ +// // TextSpan(text: 'Acute neurology ', style: TextStyle(fontWeight: FontWeight.bold)), +// // // TextSpan( +// // // text: ' therapeutic area ', +// // // style: TextStyle( +// // // fontWeight: +// // // FontWeight.bold)), +// // TextSpan(text: 'is the therapeutic area of the medical insight for '), +// // TextSpan(text: 'Product A. The age of treatment', style: TextStyle(fontWeight: FontWeight.bold)), +// // TextSpan(text: ' is the topic of interest for this source type'), +// // TextSpan(text: ' publication.', style: TextStyle(fontWeight: FontWeight.bold)), +// // ], +// // ), +// // ), + +// // const Padding( +// // padding: EdgeInsets.all(8.0), +// // child: Row( +// // mainAxisAlignment: MainAxisAlignment.spaceBetween, +// // children: [ +// // Row( +// // children: [ +// // Icon( +// // Icons.person, +// // size: 20, +// // ), +// // Text( +// // "pooja", +// // style: TextStyle(fontSize: 14.0), +// // ) +// // ], +// // ), +// // Row( +// // children: [ +// // Icon( +// // Icons.calendar_today, +// // size: 20, +// // ), +// // Text( +// // "11/11/2022 ", +// // style: TextStyle(fontSize: 14.0), +// // ) +// // ], +// // ) +// // ], +// // ), +// // ), +// // ], +// // ), +// // ), +// // ), +// // // shape: BorderRadius.only(bottomRight: Radius.circular(50)), +// // ), +// // ); +// // }), +// // ) +// // ], +// // ); +// // }), +// // ), +// // Container( +// // color: Colors.white, +// // child: Align( +// // alignment: Alignment.center, +// // child: Padding( +// // padding: +// // const EdgeInsets.all( +// // 8.0), +// // child: OutlinedButton( +// // onPressed: () {}, +// // child: Text( +// // 'Show More', +// // style: TextStyle( +// // color: Constants +// // .k2color), +// // ), +// // style: OutlinedButton +// // .styleFrom( +// // shape: +// // RoundedRectangleBorder( +// // borderRadius: +// // BorderRadius +// // .circular( +// // 12), +// // ), +// // ), +// // ), +// // ), +// // ), +// // ) +// // ]), +// // ), +// // ), +// // ), + +// Flexible( +// flex: 1, +// child: Padding( +// padding: const EdgeInsets.only( +// left: 1.0, right: 1.0), +// child: Card( +// elevation: 5, +// shape: RoundedRectangleBorder( +// borderRadius: +// BorderRadius.circular(0.0), +// ), +// color: const Color.fromARGB( +// 255, 0, 71, 137), +// child: ExpansionTile( +// maintainState: true, +// onExpansionChanged: +// (bool expanded) { +// setState(() { +// _isExpanded = expanded; +// }); +// }, +// backgroundColor: +// const Color.fromARGB( +// 255, 0, 71, 137), +// trailing: Icon( +// _isExpanded +// ? Icons.keyboard_arrow_up +// : Icons +// .keyboard_arrow_down, +// color: Colors.white), +// // collapsedBackgroundColor: Color(0xFF2b9af3), +// initiallyExpanded: true, +// // initiallyExpanded: true, +// title: Row( +// mainAxisAlignment: +// MainAxisAlignment.start, +// // mainAxisSize: MainAxisSize.min, +// children: [ +// Text1( +// title: "Medical Insight", +// txtcolor: Colors.white, +// fontweight: +// FontWeight.normal, +// txtfont: 17.0), +// const SizedBox( +// width: 8.0, +// ), +// Text1( +// title: "3", +// txtcolor: Colors.white, +// fontweight: +// FontWeight.normal, +// txtfont: 17.0), +// ], +// ), +// children: [ +// Container( +// width: MediaQuery.of(context) +// .size +// .width, + +// /// 5, +// color: Colors.white, +// child: Consumer< +// MediacalInsightProvider>( +// builder: +// (BuildContext context, +// value, +// Widget? child) { +// print( +// "med1 : ${value.med.length}"); + +// if (value.med.length != 0) { +// return ListView.builder( +// physics: +// const ScrollPhysics(), +// // scrollDirection: Axis.vertical, +// shrinkWrap: true, +// itemCount: value.med +// .take(2) +// .length, +// itemBuilder: +// (context, index) { +// item = value +// .med[index]; + +// print( +// "Item_Medical_insight ${item['Therapeutic Area']}"); +// return Padding( +// padding: +// const EdgeInsets +// .all(8.0), +// child: Card( +// margin: +// EdgeInsets +// .zero, + +// elevation: 4, +// surfaceTintColor: +// Colors +// .white, +// shape: +// RoundedRectangleBorder( +// borderRadius: +// BorderRadius +// .zero, +// ), + +// // shape: RoundedRectangleBorder( +// // side: BorderSide(color: Colors.black, width: 1), +// // borderRadius: BorderRadius.only( +// // bottomRight: Radius.circular(30)), +// // ), +// child: SizedBox( +// width: MediaQuery +// .sizeOf( +// context) +// .width, +// child: +// ListTile( +// dense: true, +// title: +// Column( +// // crossAxisAlignment: CrossAxisAlignment.center, +// children: [ +// // Text( +// // "Acute neurology is the therapeutic area of the medical insight for Product A. The age of treatment is the topic of interest for this source type publication."), + +// RichText( +// text: +// TextSpan( +// text: +// '', +// style: +// DefaultTextStyle.of(context).style, +// children: const [ +// TextSpan(text: 'Acute neurology ', style: TextStyle(fontWeight: FontWeight.bold)), +// // TextSpan( +// // text: ' therapeutic area ', +// // style: TextStyle( +// // fontWeight: +// // FontWeight.bold)), +// TextSpan(text: 'is the therapeutic area of the medical insight for '), +// TextSpan(text: 'Product A. The age of treatment', style: TextStyle(fontWeight: FontWeight.bold)), +// TextSpan(text: ' is the topic of interest for this source type'), +// TextSpan(text: ' publication.', style: TextStyle(fontWeight: FontWeight.bold)), +// ], +// ), +// ), + +// const Padding( +// padding: +// EdgeInsets.all(8.0), +// child: +// Row( +// mainAxisAlignment: +// MainAxisAlignment.spaceBetween, +// children: [ +// Row( +// children: [ +// Icon( +// Icons.person, +// size: 20, +// ), +// Text( +// "pooja", +// style: TextStyle(fontSize: 14.0), +// ) +// ], +// ), +// Row( +// children: [ +// Icon( +// Icons.calendar_today, +// size: 20, +// ), +// Text( +// "11/11/2022 ", +// style: TextStyle(fontSize: 14.0), +// ) +// ], +// ) +// ], +// ), +// ), +// ], +// ), +// ), +// ), +// // shape: BorderRadius.only(bottomRight: Radius.circular(50)), +// ), +// ); +// }); +// } else { +// return Container( +// color: Colors.white, +// width: MediaQuery.of( +// context) +// .size +// .width, +// child: Column( +// children: [ +// Text("No records"), +// ], +// ), +// ); +// } +// }), +// ), +// Container( +// color: Colors.white, +// child: Align( +// alignment: Alignment.center, +// child: Padding( +// padding: +// const EdgeInsets.all( +// 8.0), +// child: OutlinedButton( +// onPressed: () { +// Navigator.push( +// context, +// MaterialPageRoute( +// builder: (_) => +// const MedicalInsight1())); +// }, +// child: Text( +// 'Show More', +// style: TextStyle( +// color: Constants +// .k2color), +// ), +// style: OutlinedButton +// .styleFrom( +// shape: +// RoundedRectangleBorder( +// borderRadius: +// BorderRadius +// .circular( +// 12), +// ), +// ), +// ), +// ), +// ), +// ) +// ]), +// ), +// ), +// ), + // SizedBox( // height: 10.0, // ), @@ -3352,115 +4195,118 @@ class _NewProfileState extends State { // Widget? child) { // print( // "P_leangth : ${provider.savedList.length}"); -// return ListView.builder( -// shrinkWrap: true, -// physics: -// NeverScrollableScrollPhysics(), -// itemCount: provider -// .savedList -// .take(2) -// .length, -// itemBuilder: -// (context, index) { -// return Column( -// children: [ -// ListTile( -// subtitle: Text( -// 'Updated on ${provider.savedList[index].updatedTime}', -// //style: TextStyle(fontStyle: FontStyle.italic), -// ), -// title: Text( -// provider -// .savedList[ -// index] -// .id, -// ), -// trailing: -// SizedBox( -// width: 150, -// child: Row( -// children: [ -// IconButton( -// onPressed: -// () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (BuildContext context) => ViewInteractionScreen( -// saveInteraction: provider.savedList[index], -// ))); -// }, -// icon: -// const Icon( -// Icons.info_outline, -// size: -// 24, -// color: Color.fromARGB( -// 255, -// 8, -// 39, -// 92), -// ), -// ), -// IconButton( -// onPressed: -// () async { -// await provider.initConfigData().then({ + +// if (provider +// .savedList.length != +// 0) { +// return ListView.builder( +// shrinkWrap: true, +// physics: +// NeverScrollableScrollPhysics(), +// itemCount: provider +// .savedList +// .take(2) +// .length, +// itemBuilder: +// (context, index) { +// print( +// "Indexxxxxx $index"); +// return Column( +// children: [ +// ListTile( +// subtitle: +// Text( +// 'Updated on ${provider.savedList[index].updatedTime}', +// //style: TextStyle(fontStyle: FontStyle.italic), +// ), +// title: Text( +// provider +// .savedList[ +// index] +// .id, +// ), +// trailing: +// SizedBox( +// width: 150, +// child: Row( +// children: [ +// IconButton( +// onPressed: +// () { // Navigator.push( // context, // MaterialPageRoute( -// builder: (BuildContext context) => EditInteractionScreen( +// builder: (BuildContext context) => ViewInteractionScreen( // saveInteraction: provider.savedList[index], -// ))) -// }); -// }, -// icon: -// const Icon( -// Icons.edit, -// size: -// 24, -// color: Color.fromARGB( -// 255, -// 8, -// 39, -// 92), +// ))); +// }, +// icon: +// const Icon( +// Icons.info_outline, +// size: 24, +// color: Color.fromARGB(255, 8, 39, 92), +// ), // ), -// ), -// IconButton( -// onPressed: -// () { -// showDeleteRecordAlertDialog( -// context, -// provider.savedList[index].id, -// provider.savedList[index]); -// }, -// icon: -// const Icon( -// Icons.delete, -// size: -// 24, -// color: Color.fromARGB( -// 255, -// 8, -// 39, -// 92), +// IconButton( +// onPressed: +// () async { +// await provider.initConfigData().then({ +// Navigator.push( +// context, +// MaterialPageRoute( +// builder: (BuildContext context) => EditInteractionScreen( +// saveInteraction: provider.savedList[index], +// ))) +// }); +// }, +// icon: +// const Icon( +// Icons.edit, +// size: 24, +// color: Color.fromARGB(255, 8, 39, 92), +// ), // ), -// ), -// ]), +// IconButton( +// onPressed: +// () { +// showDeleteRecordAlertDialog(context, provider.savedList[index].id, provider.savedList[index]); +// }, +// icon: +// const Icon( +// Icons.delete, +// size: 24, +// color: Color.fromARGB(255, 8, 39, 92), +// ), +// ), +// ]), +// ), +// onTap: () { +// Navigator.push( +// context, +// MaterialPageRoute( +// builder: (BuildContext context) => ViewInteractionScreen( +// saveInteraction: provider.savedList[index], +// ))); +// }, // ), -// onTap: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (BuildContext context) => ViewInteractionScreen( -// saveInteraction: provider.savedList[index], -// ))); -// }, -// ), -// const Divider(), -// ], -// ); -// }); +// const Divider(), +// ], +// ); +// }); +// } else { +// return Container( +// color: Colors.white, +// width: MediaQuery.of( +// context) +// .size +// .width, +// child: Column( +// children: [ +// Text("No records"), +// ], +// ), +// ); +// } // }), // ), @@ -3538,6 +4384,315 @@ class _NewProfileState extends State { // ), // ), // ), + +// // Flexible( +// // flex: 1, +// // child: Padding( +// // padding: const EdgeInsets.only( +// // left: 1.0, right: 1.0), +// // child: Card( +// // elevation: 5, +// // shape: RoundedRectangleBorder( +// // borderRadius: +// // BorderRadius.circular(0.0), +// // ), +// // color: const Color.fromARGB( +// // 255, 0, 71, 137), +// // child: ExpansionTile( +// // maintainState: true, +// // onExpansionChanged: +// // (bool expanded) { +// // setState(() { +// // _isExpanded = expanded; +// // }); +// // }, +// // backgroundColor: +// // const Color.fromARGB( +// // 255, 0, 71, 137), +// // trailing: Icon( +// // _isExpanded +// // ? Icons.keyboard_arrow_up +// // : Icons +// // .keyboard_arrow_down, +// // color: Colors.white), +// // // collapsedBackgroundColor: Color(0xFF2b9af3), +// // initiallyExpanded: true, +// // title: Row( +// // //mainAxisSize: MainAxisSize.min, +// // children: [ +// // GestureDetector( +// // onTap: () async { +// // final provider = Provider +// // .of( +// // context, +// // listen: false); +// // print( +// // "CheckkkkkProvider : ${(getCount(provider.intConfigDataList[0].name, provider) != 0)}"); +// // if (getCount( +// // provider +// // .intConfigDataList[ +// // 0] +// // .name, +// // provider) != +// // 0) { +// // provider.savedList +// // .where((element) => +// // element.form == +// // provider +// // .intConfigDataList[ +// // 0] +// // .name) +// // .toList(); +// // Navigator.push( +// // context, +// // MaterialPageRoute( +// // builder: (BuildContext +// // context) => +// // SavedFormListScreen( +// // formname: provider +// // .intConfigDataList[ +// // 0] +// // .name, +// // ))); +// // } +// // }, +// // child: Text1( +// // title: +// // "Interaction Form", +// // txtcolor: Colors.white, +// // fontweight: +// // FontWeight.normal, +// // txtfont: 17.0), +// // ), +// // const SizedBox( +// // width: 8.0, +// // ), +// // // Text1( +// // // title: widget +// // // .text![ +// // // "affiliations_count"] +// // // .toString(), +// // // txtfont: 18.0, +// // // txtcolor: +// // // const Color +// // // .fromARGB( +// // // 255, +// // // 60, +// // // 82, +// // // 102), +// // // ) +// // ], +// // ), +// // children: [ +// // Container( +// // width: MediaQuery.of(context) +// // .size +// // .width, + +// // ///5, +// // color: Colors.white, +// // child: Consumer< +// // ViewInteractionProvider>( +// // builder: +// // (BuildContext context, +// // provider, +// // Widget? child) { +// // print( +// // "P_leangth : ${provider.savedList.length}"); + +// // if (provider +// // .savedList.length != +// // 0) { +// // return ListView.builder( +// // shrinkWrap: true, +// // physics: +// // NeverScrollableScrollPhysics(), +// // itemCount: provider +// // .savedList +// // .take(2) +// // .length, +// // itemBuilder: +// // (context, index) { +// // return Column( +// // children: [ +// // ListTile( +// // subtitle: +// // Text( +// // 'Updated on ${provider.savedList[index].updatedTime}', +// // //style: TextStyle(fontStyle: FontStyle.italic), +// // ), +// // title: Text( +// // provider +// // .savedList[ +// // index] +// // .id, +// // ), +// // trailing: +// // SizedBox( +// // width: 150, +// // child: Row( +// // children: [ +// // IconButton( +// // onPressed: +// // () { +// // Navigator.push( +// // context, +// // MaterialPageRoute( +// // builder: (BuildContext context) => ViewInteractionScreen( +// // saveInteraction: provider.savedList[index], +// // ))); +// // }, +// // icon: +// // const Icon( +// // Icons.info_outline, +// // size: 24, +// // color: Color.fromARGB(255, 8, 39, 92), +// // ), +// // ), +// // IconButton( +// // onPressed: +// // () async { +// // await provider.initConfigData().then({ +// // Navigator.push( +// // context, +// // MaterialPageRoute( +// // builder: (BuildContext context) => EditInteractionScreen1( +// // saveInteraction: provider.savedList[index], +// // ))) +// // }); +// // }, +// // icon: +// // const Icon( +// // Icons.edit, +// // size: 24, +// // color: Color.fromARGB(255, 8, 39, 92), +// // ), +// // ), +// // IconButton( +// // onPressed: +// // () { +// // showDeleteRecordAlertDialog(context, provider.savedList[index].id, provider.savedList[index]); +// // }, +// // icon: +// // const Icon( +// // Icons.delete, +// // size: 24, +// // color: Color.fromARGB(255, 8, 39, 92), +// // ), +// // ), +// // ]), +// // ), +// // onTap: () { +// // Navigator.push( +// // context, +// // MaterialPageRoute( +// // builder: (BuildContext context) => ViewInteractionScreen( +// // saveInteraction: provider.savedList[index], +// // ))); +// // }, +// // ), +// // const Divider(), +// // ], +// // ); +// // }); +// // } else { +// // return Container( +// // color: Colors.white, +// // width: MediaQuery.of( +// // context) +// // .size +// // .width, +// // child: Column( +// // children: [ +// // Padding( +// // padding: +// // const EdgeInsets +// // .all(8.0), +// // child: Text( +// // "No records"), +// // ), +// // ], +// // ), +// // ); +// // } +// // }), +// // ), +// // // InteractionProvider() +// // // .savedList +// // // .length != +// // // 0 +// // // ? +// // Container( +// // color: Colors.white, +// // child: Align( +// // alignment: Alignment.center, +// // child: Padding( +// // padding: +// // const EdgeInsets.all( +// // 8.0), +// // child: OutlinedButton( +// // onPressed: () { +// // final provider = Provider +// // .of( +// // context, +// // listen: +// // false); + +// // print( +// // "showwCheckkkk_isss: ${(getCount(provider.intConfigDataList[0].name, provider) != 0)}"); +// // if (getCount( +// // provider +// // .intConfigDataList[ +// // 0] +// // .name, +// // provider) != +// // 0) { +// // provider.savedList +// // .where((element) => +// // element +// // .form == +// // provider +// // .intConfigDataList[ +// // 0] +// // .name) +// // .toList(); +// // Navigator.push( +// // context, +// // MaterialPageRoute( +// // builder: (BuildContext +// // context) => +// // SavedFormListScreen( +// // formname: provider +// // .intConfigDataList[0] +// // .name, +// // ))); +// // } +// // }, +// // child: Text( +// // 'Show More', +// // style: TextStyle( +// // color: Constants +// // .k2color), +// // ), +// // style: OutlinedButton +// // .styleFrom( +// // shape: +// // RoundedRectangleBorder( +// // borderRadius: +// // BorderRadius +// // .circular( +// // 12), +// // ), +// // ), +// // ), +// // ), +// // ), +// // ) +// // // : SizedBox.shrink() +// // ]), +// // ), +// // ), +// // ), // ], // ), // ), @@ -3547,131 +4702,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/new_viewinteraction.dart b/lib/ui_screen/new_viewinteraction.dart new file mode 100644 index 0000000..be80529 --- /dev/null +++ b/lib/ui_screen/new_viewinteraction.dart @@ -0,0 +1,532 @@ +import 'package:discover_module/constants.dart'; +import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; +import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; +import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; +import 'package:discover_module/ui_screen/interactionform/util.dart'; +import 'package:discover_module/ui_screen/interactionform/widget/custombutton.dart'; +import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +// ignore: must_be_immutable +class ViewInteractionScreen1 extends StatefulWidget { + SaveInteraction saveInteraction; + ViewInteractionScreen1({super.key, required this.saveInteraction}); + + @override + State createState() => _ViewInteractionScreenState(); +} + +class _ViewInteractionScreenState extends State { + List interactionReponseList = []; + List sectionList = []; + List textEditingControllerList = []; + int textfieldIndex = 0; + String dropdownvalue = 'Select value'; + String? fileName; + final TextEditingController textEditingController = TextEditingController(); + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + init(); + }); + + super.initState(); + } + + init() async { + await Provider.of(context, listen: false) + .initSavedForm(widget.saveInteraction); + setState(() {}); + } + + @override + Widget build(BuildContext context) { + return Consumer( + builder: (BuildContext context, provider, Widget? child) { + print("build context"); + print("${provider.interactionReponseList}"); + return GestureDetector( + onTap: () { + FocusScope.of(context).requestFocus(FocusNode()); + }, + child: OrientationBuilder(builder: (context, orientation) { + return SafeArea( + child: Scaffold( + backgroundColor: Colors.white, + //resizeToAvoidBottomInset: false, + appBar: AppBar( + title: Text( + widget.saveInteraction.id, + style: TextStyle( + fontSize: isTablet ? 22 : 14, color: Colors.white), + ), + // backgroundColor: const Color(0xFF2b9af3), + automaticallyImplyLeading: false, + leading: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: const Icon( + Icons.arrow_back_ios, + color: Colors.white, + ), + ), + ), + body: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Expanded( + child: ListView.builder( + itemCount: provider.interactionReponseList.length, + cacheExtent: double.parse( + provider.interactionReponseList.length.toString()), + itemBuilder: (context, index) { + var item = provider.interactionReponseList[index]; + sectionList = item.sectionList; + return Card( + elevation: 4, + // color: Constants.k2color, + child: Container( + color: Color.fromARGB(255, 246, 248, 252), + child: ExpansionTile( + dense: true, + initiallyExpanded: true, + title: Stack( + alignment: AlignmentDirectional.center, + children: [ + Container( + // height: double.infinity, + width: double.infinity, + padding: const EdgeInsets.all(0.0), + decoration: BoxDecoration( + // color: Color(0xFF2b9af3), + // color: Constants.k2color, + ), + child: Text( + item.sectionName, + style: const TextStyle( + color: Colors.black, + fontWeight: FontWeight.normal, + fontSize: 18.0), + )), + ]), + children: [ + Container( + color: Colors.white, + child: Padding( + padding: + const EdgeInsets.only(top: 0.0), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0), + child: GridView.count( + physics: + const NeverScrollableScrollPhysics(), + crossAxisCount: + context.responsive( + 1, + sm: 1, // small + md: 2, // medium + lg: sectionList.length == 1 + ? 1 + : 3, // large + xl: 3, // extra large screen + ), + mainAxisSpacing: + sectionList.length == 1 || + !isTablet + ? 1 + : 3.5, + childAspectRatio: + sectionList.length == 1 + ? orientation == + Orientation + .landscape + ? 10 + : 4.8 + : isTablet + ? 2.8 + : 5.5, + shrinkWrap: true, + padding: EdgeInsets.zero, + children: List.generate( + sectionList.length, + (i) { + print(sectionList); + SectionList sectionItem = + sectionList[i]; + dropdownvalue = sectionItem + .widget == + InteractionWidget + .DROPDOWN + ? sectionItem.value ?? + "Select" + : ' '; + List< + InputClass> list = sectionItem + .widget == + InteractionWidget + .DROPDOWN || + sectionItem + .widget == + InteractionWidget + .AUTOCOMPLETE || + sectionItem + .widget == + InteractionWidget + .MULTISELECT + ? provider.getData2( + sectionItem) + : []; + provider.checkboxlist = + sectionItem.widget == + InteractionWidget + .CHECKBOX + ? provider.getData2( + sectionItem) + : []; + + return Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + sectionItem.widget == + InteractionWidget + .BUTTON && + sectionItem + .param == + 'add' + ? const SizedBox + .shrink() + : Text( + '${sectionItem.name}:*', + style: TextStyle( + color: Constants + .k2color, + fontSize: + isTablet + ? 18 + : 12, + fontWeight: + FontWeight + .normal), + ), + returnWidget( + sectionItem: + sectionItem, + item: item, + provider: provider, + list: list, + gridIndex: i, + listIndex: index, + widgetData: + sectionItem + .widget!), + ], + ); + }, + ), + ), + ), + + item.multiple + ? gridViewWidget( + provider, + item.sectionName, + item.multipleList ?? [], + orientation, + item, + index) + : const SizedBox.shrink(), + provider.interactionReponseList + .length == + index - 1 + ? saveActions(provider) + : const SizedBox.shrink() + //const Spacer(), + ], + ), + ), + ), + ]), + ), + ); + }, + ), + ), + // const Spacer(), + // saveActions(provider), + ], + )), + ); + }), + ); + }); + } + + Widget returnWidget({ + required SectionList sectionItem, + required FormFieldData item, + required InteractionProvider provider, + required List list, + required int gridIndex, + required int listIndex, + required InteractionWidget widgetData, + }) { + switch (widgetData) { + case InteractionWidget.CHECKBOX: + return (sectionItem.inputList!.length >= 5) + ? Text(sectionItem.selectedValue.toString()) + : Text(provider.getDataValue( + sectionItem.id, sectionItem.selectedValue!.last)); + + case InteractionWidget.AUTOCOMPLETE: + return Text(provider.getDataValue( + sectionItem.id, sectionItem.selectedValue!.last)); + + case InteractionWidget.MULTISELECT: + return Text(sectionItem.selectedValue.toString()); + + case InteractionWidget.RADIO: + return (sectionItem.inputList!.length >= 5) + ? Text( + sectionItem.selectedValue!.isNotEmpty + ? provider.getDataValue( + sectionItem.id, sectionItem.selectedValue!.last) + : " ", + style: TextStyle(fontSize: 18.0), + ) + : Text( + provider.getDataValue( + sectionItem.id, + sectionItem.selectedValue!.last, + ), + style: TextStyle(fontSize: 18.0), + ); + + case InteractionWidget.LABEL: + return Text( + sectionItem.input!, + style: TextStyle(fontSize: 18.0), + ); + + case InteractionWidget.RANGESLIDER: + return Text(sectionItem.selectedValue!.isNotEmpty + ? sectionItem.selectedValue!.last.toString() + : " "); + + case InteractionWidget.TEXT: + return Text( + sectionItem.selectedValue!.isNotEmpty + ? sectionItem.selectedValue!.last.toString() + : " ", + style: TextStyle(fontSize: 18.0), + ); + + case InteractionWidget.BUTTON: + return sectionItem.input == "chooseFile" + ? sectionItem.selectedValue!.isNotEmpty + ? const Text("File Uploaded") + : const Text(" ") + : const Text(" "); + default: + return Text(sectionItem.selectedValue!.isNotEmpty + ? provider.getDataValue( + sectionItem.id, sectionItem.selectedValue!.last) + : " "); + } + } + + Widget saveActions(InteractionProvider provider) { + return Align( + alignment: Alignment.centerRight, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + CustomButton( + backgroundColor: Colors.red.shade800, + onPressed: () { + //showDeleteProfileAlertDialog(context); + for (var textcontrollers in provider.textEditingControllerList) { + textcontrollers.text = ''; + } + }, + textColor: Colors.white, + title: "Reset", + height: 40, + width: isTablet ? 100 : 60, + fontsize: isTablet ? 15 : 10.2, + ), + SizedBox( + width: isTablet ? 20 : 4, + ), + CustomButton( + backgroundColor: Colors.green.shade900, + onPressed: () async { + if (textFieldsValidation(provider).isEmpty) { + // await provider.saveJsonObject(context, widget.form); + _displaySnackBar('Form Saved Sucessfully!'); + } else { + _displaySnackBar(textFieldsValidation(provider)); + } + }, + textColor: Colors.white, + title: "Save", + height: 40, + width: isTablet ? 100 : 60, + fontsize: isTablet ? 16 : 12, + ), + SizedBox( + width: isTablet ? 20 : 2, + ), + ], + ), + ); + } + + Widget gridViewWidget( + InteractionProvider provider, + String sectionName, + List sectionList, + Orientation orientation, + FormFieldData item, + int listIndex) { + List pooja = sectionList; + + print("Pooja: $pooja"); + + List> convertedArray = []; + print("Provider Length: ${item.sectionList.length}"); + + for (int i = 0; i < sectionList.length; i += item.sectionList.length + 1) { + print("Section List11111: $sectionList"); + print("item.sectionList.length List11111: ${item.sectionList.length}"); + + convertedArray + .add(sectionList.sublist(i, i + item.sectionList.length + 1)); + } + print("ConvertedArrayEdit.leangth: $convertedArray"); + print("ConvertedArray.leangth2323: ${convertedArray.length}"); + + return Column( + children: [ + for (var i = 0; i < convertedArray.length; i++) + DecoratedBox( + decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(10.0), + color: i % 2 == 0 + ? Color.fromARGB(133, 213, 241, 254) + : Colors.white, + ), + child: GridView.builder( + physics: const NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: context.responsive( + 1, // default + sm: 1, // small + md: 2, // medium + lg: sectionList.length == 1 + ? 1 + : (sectionList.length >= 1 ? 3 : 3), + // lg: sectionList.length == 1 ? 1 : 3, // large + xl: 3, // extra large screen + ), + childAspectRatio: sectionList.length == 1 + ? orientation == Orientation.landscape + ? 10 + : 4.8 + : isTablet + ? 2.8 + : 5.5, + + mainAxisSpacing: sectionList.length == 1 || !isTablet ? 1 : 3.5, + // mainAxisSpacing: sectionList.length == 1 || !isTablet ? 1 : 2, + ), + shrinkWrap: true, + padding: EdgeInsets.zero, + itemCount: convertedArray[i].length, + itemBuilder: (context, index) { + SectionList sectionItem = convertedArray[i][index]; + dropdownvalue = sectionItem.widget == InteractionWidget.DROPDOWN + ? sectionItem.value ?? "Select" + : ' '; + List list = sectionItem.widget == + InteractionWidget.DROPDOWN || + sectionItem.widget == InteractionWidget.AUTOCOMPLETE || + sectionItem.widget == InteractionWidget.MULTISELECT + ? provider.getData2(sectionItem) + : []; + provider.checkboxlist = + sectionItem.widget == InteractionWidget.CHECKBOX + ? provider.getData2(sectionItem) + : []; + + return SizedBox( + height: MediaQuery.of(context).size.height, + child: Padding( + padding: const EdgeInsets.only(left: 18.0, top: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + sectionItem.widget == InteractionWidget.BUTTON && + sectionItem.param == 'add' || + sectionItem.param == 'deletebtn' + ? const SizedBox.shrink() + + // ? const SizedBox.shrink() + : Text( + '${sectionItem.name}:*', + style: TextStyle( + color: Constants.k2color, + fontSize: isTablet ? 18 : 12, + ), + ), + // const SizedBox( + // height: 15, + // ), + returnWidget( + sectionItem: sectionItem, + item: item, + provider: provider, + list: list, + gridIndex: i, + listIndex: listIndex, + widgetData: sectionItem.widget!), + ], + ), + ), + ); + }, + ), + ), + //), + ], + ); + } + + String textFieldsValidation(InteractionProvider provider) { + if (provider.sectionList + .any((element) => element.controller!.text.isEmpty)) { + return 'Fields cannot be empty'; + } + + return ''; + } + + _displaySnackBar(String msg) { + final snackBar = SnackBar( + content: Text( + msg, + style: const TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold), + )); + ScaffoldMessenger.of(context).showSnackBar(snackBar); + //scaffoldKeyLogin.currentState!.showSnackBar(snackBar); + } +} diff --git a/lib/ui_screen/newformlist.dart b/lib/ui_screen/newformlist.dart index 02f0ed5..ee2053c 100644 --- a/lib/ui_screen/newformlist.dart +++ b/lib/ui_screen/newformlist.dart @@ -193,11 +193,11 @@ class _FormListState extends State { ConfigDataProvider(); await configDataProvider.initConfigUIDataMedical(); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - const MedicalInsight())); + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // const MedicalInsight1())); }, trailing: Icon(Icons.arrow_forward_ios), ), @@ -298,7 +298,7 @@ class _FormListState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => const MedicalInsight())); + builder: (context) => const MedicalInsight1())); }, trailing: const Icon(Icons.arrow_forward_ios), ), diff --git a/pubspec.yaml b/pubspec.yaml index 3b3b408..64376be 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -107,10 +107,12 @@ flutter: # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf + fonts: + - family: SourceSerif + fonts: + - asset: fonts/SourceSerif4-Regular.ttf + - asset: fonts/SourceSerif4-Italic.ttf + style: italic # - asset: fonts/Schyler-Italic.ttf # style: italic # - family: Trajan Pro