KonectarApp/lib/view/profileview.dart

1770 lines
69 KiB
Dart
Raw Permalink Normal View History

2024-12-03 05:59:45 +00:00
import 'dart:convert';
import 'dart:io';
2024-09-06 06:30:31 +00:00
import 'dart:math';
import 'package:avatar_stack/avatar_stack.dart';
2024-12-03 05:59:45 +00:00
import 'package:file_picker/file_picker.dart';
2024-09-06 06:30:31 +00:00
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
2024-12-16 11:26:32 +00:00
import 'package:flutter/painting.dart';
2024-09-06 06:30:31 +00:00
import 'package:flutter/rendering.dart';
2024-12-03 05:59:45 +00:00
import 'package:flutter/services.dart';
2024-09-06 06:30:31 +00:00
import 'package:flutter/widgets.dart';
import 'package:intl/intl.dart';
2024-11-19 12:57:30 +00:00
import 'package:konectar_events/contacts_module/model_class/speaker.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/configprovider.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/interactionlistscreen.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/interactionprovider.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/new_dynamicform.dart';
import 'package:konectar_events/contacts_module/ui_screen/interactionform/viewinteractionprovider.dart';
2024-12-03 05:59:45 +00:00
import 'package:konectar_events/contacts_module/ui_screen/interactionform/widget/custombutton.dart';
2024-11-19 12:57:30 +00:00
import 'package:konectar_events/contacts_module/ui_screen/new_editinteraction.dart';
import 'package:konectar_events/contacts_module/ui_screen/new_new_profile.dart';
2024-11-19 12:57:30 +00:00
import 'package:konectar_events/contacts_module/ui_screen/new_viewinteraction.dart';
2024-12-03 05:59:45 +00:00
import 'package:konectar_events/model/events_speakers_k1.dart';
2024-09-06 06:30:31 +00:00
import 'package:konectar_events/model/eventsdetailmodel.dart';
2024-11-19 12:57:30 +00:00
import 'package:konectar_events/model/eventspeakers.dart';
2024-09-06 06:30:31 +00:00
import 'package:konectar_events/model/sessionnotesmodel.dart';
2024-12-03 05:59:45 +00:00
import 'package:konectar_events/model/sessionstopics_model.dart';
2024-12-19 05:21:33 +00:00
import 'package:konectar_events/utils/appcolors.dart';
2024-09-06 06:30:31 +00:00
import 'package:konectar_events/utils/constants.dart';
import 'package:konectar_events/utils/dateformater.dart';
import 'package:konectar_events/utils/util.dart';
import 'package:konectar_events/viewmodel/hcpprofprovider.dart';
import 'package:konectar_events/widgets/customdropdown.dart';
import 'package:konectar_events/widgets/snackbar.dart';
2024-12-03 05:59:45 +00:00
import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart';
2024-09-06 06:30:31 +00:00
import 'package:provider/provider.dart';
2024-12-03 05:59:45 +00:00
import 'package:path/path.dart' as p;
2024-09-06 06:30:31 +00:00
class HCPProfileScreen extends StatefulWidget {
2024-12-03 05:59:45 +00:00
EventSpeakersData eventsdetail;
2024-09-06 06:30:31 +00:00
String eventid;
String title;
2024-12-03 05:59:45 +00:00
List<String> sessionNames;
List<String> topics;
String kolFullName;
2024-09-06 06:30:31 +00:00
HCPProfileScreen(
{super.key,
required this.eventsdetail,
required this.eventid,
2024-12-03 05:59:45 +00:00
required this.kolFullName,
required this.sessionNames,
required this.topics,
2024-09-06 06:30:31 +00:00
required this.title});
@override
State<HCPProfileScreen> createState() => _HCPProfileScreenState();
}
class _HCPProfileScreenState extends State<HCPProfileScreen> {
String? _selectedFruit;
2024-12-03 05:59:45 +00:00
SessionsTopicsData? sessionsTopicsData;
2024-09-06 06:30:31 +00:00
bool isExtended = false;
List<String> sessionList = [];
2024-12-03 05:59:45 +00:00
String attachedFileName = '';
String attachedFilePath = '';
bool isLoading = false;
2024-12-16 11:26:32 +00:00
bool enableCancel = false;
String btnText = "Add Notes";
2024-09-06 06:30:31 +00:00
final List<String> _fruits = ['Events', 'Sessions'];
final List<String> topics = [
" Admin. & Managemente",
"Cyclin-Dependent Kinase 4 | Cyclin-Dependent Kinase 6 | Breast Neoplasms"
];
final List<String> sessions = [
"Program Committee",
"Practical Application of CDK 4/6 Inhibitor"
];
2024-12-16 11:26:32 +00:00
final ValueNotifier<List<int>> valueList =
ValueNotifier<List<int>>([0, 0, 0]);
2024-09-06 06:30:31 +00:00
TextEditingController notesController = TextEditingController(text: "");
List<String> sessionNotesList = [];
2024-12-03 05:59:45 +00:00
Future<void> dialogBuilder(BuildContext context, Eventsdetail eventsdetail,
HcpProfileProvider provider) {
2024-09-06 06:30:31 +00:00
return showDialog<void>(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Session Notes'),
content: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(8.0)),
2024-12-03 05:59:45 +00:00
child: dropDown(underline: Container(), provider: provider)),
2024-09-06 06:30:31 +00:00
TextFormField(
validator: (value) {
// add email validation
if (value == null || value.isEmpty) {
return 'Please enter some text';
}
// bool emailValid = RegExp(
// r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
// .hasMatch(value);
// if (!emailValid) {
// return 'Please enter a valid email';
// }
return null;
},
decoration: const InputDecoration(
labelText: 'Notes',
hintText: 'Notes',
prefixIcon: Icon(Icons.email_outlined),
border: OutlineInputBorder(),
),
),
],
),
actions: <Widget>[
TextButton(
style: TextButton.styleFrom(
textStyle: Theme.of(context).textTheme.labelLarge,
),
child: const Text('Submit'),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
style: TextButton.styleFrom(
textStyle: Theme.of(context).textTheme.labelLarge,
),
child: const Text('Cancel'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
}
2024-12-03 05:59:45 +00:00
Widget dropDown(
{Widget? underline,
Widget? icon,
TextStyle? style,
TextStyle? hintStyle,
Color? dropdownColor,
required HcpProfileProvider provider}) =>
DropdownButton<SessionsTopicsData>(
value: sessionsTopicsData,
2024-09-06 06:30:31 +00:00
underline: underline,
icon: Align(alignment: Alignment.centerRight, child: icon),
dropdownColor: dropdownColor,
isExpanded: true,
style: TextStyle(
//fontFamily: "SourceSerif",
color: Colors.black,
fontSize: 14.0,
),
// iconEnabledColor: iconEnabledColor,
2024-12-03 05:59:45 +00:00
onChanged: (SessionsTopicsData? newValue) {
2024-09-06 06:30:31 +00:00
setState(() {
2024-12-03 05:59:45 +00:00
_selectedFruit = newValue!.sessionName;
sessionsTopicsData = newValue;
notesController.text = newValue.note ?? "";
if (newValue.note != "" && notesController.text.length != 0) {
btnText = "Update";
2024-12-16 11:26:32 +00:00
enableCancel = true;
}
2024-12-16 11:26:32 +00:00
setState(() {});
2024-09-06 06:30:31 +00:00
});
},
hint: Text("Select Session *", style: hintStyle),
2024-12-03 05:59:45 +00:00
items: provider.sessionTopics
.map((session) => DropdownMenuItem<SessionsTopicsData>(
value: session, child: Text(session.sessionName!)))
2024-09-06 06:30:31 +00:00
.toList());
@override
void initState() {
2024-12-16 11:26:32 +00:00
//valueList.value = [0, 0, 0];
2024-09-06 06:30:31 +00:00
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
init();
});
super.initState();
}
init() async {
2024-12-16 11:26:32 +00:00
// await Provider.of<HcpProfileProvider>(context, listen: false)
// .initConfigModules();
2024-09-06 06:30:31 +00:00
await Provider.of<HcpProfileProvider>(context, listen: false)
.getSessionData();
2024-12-03 05:59:45 +00:00
await Provider.of<HcpProfileProvider>(context, listen: false)
2024-12-16 11:26:32 +00:00
.getSessionTopics(widget.eventsdetail)
.then(
(value) {
valueList.value[0] =
Provider.of<HcpProfileProvider>(context, listen: false).totalNotes;
valueList.value[1] =
Provider.of<HcpProfileProvider>(context, listen: false)
.totalSessions;
valueList.value[2] =
Provider.of<HcpProfileProvider>(context, listen: false).totalTopics;
},
);
Provider.of<HcpProfileProvider>(context, listen: false).getCounts();
2024-11-19 12:57:30 +00:00
await Provider.of<InteractionProvider>(context, listen: false)
.initConfigData();
await Provider.of<InteractionProvider>(context, listen: false).getRecords();
String formname = Provider.of<InteractionProvider>(context, listen: false)
.intConfigDataList[0]
.name;
await Provider.of<ViewInteractionProvider>(context, listen: false)
2024-12-03 05:59:45 +00:00
.getRecords(formname, hcp: widget.kolFullName);
2024-09-06 06:30:31 +00:00
setState(() {});
}
Widget build(BuildContext context) {
return Consumer<HcpProfileProvider>(
builder: (BuildContext context, provider, Widget? child) {
return DefaultTabController(
2024-12-16 11:26:32 +00:00
length: provider.tabs.length,
2024-09-06 06:30:31 +00:00
child: Scaffold(
2024-12-19 05:21:33 +00:00
backgroundColor: AppColors.bgcolor,
2024-09-06 06:30:31 +00:00
appBar: AppBar(
// title: Text(""),
automaticallyImplyLeading: false,
2024-12-19 05:21:33 +00:00
backgroundColor: AppColors.blueColor,
2024-09-06 06:30:31 +00:00
centerTitle: false,
flexibleSpace: FlexibleSpaceBar(
background: Padding(
padding: const EdgeInsets.only(top: 2.0, right: 2.0),
child: Row(
// alignment: Alignment.center,
// fit: StackFit.expand,
crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
children: [
IconButton(
icon: Icon(
Icons.arrow_back_ios,
size: 18,
color: Colors.white,
),
onPressed: () {
Navigator.pop(context);
},
),
// SizedBox(
// width: 40,
// ),
Expanded(
child: Text(
"${widget.title}",
//maxLines: 4,
//softWrap: true,
style: TextStyle(
overflow: TextOverflow.ellipsis,
// decoration: TextDecoration.underline,
// decorationColor: Colors.blue,
color: Colors.white,
//fontWeight: FontWeight.bold,
fontSize: isTablet ? 22 : 14,
),
),
),
],
),
),
),
),
body: NestedScrollView(
headerSliverBuilder:
(BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
expandedHeight: 280.0,
// expandedHeight: MediaQuery.of(context).size.height * 0.25,
2024-12-19 05:21:33 +00:00
backgroundColor: AppColors.bgcolor,
2024-12-16 11:26:32 +00:00
//backgroundColor: Colors.white,
2024-09-06 06:30:31 +00:00
automaticallyImplyLeading: false,
floating: false,
pinned: false,
stretch: true,
flexibleSpace: FlexibleSpaceBar(
centerTitle: true,
collapseMode: CollapseMode.parallax,
// title: Text("",
// style: TextStyle(
// color: Colors.black,
// fontSize: 16.0,
// )),
title: SizedBox.shrink(),
background: buildCardView(
context, widget.eventsdetail, provider)
// Image.network(
// "https://images.pexels.com/photos/417173/pexels-photo-417173.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260",
// fit: BoxFit.cover,
// )
),
),
SliverPersistentHeader(
pinned: true,
floating: true,
delegate: _SliverAppBarDelegate(
2024-12-16 11:26:32 +00:00
TabBar(
2024-09-06 06:30:31 +00:00
isScrollable: false,
indicatorSize: TabBarIndicatorSize.tab,
tabAlignment: TabAlignment.fill,
2024-12-16 11:26:32 +00:00
labelColor: Colors.black,
2024-12-19 05:21:33 +00:00
indicatorColor: AppColors.blueColor,
2024-09-06 06:30:31 +00:00
labelStyle: TextStyle(
fontWeight: FontWeight.bold,
),
labelPadding: EdgeInsets.all(2),
2024-12-16 11:26:32 +00:00
indicatorWeight: 2.0,
2024-09-06 06:30:31 +00:00
//Color.fromARGB(255, 5, 36, 62)
unselectedLabelColor: Colors.grey,
2024-12-16 11:26:32 +00:00
tabs: provider.tabs,
2024-09-06 06:30:31 +00:00
),
),
),
];
},
2024-12-16 11:26:32 +00:00
body: provider.tabs.length == 0
? Container()
: TabBarView(children: returnTabWidget(provider)
// _tabs
// .map((e) => Center(
// child: FloatingActionButton.extended(
// backgroundColor:
// const Color.fromARGB(255, 222, 237, 247),
// onPressed: () {},
// heroTag: 'follow',
// elevation: 0,
// label: const Text("Add Notes"),
// icon: const Icon(Icons.add),
// ),
// // Text("${e.text}", textAlign: TextAlign.center),
// ))
// .toList()),
),
2024-09-06 06:30:31 +00:00
),
));
});
}
2024-12-16 11:26:32 +00:00
List<Widget> returnTabWidget(HcpProfileProvider provider) {
List<Widget> widgets = [];
for (var tabs in provider.tabs) {
if (tabs.text == "Sessions") {
widgets.add(topicsTab(widget.eventsdetail, provider));
}
if (tabs.text == "Notes") {
widgets.add(sessionNotes(context, widget.eventsdetail, provider));
}
if (tabs.text == "Medical Insights") {
widgets.add(medicalInsights());
}
}
return widgets;
}
buildprofile(BuildContext context, EventSpeakersData eventsdetail,
String title, HcpProfileProvider provider) {
2024-09-06 06:30:31 +00:00
MediaQuery.of(context).size.height * 0.35;
print("ORG:${eventsdetail.orgName}");
2024-09-06 06:30:31 +00:00
return Container(
//color: Colors.yellowAccent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
//mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Stack(clipBehavior: Clip.none, alignment: Alignment.center, children: [
Container(
width: MediaQuery.of(context).size.width, // Adjust width as needed
height: 140, // Adjust height as needed
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [
2024-12-19 05:21:33 +00:00
AppColors.blueColor,
AppColors.blueColor,
AppColors.blueColor,
2024-09-06 06:30:31 +00:00
// const Color.fromARGB(255, 222, 237, 247),
// const Color.fromARGB(255, 222, 237, 247),
// Color(0xff006df1)
]),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 15,
),
2024-12-03 05:59:45 +00:00
Text(eventsdetail.kolFullName!,
2024-09-06 06:30:31 +00:00
style: TextStyle(
fontSize: 20,
// fontFamily: "SourceSerif",
color: Colors.white,
fontWeight: FontWeight.bold)),
// Text("Hematology/Oncology",
// style: TextStyle(
// color: Colors.white,
// // fontFamily: "SourceSerif",
// )),
RichText(
2024-09-06 06:30:31 +00:00
textAlign: TextAlign.center,
text: TextSpan(children: [
TextSpan(
2024-12-16 11:26:32 +00:00
text: provider.getUserLoc(eventsdetail),
style: TextStyle(
// decoration: TextDecoration.underline,
// decorationColor: Colors.blue,
color: Colors.white,
fontSize: 14,
// fontFamily: "SourceSerif",
),
// maxLines: isTablet ? 4 : 4,
// softWrap: true,
// overflow: TextOverflow.ellipsis,
),
2024-12-16 11:26:32 +00:00
// TextSpan(
// text: eventsdetail.country != null
// ? '${eventsdetail.country},'
// : "",
// style: TextStyle(
// // decoration: TextDecoration.underline,
// // decorationColor: Colors.blue,
// color: Colors.white,
// fontSize: 14,
// // fontFamily: "SourceSerif",
// ),
// ),
// TextSpan(
// text: eventsdetail.city != null
// ? '${eventsdetail.city}'
// : "",
// style: TextStyle(
// // decoration: TextDecoration.underline,
// // decorationColor: Colors.blue,
// color: Colors.white,
// fontSize: 14,
// // fontFamily: "SourceSerif",
// ),
// )
])),
// Text(
// "${eventsdetail.orgName ?? ""},${eventsdetail.country ?? ""},${eventsdetail.city ?? ""}",
// softWrap: true,
// maxLines: 2,
// textAlign: TextAlign.center,
// style: TextStyle(
// color: Colors.white,
// // fontFamily: "SourceSerif",
// fontSize: 14,
// )),
2024-09-06 06:30:31 +00:00
],
),
),
// Column(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Text1(
// title: "Dr " + widget.text!["name"],
// txtcolor: Colors.white,
// fontweight: FontWeight.normal,
// txtfont: 22.0),
// Text1(
// title: widget.text!["speciality"],
// txtcolor: Colors.white,
// fontweight: FontWeight.normal,
// txtfont: 15.0),
// ],
// ),
Positioned(
bottom: -45,
child: Container(
// child: widget.text["img_path"] == null
// ? ProfilePicture(
// name: widget.text!["name"],
// radius: 38,
// fontsize: 21,
// )
child: ClipOval(
child: SizedBox.fromSize(
size: Size.fromRadius(48),
child: SizedBox(
width: 120,
height: 120,
child: BorderedCircleAvatar(
// radius: 24,
backgroundColor: Colors.grey,
border: BorderSide(color: Colors.white),
// child: Icon(
// Icons.person,
// size: 18,
// color: Colors.white,
// ),
child: Text(
title[0],
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 34,
color: Colors.white),
),
),
),
),
),
),
),
// SizedBox(
// height: 55.0,
// ),
]),
],
));
}
2024-12-03 05:59:45 +00:00
Widget buildCardView(BuildContext context, EventSpeakersData eventsdetail,
2024-09-06 06:30:31 +00:00
HcpProfileProvider provider) {
return Container(
// color: Constants.bgcolor,
child: Column(
children: [
// _TopPortion(
// title: eventsdetail.kolFullName!,
// eventsdetail: eventsdetail,
// ),
2024-12-16 11:26:32 +00:00
buildprofile(
context, eventsdetail, eventsdetail.kolFullName!, provider),
2024-09-06 06:30:31 +00:00
// Padding(
// padding: const EdgeInsets.all(8.0),
// child: Column(
// children: [
// Text(eventsdetail.kolFullName!,
// style: TextStyle(
// fontSize: 20,
// // fontFamily: "SourceSerif",
// fontWeight: FontWeight.bold)),
// Text("Hematology/Oncology",
// style: TextStyle(
// // fontFamily: "SourceSerif",
// )),
// Text(
// "${eventsdetail.orgName ?? ""} ${eventsdetail.country ?? ""} ${eventsdetail.city ?? ""}",
// softWrap: true,
// maxLines: 2,
// textAlign: TextAlign.center,
// style: TextStyle(
// // fontFamily: "SourceSerif",
// fontSize: 12,
// )),
// const SizedBox(height: 20),
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// SizedBox(
// height: 45,
// child: FloatingActionButton.extended(
// elevation: 1,
// // backgroundColor: Color.fromARGB(255, 166, 217, 250),
// backgroundColor: Colors.grey,
// onPressed: () {
// setState(() {
// isExtended = !isExtended;
// });
// },
// label: AnimatedSwitcher(
// duration: Duration(seconds: 1),
// transitionBuilder: (Widget child,
// Animation<double> animation) =>
// FadeTransition(
// opacity: animation,
// child: SizeTransition(
// child: child,
// sizeFactor: animation,
// axis: Axis.horizontal,
// ),
// ),
// child: isExtended
// ? Row(
// children: [
// Padding(
// padding: const EdgeInsets.only(
// right: 4.0),
// child: Icon(Icons.check),
// ),
// Text("Added to Contacts")
// ],
// )
// : Row(
// children: [
// Padding(
// padding: const EdgeInsets.only(
// right: 4.0),
// child: Icon(Icons.add,
// color: Colors.white),
// ),
// Text(
// "Add to Contacts",
// style:
// TextStyle(color: Colors.white),
// )
// ],
// ))),
// ),
// const SizedBox(width: 16.0),
// FloatingActionButton.extended(
// onPressed: () {},
// heroTag: 'mesage',
// elevation: 0,
// backgroundColor: Colors.red,
// label: const Text("Message"),
// icon: const Icon(Icons.message_rounded),
// ),
// ],
// ),
// const SizedBox(height: 15),
// const SizedBox(height: 5),
// ],
// ),
// ),
SizedBox(
height: 60,
),
// const Spacer(),
Center(
child: ValueListenableBuilder<List<int>>(
valueListenable: valueList,
builder: (context, value, child) => _ProfileInfoRow(items: [
ProfileInfoItem("Topic(s)", value[2]),
ProfileInfoItem("Session(s)", value[1]),
ProfileInfoItem("Note(s)", value[0]),
]),
)),
2024-09-06 06:30:31 +00:00
// SizedBox(
// height: 20,
// ),
],
),
);
}
2024-12-03 05:59:45 +00:00
Widget sessionNotes(BuildContext context, EventSpeakersData eventsdetail,
2024-09-06 06:30:31 +00:00
HcpProfileProvider provider) {
2024-12-03 05:59:45 +00:00
// sessionList = eventsdetail.sessionName!.split(',');
sessionList = widget.sessionNames;
2024-09-06 06:30:31 +00:00
return Container(
2024-12-19 05:21:33 +00:00
color: AppColors.bgcolor,
2024-09-06 06:30:31 +00:00
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
2024-09-06 06:30:31 +00:00
children: [
Container(
padding: const EdgeInsets.only(left: 15.0, top: 15, right: 15),
2024-09-06 06:30:31 +00:00
// decoration: BoxDecoration(
// border: Border.all(color: Colors.grey),
// borderRadius: BorderRadius.circular(8.0)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: const EdgeInsets.all(4.0),
// height: 40,
width: double.infinity,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(4.0)),
2024-12-03 05:59:45 +00:00
child:
dropDown(underline: Container(), provider: provider)),
2024-09-06 06:30:31 +00:00
SizedBox(
height: 15,
),
TextFormField(
controller: notesController,
maxLines: 3,
inputFormatters: [
LengthLimitingTextInputFormatter(1000),
],
2024-09-06 06:30:31 +00:00
validator: (value) {
// add email validation
if (value == null || value.isEmpty) {
return 'Please enter some text';
}
// bool emailValid = RegExp(
// r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
// .hasMatch(value);
// if (!emailValid) {
// return 'Please enter a valid email';
// }
return null;
},
decoration: const InputDecoration(
labelText: 'Notes *',
// hintText: 'Notes',
2024-09-06 06:30:31 +00:00
// prefixIcon: Icon(Icons.note),
border: OutlineInputBorder(),
focusedBorder: OutlineInputBorder(),
),
),
Text(
'Maximum Characters: 1000',
style: TextStyle(fontSize: 12),
),
2024-12-03 05:59:45 +00:00
SizedBox(
height: 10,
),
Row(
children: [
// Text("Attach a file :"),
// SizedBox(
// width: 10,
// ),
2024-12-16 11:26:32 +00:00
// SizedBox(
// width: 140,
// height: 30,
// child: OutlinedButton(
// onPressed: () {
// enableCancel = false;
// notesController.clear();
// sessionsTopicsData = null;
// _selectedFruit = "";
// btnText = "Add Notes";
// setState(() {});
// },
// style: ButtonStyle(
// shape: MaterialStateProperty.all(CircleBorder()),
// ),
// child: Icon(Icons.attach_file)),
// ),
2024-12-03 05:59:45 +00:00
CustomButton(
backgroundColor:
const Color.fromARGB(255, 233, 229, 229),
onPressed: () async {
// sectionItem.selectedValue = [];
// sectionItem.extension = [];
// sectionItem.fileName = [];
if (_selectedFruit != null) {
await getEncodedFile();
} else {
SnackBarWidget.displaySnackBar(
"Please select a session", context,
error: true);
}
2024-12-03 05:59:45 +00:00
setState(() {});
},
width: 120,
2024-12-16 11:26:32 +00:00
height: 35,
2024-12-03 05:59:45 +00:00
fontsize: 12,
textColor: Colors.black,
title: "Attach file"),
2024-12-03 05:59:45 +00:00
SizedBox(
width: 5,
),
Text(
attachedFileName != "" ? attachedFileName : "",
style: TextStyle(
color: attachedFileName != ""
? Colors.green
: Colors.red),
),
],
),
2024-09-06 06:30:31 +00:00
],
)),
2024-12-16 11:26:32 +00:00
const SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Align(
alignment: Alignment.center,
child: Stack(
children: [
Align(
alignment: Alignment.center,
child: SizedBox(
height: 40,
child:
// CustomButton(
2024-12-19 05:21:33 +00:00
// backgroundColor: AppColors.btnGreenColor,
2024-12-16 11:26:32 +00:00
// onPressed: () async {
// isLoading = true;
// if (notesController.text.isNotEmpty &&
// sessionsTopicsData != null) {
// print("ADD : ${_selectedFruit}");
// sessionNotesList.add(
// "${_selectedFruit} \n\n ${notesController.text}");
// // });
// print(
// " eventid:${widget.eventid},hcp:${widget.eventid} session: ${sessionsTopicsData}");
// await provider.submitSessionNotes(
// eventsdetail,
// sessionsTopicsData!,
// notesController.text,
// attachedFileName != ''
// ? attachedFilePath
// : "",
// attachedFileName != ''
// ? attachedFileName
// : "",
// );
// //HIVESTORE
// SessionNotesModel notesModel =
// SessionNotesModel(
// notes: notesController.text,
// addedBy: "user",
// addedDate:
// CustomDateFormatter().formatDate(),
// eventid:
// sessionsTopicsData!.kolEventsId,
// hcpid: widget.eventid,
// kolid: sessionsTopicsData!.kolId,
// event_attendees_id: sessionsTopicsData!
// .eventAttendeesId,
// kid: eventsdetail.kId,
// filepath: attachedFileName != ''
// ? attachedFilePath
// : "",
// filename: attachedFileName != ''
// ? attachedFileName
// : "",
// selectedSession: _selectedFruit);
// await provider.addSessionNotes(notesModel);
// _selectedFruit = null;
// isLoading = false;
// sessionsTopicsData = null;
// attachedFileName = "";
// notesController.clear();
// isLoading = false;
// enableCancel = false;
// btnText = "Add Notes";
// setState(() {});
// SnackBarWidget.displaySnackBar(
// "Notes added",
// context,
// );
// } else {
// isLoading = false;
// SnackBarWidget.displaySnackBar(
// "Session/Notes cannot be empty", context,
// error: true);
// }
// },
// width: 100,
// height: 35,
// fontsize: 12,
// textColor: Colors.white,
// title: btnText),
FloatingActionButton.extended(
// backgroundColor: const Color.fromARGB(255, 222, 237, 247),
backgroundColor: Colors.green,
onPressed: () async {
//"Program Committee Admin. & Management"
//setState(() {
isLoading = true;
if (notesController.text.isNotEmpty &&
sessionsTopicsData != null) {
print("ADD : ${_selectedFruit}");
sessionNotesList.add(
"${_selectedFruit} \n\n ${notesController.text}");
// });
print(
" eventid:${widget.eventid},hcp:${widget.eventid} session: ${sessionsTopicsData}");
await provider.submitSessionNotes(
eventsdetail,
sessionsTopicsData!,
notesController.text,
attachedFileName != '' ? attachedFilePath : "",
attachedFileName != '' ? attachedFileName : "",
);
//HIVESTORE
SessionNotesModel notesModel = SessionNotesModel(
notes: notesController.text,
addedBy: "user",
addedDate: CustomDateFormatter().formatDate(),
eventid: sessionsTopicsData!.kolEventsId,
hcpid: widget.eventid,
kolid: sessionsTopicsData!.kolId,
event_attendees_id:
sessionsTopicsData!.eventAttendeesId,
kid: eventsdetail.kId,
filepath: attachedFileName != ''
? attachedFilePath
: "",
filename: attachedFileName != ''
? attachedFileName
: "",
selectedSession: _selectedFruit);
await provider.addSessionNotes(notesModel);
_selectedFruit = null;
isLoading = false;
sessionsTopicsData = null;
attachedFileName = "";
notesController.clear();
isLoading = false;
enableCancel = false;
btnText = "Add Notes";
setState(() {});
SnackBarWidget.displaySnackBar(
"Notes added",
context,
);
} else {
isLoading = false;
SnackBarWidget.displaySnackBar(
"Session/Notes cannot be empty", context,
error: true);
}
},
heroTag: 'addnotes',
elevation: 0,
label: Text(
btnText,
style: TextStyle(color: Colors.white),
),
// icon: const Icon(
// Icons.add,
// color: Colors.black,
// ),
),
),
),
2024-12-16 11:26:32 +00:00
Visibility(
visible: isLoading,
child: Center(
child: CircularProgressIndicator(
2024-12-19 05:21:33 +00:00
color: AppColors.blueColor,
2024-12-16 11:26:32 +00:00
)),
),
],
2024-09-06 06:30:31 +00:00
),
2024-12-16 11:26:32 +00:00
),
Padding(
padding: const EdgeInsets.only(left: 15.0),
child: Visibility(
visible: enableCancel,
// child: Padding(
// padding: EdgeInsets.all(4.0),
// child: Text('Cancel',
// style: TextStyle(
2024-12-19 05:21:33 +00:00
// fontSize: 14, color: AppColors.blueColor)),
2024-12-16 11:26:32 +00:00
// ),
child: OutlinedButton(
onPressed: () {
enableCancel = false;
notesController.clear();
sessionsTopicsData = null;
_selectedFruit = "";
btnText = "Add Notes";
setState(() {});
},
style: ButtonStyle(
shape: MaterialStateProperty.all(RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0))),
),
child: const Text(
"Cancel",
style: TextStyle(color: Colors.black),
),
),
// child: CustomButton(
// backgroundColor: Colors.transparent,
// onPressed: () async {
// enableCancel = false;
// notesController.clear();
// sessionsTopicsData = null;
// _selectedFruit = "";
// btnText = "Add Notes";
// setState(() {});
// },
// width: 100,
// height: 40,
// fontsize: 12,
// textColor: Colors.black,
// title: "Cancel"),
// child: TextButton(
// style: TextButton.styleFrom(
// textStyle: Theme.of(context).textTheme.labelLarge,
// ),
// child: const Text('Cancel',
// style: TextStyle(
2024-12-19 05:21:33 +00:00
// fontSize: 14, color: AppColors.blueColor)),
2024-12-16 11:26:32 +00:00
// onPressed: () {
// enableCancel = false;
// notesController.clear();
// sessionsTopicsData = null;
// _selectedFruit = "";
// btnText = "Add Notes";
// setState(() {});
// },
// ),
),
2024-12-16 11:26:32 +00:00
),
],
),
Divider(),
Padding(
padding: const EdgeInsets.only(left: 15.0),
child: Text(
"My Notes",
style: TextStyle(fontSize: 16),
2024-09-06 06:30:31 +00:00
),
),
Divider(),
Expanded(
//height: 200,
child: ListView.separated(
padding: EdgeInsets.all(2.0),
itemCount: provider.sessionTopics
.where((element) => element.canEditNotes == true)
2024-09-06 06:30:31 +00:00
.length,
itemBuilder: (context, index) {
return SizedBox(
width: isTablet
? MediaQuery.of(context).size.width * 0.25
: MediaQuery.of(context).size.width * 0.5,
child: ListTile(
title: Text(
"\"${provider.sessionTopics[index].note}\"",
2024-09-06 06:30:31 +00:00
// maxLines: 3,
style: TextStyle(
// decoration: TextDecoration.underline,
// decorationColor: Colors.blue,
//fontFamily: "SourceSerif",
color: Colors.black,
fontStyle: FontStyle.italic,
fontSize: 15),
),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
height: 10,
),
Text(
"Session: ${provider.sessionTopics[index].sessionName}",
2024-09-06 06:30:31 +00:00
// maxLines: 3,
style: TextStyle(
// decoration: TextDecoration.underline,
// decorationColor: Colors.blue,
//fontFamily: "SourceSerif",
color: const Color.fromARGB(255, 66, 65, 65),
//fontStyle: FontStyle.italic,
fontSize: 14),
),
CustomButton(
backgroundColor:
const Color.fromARGB(255, 233, 229, 229),
onPressed: () {
sessionsTopicsData =
provider.sessionTopics[index];
_selectedFruit =
provider.sessionTopics[index].sessionName;
notesController.text =
provider.sessionTopics[index].note ?? "";
if (notesController.text.length != 0) {
btnText = "Update";
}
2024-12-16 11:26:32 +00:00
enableCancel = true;
setState(() {});
},
width: 80,
height: 30,
fontsize: 12,
textColor: Colors.black,
title: "Edit"),
2024-09-06 06:30:31 +00:00
SizedBox(
height: 5,
),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Text(
// "Added By:me",
// // maxLines: 3,
// style: TextStyle(
// // decoration: TextDecoration.underline,
// // decorationColor: Colors.blue,
// //fontFamily: "SourceSerif",
// color: const Color.fromARGB(255, 66, 65, 65),
// //fontStyle: FontStyle.italic,
// fontSize: 12),
// ),
// Text(
// "On: ${provider.sessionNotesList[index].addedDate}",
// // maxLines: 3,
// style: TextStyle(
// // decoration: TextDecoration.underline,
// // decorationColor: Colors.blue,
// //fontFamily: "SourceSerif",
// color: const Color.fromARGB(255, 66, 65, 65),
// //fontStyle: FontStyle.italic,
// fontSize: 12),
// ),
// ],
// ),
2024-09-06 06:30:31 +00:00
],
),
),
);
},
separatorBuilder: (context, index) {
return Divider();
},
),
)
],
),
);
}
2024-12-03 05:59:45 +00:00
Future<void> getEncodedFile() async {
String base64Image = '';
var status = Platform.isAndroid
? await Permission.manageExternalStorage.status
: await Permission.storage.status;
if (status.isGranted) {
FilePickerResult? result =
await FilePicker.platform.pickFiles(allowMultiple: false);
2024-12-03 05:59:45 +00:00
if (result != null) {
print(result.files.first.path);
print(result.files.last.path);
for (var files in result.files) {
File file = File(files.path!);
print("check file path : ${file.path}");
var fileName = file.path.split('/').last;
// Get the application folder directory
Directory? directory = Platform.isAndroid
? await getExternalStorageDirectory() //FOR ANDROID
: await getApplicationDocumentsDirectory();
String newPath = ""; //FOR ios
String convertedDirectoryPath = (directory?.path).toString();
print("see the converted directory path $convertedDirectoryPath");
newPath = "$convertedDirectoryPath/konectar/files";
print("new path :$newPath");
directory = Directory(newPath);
if (!await directory.exists()) {
await directory.create(recursive: true);
}
File newFile = await file.copy('${directory.path}/$fileName');
print("new path is ${newFile.path}");
final extension = p.extension(newFile.path);
List<int> imageBytes = await newFile.readAsBytes();
Uint8List imageUint8List = Uint8List.fromList(imageBytes);
base64Image = base64Encode(imageUint8List);
attachedFileName = fileName;
attachedFilePath = newFile.path;
if (notesController.text == "") {
notesController.text = "This attachment is loaded by Vinod Hangal";
}
2024-12-03 05:59:45 +00:00
// sectionItem.selectedValue!.add(base64Image);
// sectionItem.extension!.add(extension);
// sectionItem.fileName!.add(fileName);
}
}
} else {
print("not permitted");
await requestPermission(Platform.isAndroid
? Permission.manageExternalStorage
: Permission.storage);
}
}
Future<void> requestPermission(Permission permission) async {
final status = await permission.request();
setState(() {
print(status);
// _permissionStatus = status;
// print(_permissionStatus);
});
}
Widget topicsTab(
EventSpeakersData eventsdetail, HcpProfileProvider provider) {
//print("${eventsdetail.sessionName!.join(",").length} @@@lengtg");
// List<String> sessions = eventsdetail.sessionName!.split(",");
2024-09-06 06:30:31 +00:00
return Container(
width: double.maxFinite,
padding: EdgeInsets.only(left: 8),
decoration: BoxDecoration(
// color: Color.fromARGB(179, 248, 238, 238),
2024-12-19 05:21:33 +00:00
color: AppColors.bgcolor,
2024-09-06 06:30:31 +00:00
),
child: ListView.separated(
padding: EdgeInsets.only(top: 10.0, left: 4.0),
2024-12-03 05:59:45 +00:00
itemCount: provider.sessionTopics.length,
2024-09-06 06:30:31 +00:00
itemBuilder: (context, index) {
2024-12-03 05:59:45 +00:00
List<String> topics =
provider.sessionTopics[index].eventTopics!.split('|');
2024-09-06 06:30:31 +00:00
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Text(
// "",
// style: TextStyle(
// //fontFamily: "SourceSerif",
// fontSize: 16,
// fontWeight: FontWeight.bold,
// ),
// //softWrap: true,
// overflow: TextOverflow.ellipsis,
// ),
Text(
2024-12-03 05:59:45 +00:00
"${index + 1}.${provider.sessionTopics[index].sessionName}",
2024-09-06 06:30:31 +00:00
style: TextStyle(
// fontFamily: "SourceSerif",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
maxLines: 3,
//softWrap: true,
),
SizedBox(
height: 10,
),
SizedBox(
width: isTablet
? MediaQuery.of(context).size.width * 0.25
: MediaQuery.of(context).size.width * 0.5,
child: Text(
"Topics",
style: TextStyle(
// decoration: TextDecoration.underline,
// decorationColor: Colors.blue,
fontSize: 14,
// fontWeight: FontWeight.bold,
color: Colors.grey[900],
//fontStyle: FontStyle.italic,
),
),
),
buildTopicsCard(topics),
// SizedBox(
// width: isTablet
// ? MediaQuery.of(context).size.width * 0.25
// : MediaQuery.of(context).size.width * 0.5,
// child: Text(
// "${topics.join(" \n ")}",
// // maxLines: 3,
// style: TextStyle(
// // decoration: TextDecoration.underline,
// // decorationColor: Colors.blue,
// //fontFamily: "SourceSerif",
// color: Colors.grey[700],
// //fontStyle: FontStyle.italic,
// fontSize: 16),
// ),
// ),
],
);
},
separatorBuilder: (context, index) {
return Divider();
},
));
}
Widget buildTopicsCard(List<String> tags) {
return Container(
child: Padding(
padding: const EdgeInsets.only(
top: 8,
bottom: 8,
),
child: Wrap(
runSpacing: 12.0,
spacing: 12.0,
children: tags.map((String tag) {
return Container(
constraints: BoxConstraints(
// minWidth: MediaQuery.of(context).size.width * 0.34,
maxWidth: MediaQuery.of(context).size.width),
decoration: BoxDecoration(
2024-12-19 05:21:33 +00:00
color: AppColors.bgtopic,
2024-09-06 06:30:31 +00:00
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
// color: Colors.grey
),
margin: const EdgeInsets.symmetric(horizontal: 3.0),
padding:
const EdgeInsets.symmetric(horizontal: 1.6, vertical: 5.0),
child: Text(
'$tag',
// overflow: TextOverflow.ellipsis,
//textWidthBasis: TextWidthBasis.longestLine,
// softWrap: false,
maxLines: 2,
style: TextStyle(
overflow: TextOverflow.clip,
2024-12-19 05:21:33 +00:00
color: AppColors.fonttopic,
2024-09-06 06:30:31 +00:00
fontSize: isTablet ? 16 : 14),
),
);
}).toList()),
),
);
}
Widget medicalInsights() {
2024-11-19 12:57:30 +00:00
return Consumer<ViewInteractionProvider>(
builder: (BuildContext context, provider, Widget? child) {
return Container(
2024-12-19 05:21:33 +00:00
color: AppColors.bgcolor,
2024-11-19 12:57:30 +00:00
child: Column(
children: [
SizedBox(
height: 20,
),
Center(
child: FloatingActionButton.extended(
backgroundColor: Colors.green,
onPressed: () async {
final ConfigDataProvider configDataProvider =
ConfigDataProvider();
await configDataProvider.initConfigUIDataMediccalInsight();
await Provider.of<InteractionProvider>(context, listen: false)
.initConfigData();
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => InteractionScreen1(
index: 0,
form: Provider.of<InteractionProvider>(context,
listen: false)
.intConfigDataList[0]
.name,
2024-12-03 05:59:45 +00:00
title: "${widget.kolFullName}",
2024-11-19 12:57:30 +00:00
)));
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => const InteractionListScreen()));
},
heroTag: 'medicalinsights',
elevation: 0,
label: const Text("Add Medical Insights",
style: TextStyle(
color: Colors.white,
)),
icon: const Icon(
Icons.add,
color: Colors.white,
),
),
),
SizedBox(
height: 20,
),
provider.savedList.isEmpty
? SizedBox.shrink()
: ListView.builder(
itemCount: provider.savedList.length,
shrinkWrap: true,
cacheExtent:
double.parse(provider.savedList.length.toString()),
itemBuilder: (context, index) {
return Column(
children: [
ListTile(
subtitle: Text(
'Updated on ${CustomDateFormatter().convertDateTimeToDate(provider.savedList[index].updatedTime!)}',
//style: TextStyle(fontStyle: FontStyle.italic),
),
title: Text(
provider.savedList[index].id,
),
trailing: SizedBox(
width: 100,
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) =>
// EditInteractionScreen(
// saveInteraction: provider
// .savedList[index],
// )))
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(),
],
);
}),
],
2024-09-06 06:30:31 +00:00
),
2024-11-19 12:57:30 +00:00
);
});
2024-09-06 06:30:31 +00:00
}
}
const _tabs = [
Tab(text: "Sessions"),
Tab(text: "Notes"),
Tab(text: "Medical Insights"),
// Tab(text: "Survey"),
];
class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
_SliverAppBarDelegate(this._tabBar);
final TabBar _tabBar;
@override
double get minExtent => _tabBar.preferredSize.height;
@override
double get maxExtent => _tabBar.preferredSize.height;
@override
Widget build(
BuildContext context, double shrinkOffset, bool overlapsContent) {
return Container(
2024-12-16 11:26:32 +00:00
color: Colors.white,
// decoration: BoxDecoration(
// gradient: LinearGradient(
// begin: Alignment.bottomCenter,
// end: Alignment.topCenter,
// colors: [
// // Constants.blueColor,
2024-12-19 05:21:33 +00:00
// AppColors.tabbgColor,
// AppColors.blueColor,
2024-12-16 11:26:32 +00:00
// // Constants.tabbgColor,
// // const Color.fromARGB(255, 222, 237, 247),
// // const Color.fromARGB(255, 222, 237, 247),
// // Color(0xff006df1)
// ]),
// ),
2024-09-06 06:30:31 +00:00
// color: Colors.white,
//249, 103, 49
// color: const Color.fromARGB(255, 239, 71, 49),
child: _tabBar);
}
@override
bool shouldRebuild(_SliverAppBarDelegate oldDelegate) {
return true;
}
}
class _ProfileInfoRow extends StatelessWidget {
List<ProfileInfoItem> items;
_ProfileInfoRow({Key? key, required this.items}) : super(key: key);
bool shouldRebuild(_ProfileInfoRow delegate) {
return true;
}
2024-09-06 06:30:31 +00:00
@override
Widget build(BuildContext context) {
return Container(
height: 60,
constraints: const BoxConstraints(maxWidth: 400),
child: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: items
.map((item) => Expanded(
child: Row(
children: [
if (items.indexOf(item) != 0) const VerticalDivider(),
Expanded(child: _singleItem(context, item)),
],
)))
.toList(),
),
),
);
}
Widget _singleItem(BuildContext context, ProfileInfoItem item) => Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
item.value.toString(),
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
),
),
),
Text(
item.title,
style: Theme.of(context).textTheme.bodyLarge,
)
],
);
}
class ProfileInfoItem {
final String title;
final int value;
const ProfileInfoItem(
this.title,
this.value,
);
}
class _TopPortion extends StatelessWidget {
final String title;
final Eventsdetail eventsdetail;
const _TopPortion({Key? key, required this.title, required this.eventsdetail})
: super(key: key);
@override
Widget build(BuildContext context) {
return Stack(
//fit: StackFit.expand,
// alignment: Alignment.center,
children: [
Align(
alignment: Alignment.topCenter,
child: Container(
margin: const EdgeInsets.only(bottom: 30),
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [
2024-12-19 05:21:33 +00:00
AppColors.blueColor,
AppColors.blueColor,
AppColors.blueColor,
2024-09-06 06:30:31 +00:00
// const Color.fromARGB(255, 222, 237, 247),
// const Color.fromARGB(255, 222, 237, 247),
// Color(0xff006df1)
]),
// borderRadius: BorderRadius.only(
// bottomLeft: Radius.circular(20),
// bottomRight: Radius.circular(20),
// )
),
child: Align(
alignment: Alignment.topCenter,
child: Column(
children: [
SizedBox(
height: 15,
),
Text(eventsdetail.kolFullName!,
style: TextStyle(
fontSize: 20,
// fontFamily: "SourceSerif",
color: Colors.white,
fontWeight: FontWeight.bold)),
Text("Hematology/Oncology",
style: TextStyle(
color: Colors.white,
// fontFamily: "SourceSerif",
)),
Text(
"${eventsdetail.orgName ?? ""} ${eventsdetail.country ?? ""} ${eventsdetail.city ?? ""}",
softWrap: true,
maxLines: 2,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
// fontFamily: "SourceSerif",
fontSize: 12,
)),
],
),
),
),
),
Positioned(
bottom: -30,
child: CircleAvatar(
radius: 20,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
child: Container(
margin: const EdgeInsets.all(8.0),
decoration: const BoxDecoration(
color: Colors.green, shape: BoxShape.circle),
),
),
),
// Align(
// alignment: Alignment.bottomCenter,
// child: SizedBox(
// width: 120,
// height: 120,
// child: Stack(
// fit: StackFit.expand,
// children: [
// BorderedCircleAvatar(
// // radius: 24,
// backgroundColor: Colors.grey,
// border: BorderSide(color: Colors.white),
// // child: Icon(
// // Icons.person,
// // size: 18,
// // color: Colors.white,
// // ),
// child: Text(
// title[0],
// style: TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: 34,
// color: Colors.white),
// ),
// ),
// Container(
// decoration: const BoxDecoration(
// color: Colors.black,
// shape: BoxShape.circle,
// image: DecorationImage(
// fit: BoxFit.cover,
// image: NetworkImage(
// 'https://cardio-staging.konectar.io/images/kol_images/resized/1093755944.jpeg')),
// // 'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80')),
// ),
// ),
// Positioned(
// bottom: 0,
// right: 0,
// child: CircleAvatar(
// radius: 20,
// backgroundColor: Theme.of(context).scaffoldBackgroundColor,
// child: Container(
// margin: const EdgeInsets.all(8.0),
// decoration: const BoxDecoration(
// color: Colors.green, shape: BoxShape.circle),
// ),
// ),
// ),
// ],
// ),
//),
// )
],
);
}
}