1936 lines
96 KiB
Dart
1936 lines
96 KiB
Dart
|
import 'package:discover_module/constants.dart';
|
||
|
import 'package:discover_module/custom_widget/text.dart';
|
||
|
import 'package:discover_module/provider_class/medicalinsightprovider.dart';
|
||
|
import 'package:discover_module/provider_class/nih_provider.dart';
|
||
|
import 'package:discover_module/provider_class/patent_provider.dart';
|
||
|
import 'package:discover_module/provider_class/procedureprovider.dart';
|
||
|
import 'package:discover_module/ui_screen/bottom_sheet.dart';
|
||
|
import 'package:discover_module/ui_screen/interactionform/interactionprovider.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/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/new_viewinteraction.dart';
|
||
|
import 'package:discover_module/ui_screen/nih_show_more.dart';
|
||
|
import 'package:discover_module/ui_screen/patent_show_more.dart';
|
||
|
import 'package:discover_module/ui_screen/pro_show_more.dart';
|
||
|
import 'package:flutter/cupertino.dart';
|
||
|
import 'package:flutter/material.dart';
|
||
|
import 'package:provider/provider.dart';
|
||
|
|
||
|
class EngagementTab extends StatefulWidget {
|
||
|
EngagementTab({required this.text, Key? key}) : super(key: key);
|
||
|
|
||
|
final int text;
|
||
|
@override
|
||
|
State<EngagementTab> createState() => _EngagementTabState();
|
||
|
}
|
||
|
|
||
|
class _EngagementTabState extends State<EngagementTab> {
|
||
|
bool _isExpanded = false;
|
||
|
List medinsightData = [];
|
||
|
List patent = [];
|
||
|
List nihgrants = [];
|
||
|
List procedure = [];
|
||
|
|
||
|
// List eng = [];
|
||
|
|
||
|
var item;
|
||
|
@override
|
||
|
void initState() {
|
||
|
// TODO: implement initState
|
||
|
super.initState();
|
||
|
getdata();
|
||
|
}
|
||
|
|
||
|
getdata() async {
|
||
|
var form = Provider.of<ViewInteractionProvider>(context, listen: false);
|
||
|
form.savedList;
|
||
|
|
||
|
//var med = Provider.of<MediacalInsightProvider>(context, listen: false);
|
||
|
//await med.medicalinsightdata();
|
||
|
// final medlist = med.trialsinfo;
|
||
|
|
||
|
var patentt = Provider.of<PatentProvider>(context, listen: false);
|
||
|
await patentt.patentinfo(widget.text);
|
||
|
final patentt1 = patentt.patentlist;
|
||
|
|
||
|
var nih = Provider.of<NIHGrantsProvider>(context, listen: false);
|
||
|
await nih.nihinfo(widget.text);
|
||
|
final nih1 = nih.nihgrantslist;
|
||
|
|
||
|
var pro = Provider.of<ProcedureProvider>(context, listen: false);
|
||
|
await pro.proinfo(widget.text);
|
||
|
final pro1 = pro.prolist;
|
||
|
|
||
|
setState(() {
|
||
|
// medinsightData = medlist;
|
||
|
patent = patentt1;
|
||
|
nihgrants = nih1;
|
||
|
procedure = pro1;
|
||
|
// speaker = speakerlist;
|
||
|
// eng = engtypelist;
|
||
|
});
|
||
|
|
||
|
print("CheckingPatent: $patent");
|
||
|
print("Checkingnihgrants: $nihgrants");
|
||
|
}
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Center(
|
||
|
child: ListView(
|
||
|
children: [
|
||
|
// ListTileTheme(
|
||
|
// dense: true,
|
||
|
// child: Padding(
|
||
|
// padding: const EdgeInsets.only(left: 8.0, right: 8.0),
|
||
|
// child: Card(
|
||
|
// margin: EdgeInsets.all(1.0),
|
||
|
// //elevation: 5,
|
||
|
// shape: RoundedRectangleBorder(
|
||
|
// borderRadius: BorderRadius.circular(0.0),
|
||
|
// ),
|
||
|
// color: Constants.k2color11,
|
||
|
// child: ExpansionTile(
|
||
|
// initiallyExpanded: false,
|
||
|
// maintainState: true,
|
||
|
// onExpansionChanged: (bool expanded) {
|
||
|
// setState(() {
|
||
|
// _isExpanded = expanded;
|
||
|
// });
|
||
|
// },
|
||
|
// backgroundColor: Constants.k2color11,
|
||
|
// trailing: Icon(
|
||
|
// _isExpanded
|
||
|
// ? Icons.keyboard_arrow_up
|
||
|
// : Icons.keyboard_arrow_down,
|
||
|
// color: Colors.black),
|
||
|
// // collapsedBackgroundColor: Color(0xFF2b9af3),
|
||
|
// // initiallyExpanded: true,
|
||
|
// title: Row(
|
||
|
// mainAxisAlignment: MainAxisAlignment.start,
|
||
|
// // mainAxisSize: MainAxisSize.min,
|
||
|
// children: [
|
||
|
// Text1(
|
||
|
// title: "Medical Insights",
|
||
|
// txtcolor: Colors.black,
|
||
|
// fontweight: FontWeight.normal,
|
||
|
// txtfont: 17.0),
|
||
|
// const SizedBox(
|
||
|
// width: 8.0,
|
||
|
// ),
|
||
|
// Text1(
|
||
|
// title: "(3)",
|
||
|
// txtcolor: Colors.black,
|
||
|
// 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,
|
||
|
// ),
|
||
|
|
||
|
// child: SizedBox(
|
||
|
// width: MediaQuery.sizeOf(context).width,
|
||
|
// child: ListTile(
|
||
|
// dense: true,
|
||
|
// title: Column(
|
||
|
// // crossAxisAlignment: CrossAxisAlignment.center,
|
||
|
// children: [
|
||
|
// // Text(
|
||
|
// // "Acute neurology is the <b> therapeutic </b> 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>[
|
||
|
// 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),
|
||
|
// ),
|
||
|
// ),
|
||
|
// ),
|
||
|
// ),
|
||
|
// ),
|
||
|
// )
|
||
|
// ]),
|
||
|
// ),
|
||
|
// ),
|
||
|
// ),
|
||
|
|
||
|
ListTileTheme(
|
||
|
dense: true,
|
||
|
child: Padding(
|
||
|
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
|
||
|
child: Card(
|
||
|
margin: EdgeInsets.all(1.0),
|
||
|
// elevation: 5,
|
||
|
shape: RoundedRectangleBorder(
|
||
|
borderRadius: BorderRadius.circular(0.0),
|
||
|
),
|
||
|
color: Constants.k2color11,
|
||
|
child: ExpansionTile(
|
||
|
initiallyExpanded: false,
|
||
|
maintainState: true,
|
||
|
onExpansionChanged: (bool expanded) {
|
||
|
setState(() {
|
||
|
_isExpanded = expanded;
|
||
|
});
|
||
|
},
|
||
|
backgroundColor: Constants.k2color11,
|
||
|
trailing: Icon(
|
||
|
_isExpanded
|
||
|
? Icons.keyboard_arrow_up
|
||
|
: Icons.keyboard_arrow_down,
|
||
|
color: Colors.black),
|
||
|
// collapsedBackgroundColor: Color(0xFF2b9af3),
|
||
|
title: Row(
|
||
|
//mainAxisSize: MainAxisSize.min,
|
||
|
children: [
|
||
|
GestureDetector(
|
||
|
onTap: () async {
|
||
|
final provider = Provider.of<InteractionProvider>(
|
||
|
context,
|
||
|
listen: false);
|
||
|
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: "Interactions",
|
||
|
txtcolor: Colors.black,
|
||
|
fontweight: FontWeight.normal,
|
||
|
txtfont: 17.0),
|
||
|
),
|
||
|
const SizedBox(
|
||
|
width: 8.0,
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
children: [
|
||
|
Container(
|
||
|
height: MediaQuery.of(context).size.height / 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) {
|
||
|
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) =>
|
||
|
ViewInteractionScreen1(
|
||
|
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) =>
|
||
|
ViewInteractionScreen1(
|
||
|
saveInteraction:
|
||
|
provider.savedList[
|
||
|
index],
|
||
|
)));
|
||
|
},
|
||
|
),
|
||
|
const Divider(),
|
||
|
],
|
||
|
);
|
||
|
});
|
||
|
} 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: () {
|
||
|
final provider =
|
||
|
Provider.of<InteractionProvider>(context,
|
||
|
listen: false);
|
||
|
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: OutlinedButton.styleFrom(
|
||
|
shape: RoundedRectangleBorder(
|
||
|
borderRadius: BorderRadius.circular(12),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
)
|
||
|
]),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
|
||
|
// ListTileTheme(
|
||
|
// dense: true,
|
||
|
// child: Padding(
|
||
|
// padding: const EdgeInsets.only(
|
||
|
// left: 8.0, right: 8.0),
|
||
|
// child: Card(
|
||
|
// margin: EdgeInsets.all(1.0),
|
||
|
// // elevation: 5,
|
||
|
// shape: RoundedRectangleBorder(
|
||
|
// borderRadius: BorderRadius.circular(0.0),
|
||
|
// ),
|
||
|
// color: Constants.k2color11,
|
||
|
// child: ExpansionTile(
|
||
|
// initiallyExpanded: false,
|
||
|
// maintainState: true,
|
||
|
// onExpansionChanged: (bool expanded) {
|
||
|
// setState(() {
|
||
|
// _isExpanded = expanded;
|
||
|
// });
|
||
|
// },
|
||
|
// backgroundColor: Constants.k2color11,
|
||
|
// trailing: Icon(
|
||
|
// _isExpanded
|
||
|
// ? Icons.keyboard_arrow_up
|
||
|
// : Icons.keyboard_arrow_down,
|
||
|
// color: Colors.black),
|
||
|
// // backgroundColor: Colors.white,
|
||
|
// // collapsedBackgroundColor: Color(0xFF2b9af3),
|
||
|
// title: Row(
|
||
|
// mainAxisAlignment:
|
||
|
// MainAxisAlignment.start,
|
||
|
// // mainAxisSize: MainAxisSize.min,
|
||
|
// children: [
|
||
|
// Text1(
|
||
|
// title: "Speaker Evalution",
|
||
|
// txtcolor: Colors.black,
|
||
|
// fontweight: FontWeight.normal,
|
||
|
// txtfont: 17.0),
|
||
|
// const SizedBox(
|
||
|
// width: 8.0,
|
||
|
// ),
|
||
|
// Text1(
|
||
|
// title: "(4)",
|
||
|
// txtcolor: Colors.black,
|
||
|
// fontweight: FontWeight.normal,
|
||
|
// txtfont: 17.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(
|
||
|
// 'Program Topic',
|
||
|
// style: TextStyle(
|
||
|
// fontWeight:
|
||
|
// FontWeight
|
||
|
// .w600),
|
||
|
// ),
|
||
|
// )),
|
||
|
// DataColumn(
|
||
|
// label: Expanded(
|
||
|
// child: Text(
|
||
|
// 'Speaker Name',
|
||
|
// style: TextStyle(
|
||
|
// fontWeight:
|
||
|
// FontWeight
|
||
|
// .w600)))),
|
||
|
// ],
|
||
|
// rows: List.generate(
|
||
|
// speaker.take(2).length,
|
||
|
// (index) => DataRow(
|
||
|
// onSelectChanged: (value) {
|
||
|
// // =======> Use onSelectChanged for tab
|
||
|
// print(
|
||
|
// "message ${speaker[index]}");
|
||
|
|
||
|
// // bsheet(
|
||
|
// // publication_data[
|
||
|
// // 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(
|
||
|
// speaker[index]);
|
||
|
// },
|
||
|
// );
|
||
|
// },
|
||
|
// color: MaterialStateProperty
|
||
|
// .resolveWith<
|
||
|
// Color?>((Set<
|
||
|
// MaterialState>
|
||
|
// states) {
|
||
|
// if (index.isEven) {
|
||
|
// return Colors.grey
|
||
|
// .withOpacity(0.1);
|
||
|
// }
|
||
|
// return null;
|
||
|
// }),
|
||
|
// cells: [
|
||
|
// DataCell(Text(
|
||
|
// speaker[index][
|
||
|
// 'programtopic']
|
||
|
// .toString(),
|
||
|
// softWrap: true)),
|
||
|
// DataCell(Text(
|
||
|
// speaker[index][
|
||
|
// 'speakername']
|
||
|
// .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: (_) =>
|
||
|
// // AffiliationsData()));
|
||
|
// },
|
||
|
// 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
|
||
|
|
||
|
// ListTileTheme(
|
||
|
// dense: true,
|
||
|
// child: Padding(
|
||
|
// padding: const EdgeInsets.only(
|
||
|
// left: 8.0, right: 8.0),
|
||
|
// child: Card(
|
||
|
// margin: EdgeInsets.all(1.0),
|
||
|
// // elevation: 5,
|
||
|
// shape: RoundedRectangleBorder(
|
||
|
// borderRadius: BorderRadius.circular(0.0),
|
||
|
// ),
|
||
|
// color: Constants.k2color11,
|
||
|
// child: ExpansionTile(
|
||
|
// initiallyExpanded: false,
|
||
|
// maintainState: true,
|
||
|
// onExpansionChanged: (bool expanded) {
|
||
|
// setState(() {
|
||
|
// _isExpanded = expanded;
|
||
|
// });
|
||
|
// },
|
||
|
// backgroundColor: Constants.k2color11,
|
||
|
// trailing: Icon(
|
||
|
// _isExpanded
|
||
|
// ? Icons.keyboard_arrow_up
|
||
|
// : Icons.keyboard_arrow_down,
|
||
|
// color: Colors.black),
|
||
|
// // backgroundColor: Colors.white,
|
||
|
// // collapsedBackgroundColor: Color(0xFF2b9af3),
|
||
|
// title: Row(
|
||
|
// mainAxisAlignment:
|
||
|
// MainAxisAlignment.start,
|
||
|
// // mainAxisSize: MainAxisSize.min,
|
||
|
// children: [
|
||
|
// Text1(
|
||
|
// title: "Engagements",
|
||
|
// txtcolor: Colors.black,
|
||
|
// fontweight: FontWeight.normal,
|
||
|
// txtfont: 17.0),
|
||
|
// const SizedBox(
|
||
|
// width: 8.0,
|
||
|
// ),
|
||
|
// Text1(
|
||
|
// title: "(3)",
|
||
|
// txtcolor: Colors.black,
|
||
|
// fontweight: FontWeight.normal,
|
||
|
// txtfont: 17.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(
|
||
|
// 'Main Therapeutic Area',
|
||
|
// style: TextStyle(
|
||
|
// fontWeight:
|
||
|
// FontWeight
|
||
|
// .w600),
|
||
|
// ),
|
||
|
// )),
|
||
|
// DataColumn(
|
||
|
// label: Expanded(
|
||
|
// child: Text('Date',
|
||
|
// style: TextStyle(
|
||
|
// fontWeight:
|
||
|
// FontWeight
|
||
|
// .w600)))),
|
||
|
// ],
|
||
|
// rows: List.generate(
|
||
|
// eng.take(2).length,
|
||
|
// (index) => DataRow(
|
||
|
// onSelectChanged: (value) {
|
||
|
// // =======> Use onSelectChanged for tab
|
||
|
// print(
|
||
|
// "message ${eng[index]}");
|
||
|
|
||
|
// // bsheet(
|
||
|
// // publication_data[
|
||
|
// // 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(
|
||
|
// eng[index]);
|
||
|
// },
|
||
|
// );
|
||
|
// },
|
||
|
// color: MaterialStateProperty
|
||
|
// .resolveWith<
|
||
|
// Color?>((Set<
|
||
|
// MaterialState>
|
||
|
// states) {
|
||
|
// if (index.isEven) {
|
||
|
// return Colors.grey
|
||
|
// .withOpacity(0.1);
|
||
|
// }
|
||
|
// return null;
|
||
|
// }),
|
||
|
// cells: [
|
||
|
// DataCell(Text(
|
||
|
// eng[index][
|
||
|
// 'main thereutic area']
|
||
|
// .toString(),
|
||
|
// softWrap: true)),
|
||
|
// DataCell(Text(
|
||
|
// eng[index]['date']
|
||
|
// .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: (_) =>
|
||
|
// EngagementList()));
|
||
|
// },
|
||
|
// child: Text(
|
||
|
// 'Show More',
|
||
|
// style: TextStyle(
|
||
|
// color:
|
||
|
// Constants.k2color),
|
||
|
// ),
|
||
|
// style:
|
||
|
// OutlinedButton.styleFrom(
|
||
|
// shape:
|
||
|
// RoundedRectangleBorder(
|
||
|
// borderRadius:
|
||
|
// BorderRadius.circular(
|
||
|
// 12),
|
||
|
// ),
|
||
|
// ),
|
||
|
// ),
|
||
|
// ),
|
||
|
// ),
|
||
|
// )
|
||
|
// ]),
|
||
|
// ),
|
||
|
// ),
|
||
|
// ),
|
||
|
|
||
|
nihgrants.length != 0
|
||
|
? ListTileTheme(
|
||
|
dense: true,
|
||
|
child: Padding(
|
||
|
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
|
||
|
child: Card(
|
||
|
margin: EdgeInsets.all(1.0),
|
||
|
//elevation: 5,
|
||
|
shape: RoundedRectangleBorder(
|
||
|
borderRadius: BorderRadius.circular(0.0),
|
||
|
),
|
||
|
color: Constants.k2color11,
|
||
|
child: ExpansionTile(
|
||
|
initiallyExpanded: false,
|
||
|
maintainState: true,
|
||
|
// backgroundColor: Colors.white,
|
||
|
// collapsedBackgroundColor: Color(0xFF2b9af3),
|
||
|
onExpansionChanged: (bool expanded) {
|
||
|
setState(() {
|
||
|
_isExpanded = expanded;
|
||
|
});
|
||
|
},
|
||
|
backgroundColor: Constants.k2color11,
|
||
|
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: "NIH Grants",
|
||
|
txtcolor: Colors.black,
|
||
|
fontweight: FontWeight.normal,
|
||
|
txtfont: 17.0),
|
||
|
const SizedBox(
|
||
|
width: 8.0,
|
||
|
),
|
||
|
Text1(
|
||
|
title: "(${nihgrants.length.toString()})",
|
||
|
txtcolor: Colors.black,
|
||
|
fontweight: FontWeight.normal,
|
||
|
txtfont: 17.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('NIH Center',
|
||
|
style: TextStyle(
|
||
|
fontWeight: FontWeight.w600),
|
||
|
softWrap: true),
|
||
|
)),
|
||
|
DataColumn(
|
||
|
label: Expanded(
|
||
|
child: Text('Organization Name',
|
||
|
style: TextStyle(
|
||
|
fontWeight:
|
||
|
FontWeight.w600)))),
|
||
|
],
|
||
|
rows: List.generate(
|
||
|
nihgrants.take(2).length,
|
||
|
(index) => DataRow(
|
||
|
onSelectChanged: (value) {
|
||
|
print("message ${nihgrants[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(nihgrants[index]);
|
||
|
},
|
||
|
);
|
||
|
},
|
||
|
cells: [
|
||
|
DataCell(Text(
|
||
|
nihgrants[index]['pi_names']
|
||
|
.toString(),
|
||
|
softWrap: true)),
|
||
|
DataCell(Text(
|
||
|
nihgrants[index]
|
||
|
['NIH Center/Institute']
|
||
|
.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: (_) => NIHShowMore(
|
||
|
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
|
||
|
|
||
|
procedure.length != 0
|
||
|
? ListTileTheme(
|
||
|
dense: true,
|
||
|
child: Padding(
|
||
|
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
|
||
|
child: Card(
|
||
|
margin: EdgeInsets.all(1.0),
|
||
|
// elevation: 5,
|
||
|
shape: RoundedRectangleBorder(
|
||
|
borderRadius: BorderRadius.circular(0.0),
|
||
|
),
|
||
|
color: Constants.k2color11,
|
||
|
child: ExpansionTile(
|
||
|
initiallyExpanded: false,
|
||
|
maintainState: true,
|
||
|
// backgroundColor: Colors.white,
|
||
|
// collapsedBackgroundColor: Color(0xFF2b9af3),
|
||
|
onExpansionChanged: (bool expanded) {
|
||
|
setState(() {
|
||
|
_isExpanded = expanded;
|
||
|
});
|
||
|
},
|
||
|
backgroundColor: Constants.k2color11,
|
||
|
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: "Procedures",
|
||
|
txtcolor: Colors.black,
|
||
|
fontweight: FontWeight.normal,
|
||
|
txtfont: 17.0),
|
||
|
const SizedBox(
|
||
|
width: 8.0,
|
||
|
),
|
||
|
Text1(
|
||
|
title: "(${procedure.length.toString()})",
|
||
|
txtcolor: Colors.black,
|
||
|
fontweight: FontWeight.normal,
|
||
|
txtfont: 17.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('Program Year',
|
||
|
style: TextStyle(
|
||
|
fontWeight: FontWeight.w600),
|
||
|
softWrap: true),
|
||
|
)),
|
||
|
DataColumn(
|
||
|
label: Expanded(
|
||
|
child: Text('Procedure',
|
||
|
style: TextStyle(
|
||
|
fontWeight:
|
||
|
FontWeight.w600)))),
|
||
|
],
|
||
|
rows: List.generate(
|
||
|
procedure.take(2).length,
|
||
|
(index) => DataRow(
|
||
|
onSelectChanged: (value) {
|
||
|
print("message ${procedure[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(procedure[index]);
|
||
|
},
|
||
|
);
|
||
|
},
|
||
|
cells: [
|
||
|
DataCell(Text(
|
||
|
procedure[index]['Procedure']
|
||
|
.toString(),
|
||
|
softWrap: true)),
|
||
|
DataCell(Text(
|
||
|
procedure[index]
|
||
|
['Place of Service']
|
||
|
.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: (_) => ProShowMore(
|
||
|
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
|
||
|
|
||
|
patent.length != 0
|
||
|
? ListTileTheme(
|
||
|
dense: true,
|
||
|
child: Padding(
|
||
|
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
|
||
|
child: Card(
|
||
|
margin: EdgeInsets.all(1.0),
|
||
|
// elevation: 5,
|
||
|
shape: RoundedRectangleBorder(
|
||
|
borderRadius: BorderRadius.circular(0.0),
|
||
|
),
|
||
|
color: Constants.k2color11,
|
||
|
child: ExpansionTile(
|
||
|
initiallyExpanded: false,
|
||
|
maintainState: true,
|
||
|
// backgroundColor: Colors.white,
|
||
|
// collapsedBackgroundColor: Color(0xFF2b9af3),
|
||
|
onExpansionChanged: (bool expanded) {
|
||
|
setState(() {
|
||
|
_isExpanded = expanded;
|
||
|
});
|
||
|
},
|
||
|
backgroundColor: Constants.k2color11,
|
||
|
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: "Patents",
|
||
|
txtcolor: Colors.black,
|
||
|
fontweight: FontWeight.normal,
|
||
|
txtfont: 17.0),
|
||
|
const SizedBox(
|
||
|
width: 8.0,
|
||
|
),
|
||
|
Text1(
|
||
|
title: "(${patent.length.toString()})",
|
||
|
txtcolor: Colors.black,
|
||
|
fontweight: FontWeight.normal,
|
||
|
txtfont: 17.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('Patent Title',
|
||
|
style: TextStyle(
|
||
|
fontWeight: FontWeight.w600),
|
||
|
softWrap: true),
|
||
|
)),
|
||
|
DataColumn(
|
||
|
label: Expanded(
|
||
|
child: Text('Status',
|
||
|
style: TextStyle(
|
||
|
fontWeight:
|
||
|
FontWeight.w600)))),
|
||
|
],
|
||
|
rows: List.generate(
|
||
|
patent.take(2).length,
|
||
|
(index) => DataRow(
|
||
|
onSelectChanged: (value) {
|
||
|
print("message ${patent[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(patent[index]);
|
||
|
},
|
||
|
);
|
||
|
},
|
||
|
cells: [
|
||
|
DataCell(Text(
|
||
|
patent[index]['Patent Title']
|
||
|
.toString(),
|
||
|
softWrap: true)),
|
||
|
DataCell(Text(
|
||
|
patent[index]['Status']
|
||
|
.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: (_) => PatentShowMore(
|
||
|
text: widget.text)));
|
||
|
},
|
||
|
child: Text(
|
||
|
'Show More',
|
||
|
style:
|
||
|
TextStyle(color: Constants.k2color),
|
||
|
),
|
||
|
style: OutlinedButton.styleFrom(
|
||
|
shape: RoundedRectangleBorder(
|
||
|
borderRadius: BorderRadius.circular(12),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
)
|
||
|
]),
|
||
|
),
|
||
|
),
|
||
|
)
|
||
|
: Container(),
|
||
|
|
||
|
// 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.k2color11,
|
||
|
// child: ExpansionTile(
|
||
|
// initiallyExpanded: false,
|
||
|
// maintainState: true,
|
||
|
// // backgroundColor: Colors.white,
|
||
|
// // collapsedBackgroundColor: Color(0xFF2b9af3),
|
||
|
// onExpansionChanged: (bool expanded) {
|
||
|
// setState(() {
|
||
|
// _isExpanded = expanded;
|
||
|
// });
|
||
|
// },
|
||
|
// backgroundColor: Constants.k2color11,
|
||
|
// 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: "Patient Referrals",
|
||
|
// txtcolor: Colors.black,
|
||
|
// fontweight: FontWeight.normal,
|
||
|
// txtfont: 16.0),
|
||
|
// const SizedBox(
|
||
|
// width: 8.0,
|
||
|
// ),
|
||
|
// Text1(
|
||
|
// title: "(3)",
|
||
|
// txtcolor: Colors.black,
|
||
|
// fontweight: FontWeight.normal,
|
||
|
// txtfont: 17.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(
|
||
|
// 'Referred By',
|
||
|
// style: TextStyle(
|
||
|
// fontWeight:
|
||
|
// FontWeight
|
||
|
// .w600),
|
||
|
// softWrap: true),
|
||
|
// )),
|
||
|
// DataColumn(
|
||
|
// label: Expanded(
|
||
|
// child: Text(
|
||
|
// 'Type of Referrals',
|
||
|
// style: TextStyle(
|
||
|
// fontWeight:
|
||
|
// FontWeight
|
||
|
// .w600)))),
|
||
|
// ],
|
||
|
// rows: List.generate(
|
||
|
// publication_data.length,
|
||
|
// (index) => DataRow(
|
||
|
// onSelectChanged:
|
||
|
// (value) {
|
||
|
// print(
|
||
|
// "message ${publication_data[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(
|
||
|
// publication_data[
|
||
|
// index]);
|
||
|
// },
|
||
|
// );
|
||
|
// },
|
||
|
// cells: [
|
||
|
// DataCell(Text(
|
||
|
// publication_data[
|
||
|
// index]
|
||
|
// [
|
||
|
// 'artical_title']
|
||
|
// .toString(),
|
||
|
// softWrap: true)),
|
||
|
// DataCell(Text(
|
||
|
// publication_data[
|
||
|
// index]
|
||
|
// ['author']
|
||
|
// .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: (_) =>
|
||
|
// // PublicationsData()));
|
||
|
// },
|
||
|
// 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
|
||
|
//////////////////////////////////////////////
|
||
|
// ListTileTheme(
|
||
|
// dense: true,
|
||
|
// child: Padding(
|
||
|
// padding: const EdgeInsets.only(left: 8.0, right: 8.0),
|
||
|
// child: Card(
|
||
|
// margin: EdgeInsets.all(1.0),
|
||
|
// // elevation: 5,
|
||
|
// shape: RoundedRectangleBorder(
|
||
|
// borderRadius: BorderRadius.circular(0.0),
|
||
|
// ),
|
||
|
// color: Constants.k2color11,
|
||
|
// child: ExpansionTile(
|
||
|
// initiallyExpanded: false,
|
||
|
// maintainState: true,
|
||
|
// // backgroundColor: Colors.white,
|
||
|
// // collapsedBackgroundColor: Color(0xFF2b9af3),
|
||
|
// onExpansionChanged: (bool expanded) {
|
||
|
// setState(() {
|
||
|
// _isExpanded = expanded;
|
||
|
// });
|
||
|
// },
|
||
|
// backgroundColor: Constants.k2color11,
|
||
|
// 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: "(3)",
|
||
|
// 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('Institute Name',
|
||
|
// style: TextStyle(
|
||
|
// fontWeight: FontWeight.w600),
|
||
|
// softWrap: true),
|
||
|
// )),
|
||
|
// DataColumn(
|
||
|
// label: Expanded(
|
||
|
// child: Text('Degree',
|
||
|
// style: TextStyle(
|
||
|
// fontWeight: FontWeight.w600)))),
|
||
|
// ],
|
||
|
// rows: List.generate(
|
||
|
// publication_data.length,
|
||
|
// (index) => DataRow(
|
||
|
// onSelectChanged: (value) {
|
||
|
// print("message ${publication_data[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(publication_data[index]);
|
||
|
// },
|
||
|
// );
|
||
|
// },
|
||
|
// cells: [
|
||
|
// DataCell(Text(
|
||
|
// publication_data[index]['artical_title']
|
||
|
// .toString(),
|
||
|
// softWrap: true)),
|
||
|
// DataCell(Text(
|
||
|
// publication_data[index]['author']
|
||
|
// .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: (_) =>
|
||
|
// // PublicationsData()));
|
||
|
// },
|
||
|
// 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
|
||
|
// ////////////////////////////////////////////////////
|
||
|
// 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.k2color11,
|
||
|
// child: ExpansionTile(
|
||
|
// backgroundColor: Constants.k2color11,
|
||
|
// 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: "Case",
|
||
|
// txtcolor: Colors.black,
|
||
|
// fontweight: FontWeight.normal,
|
||
|
// txtfont: 16.0),
|
||
|
// const SizedBox(
|
||
|
// width: 8.0,
|
||
|
// ),
|
||
|
// Text1(
|
||
|
// title: "(3)",
|
||
|
// 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('Name',
|
||
|
// style: TextStyle(
|
||
|
// fontWeight:
|
||
|
// FontWeight
|
||
|
// .w600),
|
||
|
// softWrap: true),
|
||
|
// )),
|
||
|
// DataColumn(
|
||
|
// label: Expanded(
|
||
|
// child: Text(
|
||
|
// 'Type',
|
||
|
// style: TextStyle(
|
||
|
// fontWeight:
|
||
|
// FontWeight
|
||
|
// .w600)))),
|
||
|
// ],
|
||
|
// rows: List.generate(
|
||
|
// publication_data.length,
|
||
|
// (index) => DataRow(
|
||
|
// onSelectChanged:
|
||
|
// (value) {
|
||
|
// print(
|
||
|
// "message ${publication_data[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(
|
||
|
// publication_data[
|
||
|
// index]);
|
||
|
// },
|
||
|
// );
|
||
|
// },
|
||
|
// cells: [
|
||
|
// DataCell(Text(
|
||
|
// publication_data[
|
||
|
// index]
|
||
|
// [
|
||
|
// 'artical_title']
|
||
|
// .toString(),
|
||
|
// softWrap: true)),
|
||
|
// DataCell(Text(
|
||
|
// publication_data[
|
||
|
// index]
|
||
|
// ['author']
|
||
|
// .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: (_) =>
|
||
|
// // PublicationsData()));
|
||
|
// },
|
||
|
// 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
|
||
|
],
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
|
||
|
Future<int> getCount(String form, InteractionProvider provider) async {
|
||
|
await provider.getRecords();
|
||
|
|
||
|
return provider.savedList.where((element) => element.form == form).length;
|
||
|
}
|
||
|
|
||
|
showDeleteRecordAlertDialog(
|
||
|
BuildContext context, String record, SaveInteraction saveInteraction) {
|
||
|
// set up the buttons
|
||
|
ViewInteractionProvider provider =
|
||
|
Provider.of<ViewInteractionProvider>(context, listen: false);
|
||
|
Widget cancelButton = TextButton(
|
||
|
child: const Text("YES"),
|
||
|
onPressed: () async {
|
||
|
await provider.deleteRecord(saveInteraction).then((value) {
|
||
|
_displaySnackBar("Deleted sucessfully!");
|
||
|
Navigator.of(context).pop();
|
||
|
});
|
||
|
},
|
||
|
);
|
||
|
Widget continueButton = TextButton(
|
||
|
child: const Text("NO"),
|
||
|
onPressed: () {
|
||
|
Navigator.of(context).pop();
|
||
|
},
|
||
|
);
|
||
|
|
||
|
// set up the AlertDialog
|
||
|
AlertDialog alert = AlertDialog(
|
||
|
title: const Text(""),
|
||
|
content: Text("Are you sure you want to delete the record $record ?"),
|
||
|
actions: [
|
||
|
cancelButton,
|
||
|
continueButton,
|
||
|
],
|
||
|
);
|
||
|
|
||
|
// show the dialog
|
||
|
showDialog(
|
||
|
context: context,
|
||
|
builder: (BuildContext context) {
|
||
|
return alert;
|
||
|
},
|
||
|
);
|
||
|
}
|
||
|
|
||
|
_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);
|
||
|
}
|
||
|
}
|