// import 'package:discover_module/provider_class/affiliationsprovider.dart'; // import 'package:discover_module/provider_class/publications_provider.dart'; // import 'package:discover_module/ui_screen/bottom_sheet.dart'; // import 'package:discover_module/ui_screen/bottommmsheet.dart'; import 'package:discover_module/contacts_module/provider_class/publications_provider.dart'; import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class PublicationsData extends StatefulWidget { PublicationsData({required this.text, Key? key}) : super(key: key); final int text; @override State createState() => _PublicationsDataState(); } class _PublicationsDataState extends State { List hcppublication = []; @override void initState() { // TODO: implement initState super.initState(); affdata(); } affdata() async { final affprovider = Provider.of(context, listen: false); await affprovider.publicatininfo(widget.text); final affdata = affprovider.publicationlist; setState(() { hcppublication = affdata; }); print("hcppppProfiledata: ${hcppublication}"); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Publications'), ), body: Scrollbar( child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: SingleChildScrollView( scrollDirection: Axis.vertical, child: Container( constraints: BoxConstraints(minWidth: MediaQuery.of(context).size.width), color: Colors.white, child: DataTable( showCheckboxColumn: false, columns: const [ DataColumn( label: Expanded( child: Text('Article Title', softWrap: true), )), DataColumn( label: Expanded( child: Text('Journal Name', softWrap: true))), DataColumn( label: Expanded(child: Text('Date', softWrap: true))), DataColumn( label: Expanded(child: Text('Authors', softWrap: true))), // Add more columns as needed ], rows: List.generate( hcppublication.length, (index) => DataRow( onSelectChanged: (value) { // =======> Use onSelectChanged for tab print("message11 ${hcppublication[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(hcppublication[index]); }, ); }, cells: [ DataCell(Text( hcppublication[index]['artical_title'].toString(), softWrap: true)), DataCell(Text( hcppublication[index]['journal_name'].toString(), softWrap: true)), DataCell(Text(hcppublication[index]['date'].toString(), softWrap: true)), DataCell(Text( hcppublication[index]['author'].toString(), softWrap: true)), // Add more DataCells as needed ], ), ), ), ), ), ), )); } }