// import 'package:discover_module/constants.dart'; // import 'package:discover_module/custom_widget/text.dart'; // import 'package:discover_module/provider_class/award_provider.dart'; // import 'package:discover_module/provider_class/certificate_provider.dart'; // import 'package:discover_module/provider_class/educationprovider.dart'; // import 'package:discover_module/provider_class/email_provider.dart'; // import 'package:discover_module/provider_class/location_provider.dart'; // import 'package:discover_module/provider_class/phoneno_provider.dart'; // import 'package:discover_module/provider_class/training_provider.dart'; // import 'package:discover_module/storage_hive/awa_data/crud_awa.dart'; // import 'package:discover_module/storage_hive/cer_hive/crud_cer.dart'; // import 'package:discover_module/storage_hive/edu_data/crud_edu.dart'; // import 'package:discover_module/storage_hive/email_data/crud_email.dart'; // import 'package:discover_module/storage_hive/loc_data/crud_loc.dart'; // import 'package:discover_module/storage_hive/pno_data/crud_pno.dart'; // import 'package:discover_module/storage_hive/traning_data/crud_training.dart'; // import 'package:discover_module/ui_screen/awardshowmore.dart'; // import 'package:discover_module/ui_screen/bottom_sheet.dart'; // import 'package:discover_module/ui_screen/cer_show_more.dart'; // import 'package:discover_module/ui_screen/edu_show_more.dart'; // import 'package:discover_module/ui_screen/email_show_more.dart'; // import 'package:discover_module/ui_screen/interactionform/widget/location_showmore.dart'; // import 'package:discover_module/ui_screen/pno_showmore.dart'; // import 'package:discover_module/ui_screen/training_showmore.dart'; import 'package:discover_module/contacts_module/constants.dart'; import 'package:discover_module/contacts_module/custom_widget/text.dart'; import 'package:discover_module/contacts_module/provider_class/award_provider.dart'; import 'package:discover_module/contacts_module/provider_class/certificate_provider.dart'; import 'package:discover_module/contacts_module/provider_class/educationprovider.dart'; import 'package:discover_module/contacts_module/provider_class/email_provider.dart'; import 'package:discover_module/contacts_module/provider_class/location_provider.dart'; import 'package:discover_module/contacts_module/provider_class/phoneno_provider.dart'; import 'package:discover_module/contacts_module/provider_class/training_provider.dart'; import 'package:discover_module/contacts_module/storage_hive/awa_data/crud_awa.dart'; import 'package:discover_module/contacts_module/storage_hive/cer_hive/crud_cer.dart'; import 'package:discover_module/contacts_module/storage_hive/edu_data/crud_edu.dart'; import 'package:discover_module/contacts_module/storage_hive/email_data/crud_email.dart'; import 'package:discover_module/contacts_module/storage_hive/loc_data/crud_loc.dart'; import 'package:discover_module/contacts_module/storage_hive/pno_data/crud_pno.dart'; import 'package:discover_module/contacts_module/storage_hive/traning_data/crud_training.dart'; import 'package:discover_module/contacts_module/ui_screen/awardshowmore.dart'; import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; import 'package:discover_module/contacts_module/ui_screen/cer_show_more.dart'; import 'package:discover_module/contacts_module/ui_screen/edu_show_more.dart'; import 'package:discover_module/contacts_module/ui_screen/email_show_more.dart'; import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/location_showmore.dart'; import 'package:discover_module/contacts_module/ui_screen/pno_showmore.dart'; import 'package:discover_module/contacts_module/ui_screen/training_showmore.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class LocationTab extends StatefulWidget { // const LocationTab({super.key}); LocationTab({required this.text, this.offline, Key? key}) : super(key: key); final int text; int? offline; @override State createState() => _LocationTabState(); } class _LocationTabState extends State { bool _isExpanded = false; List locationList = []; List pno = []; List emailid = []; List training = []; List education = []; List award = []; List certificate = []; @override void initState() { // TODO: implement initState super.initState(); getaffiliations(); print("OfflineeStored_loccc: ${widget.offline}"); } getaffiliations() async { final loclist, phoneno, emailno1, edu1, awa1, cer1, training1; if (widget.offline == 1) { loclist = await retrieveidlocations(widget.text); print("Savedd_Checkingloclist: $loclist"); } else { var location = Provider.of(context, listen: false); await location.locationinfo(widget.text); loclist = location.locationlist; print("Savedd_Checkingloclist123: $loclist"); } if (widget.offline == 1) { phoneno = await retrieveidpnos(widget.text); print("Savedd_Checkingloclist: $loclist"); } else { var phone = Provider.of(context, listen: false); await phone.phoneinfo(widget.text); phoneno = phone.phonenolist; } if (widget.offline == 1) { emailno1 = await retrieveidemails(widget.text); print("Savedd_CheckingloclistEmailll: $emailno1"); } else { var email = Provider.of(context, listen: false); await email.emailinfo(widget.text); emailno1 = email.emailkollist; print("Savedd_CheckingloclistEmailll123: $emailno1"); } if (widget.offline == 1) { training1 = await retrieveidtri(widget.text); print("Savedd_CheckingloclistEmailll: $emailno1"); } else { var trai = Provider.of(context, listen: false); await trai.traininginfo(widget.text); training1 = trai.traininglist; } if (widget.offline == 1) { edu1 = await retrieveidedus(widget.text); print("Savedd_CheckingloclistEdu: $edu1"); } else { var edu = Provider.of(context, listen: false); await edu.eduinfo(widget.text); edu1 = edu.educationlist; print("Savedd_CheckingloclistEdu123: $edu1"); } if (widget.offline == 1) { awa1 = await retrieveidawa(widget.text); print("Savedd_CheckingloclistEdu: $edu1"); } else { var awa = Provider.of(context, listen: false); await awa.awainfo(widget.text); awa1 = awa.awardlist; } if (widget.offline == 1) { cer1 = await retrieveidcer(widget.text); print("Savedd_CheckingloclistEdu: $edu1"); } else { var cer = Provider.of(context, listen: false); await cer.certificateinfo(widget.text); cer1 = cer.certificatelist; } setState(() { locationList = loclist; pno = phoneno; emailid = emailno1; training = training1; certificate = cer1; education = edu1; award = awa1; }); print( "locationListlocationList_isss: $locationList, ${locationList.length}"); //final affiliationsss = affiliation_data['Affiliations'] as List>; } @override Widget build(BuildContext context) { return Center( child: ListView(children: [ locationList.length != 0 ? ListTileTheme( dense: true, child: Padding( padding: const EdgeInsets.only(left: 8.0, right: 8.0), child: Container( child: Card( margin: EdgeInsets.all(1.0), //elevation: 5, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), color: Constants.bgwhitecolor, child: ExpansionTile( backgroundColor: Constants.bgwhitecolor, initiallyExpanded: false, maintainState: true, // backgroundColor: Colors.white, // collapsedBackgroundColor: Color(0xFF2b9af3), onExpansionChanged: (bool expanded) { setState(() { _isExpanded = expanded; }); }, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, color: Colors.black), title: Row( mainAxisAlignment: MainAxisAlignment.start, // mainAxisSize: MainAxisSize.min, children: [ Text1( title: "Locations", txtcolor: Colors.black, fontweight: FontWeight.normal, txtfont: 16.0), const SizedBox( width: 8.0, ), Text1( title: "(${locationList.length.toString()})", txtcolor: Colors.black, fontweight: FontWeight.normal, txtfont: 16.0), ], ), children: [ Scrollbar( child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: Container( constraints: BoxConstraints( minWidth: MediaQuery.of(context).size.width), color: Colors.white, child: DataTable( showCheckboxColumn: false, columns: const [ DataColumn( label: Expanded( child: Text('Institution', style: TextStyle( fontWeight: FontWeight.w600), softWrap: true), )), DataColumn( label: Expanded( child: Text('Address', style: TextStyle( fontWeight: FontWeight.w600)))), ], rows: List.generate( locationList.take(2).length, (index) => DataRow( onSelectChanged: (value) { print( "message123 ${locationList[index]}"); showModalBottomSheet( useRootNavigator: true, isScrollControlled: false, enableDrag: true, useSafeArea: true, constraints: const BoxConstraints( maxWidth: double.infinity, ), shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( top: Radius.circular(0), ), ), clipBehavior: Clip.antiAliasWithSaveLayer, context: context, builder: (context) { return bsheet( locationList[index]); }, ); }, cells: [ DataCell(Text( locationList[index].institution, softWrap: true)), DataCell(Text( locationList[index].address, softWrap: true)), ], ), ), ), ), ), ), 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: (_) => Locationfulldata( text: widget.text))); }, child: Text( 'Show More', style: TextStyle(color: Constants.k2color), ), style: OutlinedButton.styleFrom( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), ), ), ), ), ), ) ]), ), ), ), ) : Container(), // adds spacing between the text and image pno.length != 0 ? ListTileTheme( dense: true, child: Padding( padding: const EdgeInsets.only(left: 8.0, right: 8.0), child: Container( child: Card( margin: EdgeInsets.all(1.0), // elevation: 5, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), color: Constants.bgwhitecolor, child: ExpansionTile( backgroundColor: Constants.bgwhitecolor, initiallyExpanded: false, maintainState: true, // backgroundColor: Colors.white, // collapsedBackgroundColor: Color(0xFF2b9af3), onExpansionChanged: (bool expanded) { setState(() { _isExpanded = expanded; }); }, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, color: Colors.black), title: Row( mainAxisAlignment: MainAxisAlignment.start, // mainAxisSize: MainAxisSize.min, children: [ Text1( title: "Phone Numbers", txtcolor: Colors.black, fontweight: FontWeight.normal, txtfont: 16.0), const SizedBox( width: 8.0, ), Text1( title: "(${pno.length.toString()})", txtcolor: Colors.black, fontweight: FontWeight.normal, txtfont: 16.0), ], ), children: [ Scrollbar( child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: Container( constraints: BoxConstraints( minWidth: MediaQuery.of(context).size.width), color: Colors.white, child: DataTable( showCheckboxColumn: false, columns: const [ DataColumn( label: Expanded( child: Text('phone Type', style: TextStyle( fontWeight: FontWeight.w600), softWrap: true), )), DataColumn( label: Expanded( child: Text('Phone No', style: TextStyle( fontWeight: FontWeight.w600)))), ], rows: List.generate( pno.take(2).length, (index) => DataRow( onSelectChanged: (value) { print("message ${pno[index]}"); showModalBottomSheet( useRootNavigator: true, isScrollControlled: false, enableDrag: true, useSafeArea: true, constraints: const BoxConstraints( maxWidth: double.infinity, ), shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( top: Radius.circular(0), ), ), clipBehavior: Clip.antiAliasWithSaveLayer, context: context, builder: (context) { return bsheet(pno[index]); }, ); }, cells: [ DataCell(Text( pno[index].phoneType.toString(), softWrap: true)), DataCell(Text( pno[index].phoneNumber.toString(), softWrap: true)), ], ), ), ), ), ), ), 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: (_) => PhoneShowMore( text: widget.text))); }, child: Text( 'Show More', style: TextStyle(color: Constants.k2color), ), style: OutlinedButton.styleFrom( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), ), ), ), ), ), ) ]), ), ), ), ) : Container(), // adds spacing between the text and image emailid.length != 0 ? ListTileTheme( dense: true, child: Padding( padding: const EdgeInsets.only(left: 8.0, right: 8.0), child: Container( child: Card( margin: EdgeInsets.all(1.0), //elevation: 5, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), color: Constants.bgwhitecolor, child: ExpansionTile( backgroundColor: Constants.bgwhitecolor, initiallyExpanded: false, maintainState: true, // backgroundColor: Colors.white, // collapsedBackgroundColor: Color(0xFF2b9af3), onExpansionChanged: (bool expanded) { setState(() { _isExpanded = expanded; }); }, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, color: Colors.black), title: Row( mainAxisAlignment: MainAxisAlignment.start, // mainAxisSize: MainAxisSize.min, children: [ Text1( title: "Emails", txtcolor: Colors.black, fontweight: FontWeight.normal, txtfont: 16.0), const SizedBox( width: 8.0, ), Text1( title: "(${emailid.length.toString()})", txtcolor: Colors.black, fontweight: FontWeight.normal, txtfont: 16.0), ], ), children: [ Scrollbar( child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: Container( constraints: BoxConstraints( minWidth: MediaQuery.of(context).size.width), color: Colors.white, child: DataTable( showCheckboxColumn: false, columns: const [ DataColumn( label: Expanded( child: Text('Email Type', style: TextStyle( fontWeight: FontWeight.w600), softWrap: true), )), DataColumn( label: Expanded( child: Text('Email', style: TextStyle( fontWeight: FontWeight.w600)))), ], rows: List.generate( emailid.take(2).length, (index) => DataRow( onSelectChanged: (value) { print("message ${emailid[index]}"); showModalBottomSheet( useRootNavigator: true, isScrollControlled: false, enableDrag: true, useSafeArea: true, constraints: const BoxConstraints( maxWidth: double.infinity, ), shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( top: Radius.circular(0), ), ), clipBehavior: Clip.antiAliasWithSaveLayer, context: context, builder: (context) { return bsheet(emailid[index]); }, ); }, cells: [ DataCell(Text( emailid[index] .emailType .toString(), softWrap: true)), DataCell(Text( emailid[index].email.toString(), softWrap: true)), ], ), ), ), ), ), ), 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: (_) => EmailShowMore( text: widget.text))); }, child: Text( 'Show More', style: TextStyle(color: Constants.k2color), ), style: OutlinedButton.styleFrom( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), ), ), ), ), ), ) ]), ), ), ), ) : Container(), // adds spacing between the text and image training.length != 0 ? ListTileTheme( dense: true, child: Padding( padding: const EdgeInsets.only(left: 8.0, right: 8.0), child: Container( child: Card( margin: EdgeInsets.all(1.0), //elevation: 5, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), color: Constants.bgwhitecolor, child: ExpansionTile( backgroundColor: Constants.bgwhitecolor, initiallyExpanded: false, maintainState: true, // backgroundColor: Colors.white, // collapsedBackgroundColor: Color(0xFF2b9af3), onExpansionChanged: (bool expanded) { setState(() { _isExpanded = expanded; }); }, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, color: Colors.black), title: Row( mainAxisAlignment: MainAxisAlignment.start, // mainAxisSize: MainAxisSize.min, children: [ Text1( title: "Training ", txtcolor: Colors.black, fontweight: FontWeight.normal, txtfont: 16.0), const SizedBox( width: 8.0, ), Text1( title: "(${training.length.toString()})", txtcolor: Colors.black, fontweight: FontWeight.normal, txtfont: 16.0), ], ), children: [ Scrollbar( child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: Container( constraints: BoxConstraints( minWidth: MediaQuery.of(context).size.width), color: Colors.white, child: DataTable( showCheckboxColumn: false, columns: const [ DataColumn( label: Expanded( child: Text('Education Type', style: TextStyle( fontWeight: FontWeight.w600), softWrap: true), )), DataColumn( label: Expanded( child: Text('Institution Name', style: TextStyle( fontWeight: FontWeight.w600)))), ], rows: List.generate( training.take(2).length, (index) => DataRow( onSelectChanged: (value) { print("message ${training[index]}"); showModalBottomSheet( useRootNavigator: true, isScrollControlled: false, enableDrag: true, useSafeArea: true, constraints: const BoxConstraints( maxWidth: double.infinity, ), shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( top: Radius.circular(0), ), ), clipBehavior: Clip.antiAliasWithSaveLayer, context: context, builder: (context) { return bsheet(training[index]); }, ); }, cells: [ DataCell(Text( training[index] .educationType .toString(), softWrap: true)), DataCell(Text( training[index] .institutionName .toString(), softWrap: true)), ], ), ), ), ), ), ), 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: (_) => TrainingShowMore( text: widget.text))); }, child: Text( 'Show More', style: TextStyle(color: Constants.k2color), ), style: OutlinedButton.styleFrom( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), ), ), ), ), ), ) ]), ), ), ), ) : Container(), // adds spacing between the text and image ListTileTheme( dense: true, child: Padding( padding: const EdgeInsets.only(left: 8.0, right: 8.0), child: Container( child: Card( margin: EdgeInsets.all(1.0), //elevation: 5, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), color: Constants.bgwhitecolor, child: ExpansionTile( backgroundColor: Constants.bgwhitecolor, initiallyExpanded: false, maintainState: true, // backgroundColor: Colors.white, // collapsedBackgroundColor: Color(0xFF2b9af3), onExpansionChanged: (bool expanded) { setState(() { _isExpanded = expanded; }); }, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, color: Colors.black), title: Row( mainAxisAlignment: MainAxisAlignment.start, // mainAxisSize: MainAxisSize.min, children: [ Text1( title: "Education ", txtcolor: Colors.black, fontweight: FontWeight.normal, txtfont: 16.0), const SizedBox( width: 8.0, ), Text1( title: "(${education.length.toString()})", txtcolor: Colors.black, fontweight: FontWeight.normal, txtfont: 16.0), ], ), children: [ Scrollbar( child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: Container( constraints: BoxConstraints( minWidth: MediaQuery.of(context).size.width), color: Colors.white, child: DataTable( showCheckboxColumn: false, columns: const [ DataColumn( label: Expanded( child: Text('Education Type', style: TextStyle( fontWeight: FontWeight.w600), softWrap: true), )), DataColumn( label: Expanded( child: Text('Institution Name', style: TextStyle( fontWeight: FontWeight.w600)))), ], rows: List.generate( education.take(2).length, (index) => DataRow( onSelectChanged: (value) { print("message ${education[index]}"); showModalBottomSheet( useRootNavigator: true, isScrollControlled: false, enableDrag: true, useSafeArea: true, constraints: const BoxConstraints( maxWidth: double.infinity, ), shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( top: Radius.circular(0), ), ), clipBehavior: Clip.antiAliasWithSaveLayer, context: context, builder: (context) { return bsheet(education[index]); }, ); }, cells: [ DataCell(Text( education[index] .educationType .toString(), softWrap: true)), DataCell(Text( education[index] .institutionName .toString(), softWrap: true)), ], ), ), ), ), ), ), 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: (_) => EducationShowMore( text: widget.text, ))); }, child: Text( 'Show More', style: TextStyle(color: Constants.k2color), ), style: OutlinedButton.styleFrom( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), ), ), ), ), ), ) ]), ), ), ), ), // adds spacing between the text and image award.length != 0 ? ListTileTheme( dense: true, child: Padding( padding: const EdgeInsets.only(left: 8.0, right: 8.0), child: Container( child: Card( margin: EdgeInsets.all(1.0), //elevation: 5, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), color: Constants.bgwhitecolor, child: ExpansionTile( backgroundColor: Constants.bgwhitecolor, initiallyExpanded: false, maintainState: true, // backgroundColor: Colors.white, // collapsedBackgroundColor: Color(0xFF2b9af3), onExpansionChanged: (bool expanded) { setState(() { _isExpanded = expanded; }); }, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, color: Colors.black), title: Row( mainAxisAlignment: MainAxisAlignment.start, // mainAxisSize: MainAxisSize.min, children: [ Text1( title: "Awards ", txtcolor: Colors.black, fontweight: FontWeight.normal, txtfont: 16.0), const SizedBox( width: 8.0, ), Text1( title: "(${award.length.toString()})", txtcolor: Colors.black, fontweight: FontWeight.normal, txtfont: 16.0), ], ), children: [ Scrollbar( child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: Container( constraints: BoxConstraints( minWidth: MediaQuery.of(context).size.width), color: Colors.white, child: DataTable( showCheckboxColumn: false, columns: const [ DataColumn( label: Expanded( child: Text('Education Type', style: TextStyle( fontWeight: FontWeight.w600), softWrap: true), )), DataColumn( label: Expanded( child: Text('Institution Name', style: TextStyle( fontWeight: FontWeight.w600)))), ], rows: List.generate( award.take(2).length, (index) => DataRow( onSelectChanged: (value) { print("message ${award[index]}"); showModalBottomSheet( useRootNavigator: true, isScrollControlled: false, enableDrag: true, useSafeArea: true, constraints: const BoxConstraints( maxWidth: double.infinity, ), shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( top: Radius.circular(0), ), ), clipBehavior: Clip.antiAliasWithSaveLayer, context: context, builder: (context) { return bsheet(award[index]); }, ); }, cells: [ DataCell(Text( award[index] .educationType .toString(), softWrap: true)), DataCell(Text( award[index] .institutionName .toString(), softWrap: true)), ], ), ), ), ), ), ), 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: (_) => AwardShowMore( text: widget.text))); }, child: Text( 'Show More', style: TextStyle(color: Constants.k2color), ), style: OutlinedButton.styleFrom( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), ), ), ), ), ), ) ]), ), ), ), ) : Container(), // adds spacing between the text and image certificate.length != 0 ? ListTileTheme( dense: true, child: Padding( padding: const EdgeInsets.only(left: 8.0, right: 8.0), child: Container( child: Card( margin: EdgeInsets.all(1.0), //elevation: 5, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0.0), ), color: Constants.bgwhitecolor, child: ExpansionTile( backgroundColor: Constants.bgwhitecolor, initiallyExpanded: false, maintainState: true, // backgroundColor: Colors.white, // collapsedBackgroundColor: Color(0xFF2b9af3), onExpansionChanged: (bool expanded) { setState(() { _isExpanded = expanded; }); }, trailing: Icon( _isExpanded ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, color: Colors.black), title: Row( mainAxisAlignment: MainAxisAlignment.start, // mainAxisSize: MainAxisSize.min, children: [ Text1( title: "Certificates ", txtcolor: Colors.black, fontweight: FontWeight.normal, txtfont: 16.0), const SizedBox( width: 8.0, ), Text1( title: "(${certificate.length.toString()})", txtcolor: Colors.black, fontweight: FontWeight.normal, txtfont: 16.0), ], ), children: [ Scrollbar( child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: Container( constraints: BoxConstraints( minWidth: MediaQuery.of(context).size.width), color: Colors.white, child: DataTable( showCheckboxColumn: false, columns: const [ DataColumn( label: Expanded( child: Text('Education Type', style: TextStyle( fontWeight: FontWeight.w600), softWrap: true), )), DataColumn( label: Expanded( child: Text('Institution Name', style: TextStyle( fontWeight: FontWeight.w600)))), ], rows: List.generate( certificate.take(2).length, (index) => DataRow( onSelectChanged: (value) { print( "message ${certificate[index]}"); showModalBottomSheet( useRootNavigator: true, isScrollControlled: false, enableDrag: true, useSafeArea: true, constraints: const BoxConstraints( maxWidth: double.infinity, ), shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( top: Radius.circular(0), ), ), clipBehavior: Clip.antiAliasWithSaveLayer, context: context, builder: (context) { return bsheet(certificate[index]); }, ); }, cells: [ DataCell(Text( certificate[index] .educationType .toString(), softWrap: true)), DataCell(Text( certificate[index] .institutionName .toString(), softWrap: true)), ], ), ), ), ), ), ), 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: (_) => CerShowMore( text: widget.text))); }, child: Text( 'Show More', style: TextStyle(color: Constants.k2color), ), style: OutlinedButton.styleFrom( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), ), ), ), ), ), ) ]), ), ), ), ) : Container(), // adds spacing between the text and image ]), ); } }