927 lines
47 KiB
Dart
927 lines
47 KiB
Dart
|
// import 'package:discover_module/constants.dart';
|
||
|
// import 'package:discover_module/provider_class/medicalinsightprovider.dart';
|
||
|
// import 'package:discover_module/ui_screen/view_insight.dart';
|
||
|
// import 'package:flutter/cupertino.dart';
|
||
|
// import 'package:flutter/material.dart';
|
||
|
// import 'package:flutter/widgets.dart';
|
||
|
// import 'package:provider/provider.dart';
|
||
|
|
||
|
// class MedicalInsight extends StatefulWidget {
|
||
|
// const MedicalInsight({super.key});
|
||
|
|
||
|
// @override
|
||
|
// State<MedicalInsight> createState() => _MedicalInsightState();
|
||
|
// }
|
||
|
|
||
|
// class _MedicalInsightState extends State<MedicalInsight> {
|
||
|
// final List<Map<String, dynamic>> cardData = [
|
||
|
// {'id': 'ID ', 'number': 'MI1688128025', 'id1': "jjj", 'number1': '265'},
|
||
|
// {'id': 'ID ', 'number': 20},
|
||
|
// {'id': 'ID ', 'number': 30},
|
||
|
// // Add more data entries as needed
|
||
|
// ];
|
||
|
|
||
|
// String selectedOption = 'None';
|
||
|
// late GlobalKey actionKey;
|
||
|
|
||
|
// var item;
|
||
|
|
||
|
// @override
|
||
|
// void initState() {
|
||
|
// actionKey = GlobalKey();
|
||
|
// super.initState();
|
||
|
// getapicall();
|
||
|
// }
|
||
|
|
||
|
// void getapicall() async {
|
||
|
// await Provider.of<MediacalInsightProvider>(context, listen: false)
|
||
|
// .medicalinsightdata();
|
||
|
// }
|
||
|
|
||
|
// // GlobalKey actionKey;
|
||
|
// // final List<Map<String, dynamic>> data = [
|
||
|
// // {'id': 'Data ID 1', 'number': 10},
|
||
|
// // {'id': 'Data ID 2', 'number': 20},
|
||
|
// // {'id': 'Data ID 3', 'number': 30},
|
||
|
// // // Add more data entries as needed
|
||
|
// // ];
|
||
|
// @override
|
||
|
// Widget build(BuildContext context) {
|
||
|
// return Directionality(
|
||
|
// textDirection: TextDirection.ltr,
|
||
|
// child: SafeArea(
|
||
|
// child: Scaffold(
|
||
|
// backgroundColor: const Color.fromARGB(255, 222, 237, 247),
|
||
|
// appBar: AppBar(
|
||
|
// title: const Text('Medical Insight'),
|
||
|
// ),
|
||
|
// body: Consumer<MediacalInsightProvider>(
|
||
|
// builder: (context, value, child) {
|
||
|
// return Column(
|
||
|
// children: [
|
||
|
// Padding(
|
||
|
// padding: const EdgeInsets.all(15.0),
|
||
|
// child: TextField(
|
||
|
// //controller: _searchController,
|
||
|
// onChanged: (value) {
|
||
|
// setState(() {});
|
||
|
// },
|
||
|
// decoration: InputDecoration(
|
||
|
// fillColor: Constants.k2color,
|
||
|
// contentPadding: const EdgeInsets.symmetric(vertical: 9.0),
|
||
|
// border: const OutlineInputBorder(
|
||
|
// borderRadius: BorderRadius.only(
|
||
|
// bottomRight: Radius.circular(0))),
|
||
|
// labelText: ' Search',
|
||
|
// prefixIcon: const Icon(
|
||
|
// Icons.search,
|
||
|
// ),
|
||
|
// ),
|
||
|
// ),
|
||
|
// ),
|
||
|
// Row(
|
||
|
// mainAxisAlignment: MainAxisAlignment.end,
|
||
|
// children: [
|
||
|
// OutlinedButton(
|
||
|
// style: OutlinedButton.styleFrom(
|
||
|
// backgroundColor: Constants.k2color,
|
||
|
// foregroundColor: Colors.white),
|
||
|
// onPressed: () {},
|
||
|
// child: Text("Create Medical Insight"))
|
||
|
// ],
|
||
|
// ),
|
||
|
// 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 GestureDetector(
|
||
|
// onTap: () {
|
||
|
// _showAlertDialog(context);
|
||
|
// },
|
||
|
// child: Padding(
|
||
|
// padding: const EdgeInsets.all(8.0),
|
||
|
// child: Card(
|
||
|
// surfaceTintColor: Colors.white,
|
||
|
// // 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(
|
||
|
// title: Column(
|
||
|
// // crossAxisAlignment: CrossAxisAlignment.center,
|
||
|
// children: [
|
||
|
// Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// "ID",
|
||
|
// style: TextStyle(
|
||
|
// fontSize: 16,
|
||
|
// fontWeight: FontWeight.bold),
|
||
|
// ),
|
||
|
// ),
|
||
|
// Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// item['id'].toString(),
|
||
|
// textAlign: TextAlign.left,
|
||
|
// style: const TextStyle(fontSize: 16),
|
||
|
// ),
|
||
|
// ),
|
||
|
// // Row(
|
||
|
// // mainAxisAlignment:
|
||
|
// // MainAxisAlignment.spaceBetween,
|
||
|
// // children: [
|
||
|
// // Text(
|
||
|
// // "Interaction Id",
|
||
|
// // style: TextStyle(
|
||
|
// // fontSize: 16,
|
||
|
// // fontWeight: FontWeight.bold),
|
||
|
// // ),
|
||
|
// // Text(
|
||
|
// // "pokn".toString(),
|
||
|
// // style: TextStyle(fontSize: 16),
|
||
|
// // ),
|
||
|
// // ],
|
||
|
// // ),
|
||
|
|
||
|
// Row(
|
||
|
// mainAxisAlignment:
|
||
|
// MainAxisAlignment.spaceBetween,
|
||
|
// children: [
|
||
|
// const Expanded(
|
||
|
// flex: 1,
|
||
|
// child: Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// "Therapeutic Area",
|
||
|
// style: TextStyle(
|
||
|
// fontSize: 16,
|
||
|
// fontWeight:
|
||
|
// FontWeight.bold),
|
||
|
// ),
|
||
|
// ),
|
||
|
// ),
|
||
|
// Expanded(
|
||
|
// flex: 1,
|
||
|
// child: Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// item['Therapeutic Area']
|
||
|
// .toString(),
|
||
|
// style: const TextStyle(
|
||
|
// fontSize: 16),
|
||
|
// ),
|
||
|
// ),
|
||
|
// )
|
||
|
// ],
|
||
|
// ),
|
||
|
// Row(
|
||
|
// mainAxisAlignment:
|
||
|
// MainAxisAlignment.spaceBetween,
|
||
|
// children: [
|
||
|
// const Expanded(
|
||
|
// flex: 1,
|
||
|
// child: Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// "Product",
|
||
|
// style: TextStyle(
|
||
|
// fontSize: 16,
|
||
|
// fontWeight:
|
||
|
// FontWeight.bold),
|
||
|
// ),
|
||
|
// ),
|
||
|
// ),
|
||
|
// Expanded(
|
||
|
// flex: 1,
|
||
|
// child: Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// item['Product'].toString(),
|
||
|
// style: const TextStyle(
|
||
|
// fontSize: 16),
|
||
|
// ),
|
||
|
// ),
|
||
|
// ),
|
||
|
// ],
|
||
|
// ),
|
||
|
// Row(
|
||
|
// mainAxisAlignment:
|
||
|
// MainAxisAlignment.spaceBetween,
|
||
|
// children: [
|
||
|
// const Expanded(
|
||
|
// flex: 1,
|
||
|
// child: Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// "Source Type",
|
||
|
// style: TextStyle(
|
||
|
// fontSize: 16,
|
||
|
// fontWeight:
|
||
|
// FontWeight.bold),
|
||
|
// ),
|
||
|
// )),
|
||
|
// Expanded(
|
||
|
// flex: 1,
|
||
|
// child: Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// item['Source Type'].toString(),
|
||
|
// style: const TextStyle(
|
||
|
// fontSize: 16),
|
||
|
// ),
|
||
|
// ),
|
||
|
// )
|
||
|
// ],
|
||
|
// ),
|
||
|
// Row(
|
||
|
// mainAxisAlignment:
|
||
|
// MainAxisAlignment.spaceBetween,
|
||
|
// children: [
|
||
|
// const Expanded(
|
||
|
// flex: 1,
|
||
|
// child: Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// "Topics",
|
||
|
// style: TextStyle(
|
||
|
// fontSize: 16,
|
||
|
// fontWeight:
|
||
|
// FontWeight.bold),
|
||
|
// ),
|
||
|
// ),
|
||
|
// ),
|
||
|
// Expanded(
|
||
|
// flex: 1,
|
||
|
// child: Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// item['Topics'].toString(),
|
||
|
// style: const TextStyle(
|
||
|
// fontSize: 16),
|
||
|
// ),
|
||
|
// ),
|
||
|
// )
|
||
|
// ],
|
||
|
// ),
|
||
|
// Row(
|
||
|
// children: [
|
||
|
// Expanded(
|
||
|
// flex: 1,
|
||
|
// child: Column(
|
||
|
// 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),
|
||
|
// )
|
||
|
// ],
|
||
|
// )
|
||
|
// ],
|
||
|
// ),
|
||
|
// ),
|
||
|
// Expanded(
|
||
|
// flex: 1,
|
||
|
// child: Align(
|
||
|
// alignment:
|
||
|
// Alignment.centerRight,
|
||
|
// child: OutlinedButton(
|
||
|
// style:
|
||
|
// OutlinedButton.styleFrom(
|
||
|
// shape:
|
||
|
// CircleBorder()),
|
||
|
// onPressed: () {
|
||
|
// // final RenderBox renderBox =
|
||
|
// // actionKey.currentContext!
|
||
|
// // .findRenderObject();
|
||
|
// // final position = renderBox
|
||
|
// // .localToGlobal(Offset.zero);
|
||
|
// final RenderBox renderBox =
|
||
|
// actionKey
|
||
|
// .currentContext!
|
||
|
// .findRenderObject()
|
||
|
// as RenderBox;
|
||
|
// final position =
|
||
|
// renderBox.localToGlobal(
|
||
|
// Offset.zero);
|
||
|
|
||
|
// showMenu(
|
||
|
// context: context,
|
||
|
// position:
|
||
|
// RelativeRect.fromLTRB(
|
||
|
// position.dx,
|
||
|
// position.dy +
|
||
|
// renderBox
|
||
|
// .size.height,
|
||
|
// position.dx +
|
||
|
// renderBox
|
||
|
// .size.width,
|
||
|
// position.dy +
|
||
|
// renderBox
|
||
|
// .size.height +
|
||
|
// 10,
|
||
|
// ),
|
||
|
// items: <PopupMenuEntry<
|
||
|
// String>>[
|
||
|
// PopupMenuItem<String>(
|
||
|
// value: 'Option 1',
|
||
|
// child:
|
||
|
// Text('Option 1'),
|
||
|
// ),
|
||
|
// PopupMenuItem<String>(
|
||
|
// value: 'Option 2',
|
||
|
// child:
|
||
|
// Text('Option 2'),
|
||
|
// ),
|
||
|
// PopupMenuItem<String>(
|
||
|
// value: 'Option 3',
|
||
|
// child:
|
||
|
// Text('Option 3'),
|
||
|
// ),
|
||
|
// ],
|
||
|
// ).then((value) {
|
||
|
// if (value != null) {
|
||
|
// setState(() {
|
||
|
// selectedOption =
|
||
|
// value;
|
||
|
// });
|
||
|
// }
|
||
|
// });
|
||
|
// },
|
||
|
// child: Icon(
|
||
|
// Icons.more_horiz_rounded,
|
||
|
// // color: Constants.k2color,
|
||
|
// ),
|
||
|
// )),
|
||
|
// )
|
||
|
// ],
|
||
|
// ),
|
||
|
// ],
|
||
|
// ),
|
||
|
// ),
|
||
|
// ),
|
||
|
// // shape: BorderRadius.only(bottomRight: Radius.circular(50)),
|
||
|
// ),
|
||
|
// ),
|
||
|
// );
|
||
|
// }),
|
||
|
// )
|
||
|
// ],
|
||
|
// );
|
||
|
// }),
|
||
|
// ),
|
||
|
// ),
|
||
|
// );
|
||
|
// }
|
||
|
|
||
|
// void _showAlertDialog(BuildContext context) {
|
||
|
// showDialog(
|
||
|
// context: context,
|
||
|
// builder: (BuildContext context) {
|
||
|
// return AlertDialog(
|
||
|
// // title: Text('Alert'),
|
||
|
// content: const MyWidget22(),
|
||
|
// actions: <Widget>[
|
||
|
// TextButton(
|
||
|
// child: const Text('Close'),
|
||
|
// onPressed: () {
|
||
|
// Navigator.of(context).pop();
|
||
|
// },
|
||
|
// ),
|
||
|
// ],
|
||
|
// );
|
||
|
// },
|
||
|
// );
|
||
|
// }
|
||
|
// }
|
||
|
|
||
|
import 'package:discover_module/constants.dart';
|
||
|
import 'package:discover_module/provider_class/medicalinsightprovider.dart';
|
||
|
import 'package:discover_module/ui_screen/view_insight.dart';
|
||
|
import 'package:flutter/cupertino.dart';
|
||
|
import 'package:flutter/material.dart';
|
||
|
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});
|
||
|
|
||
|
@override
|
||
|
State<MedicalInsight> createState() => _MedicalInsightState();
|
||
|
}
|
||
|
|
||
|
class _MedicalInsightState extends State<MedicalInsight> {
|
||
|
final List<Map<String, dynamic>> cardData = [
|
||
|
{'id': 'ID ', 'number': 'MI1688128025', 'id1': "jjj", 'number1': '265'},
|
||
|
{'id': 'ID ', 'number': 20},
|
||
|
{'id': 'ID ', 'number': 30},
|
||
|
// Add more data entries as needed
|
||
|
];
|
||
|
|
||
|
String selectedOption = 'None';
|
||
|
late GlobalKey actionKey;
|
||
|
// DateTime? pickedDate;
|
||
|
|
||
|
var item;
|
||
|
final TextEditingController textController = TextEditingController();
|
||
|
|
||
|
DateTime? selectedDate;
|
||
|
|
||
|
bool calview = false;
|
||
|
String? start, end;
|
||
|
@override
|
||
|
void initState() {
|
||
|
actionKey = GlobalKey();
|
||
|
super.initState();
|
||
|
getapicall();
|
||
|
}
|
||
|
|
||
|
void getapicall() async {
|
||
|
await Provider.of<MediacalInsightProvider>(context, listen: false)
|
||
|
.medicalinsightdata();
|
||
|
}
|
||
|
|
||
|
// GlobalKey actionKey;
|
||
|
// final List<Map<String, dynamic>> data = [
|
||
|
// {'id': 'Data ID 1', 'number': 10},
|
||
|
// {'id': 'Data ID 2', 'number': 20},
|
||
|
// {'id': 'Data ID 3', 'number': 30},
|
||
|
// // Add more data entries as needed
|
||
|
// ];
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Directionality(
|
||
|
textDirection: TextDirection.ltr,
|
||
|
child: SafeArea(
|
||
|
child: Scaffold(
|
||
|
backgroundColor: const Color.fromARGB(255, 222, 237, 247),
|
||
|
appBar: AppBar(
|
||
|
title: const Text('Medical Insight'),
|
||
|
actions: [
|
||
|
GestureDetector(
|
||
|
onTap: () {
|
||
|
setState(() {
|
||
|
calview = true;
|
||
|
});
|
||
|
},
|
||
|
child: Icon(Icons.calendar_month))
|
||
|
],
|
||
|
),
|
||
|
body: Consumer<MediacalInsightProvider>(
|
||
|
builder: (context, value, child) {
|
||
|
return Column(
|
||
|
children: [
|
||
|
// GestureDetector(
|
||
|
// onTap: () => _selectDate(context),
|
||
|
// child: AbsorbPointer(
|
||
|
// child: TextField(
|
||
|
// controller: textController,
|
||
|
// decoration: InputDecoration(
|
||
|
// focusedBorder: InputBorder.none,
|
||
|
// enabledBorder: InputBorder.none,
|
||
|
// contentPadding: EdgeInsets.all(10.0),
|
||
|
// labelText: "date",
|
||
|
// labelStyle:
|
||
|
// TextStyle(color: Colors.black, fontSize: 16),
|
||
|
// // pass the hint text parameter here
|
||
|
// hintStyle: TextStyle(color: Colors.black, fontSize: 16),
|
||
|
// suffixIcon: Icon(Icons.calendar_today),
|
||
|
// ),
|
||
|
// style: TextStyle(color: Colors.black, fontSize: 18),
|
||
|
// ),
|
||
|
// ),
|
||
|
// ),
|
||
|
Visibility(
|
||
|
visible: calview,
|
||
|
child: Row(
|
||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||
|
children: [
|
||
|
OutlinedButton(
|
||
|
onPressed: () {
|
||
|
_selectDate(context);
|
||
|
},
|
||
|
child:
|
||
|
start == null ? Text('Start Date') : Text(start!),
|
||
|
),
|
||
|
OutlinedButton(
|
||
|
onPressed: () {
|
||
|
_selectDate1(context);
|
||
|
},
|
||
|
child: end == null ? Text('Start Date') : Text(end!),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
|
||
|
Padding(
|
||
|
padding: const EdgeInsets.all(8.0),
|
||
|
child: TextField(
|
||
|
//controller: _searchController,
|
||
|
onChanged: (value) {
|
||
|
setState(() {});
|
||
|
},
|
||
|
decoration: InputDecoration(
|
||
|
fillColor: Constants.k2color,
|
||
|
contentPadding: const EdgeInsets.symmetric(vertical: 9.0),
|
||
|
border: const OutlineInputBorder(
|
||
|
borderRadius: BorderRadius.only(
|
||
|
bottomRight: Radius.circular(0))),
|
||
|
labelText: ' Search',
|
||
|
prefixIcon: const Icon(
|
||
|
Icons.search,
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
Row(
|
||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||
|
children: [
|
||
|
OutlinedButton(
|
||
|
style: OutlinedButton.styleFrom(
|
||
|
backgroundColor: Constants.k2color,
|
||
|
foregroundColor: Colors.white),
|
||
|
onPressed: () {},
|
||
|
child: Text("Create Medical Insight"))
|
||
|
],
|
||
|
),
|
||
|
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 GestureDetector(
|
||
|
onTap: () {
|
||
|
_showAlertDialog(context);
|
||
|
},
|
||
|
child: Padding(
|
||
|
padding: const EdgeInsets.all(8.0),
|
||
|
child: Card(
|
||
|
surfaceTintColor: Colors.white,
|
||
|
// 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(
|
||
|
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: 'Acute neurology is the',
|
||
|
style: DefaultTextStyle.of(context)
|
||
|
.style,
|
||
|
children: const <TextSpan>[
|
||
|
TextSpan(
|
||
|
text: ' therapeutic area ',
|
||
|
style: TextStyle(
|
||
|
fontWeight:
|
||
|
FontWeight.bold)),
|
||
|
TextSpan(
|
||
|
text:
|
||
|
'of the medical insight for Product A.'),
|
||
|
TextSpan(
|
||
|
text: '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)),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
|
||
|
Padding(
|
||
|
padding: const EdgeInsets.all(8.0),
|
||
|
child: Row(
|
||
|
mainAxisAlignment:
|
||
|
MainAxisAlignment.spaceAround,
|
||
|
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),
|
||
|
)
|
||
|
],
|
||
|
)
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
// Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// "Therapeutic Area",
|
||
|
// style: TextStyle(
|
||
|
// fontSize: 12,
|
||
|
// fontWeight: FontWeight.normal),
|
||
|
// ),
|
||
|
// ),
|
||
|
// Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// item['Therapeutic Area'].toString(),
|
||
|
// style: const TextStyle(fontSize: 14),
|
||
|
// ),
|
||
|
// ),
|
||
|
// Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// "Product",
|
||
|
// style: TextStyle(
|
||
|
// fontSize: 12,
|
||
|
// fontWeight: FontWeight.normal),
|
||
|
// ),
|
||
|
// ),
|
||
|
// Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// item['Product'].toString(),
|
||
|
// style: const TextStyle(fontSize: 14),
|
||
|
// ),
|
||
|
// ),
|
||
|
// Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// "Source Type",
|
||
|
// style: TextStyle(
|
||
|
// fontSize: 12,
|
||
|
// fontWeight: FontWeight.normal),
|
||
|
// ),
|
||
|
// ),
|
||
|
// Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// item['Source Type'].toString(),
|
||
|
// style: const TextStyle(fontSize: 14),
|
||
|
// ),
|
||
|
// ),
|
||
|
// Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// "Topics",
|
||
|
// style: TextStyle(
|
||
|
// fontSize: 12,
|
||
|
// fontWeight: FontWeight.normal),
|
||
|
// ),
|
||
|
// ),
|
||
|
// Align(
|
||
|
// alignment: Alignment.centerLeft,
|
||
|
// child: Text(
|
||
|
// item['Topics'].toString(),
|
||
|
// style: const TextStyle(fontSize: 14),
|
||
|
// ),
|
||
|
// ),
|
||
|
// Row(
|
||
|
// children: [
|
||
|
// Expanded(
|
||
|
// flex: 1,
|
||
|
// child: Column(
|
||
|
// 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),
|
||
|
// )
|
||
|
// ],
|
||
|
// )
|
||
|
// ],
|
||
|
// ),
|
||
|
// ),
|
||
|
// Expanded(
|
||
|
// flex: 1,
|
||
|
// child: Align(
|
||
|
// alignment:
|
||
|
// Alignment.centerRight,
|
||
|
// child: OutlinedButton(
|
||
|
// style:
|
||
|
// OutlinedButton.styleFrom(
|
||
|
// shape:
|
||
|
// CircleBorder()),
|
||
|
// onPressed: () {
|
||
|
// // final RenderBox renderBox =
|
||
|
// // actionKey.currentContext!
|
||
|
// // .findRenderObject();
|
||
|
// // final position = renderBox
|
||
|
// // .localToGlobal(Offset.zero);
|
||
|
// final RenderBox renderBox =
|
||
|
// actionKey
|
||
|
// .currentContext!
|
||
|
// .findRenderObject()
|
||
|
// as RenderBox;
|
||
|
// final position =
|
||
|
// renderBox.localToGlobal(
|
||
|
// Offset.zero);
|
||
|
|
||
|
// showMenu(
|
||
|
// context: context,
|
||
|
// position:
|
||
|
// RelativeRect.fromLTRB(
|
||
|
// position.dx,
|
||
|
// position.dy +
|
||
|
// renderBox
|
||
|
// .size.height,
|
||
|
// position.dx +
|
||
|
// renderBox
|
||
|
// .size.width,
|
||
|
// position.dy +
|
||
|
// renderBox
|
||
|
// .size.height +
|
||
|
// 10,
|
||
|
// ),
|
||
|
// items: <PopupMenuEntry<
|
||
|
// String>>[
|
||
|
// PopupMenuItem<String>(
|
||
|
// value: 'Option 1',
|
||
|
// child:
|
||
|
// Text('Option 1'),
|
||
|
// ),
|
||
|
// PopupMenuItem<String>(
|
||
|
// value: 'Option 2',
|
||
|
// child:
|
||
|
// Text('Option 2'),
|
||
|
// ),
|
||
|
// PopupMenuItem<String>(
|
||
|
// value: 'Option 3',
|
||
|
// child:
|
||
|
// Text('Option 3'),
|
||
|
// ),
|
||
|
// ],
|
||
|
// ).then((value) {
|
||
|
// if (value != null) {
|
||
|
// setState(() {
|
||
|
// selectedOption =
|
||
|
// value;
|
||
|
// });
|
||
|
// }
|
||
|
// });
|
||
|
// },
|
||
|
// child: Icon(
|
||
|
// Icons.more_horiz_rounded,
|
||
|
// // color: Constants.k2color,
|
||
|
// ),
|
||
|
// )),
|
||
|
// )
|
||
|
// ],
|
||
|
// ),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
// shape: BorderRadius.only(bottomRight: Radius.circular(50)),
|
||
|
),
|
||
|
),
|
||
|
);
|
||
|
}),
|
||
|
)
|
||
|
],
|
||
|
);
|
||
|
}),
|
||
|
),
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
|
||
|
void _showAlertDialog(BuildContext context) {
|
||
|
showDialog(
|
||
|
context: context,
|
||
|
builder: (BuildContext context) {
|
||
|
return AlertDialog(
|
||
|
// title: Text('Alert'),
|
||
|
content: const MyWidget22(),
|
||
|
actions: <Widget>[
|
||
|
TextButton(
|
||
|
child: const Text('Close'),
|
||
|
onPressed: () {
|
||
|
Navigator.of(context).pop();
|
||
|
},
|
||
|
),
|
||
|
],
|
||
|
);
|
||
|
},
|
||
|
);
|
||
|
}
|
||
|
|
||
|
Future<Null> _selectDate(BuildContext context) async {
|
||
|
final DateTime? picked = await showDatePicker(
|
||
|
context: context,
|
||
|
initialDate: selectedDate,
|
||
|
firstDate: DateTime(1901, 1),
|
||
|
lastDate: DateTime(2100));
|
||
|
if (picked != null && picked != selectedDate)
|
||
|
setState(() {
|
||
|
selectedDate = picked;
|
||
|
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);
|
||
|
|
||
|
start = convertedDateTime;
|
||
|
;
|
||
|
});
|
||
|
}
|
||
|
|
||
|
Future<Null> _selectDate1(BuildContext context) async {
|
||
|
final DateTime? picked = await showDatePicker(
|
||
|
context: context,
|
||
|
initialDate: selectedDate,
|
||
|
firstDate: DateTime(1901, 1),
|
||
|
lastDate: DateTime(2100));
|
||
|
if (picked != null && picked != selectedDate)
|
||
|
setState(() {
|
||
|
selectedDate = picked;
|
||
|
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);
|
||
|
|
||
|
end = convertedDateTime;
|
||
|
;
|
||
|
});
|
||
|
}
|
||
|
}
|