diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 91422ad..6483a6d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,4 +1,6 @@ + + createState() => _ContactsState(); +// } + +// class _ContactsState extends State { +// // final _contactbox = Hive.box('mycontact'); +// static final _contactbox = Hive.box("mycontact"); + +// bool _switchValue = false; + +// bool isOnline2 = false; + +// // List alldata = _contactbox.values.toList(); +// @override +// void initState() { +// // TODO: implement initState +// super.initState(); +// setupConnectivityListener(); + +// getcall(); +// } + +// NetworkConnectivity networkConnectivity = NetworkConnectivity(); + +// Future setupConnectivityListener() async { +// while (true) { +// bool isOnline = await networkConnectivity.isInternetAvailable(); +// print('Internetcontact available: $isOnline'); +// // Perform actions based on connectivity status +// await Future.delayed(Duration(seconds: 10)); + +// setState(() { +// isOnline2 = isOnline; +// }); // Example: Check every 10 seconds +// } +// } + +// void getcall() async { +// await Provider.of(context, listen: false).getHCPProvider(); +// } + +// @override +// Widget build(BuildContext context) { +// SystemChrome.setSystemUIOverlayStyle( +// SystemUiOverlayStyle(statusBarColor: Color.fromARGB(255, 0, 71, 132))); +// print( +// "newdata_is: ${_contactbox.values.toList()},${_contactbox.values.toList().length}"); + +// print( +// "Data_newww: ${HiveFunctions.getAllUsers()} ,${HiveFunctions.getAllUsers().length} "); + +// return SafeArea( +// child: Scaffold( +// // appBar: AppBar( +// // title: const Text('Contacts'), +// // ), +// body: Consumer(builder: (context, value, child) { +// print("todoss: ${value},${value.list.length}"); +// return Column( +// children: [ +// Row( +// mainAxisAlignment: MainAxisAlignment +// .center, // Align children to start and end of the row + +// children: [ +// Expanded( +// child: Padding( +// padding: const EdgeInsets.only(left: 45.0), +// child: Text( +// _switchValue ? "My Contacts" : "All Contacts", +// textAlign: TextAlign.center, +// style: TextStyle( +// fontSize: 20.0, +// fontWeight: FontWeight.w500, +// fontStyle: FontStyle.normal, +// color: +// _switchValue ? Colors.black : Colors.black), +// ), +// ), +// ), +// // Expanded( +// Row( +// // Adjust alignment as needed +// mainAxisSize: MainAxisSize.min, +// children: [ +// _switchValue +// ? const Text( +// 'All', +// style: TextStyle( +// fontSize: 12, +// decoration: TextDecoration.lineThrough, +// decorationThickness: 0.85, +// ), +// // TODO: implement dispose +// ) +// : const Text('All', +// style: TextStyle( +// fontSize: 12, +// )), +// CupertinoSwitch( +// activeColor: Color.fromARGB(255, 0, 71, 132), +// value: _switchValue, +// onChanged: (value) { +// setState(() { +// print("Switch_value_is : $value"); +// _switchValue = value; +// }); +// }, +// ), +// Padding( +// padding: const EdgeInsets.only(right: 8.0), +// child: !_switchValue +// ? const Text( +// 'My', +// style: TextStyle( +// fontSize: 12, +// decoration: TextDecoration.lineThrough, +// decorationThickness: 0.85, +// ), +// ) +// : const Text('My', +// style: TextStyle( +// fontSize: 12, +// )), +// ) +// ], +// ), +// // ), +// ]), +// isOnline2 +// ? Expanded( +// child: ListView.builder( +// itemCount: value.list.length, +// itemBuilder: (BuildContext context, int index) { +// // var data = HiveFunctions.getAllUsers()[index]; +// var data = value.list[index]; + +// print("dataaaa_isss:$data"); + +// return Column( +// children: [ +// ListTile( +// onTap: () { +// Navigator.push( +// context, +// MaterialPageRoute( +// builder: (context) => Profile( +// text: data, +// ))); +// }, +// // title: Text(_contactbox.values.toString()), +// leading: ProfilePicture( +// name: data["name"], +// radius: 20, +// fontsize: 12, +// ), +// title: Text( +// data["name"], +// style: const TextStyle( +// fontSize: 18.0, +// fontWeight: FontWeight.bold), +// ), +// subtitle: const Text( +// "Added by Pooja.K", +// style: TextStyle( +// fontSize: 14.0, +// fontWeight: FontWeight.normal), +// ), +// ), +// ], +// ); +// }, +// ), +// ) +// : Expanded( +// child: ListView.builder( +// itemCount: HiveFunctions.getAllUsers().length, +// itemBuilder: (BuildContext context, int index) { +// var data = HiveFunctions.getAllUsers()[index]; + +// print("dataaaa_isss:$data"); + +// return Column( +// children: [ +// ListTile( +// onTap: () { +// Navigator.push( +// context, +// MaterialPageRoute( +// builder: (context) => Profile( +// text: data, +// ))); +// }, +// // title: Text(_contactbox.values.toString()), +// leading: ProfilePicture( +// name: data["name"], +// radius: 20, +// fontsize: 12, +// ), +// title: Text( +// data["name"], +// style: const TextStyle( +// fontSize: 18.0, +// fontWeight: FontWeight.bold), +// ), +// subtitle: const Text( +// "Added by Pooja.K", +// style: TextStyle( +// fontSize: 14.0, +// fontWeight: FontWeight.normal), +// ), +// ), +// ], +// ); +// }, +// ), +// ), + +// /////////////////////////////////////////////// +// // Expanded( +// // child: ListView.builder( +// // itemCount: HiveFunctions.getAllUsers().length, +// // itemBuilder: (BuildContext context, int index) { +// // var data = HiveFunctions.getAllUsers()[index]; + +// // print("dataaaa_isss:$data"); + +// // return Column( +// // children: [ +// // ListTile( +// // onTap: () { +// // Navigator.push( +// // context, +// // MaterialPageRoute( +// // builder: (context) => Profile( +// // text: data, +// // ))); +// // }, +// // // title: Text(_contactbox.values.toString()), +// // leading: ProfilePicture( +// // name: data["name"], +// // radius: 20, +// // fontsize: 12, +// // ), +// // title: Text( +// // data["name"], +// // style: const TextStyle( +// // fontSize: 18.0, fontWeight: FontWeight.bold), +// // ), +// // subtitle: const Text( +// // "Added by Pooja.K", +// // style: TextStyle( +// // fontSize: 14.0, fontWeight: FontWeight.normal), +// // ), +// // ), +// // ], +// // ); +// // }, +// // ), +// // ), +// ], +// ); +// }), +// ), +// ); +// } +// } + import 'package:discover_module/provider_class/hcp%20_provider.dart'; -import 'package:discover_module/ui_screen/profile.dart'; -import 'package:discover_module/ui_screen/ranking.dart'; +import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter/widgets.dart'; import 'package:flutter_profile_picture/flutter_profile_picture.dart'; import 'package:hive_flutter/hive_flutter.dart'; import 'package:provider/provider.dart'; +import 'package:flutter/services.dart'; +import 'package:discover_module/ui_screen/profile.dart'; class Contacts extends StatefulWidget { - const Contacts({super.key}); + const Contacts({Key? key}) : super(key: key); @override State createState() => _ContactsState(); } class _ContactsState extends State { - // final _contactbox = Hive.box('mycontact'); - static final _contactbox = Hive.box("mycontact"); - + final _contactBox = Hive.box("mycontact"); bool _switchValue = false; + bool isOnline2 = true; - // List alldata = _contactbox.values.toList(); @override void initState() { - // TODO: implement initState super.initState(); - getcall(); + setupConnectivityListener(); + getCall(); } - void getcall() async { + Future setupConnectivityListener() async { + while (true) { + bool isOnline = await NetworkConnectivity().isInternetAvailable(); + print('Internet contact available: $isOnline'); + await Future.delayed(Duration(seconds: 2)); + if (mounted) { + setState(() { + isOnline2 = isOnline; + }); + } + } + } + + // @override + // void dispose() { + // // TODO: implement dispose + // } + void getCall() async { await Provider.of(context, listen: false).getHCPProvider(); } @@ -39,25 +337,15 @@ class _ContactsState extends State { Widget build(BuildContext context) { SystemChrome.setSystemUIOverlayStyle( SystemUiOverlayStyle(statusBarColor: Color.fromARGB(255, 0, 71, 132))); - print( - "newdata_is: ${_contactbox.values.toList()},${_contactbox.values.toList().length}"); - - print( - "Data_newww: ${HiveFunctions.getAllUsers()} ,${HiveFunctions.getAllUsers().length} "); return SafeArea( child: Scaffold( - // appBar: AppBar( - // title: const Text('Contacts'), - // ), - body: Consumer(builder: (context, value, child) { - print("todoss: ${value},${value.list.length}"); - return Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment - .center, // Align children to start and end of the row - + body: Consumer( + builder: (context, value, child) { + return Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( child: Padding( @@ -66,17 +354,13 @@ class _ContactsState extends State { _switchValue ? "My Contacts" : "All Contacts", textAlign: TextAlign.center, style: TextStyle( - fontSize: 20.0, - fontWeight: FontWeight.w500, - fontStyle: FontStyle.normal, - color: - _switchValue ? Colors.black : Colors.black), + fontSize: 20.0, + fontWeight: FontWeight.w500, + ), ), ), ), - // Expanded( Row( - // Adjust alignment as needed mainAxisSize: MainAxisSize.min, children: [ _switchValue @@ -87,18 +371,18 @@ class _ContactsState extends State { decoration: TextDecoration.lineThrough, decorationThickness: 0.85, ), - // TODO: implement dispose ) - : const Text('All', + : const Text( + 'All', style: TextStyle( fontSize: 12, - )), + ), + ), CupertinoSwitch( activeColor: Color.fromARGB(255, 0, 71, 132), value: _switchValue, onChanged: (value) { setState(() { - print("Switch_value_is : $value"); _switchValue = value; }); }, @@ -114,104 +398,101 @@ class _ContactsState extends State { decorationThickness: 0.85, ), ) - : const Text('My', + : const Text( + 'My', style: TextStyle( fontSize: 12, - )), + ), + ), ) ], ), - // ), - ]), - - Expanded( - child: ListView.builder( - itemCount: value.list.length, - itemBuilder: (BuildContext context, int index) { - // var data = HiveFunctions.getAllUsers()[index]; - var data = value.list[index]; - - print("dataaaa_isss:$data"); - - return Column( - children: [ - ListTile( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => Profile( - text: data, - ))); - }, - // title: Text(_contactbox.values.toString()), - leading: ProfilePicture( - name: data["name"], - radius: 20, - fontsize: 12, - ), - title: Text( - data["name"], - style: const TextStyle( - fontSize: 18.0, fontWeight: FontWeight.bold), - ), - subtitle: const Text( - "Added by Pooja.K", - style: TextStyle( - fontSize: 14.0, fontWeight: FontWeight.normal), - ), - ), - ], - ); - }, + ], ), - ), - - /////////////////////////////////////////////// - // Expanded( - // child: ListView.builder( - // itemCount: HiveFunctions.getAllUsers().length, - // itemBuilder: (BuildContext context, int index) { - // var data = HiveFunctions.getAllUsers()[index]; - - // print("dataaaa_isss:$data"); - - // return Column( - // children: [ - // ListTile( - // onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => Profile( - // text: data, - // ))); - // }, - // // title: Text(_contactbox.values.toString()), - // leading: ProfilePicture( - // name: data["name"], - // radius: 20, - // fontsize: 12, - // ), - // title: Text( - // data["name"], - // style: const TextStyle( - // fontSize: 18.0, fontWeight: FontWeight.bold), - // ), - // subtitle: const Text( - // "Added by Pooja.K", - // style: TextStyle( - // fontSize: 14.0, fontWeight: FontWeight.normal), - // ), - // ), - // ], - // ); - // }, - // ), - // ), - ], - ); - }), + isOnline2 + ? Expanded( + child: ListView.builder( + itemCount: value.list.length, + itemBuilder: (BuildContext context, int index) { + var data = value.list[index]; + return ListTile( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => Profile( + text: data, + ), + ), + ); + }, + leading: ProfilePicture( + name: data["name"], + radius: 20, + fontsize: 12, + ), + title: Text( + data["name"], + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + subtitle: Text( + "Added by Pooja.K", + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.normal, + ), + ), + ); + }, + ), + ) + : Expanded( + child: ListView.builder( + itemCount: _contactBox.values.length, + itemBuilder: (BuildContext context, int index) { + var data = _contactBox.get(index); + print(":data_is: $data"); + return ListTile( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => Profile( + text: data!, + ), + ), + ); + }, + leading: ProfilePicture( + name: data["name"], + radius: 20, + fontsize: 12, + ), + title: Text( + data["name"], + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + subtitle: Text( + "Added by Pooja.K", + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.normal, + ), + ), + ); + }, + ), + ), + ], + ); + }, + ), ), ); } diff --git a/lib/ui_screen/interactionform/NewtworkConnectivity.dart b/lib/ui_screen/interactionform/NewtworkConnectivity.dart index 33ed9e4..3c8177f 100644 --- a/lib/ui_screen/interactionform/NewtworkConnectivity.dart +++ b/lib/ui_screen/interactionform/NewtworkConnectivity.dart @@ -1,10 +1,27 @@ import 'dart:async'; +import 'dart:io'; import 'package:connectivity_plus/connectivity_plus.dart'; class NetworkConnectivity { + // Future isInternetAvailable() async { + // var connectivityResult = await (Connectivity().checkConnectivity()); + // return connectivityResult != ConnectivityResult.none; + // } Future isInternetAvailable() async { - var connectivityResult = await (Connectivity().checkConnectivity()); - return connectivityResult != ConnectivityResult.none; + var connectivityResult = await Connectivity().checkConnectivity(); + if (connectivityResult == ConnectivityResult.none) { + return false; + } else { + try { + final result = await InternetAddress.lookup('google.com'); + if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) { + return true; + } + return false; + } on SocketException catch (_) { + return false; + } + } } } diff --git a/lib/ui_screen/interactionform/edit_interaction_screen.dart b/lib/ui_screen/interactionform/edit_interaction_screen.dart index af9e61b..a7cf2b7 100644 --- a/lib/ui_screen/interactionform/edit_interaction_screen.dart +++ b/lib/ui_screen/interactionform/edit_interaction_screen.dart @@ -1246,7 +1246,7 @@ class _EditInteractionScreenState extends State { ), child: Wrap( children: [ - GestureDetector(child: Text("data")), + //GestureDetector(child: Text("data")), GridView.builder( physics: const NeverScrollableScrollPhysics(), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( diff --git a/lib/ui_screen/interactionform/interactionlistscreen.dart b/lib/ui_screen/interactionform/interactionlistscreen.dart index 0486bc3..25b7ac2 100644 --- a/lib/ui_screen/interactionform/interactionlistscreen.dart +++ b/lib/ui_screen/interactionform/interactionlistscreen.dart @@ -73,6 +73,7 @@ class _InteractionListScreenState extends State { cacheExtent: double.parse( provider.intConfigDataList.length.toString()), itemBuilder: (context, index) { + print("ism Screenindex $index"); return Column( children: [ ListTile( @@ -112,6 +113,8 @@ class _InteractionListScreenState extends State { -1 ? InkWell( onTap: () { + print("inwesm Screenindex $index"); + if (getCount( provider.intConfigDataList[index] .name, diff --git a/lib/ui_screen/listview.dart b/lib/ui_screen/listview.dart index d7ad86d..9397d1f 100644 --- a/lib/ui_screen/listview.dart +++ b/lib/ui_screen/listview.dart @@ -153,8 +153,8 @@ class _DataSource extends DataTableSource { selected: row.selected, onSelectChanged: (value) { // print("hii"); - Navigator.push( - context, MaterialPageRoute(builder: (context) => Profile())); + // Navigator.push( + // context, MaterialPageRoute(builder: (context) => Profile())); }, cells: [ DataCell(Text(row.valueA)), diff --git a/lib/ui_screen/profile.dart b/lib/ui_screen/profile.dart index 649665f..81a4b31 100644 --- a/lib/ui_screen/profile.dart +++ b/lib/ui_screen/profile.dart @@ -373,23 +373,1134 @@ // ); // } // } +//////////////////////////////////////////////////////////////////////////// +// import 'package:discover_module/custom_widget/text.dart'; +// import 'package:discover_module/hive_fun.dart'; +// import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart'; +// import 'package:discover_module/ui_screen/interactionform/configprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/interaction_screen.dart'; +// import 'package:discover_module/ui_screen/interactionform/interactionlistscreen.dart'; +// import 'package:discover_module/ui_screen/newformlist.dart'; +// import 'package:flutter/cupertino.dart'; +// import 'package:flutter/material.dart'; +// import 'package:flutter/rendering.dart'; +// import 'package:flutter/widgets.dart'; +// import 'package:flutter_profile_picture/flutter_profile_picture.dart'; +// class Profile extends StatefulWidget { +// const Profile({Key? key, required this.text}) : super(key: key); +// final Map text; + +// @override +// State createState() => _ProfileState(); +// } + +// class _ProfileState extends State { +// bool isonline = false; + +// @override +// void initState() { +// // TODO: implement initState +// super.initState(); +// print("pooja123"); + +// getuserdetails(); +// print("Widget_isssIndex_iss ${widget.text}"); +// print("Widget_isssIndex_iss ${widget.text!["id"]},${widget.text!["name"]}"); +// } + +// getuserdetails() async { +// // HiveFunctions.getindexUser(widget.text); + +// NetworkConnectivity networkConnectivity = NetworkConnectivity(); +// bool isonline1 = await networkConnectivity.isInternetAvailable(); + +// setState(() { +// print("Profile_isOnline: $isonline1"); +// isonline = isonline1; +// }); +// } + +// @override +// Widget build(BuildContext context) { +// return SafeArea( +// child: Scaffold( +// appBar: AppBar( +// title: const Text('Profile'), +// // actions: const [ +// // Padding( +// // padding: const EdgeInsets.all(8.0), +// // child: Text("View Similar"), +// // ), +// // Padding( +// // padding: const EdgeInsets.all(8.0), +// // child: Text("Request Profile"), +// // ) +// // ], +// ), +// body: ListView( +// children: [ +// Column( +// crossAxisAlignment: CrossAxisAlignment.center, +// mainAxisAlignment: MainAxisAlignment.center, +// mainAxisSize: MainAxisSize.min, +// children: [ +// Row( +// children: [ +// Padding( +// padding: EdgeInsets.all(10.0), +// child: ProfilePicture( +// name: widget.text!["name"], +// radius: 31, +// fontsize: 21, +// ), +// ), +// Column( +// mainAxisAlignment: MainAxisAlignment.start, +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// // Text( +// // "Gerosa, Gino", +// // style: TextStyle( +// // fontSize: 22.0, +// // color: Colors.black, +// // ), +// // ), +// Text1( +// title: widget.text!["name"], +// txtcolor: Colors.black, +// fontweight: FontWeight.bold, +// txtfont: 22.0), +// // Text( +// // "Cardiac Surgery", +// // style: TextStyle( +// // fontWeight: FontWeight.bold, fontSize: 14.0), +// // ), +// Text1( +// title: widget.text!["speciality"], +// txtcolor: Colors.black, +// fontweight: FontWeight.normal, +// txtfont: 18.0), + +// // Text( +// // widget.text!["speciality"], +// // textScaleFactor: 1.0, +// // textAlign: TextAlign.start, +// // style: TextStyle(), +// // ), + +// Row( +// children: [ +// isonline +// ? const Icon( +// Icons.circle_rounded, +// color: Colors.green, +// ) +// : const Icon( +// Icons.circle_rounded, +// color: Colors.red, +// ), +// const SizedBox( +// width: 5.0, +// ), +// Text(isonline ? "Online" : "Offline") +// ], +// ) +// ], +// ), +// ], +// ), +// Padding( +// padding: const EdgeInsets.symmetric( +// vertical: 30.0, horizontal: 14.0), +// child: Column( +// mainAxisAlignment: MainAxisAlignment.center, +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Row(children: [ +// const Icon( +// Icons.location_city_sharp, +// color: Color.fromARGB(255, 0, 71, 132), +// ), +// const SizedBox( +// width: 3.0, +// ), +// Expanded( +// // child: Text( +// // "Azienda Ospedaliera di Padova", +// // style: TextStyle( +// // fontWeight: FontWeight.bold, fontSize: 14.0), +// // ), +// child: Text1( +// title: widget.text!["addr"] ?? +// "Azienda Ospedaliera di Padova", +// txtcolor: Colors.black, +// txtfont: 14.0, +// fontweight: FontWeight.bold, +// )), +// ]), +// const SizedBox( +// height: 8.0, +// ), +// Row(children: [ +// const Icon( +// Icons.location_pin, +// color: Color.fromARGB(255, 0, 71, 132), +// ), +// const SizedBox( +// width: 3.0, +// ), +// Expanded( +// // child: Text( +// // "Via Giustiniani, 2, Padova, Veneto 35128, Italy", +// // style: TextStyle( +// // fontWeight: FontWeight.bold, fontSize: 14.0), +// // ), +// child: Text1( +// title: widget.text!["adrr"] ?? +// "Via Giustiniani, 2, Padova, Veneto 35128, Italy", +// txtcolor: Colors.black, +// fontweight: FontWeight.bold, +// txtfont: 14.0), +// ), +// ]), +// const SizedBox( +// height: 8.0, +// ), +// Row(children: [ +// const Icon( +// Icons.phone, +// color: Color.fromARGB(255, 0, 71, 132), +// ), +// const SizedBox( +// width: 3.0, +// ), +// // Text( +// // "+390498212410 X 12", +// // style: TextStyle( +// // fontWeight: FontWeight.bold, fontSize: 14.0), +// // ), +// Text1( +// title: widget.text!["phone_no"].toString(), +// txtcolor: Colors.black, +// fontweight: FontWeight.bold, +// txtfont: 14.0), +// ]), +// const SizedBox( +// height: 8.0, +// ), +// Row(children: [ +// const Icon( +// Icons.call, +// color: Color.fromARGB(255, 0, 71, 132), +// ), +// const SizedBox( +// width: 3.0, +// ), +// Text1( +// title: widget.text!["phone_no"].toString(), +// txtcolor: Colors.black, +// fontweight: FontWeight.bold, +// txtfont: 14.0), +// ]), +// const SizedBox( +// height: 8.0, +// ), +// Row(children: [ +// const Icon( +// Icons.email, +// color: Color.fromARGB(255, 0, 71, 132), +// ), +// const SizedBox( +// width: 3.0, +// ), +// Text1( +// title: widget.text!["email"], +// txtcolor: Colors.black, +// fontweight: FontWeight.bold, +// txtfont: 14.0), +// ]), +// const SizedBox( +// height: 18.0, +// ), +// Visibility( +// visible: isonline!, +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// // const Text( +// // "Profile Summarry", +// // style: TextStyle( +// // fontSize: 20.0, fontWeight: FontWeight.bold), +// // ), +// Text1( +// title: "Profile Summarry", +// txtcolor: Colors.black, +// fontweight: FontWeight.bold, +// txtfont: 20.0), +// SizedBox( +// height: 15.0, +// ), +// // Text( +// // widget.text!["summarry"], +// // textScaleFactor: 1.3, +// // style: TextStyle( +// // fontSize: 14.0, +// // fontWeight: FontWeight.normal), +// // ), +// Text1( +// title: widget.text!["summarry"], +// txtcolor: Colors.black, +// fontweight: FontWeight.bold, +// txtfont: 16.0), +// Padding( +// padding: EdgeInsets.all(0.0), +// //child: Card( +// // surfaceTintColor: Colors.white, + +// // clipBehavior: Clip.antiAlias, +// // color: Colors.white, +// // elevation: 5, // adds a shadow effect +// // shape: RoundedRectangleBorder( +// // borderRadius: BorderRadius.circular( +// // 15.0), // adds rounded corners +// // ), +// child: Padding( +// padding: const EdgeInsets.all(0), +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisSize: MainAxisSize.min, +// children: [ +// Card( +// surfaceTintColor: Colors.white, +// clipBehavior: Clip.antiAlias, +// color: Colors.white, +// elevation: 5, +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.circular( +// 15.0), // adds rounded corners +// ), +// child: Padding( +// padding: const EdgeInsets.all(18.0), +// child: Row( +// //mainAxisSize: MainAxisSize.min, +// children: [ +// Text1( +// title: "Affiliations", +// txtcolor: Color.fromARGB( +// 255, 0, 71, 137), +// fontweight: FontWeight.bold, +// txtfont: 20.0), +// const SizedBox( +// height: 15.0, +// ), +// Text1( +// title: widget +// .text!["affiliations_count"] +// .toString(), +// txtfont: 18.0, +// txtcolor: Color.fromARGB( +// 255, 0, 71, 137), +// ) +// ], +// ), +// ), +// ), +// const SizedBox( +// height: +// 10), // adds spacing between the text and image +// Card( +// surfaceTintColor: Colors.white, +// clipBehavior: Clip.antiAlias, +// color: Colors.white, +// elevation: 5, +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.circular( +// 15.0), // adds rounded corners +// ), +// child: Padding( +// padding: const EdgeInsets.all(18.0), +// child: Row( +// mainAxisAlignment: +// MainAxisAlignment.start, +// // mainAxisSize: MainAxisSize.min, +// children: [ +// Text1( +// title: "Events", +// txtcolor: Color.fromARGB( +// 255, 0, 71, 137), +// fontweight: FontWeight.bold, +// txtfont: 20.0), +// const SizedBox( +// height: 15.0, +// ), +// Text1( +// title: widget +// .text!["events_count"] +// .toString(), +// txtfont: 18.0, +// txtcolor: Color.fromARGB( +// 255, 0, 71, 137), +// ) +// ], +// ), +// ), +// ), +// const SizedBox( +// height: +// 10), // adds spacing between the image and button +// Card( +// surfaceTintColor: Colors.white, +// clipBehavior: Clip.antiAlias, +// color: Colors.white, +// elevation: 5, +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.circular( +// 15.0), // adds rounded corners +// ), +// child: Padding( +// padding: const EdgeInsets.all(18.0), +// child: Row( +// mainAxisAlignment: +// MainAxisAlignment.start, +// // mainAxisSize: MainAxisSize.min, +// children: [ +// Text1( +// title: "Publications", +// txtcolor: Color.fromARGB( +// 255, 0, 71, 137), +// fontweight: FontWeight.bold, +// txtfont: 20.0), +// const SizedBox( +// height: 15.0, +// ), +// Text1( +// title: widget +// .text!["publications_count"] +// .toString(), +// txtfont: 18.0, +// txtcolor: Color.fromARGB( +// 255, 0, 71, 137), +// ) +// ], +// ), +// ), +// ), +// SizedBox( +// height: 10.0, +// ), +// Card( +// surfaceTintColor: Colors.white, +// clipBehavior: Clip.antiAlias, +// color: Colors.white, +// elevation: 5, +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.circular( +// 15.0), // adds rounded corners +// ), +// child: Padding( +// padding: const EdgeInsets.all(18.0), +// child: Row( +// mainAxisAlignment: +// MainAxisAlignment.start, +// // mainAxisSize: MainAxisSize.min, +// children: [ +// Text1( +// title: "Trails", +// txtcolor: Color.fromARGB( +// 255, 0, 71, 137), +// fontweight: FontWeight.bold, +// txtfont: 20.0), +// const SizedBox( +// height: 15.0, +// ), +// Text1( +// title: widget +// .text!["publications_count"] +// .toString(), +// txtfont: 18.0, +// txtcolor: Color.fromARGB( +// 255, 0, 71, 137), +// ) +// ], +// ), +// ), +// ), + +// SizedBox( +// height: 10.0, +// ), +// Card( +// surfaceTintColor: Colors.white, +// clipBehavior: Clip.antiAlias, +// color: Colors.white, +// elevation: 5, +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.circular( +// 15.0), // adds rounded corners +// ), +// child: Padding( +// padding: const EdgeInsets.all(18.0), +// child: Row( +// mainAxisAlignment: +// MainAxisAlignment.start, +// //mainAxisSize: MainAxisSize.min, +// children: [ +// GestureDetector( +// onTap: () async { +// /// +// Navigator.push( +// context, +// MaterialPageRoute( +// builder: (BuildContext +// context) => +// InteractionScreen( +// index: 0, +// form: +// "form3 demo"))); +// }, +// child: Text1( +// title: "Interaction Form", +// txtcolor: Color.fromARGB( +// 255, 0, 71, 137), +// fontweight: FontWeight.bold, +// txtfont: 20.0), +// ), +// ], +// ), +// ), +// ), +// ], +// ), +// ), +// // ) +// //////////////////////////////////////////////// +// // child: Card( +// // surfaceTintColor: Colors.white, + +// // clipBehavior: Clip.antiAlias, +// // color: Colors.white, +// // elevation: 5, // adds a shadow effect +// // shape: RoundedRectangleBorder( +// // borderRadius: BorderRadius.circular( +// // 15.0), // adds rounded corners +// // ), +// // child: Padding( +// // padding: const EdgeInsets.all(50), +// // child: Column( +// // crossAxisAlignment: +// // CrossAxisAlignment.start, +// // mainAxisSize: MainAxisSize.min, +// // children: [ +// // Row( +// // mainAxisSize: MainAxisSize.min, +// // children: [ +// // Text1( +// // title: "Affiliations", +// // txtcolor: Color.fromARGB( +// // 255, 0, 71, 137), +// // fontweight: FontWeight.bold, +// // txtfont: 20.0), +// // const SizedBox( +// // height: 15.0, +// // ), +// // Text1( +// // title: widget +// // .text!["affiliations_count"] +// // .toString(), +// // txtfont: 18.0, +// // txtcolor: +// // Color.fromARGB(255, 0, 71, 137), +// // ) +// // ], +// // ), +// // const SizedBox( +// // height: +// // 10), // adds spacing between the text and image +// // Row( +// // mainAxisAlignment: +// // MainAxisAlignment.start, +// // mainAxisSize: MainAxisSize.min, +// // children: [ +// // Text1( +// // title: "Events", +// // txtcolor: Color.fromARGB( +// // 255, 0, 71, 137), +// // fontweight: FontWeight.bold, +// // txtfont: 20.0), +// // const SizedBox( +// // height: 15.0, +// // ), +// // Text1( +// // title: widget.text!["events_count"] +// // .toString(), +// // txtfont: 18.0, +// // txtcolor: +// // Color.fromARGB(255, 0, 71, 137), +// // ) +// // ], +// // ), +// // const SizedBox( +// // height: +// // 10), // adds spacing between the image and button +// // Row( +// // mainAxisAlignment: +// // MainAxisAlignment.start, +// // mainAxisSize: MainAxisSize.min, +// // children: [ +// // Text1( +// // title: "Publications", +// // txtcolor: Color.fromARGB( +// // 255, 0, 71, 137), +// // fontweight: FontWeight.bold, +// // txtfont: 20.0), +// // const SizedBox( +// // height: 15.0, +// // ), +// // Text1( +// // title: widget +// // .text!["publications_count"] +// // .toString(), +// // txtfont: 18.0, +// // txtcolor: +// // Color.fromARGB(255, 0, 71, 137), +// // ) +// // ], +// // ), +// // SizedBox( +// // height: 10.0, +// // ), +// // Row( +// // mainAxisAlignment: +// // MainAxisAlignment.start, +// // mainAxisSize: MainAxisSize.min, +// // children: [ +// // Text1( +// // title: "Trails", +// // txtcolor: Color.fromARGB( +// // 255, 0, 71, 137), +// // fontweight: FontWeight.bold, +// // txtfont: 20.0), +// // const SizedBox( +// // height: 15.0, +// // ), +// // Text1( +// // title: widget +// // .text!["publications_count"] +// // .toString(), +// // txtfont: 18.0, +// // txtcolor: +// // Color.fromARGB(255, 0, 71, 137), +// // ) +// // ], +// // ), + +// // SizedBox( +// // height: 10.0, +// // ), +// // Row( +// // mainAxisAlignment: +// // MainAxisAlignment.start, +// // mainAxisSize: MainAxisSize.min, +// // children: [ +// // GestureDetector( +// // onTap: () async { +// // print("I am Interaction"); +// // final ConfigDataProvider +// // configDataProvider = +// // ConfigDataProvider(); + +// // await configDataProvider +// // .initConfigUIData(); +// // // Navigator.push(context, MaterialPageRoute(builder: (context)))=> InteractionScreen(); +// // Navigator.push( +// // context, +// // MaterialPageRoute( +// // builder: (context) => +// // InteractionListScreen())); +// // }, +// // child: Text1( +// // title: "Interaction Form", +// // txtcolor: Color.fromARGB( +// // 255, 0, 71, 137), +// // fontweight: FontWeight.bold, +// // txtfont: 20.0), +// // ), +// // ], +// // ), +// // ], +// // ), +// // ), +// // ), + +// ////////////////////////////////////////////////////////////////// + +// // child: Card( +// // surfaceTintColor: Colors.white, +// // // margin: EdgeInsets.symmetric( +// // // horizontal: 15.0, vertical: 5.0), +// // clipBehavior: Clip.antiAlias, +// // color: Colors.red, +// // elevation: 5.0, +// // child: Column( +// // crossAxisAlignment: CrossAxisAlignment.start, +// // mainAxisAlignment: MainAxisAlignment.start, +// // children: [ +// // Row( +// // mainAxisAlignment: +// // MainAxisAlignment.center, +// // crossAxisAlignment: +// // CrossAxisAlignment.start, +// // children: [ +// // Text1( +// // title: "Affiliations", +// // txtcolor: +// // Color.fromARGB(255, 0, 71, 137), +// // fontweight: FontWeight.bold, +// // txtfont: 20.0), +// // const SizedBox( +// // height: 15.0, +// // ), +// // Text1( +// // title: widget +// // .text!["affiliations_count"] +// // .toString(), +// // txtfont: 18.0, +// // txtcolor: +// // Color.fromARGB(255, 0, 71, 137), +// // ) +// // ], +// // ), +// // SizedBox( +// // height: 10.0, +// // ), +// // Row( +// // mainAxisAlignment: +// // MainAxisAlignment.center, +// // crossAxisAlignment: +// // CrossAxisAlignment.start, +// // children: [ +// // Text1( +// // title: "Events", +// // txtcolor: +// // Color.fromARGB(255, 0, 71, 137), +// // fontweight: FontWeight.bold, +// // txtfont: 20.0), +// // const SizedBox( +// // height: 15.0, +// // ), +// // Text1( +// // title: widget.text!["events_count"] +// // .toString(), +// // txtfont: 18.0, +// // txtcolor: +// // Color.fromARGB(255, 0, 71, 137), +// // ) +// // ], +// // ), +// // SizedBox( +// // height: 10.0, +// // ), +// // Row( +// // mainAxisAlignment: +// // MainAxisAlignment.center, +// // children: [ +// // Text1( +// // title: "Publications", +// // txtcolor: +// // Color.fromARGB(255, 0, 71, 137), +// // fontweight: FontWeight.bold, +// // txtfont: 20.0), +// // const SizedBox( +// // height: 15.0, +// // ), +// // Text1( +// // title: widget +// // .text!["publications_count"] +// // .toString(), +// // txtfont: 18.0, +// // txtcolor: +// // Color.fromARGB(255, 0, 71, 137), +// // ) +// // ], +// // ), +// // SizedBox( +// // height: 10.0, +// // ), +// // Row( +// // mainAxisAlignment: +// // MainAxisAlignment.center, +// // children: [ +// // Text1( +// // title: "Trails", +// // txtcolor: +// // Color.fromARGB(255, 0, 71, 137), +// // fontweight: FontWeight.bold, +// // txtfont: 20.0), +// // const SizedBox( +// // height: 15.0, +// // ), +// // Text1( +// // title: widget +// // .text!["publications_count"] +// // .toString(), +// // txtfont: 18.0, +// // txtcolor: +// // Color.fromARGB(255, 0, 71, 137), +// // ) +// // ], +// // ), +// // ], +// // ), +// // ), +// ) +// ], +// ), +// ), +// ], +// ), +// ), + +// // Padding( +// // padding: EdgeInsets.only(bottom: 18.0), +// // child: Card( +// // margin: +// // EdgeInsets.symmetric(horizontal: 15.0, vertical: 5.0), +// // clipBehavior: Clip.antiAlias, +// // color: Colors.white, +// // elevation: 5.0, +// // child: Padding( +// // padding: +// // EdgeInsets.symmetric(horizontal: 1.0, vertical: 22.0), +// // child: Row( +// // children: [ +// // Expanded( +// // child: Column( +// // children: [ +// // // Text( +// // // "Affliations", +// // // style: TextStyle( +// // // color: Color.fromARGB(255, 0, 71, 137), +// // // fontSize: 13.0, +// // // fontWeight: FontWeight.bold, +// // // ), +// // // ), +// // Text1( +// // title: "Affliations", +// // txtcolor: Color.fromARGB(255, 0, 71, 137), +// // fontweight: FontWeight.bold, +// // txtfont: 13.0), +// // const SizedBox( +// // height: 5.0, +// // ), +// // // Text( +// // // "75", +// // // style: TextStyle( +// // // fontSize: 13.0, +// // // color: Color.fromARGB(255, 0, 71, 137), +// // // ), +// // // ) +// // Text1( +// // title: widget.text!["affiliations_count"] +// // .toString(), +// // txtfont: 13.0, +// // txtcolor: Color.fromARGB(255, 0, 71, 137), +// // ) +// // ], +// // ), +// // ), +// // Expanded( +// // child: Column( +// // children: [ +// // Text1( +// // title: "Events", +// // txtcolor: Color.fromARGB(255, 0, 71, 137), +// // fontweight: FontWeight.bold, +// // txtfont: 13.0), +// // const SizedBox( +// // height: 5.0, +// // ), +// // // Text( +// // // "0", +// // // style: TextStyle( +// // // fontSize: 13.0, +// // // color: Color.fromARGB(255, 0, 71, 137), +// // // ), +// // // ) +// // Text1( +// // title: +// // widget.text!["events_count"].toString(), +// // txtfont: 13.0, +// // txtcolor: Color.fromARGB(255, 0, 71, 137), +// // ) +// // ], +// // ), +// // ), +// // Expanded( +// // child: Column( +// // children: [ +// // // Text( +// // // "Publications", +// // // style: TextStyle( +// // // color: Color.fromARGB(255, 0, 71, 137), +// // // fontSize: 13.0, +// // // fontWeight: FontWeight.bold, +// // // ), +// // // ), +// // Text1( +// // title: "Publications", +// // txtcolor: Color.fromARGB(255, 0, 71, 137), +// // fontweight: FontWeight.bold, +// // txtfont: 13.0), +// // SizedBox( +// // height: 5.0, +// // ), +// // // Text( +// // // "251", +// // // style: TextStyle( +// // // fontSize: 13.0, +// // // color: Color.fromARGB(255, 0, 71, 137), +// // // ), +// // // ) +// // Text1( +// // title: widget.text!["publications_count"] +// // .toString(), +// // txtfont: 13.0, +// // txtcolor: Color.fromARGB(255, 0, 71, 137), +// // ) +// // ], +// // ), +// // ), +// // Expanded( +// // child: Column( +// // children: [ +// // // Text( +// // // "Trails", +// // // style: TextStyle( +// // // color: Color.fromARGB(255, 0, 71, 137), +// // // fontSize: 13.0, +// // // fontWeight: FontWeight.bold, +// // // ), +// // // ), +// // Text1( +// // title: "Trails", +// // txtcolor: Color.fromARGB(255, 0, 71, 137), +// // fontweight: FontWeight.bold, +// // txtfont: 13.0), +// // SizedBox( +// // height: 5.0, +// // ), +// // // Text( +// // // "1", +// // // style: TextStyle( +// // // fontSize: 13.0, +// // // color: Color.fromARGB(255, 0, 71, 137), +// // // ), +// // // ) +// // Text1( +// // title: "1", +// // txtfont: 13.0, +// // txtcolor: Color.fromARGB(255, 0, 71, 137), +// // ) +// // ], +// // ), +// // ), +// // ], +// // ), +// // ), +// // ), +// // ) + +// // // Padding( +// // padding: EdgeInsets.only(bottom: 18.0), +// // child: Card( +// // surfaceTintColor: Colors.white, +// // margin: +// // EdgeInsets.symmetric(horizontal: 15.0, vertical: 5.0), +// // clipBehavior: Clip.antiAlias, +// // color: Colors.white, +// // elevation: 5.0, +// // child: Padding( +// // padding: +// // EdgeInsets.symmetric(horizontal: 1.0, vertical: 22.0), +// // child: Row( +// // children: [ +// // Expanded( +// // child: Column( +// // children: [ +// // // Text( +// // // "Affliations", +// // // style: TextStyle( +// // // color: Color.fromARGB(255, 0, 71, 137), +// // // fontSize: 13.0, +// // // fontWeight: FontWeight.bold, +// // // ), +// // // ), +// // Text1( +// // title: "Affliations", +// // txtcolor: Color.fromARGB(255, 0, 71, 137), +// // fontweight: FontWeight.bold, +// // txtfont: 13.0), +// // const SizedBox( +// // height: 5.0, +// // ), +// // // Text( +// // // "75", +// // // style: TextStyle( +// // // fontSize: 13.0, +// // // color: Color.fromARGB(255, 0, 71, 137), +// // // ), +// // // ) +// // Text1( +// // title: widget.text!["affiliations_count"] +// // .toString(), +// // txtfont: 13.0, +// // txtcolor: Color.fromARGB(255, 0, 71, 137), +// // ) +// // ], +// // ), +// // ), +// // Expanded( +// // child: Column( +// // children: [ +// // Text1( +// // title: "Events", +// // txtcolor: Color.fromARGB(255, 0, 71, 137), +// // fontweight: FontWeight.bold, +// // txtfont: 13.0), +// // const SizedBox( +// // height: 5.0, +// // ), +// // // Text( +// // // "0", +// // // style: TextStyle( +// // // fontSize: 13.0, +// // // color: Color.fromARGB(255, 0, 71, 137), +// // // ), +// // // ) +// // Text1( +// // title: +// // widget.text!["events_count"].toString(), +// // txtfont: 13.0, +// // txtcolor: Color.fromARGB(255, 0, 71, 137), +// // ) +// // ], +// // ), +// // ), +// // Expanded( +// // child: Column( +// // children: [ +// // // Text( +// // // "Publications", +// // // style: TextStyle( +// // // color: Color.fromARGB(255, 0, 71, 137), +// // // fontSize: 13.0, +// // // fontWeight: FontWeight.bold, +// // // ), +// // // ), +// // Text1( +// // title: "Publications", +// // txtcolor: Color.fromARGB(255, 0, 71, 137), +// // fontweight: FontWeight.bold, +// // txtfont: 13.0), +// // SizedBox( +// // height: 5.0, +// // ), +// // // Text( +// // // "251", +// // // style: TextStyle( +// // // fontSize: 13.0, +// // // color: Color.fromARGB(255, 0, 71, 137), +// // // ), +// // // ) +// // Text1( +// // title: widget.text!["publications_count"] +// // .toString(), +// // txtfont: 13.0, +// // txtcolor: Color.fromARGB(255, 0, 71, 137), +// // ) +// // ], +// // ), +// // ), +// // Expanded( +// // child: Column( +// // children: [ +// // // Text( +// // // "Trails", +// // // style: TextStyle( +// // // color: Color.fromARGB(255, 0, 71, 137), +// // // fontSize: 13.0, +// // // fontWeight: FontWeight.bold, +// // // ), +// // // ), +// // Text1( +// // title: "Trails", +// // txtcolor: Color.fromARGB(255, 0, 71, 137), +// // fontweight: FontWeight.bold, +// // txtfont: 13.0), +// // SizedBox( +// // height: 5.0, +// // ), +// // // Text( +// // // "1", +// // // style: TextStyle( +// // // fontSize: 13.0, +// // // color: Color.fromARGB(255, 0, 71, 137), +// // // ), +// // // ) +// // Text1( +// // title: "1", +// // txtfont: 13.0, +// // txtcolor: Color.fromARGB(255, 0, 71, 137), +// // ) +// // ], +// // ), +// // ), +// // ], +// // ), +// // ), +// // ), +// // ) +// ], +// ), +// ], +// ), +// floatingActionButton: Visibility( +// visible: true, +// child: FloatingActionButton( +// onPressed: () { +// Navigator.push( +// context, MaterialPageRoute(builder: (context) => FormList())); +// }, +// foregroundColor: Colors.white, +// backgroundColor: const Color.fromARGB(255, 0, 71, 132), +// child: new Icon(Icons.add), +// ), +// ), +// ), +// ); +// } +// } +//////////////////////////////////////////////////////////////////////////////////////////// import 'package:discover_module/custom_widget/text.dart'; import 'package:discover_module/hive_fun.dart'; import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart'; import 'package:discover_module/ui_screen/interactionform/configprovider.dart'; import 'package:discover_module/ui_screen/interactionform/interaction_screen.dart'; import 'package:discover_module/ui_screen/interactionform/interactionlistscreen.dart'; +import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; +import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart'; import 'package:discover_module/ui_screen/newformlist.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_profile_picture/flutter_profile_picture.dart'; +import 'package:provider/provider.dart'; class Profile extends StatefulWidget { - const Profile({Key? key, this.text}) : super(key: key); - final Map? text; + const Profile({Key? key, required this.text}) : super(key: key); + final Map text; @override State createState() => _ProfileState(); @@ -623,858 +1734,424 @@ class _ProfileState extends State { const SizedBox( height: 18.0, ), - Visibility( - visible: isonline!, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // const Text( - // "Profile Summarry", - // style: TextStyle( - // fontSize: 20.0, fontWeight: FontWeight.bold), - // ), - Text1( - title: "Profile Summarry", - txtcolor: Colors.black, - fontweight: FontWeight.bold, - txtfont: 20.0), - SizedBox( - height: 15.0, - ), - // Text( - // widget.text!["summarry"], - // textScaleFactor: 1.3, - // style: TextStyle( - // fontSize: 14.0, - // fontWeight: FontWeight.normal), - // ), - Text1( - title: widget.text!["summarry"], - txtcolor: Colors.black, - fontweight: FontWeight.bold, - txtfont: 16.0), - Padding( - padding: EdgeInsets.all(0.0), - //child: Card( - // surfaceTintColor: Colors.white, + isonline + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // const Text( + // "Profile Summarry", + // style: TextStyle( + // fontSize: 20.0, fontWeight: FontWeight.bold), + // ), + Text1( + title: "Profile Summarry", + txtcolor: Colors.black, + fontweight: FontWeight.bold, + txtfont: 20.0), + SizedBox( + height: 15.0, + ), + // Text( + // widget.text!["summarry"], + // textScaleFactor: 1.3, + // style: TextStyle( + // fontSize: 14.0, + // fontWeight: FontWeight.normal), + // ), + Text1( + title: widget.text!["summarry"], + txtcolor: Colors.black, + fontweight: FontWeight.bold, + txtfont: 16.0), + Padding( + padding: EdgeInsets.all(0.0), + //child: Card( + // surfaceTintColor: Colors.white, - // clipBehavior: Clip.antiAlias, - // color: Colors.white, - // elevation: 5, // adds a shadow effect - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular( - // 15.0), // adds rounded corners - // ), - child: Padding( - padding: const EdgeInsets.all(0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Card( - surfaceTintColor: Colors.white, - clipBehavior: Clip.antiAlias, - color: Colors.white, - elevation: 5, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular( - 15.0), // adds rounded corners - ), - child: Padding( - padding: const EdgeInsets.all(18.0), - child: Row( - //mainAxisSize: MainAxisSize.min, - children: [ - Text1( - title: "Affiliations", - txtcolor: Color.fromARGB( - 255, 0, 71, 137), - fontweight: FontWeight.bold, - txtfont: 20.0), - const SizedBox( - height: 15.0, - ), - Text1( - title: widget - .text!["affiliations_count"] - .toString(), - txtfont: 18.0, - txtcolor: Color.fromARGB( - 255, 0, 71, 137), - ) - ], - ), - ), - ), - const SizedBox( - height: - 10), // adds spacing between the text and image - Card( - surfaceTintColor: Colors.white, - clipBehavior: Clip.antiAlias, - color: Colors.white, - elevation: 5, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular( - 15.0), // adds rounded corners - ), - child: Padding( - padding: const EdgeInsets.all(18.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - // mainAxisSize: MainAxisSize.min, - children: [ - Text1( - title: "Events", - txtcolor: Color.fromARGB( - 255, 0, 71, 137), - fontweight: FontWeight.bold, - txtfont: 20.0), - const SizedBox( - height: 15.0, - ), - Text1( - title: widget - .text!["events_count"] - .toString(), - txtfont: 18.0, - txtcolor: Color.fromARGB( - 255, 0, 71, 137), - ) - ], - ), - ), - ), - const SizedBox( - height: - 10), // adds spacing between the image and button - Card( - surfaceTintColor: Colors.white, - clipBehavior: Clip.antiAlias, - color: Colors.white, - elevation: 5, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular( - 15.0), // adds rounded corners - ), - child: Padding( - padding: const EdgeInsets.all(18.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - // mainAxisSize: MainAxisSize.min, - children: [ - Text1( - title: "Publications", - txtcolor: Color.fromARGB( - 255, 0, 71, 137), - fontweight: FontWeight.bold, - txtfont: 20.0), - const SizedBox( - height: 15.0, - ), - Text1( - title: widget - .text!["publications_count"] - .toString(), - txtfont: 18.0, - txtcolor: Color.fromARGB( - 255, 0, 71, 137), - ) - ], - ), - ), - ), - SizedBox( - height: 10.0, - ), - Card( - surfaceTintColor: Colors.white, - clipBehavior: Clip.antiAlias, - color: Colors.white, - elevation: 5, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular( - 15.0), // adds rounded corners - ), - child: Padding( - padding: const EdgeInsets.all(18.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - // mainAxisSize: MainAxisSize.min, - children: [ - Text1( - title: "Trails", - txtcolor: Color.fromARGB( - 255, 0, 71, 137), - fontweight: FontWeight.bold, - txtfont: 20.0), - const SizedBox( - height: 15.0, - ), - Text1( - title: widget - .text!["publications_count"] - .toString(), - txtfont: 18.0, - txtcolor: Color.fromARGB( - 255, 0, 71, 137), - ) - ], - ), - ), - ), - - SizedBox( - height: 10.0, - ), - Card( - surfaceTintColor: Colors.white, - clipBehavior: Clip.antiAlias, - color: Colors.white, - elevation: 5, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular( - 15.0), // adds rounded corners - ), - child: Padding( - padding: const EdgeInsets.all(18.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - //mainAxisSize: MainAxisSize.min, - children: [ - GestureDetector( - onTap: () async { - // print("I am Interaction"); - // final ConfigDataProvider - // configDataProvider = - // ConfigDataProvider(); - - // await configDataProvider - // .initConfigUIData(); - // // Navigator.push(context, MaterialPageRoute(builder: (context)))=> InteractionScreen(); - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // InteractionListScreen())); - ///////////////////////////////////////// - /// - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext - context) => - InteractionScreen( - index: 0, - form: - "form3 demo"))); - }, - child: Text1( - title: "Interaction Form", + // clipBehavior: Clip.antiAlias, + // color: Colors.white, + // elevation: 5, // adds a shadow effect + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular( + // 15.0), // adds rounded corners + // ), + child: Padding( + padding: const EdgeInsets.all(0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Card( + surfaceTintColor: Colors.white, + clipBehavior: Clip.antiAlias, + color: Colors.white, + elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular( + 15.0), // adds rounded corners + ), + child: Padding( + padding: const EdgeInsets.all(18.0), + child: Row( + //mainAxisSize: MainAxisSize.min, + children: [ + Text1( + title: "Affiliations", + txtcolor: Color.fromARGB( + 255, 0, 71, 137), + fontweight: FontWeight.bold, + txtfont: 20.0), + const SizedBox( + height: 15.0, + ), + Text1( + title: widget.text![ + "affiliations_count"] + .toString(), + txtfont: 18.0, txtcolor: Color.fromARGB( 255, 0, 71, 137), - fontweight: FontWeight.bold, - txtfont: 20.0), + ) + ], ), - ], + ), ), + const SizedBox( + height: + 10), // adds spacing between the text and image + Card( + surfaceTintColor: Colors.white, + clipBehavior: Clip.antiAlias, + color: Colors.white, + elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular( + 15.0), // adds rounded corners + ), + child: Padding( + padding: const EdgeInsets.all(18.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + children: [ + Text1( + title: "Events", + txtcolor: Color.fromARGB( + 255, 0, 71, 137), + fontweight: FontWeight.bold, + txtfont: 20.0), + const SizedBox( + height: 15.0, + ), + Text1( + title: widget + .text!["events_count"] + .toString(), + txtfont: 18.0, + txtcolor: Color.fromARGB( + 255, 0, 71, 137), + ) + ], + ), + ), + ), + const SizedBox( + height: + 10), // adds spacing between the image and button + Card( + surfaceTintColor: Colors.white, + clipBehavior: Clip.antiAlias, + color: Colors.white, + elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular( + 15.0), // adds rounded corners + ), + child: Padding( + padding: const EdgeInsets.all(18.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + children: [ + Text1( + title: "Publications", + txtcolor: Color.fromARGB( + 255, 0, 71, 137), + fontweight: FontWeight.bold, + txtfont: 20.0), + const SizedBox( + height: 15.0, + ), + Text1( + title: widget.text![ + "publications_count"] + .toString(), + txtfont: 18.0, + txtcolor: Color.fromARGB( + 255, 0, 71, 137), + ) + ], + ), + ), + ), + SizedBox( + height: 10.0, + ), + Card( + surfaceTintColor: Colors.white, + clipBehavior: Clip.antiAlias, + color: Colors.white, + elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular( + 15.0), // adds rounded corners + ), + child: Padding( + padding: const EdgeInsets.all(18.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + children: [ + Text1( + title: "Trails", + txtcolor: Color.fromARGB( + 255, 0, 71, 137), + fontweight: FontWeight.bold, + txtfont: 20.0), + const SizedBox( + height: 15.0, + ), + Text1( + title: widget.text![ + "publications_count"] + .toString(), + txtfont: 18.0, + txtcolor: Color.fromARGB( + 255, 0, 71, 137), + ) + ], + ), + ), + ), + + SizedBox( + height: 10.0, + ), + Card( + surfaceTintColor: Colors.white, + clipBehavior: Clip.antiAlias, + color: Colors.white, + elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular( + 15.0), // adds rounded corners + ), + child: Padding( + padding: const EdgeInsets.all(18.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + //mainAxisSize: MainAxisSize.min, + children: [ + GestureDetector( + onTap: () async { + /// + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (BuildContext + // context) => + // InteractionScreen( + // index: 0, + // form: + // "form3 demo"))); + + ///////////////////////////////////// + /// + + final provider = Provider + .of( + 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: "Interaction Form", + txtcolor: Color.fromARGB( + 255, 0, 71, 137), + fontweight: + FontWeight.bold, + txtfont: 20.0), + ), + ], + ), + ), + ), + ], + ), + ), + // ) + ) + ], + ) + : Card( + surfaceTintColor: Colors.white, + margin: EdgeInsets.symmetric( + horizontal: 15.0, vertical: 5.0), + clipBehavior: Clip.antiAlias, + color: Colors.white, + elevation: 5.0, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 1.0, vertical: 22.0), + child: Row( + children: [ + Expanded( + child: Column( + children: [ + Text( + "Affliations", + style: TextStyle( + color: Color.fromARGB( + 255, 0, 71, 137), + fontSize: 13.0, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 5.0, + ), + Text( + widget.text["affiliations_count"] + .toString(), + style: TextStyle( + fontSize: 13.0, + color: Color.fromARGB( + 255, 0, 71, 137), + ), + ) + ], + ), + ), + Expanded( + child: Column( + children: [ + Text( + "Events", + style: TextStyle( + color: Color.fromARGB( + 255, 0, 71, 137), + fontSize: 13.0, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 5.0, + ), + Text( + widget.text["events_count"] + .toString(), + style: TextStyle( + fontSize: 13.0, + color: Color.fromARGB( + 255, 0, 71, 137), + ), + ) + ], + ), + ), + Expanded( + child: Column( + children: [ + Text( + "Publications", + style: TextStyle( + color: Color.fromARGB( + 255, 0, 71, 137), + fontSize: 13.0, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 5.0, + ), + Text( + widget.text["publications_count"] + .toString(), + style: TextStyle( + fontSize: 13.0, + color: Color.fromARGB( + 255, 0, 71, 137), + ), + ) + ], + ), + ), + Expanded( + child: Column( + children: [ + Text( + "Trails", + style: TextStyle( + color: Color.fromARGB( + 255, 0, 71, 137), + fontSize: 13.0, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 5.0, + ), + Text( + widget.text["publications_count"] + .toString(), + style: TextStyle( + fontSize: 13.0, + color: Color.fromARGB( + 255, 0, 71, 137), + ), + ) + ], ), ), ], ), ), - // ) - //////////////////////////////////////////////// - // child: Card( - // surfaceTintColor: Colors.white, - - // clipBehavior: Clip.antiAlias, - // color: Colors.white, - // elevation: 5, // adds a shadow effect - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular( - // 15.0), // adds rounded corners - // ), - // child: Padding( - // padding: const EdgeInsets.all(50), - // child: Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // mainAxisSize: MainAxisSize.min, - // children: [ - // Row( - // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Affiliations", - // txtcolor: Color.fromARGB( - // 255, 0, 71, 137), - // fontweight: FontWeight.bold, - // txtfont: 20.0), - // const SizedBox( - // height: 15.0, - // ), - // Text1( - // title: widget - // .text!["affiliations_count"] - // .toString(), - // txtfont: 18.0, - // txtcolor: - // Color.fromARGB(255, 0, 71, 137), - // ) - // ], - // ), - // const SizedBox( - // height: - // 10), // adds spacing between the text and image - // Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Events", - // txtcolor: Color.fromARGB( - // 255, 0, 71, 137), - // fontweight: FontWeight.bold, - // txtfont: 20.0), - // const SizedBox( - // height: 15.0, - // ), - // Text1( - // title: widget.text!["events_count"] - // .toString(), - // txtfont: 18.0, - // txtcolor: - // Color.fromARGB(255, 0, 71, 137), - // ) - // ], - // ), - // const SizedBox( - // height: - // 10), // adds spacing between the image and button - // Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Publications", - // txtcolor: Color.fromARGB( - // 255, 0, 71, 137), - // fontweight: FontWeight.bold, - // txtfont: 20.0), - // const SizedBox( - // height: 15.0, - // ), - // Text1( - // title: widget - // .text!["publications_count"] - // .toString(), - // txtfont: 18.0, - // txtcolor: - // Color.fromARGB(255, 0, 71, 137), - // ) - // ], - // ), - // SizedBox( - // height: 10.0, - // ), - // Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Trails", - // txtcolor: Color.fromARGB( - // 255, 0, 71, 137), - // fontweight: FontWeight.bold, - // txtfont: 20.0), - // const SizedBox( - // height: 15.0, - // ), - // Text1( - // title: widget - // .text!["publications_count"] - // .toString(), - // txtfont: 18.0, - // txtcolor: - // Color.fromARGB(255, 0, 71, 137), - // ) - // ], - // ), - - // SizedBox( - // height: 10.0, - // ), - // Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // mainAxisSize: MainAxisSize.min, - // children: [ - // GestureDetector( - // onTap: () async { - // print("I am Interaction"); - // final ConfigDataProvider - // configDataProvider = - // ConfigDataProvider(); - - // await configDataProvider - // .initConfigUIData(); - // // Navigator.push(context, MaterialPageRoute(builder: (context)))=> InteractionScreen(); - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // InteractionListScreen())); - // }, - // child: Text1( - // title: "Interaction Form", - // txtcolor: Color.fromARGB( - // 255, 0, 71, 137), - // fontweight: FontWeight.bold, - // txtfont: 20.0), - // ), - // ], - // ), - // ], - // ), - // ), - // ), - -////////////////////////////////////////////////////////////////// - - // child: Card( - // surfaceTintColor: Colors.white, - // // margin: EdgeInsets.symmetric( - // // horizontal: 15.0, vertical: 5.0), - // clipBehavior: Clip.antiAlias, - // color: Colors.red, - // elevation: 5.0, - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // Row( - // mainAxisAlignment: - // MainAxisAlignment.center, - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Text1( - // title: "Affiliations", - // txtcolor: - // Color.fromARGB(255, 0, 71, 137), - // fontweight: FontWeight.bold, - // txtfont: 20.0), - // const SizedBox( - // height: 15.0, - // ), - // Text1( - // title: widget - // .text!["affiliations_count"] - // .toString(), - // txtfont: 18.0, - // txtcolor: - // Color.fromARGB(255, 0, 71, 137), - // ) - // ], - // ), - // SizedBox( - // height: 10.0, - // ), - // Row( - // mainAxisAlignment: - // MainAxisAlignment.center, - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Text1( - // title: "Events", - // txtcolor: - // Color.fromARGB(255, 0, 71, 137), - // fontweight: FontWeight.bold, - // txtfont: 20.0), - // const SizedBox( - // height: 15.0, - // ), - // Text1( - // title: widget.text!["events_count"] - // .toString(), - // txtfont: 18.0, - // txtcolor: - // Color.fromARGB(255, 0, 71, 137), - // ) - // ], - // ), - // SizedBox( - // height: 10.0, - // ), - // Row( - // mainAxisAlignment: - // MainAxisAlignment.center, - // children: [ - // Text1( - // title: "Publications", - // txtcolor: - // Color.fromARGB(255, 0, 71, 137), - // fontweight: FontWeight.bold, - // txtfont: 20.0), - // const SizedBox( - // height: 15.0, - // ), - // Text1( - // title: widget - // .text!["publications_count"] - // .toString(), - // txtfont: 18.0, - // txtcolor: - // Color.fromARGB(255, 0, 71, 137), - // ) - // ], - // ), - // SizedBox( - // height: 10.0, - // ), - // Row( - // mainAxisAlignment: - // MainAxisAlignment.center, - // children: [ - // Text1( - // title: "Trails", - // txtcolor: - // Color.fromARGB(255, 0, 71, 137), - // fontweight: FontWeight.bold, - // txtfont: 20.0), - // const SizedBox( - // height: 15.0, - // ), - // Text1( - // title: widget - // .text!["publications_count"] - // .toString(), - // txtfont: 18.0, - // txtcolor: - // Color.fromARGB(255, 0, 71, 137), - // ) - // ], - // ), - // ], - // ), - // ), ) - ], - ), - ), ], ), ), - - // Padding( - // padding: EdgeInsets.only(bottom: 18.0), - // child: Card( - // margin: - // EdgeInsets.symmetric(horizontal: 15.0, vertical: 5.0), - // clipBehavior: Clip.antiAlias, - // color: Colors.white, - // elevation: 5.0, - // child: Padding( - // padding: - // EdgeInsets.symmetric(horizontal: 1.0, vertical: 22.0), - // child: Row( - // children: [ - // Expanded( - // child: Column( - // children: [ - // // Text( - // // "Affliations", - // // style: TextStyle( - // // color: Color.fromARGB(255, 0, 71, 137), - // // fontSize: 13.0, - // // fontWeight: FontWeight.bold, - // // ), - // // ), - // Text1( - // title: "Affliations", - // txtcolor: Color.fromARGB(255, 0, 71, 137), - // fontweight: FontWeight.bold, - // txtfont: 13.0), - // const SizedBox( - // height: 5.0, - // ), - // // Text( - // // "75", - // // style: TextStyle( - // // fontSize: 13.0, - // // color: Color.fromARGB(255, 0, 71, 137), - // // ), - // // ) - // Text1( - // title: widget.text!["affiliations_count"] - // .toString(), - // txtfont: 13.0, - // txtcolor: Color.fromARGB(255, 0, 71, 137), - // ) - // ], - // ), - // ), - // Expanded( - // child: Column( - // children: [ - // Text1( - // title: "Events", - // txtcolor: Color.fromARGB(255, 0, 71, 137), - // fontweight: FontWeight.bold, - // txtfont: 13.0), - // const SizedBox( - // height: 5.0, - // ), - // // Text( - // // "0", - // // style: TextStyle( - // // fontSize: 13.0, - // // color: Color.fromARGB(255, 0, 71, 137), - // // ), - // // ) - // Text1( - // title: - // widget.text!["events_count"].toString(), - // txtfont: 13.0, - // txtcolor: Color.fromARGB(255, 0, 71, 137), - // ) - // ], - // ), - // ), - // Expanded( - // child: Column( - // children: [ - // // Text( - // // "Publications", - // // style: TextStyle( - // // color: Color.fromARGB(255, 0, 71, 137), - // // fontSize: 13.0, - // // fontWeight: FontWeight.bold, - // // ), - // // ), - // Text1( - // title: "Publications", - // txtcolor: Color.fromARGB(255, 0, 71, 137), - // fontweight: FontWeight.bold, - // txtfont: 13.0), - // SizedBox( - // height: 5.0, - // ), - // // Text( - // // "251", - // // style: TextStyle( - // // fontSize: 13.0, - // // color: Color.fromARGB(255, 0, 71, 137), - // // ), - // // ) - // Text1( - // title: widget.text!["publications_count"] - // .toString(), - // txtfont: 13.0, - // txtcolor: Color.fromARGB(255, 0, 71, 137), - // ) - // ], - // ), - // ), - // Expanded( - // child: Column( - // children: [ - // // Text( - // // "Trails", - // // style: TextStyle( - // // color: Color.fromARGB(255, 0, 71, 137), - // // fontSize: 13.0, - // // fontWeight: FontWeight.bold, - // // ), - // // ), - // Text1( - // title: "Trails", - // txtcolor: Color.fromARGB(255, 0, 71, 137), - // fontweight: FontWeight.bold, - // txtfont: 13.0), - // SizedBox( - // height: 5.0, - // ), - // // Text( - // // "1", - // // style: TextStyle( - // // fontSize: 13.0, - // // color: Color.fromARGB(255, 0, 71, 137), - // // ), - // // ) - // Text1( - // title: "1", - // txtfont: 13.0, - // txtcolor: Color.fromARGB(255, 0, 71, 137), - // ) - // ], - // ), - // ), - // ], - // ), - // ), - // ), - // ) - - // // Padding( - // padding: EdgeInsets.only(bottom: 18.0), - // child: Card( - // surfaceTintColor: Colors.white, - // margin: - // EdgeInsets.symmetric(horizontal: 15.0, vertical: 5.0), - // clipBehavior: Clip.antiAlias, - // color: Colors.white, - // elevation: 5.0, - // child: Padding( - // padding: - // EdgeInsets.symmetric(horizontal: 1.0, vertical: 22.0), - // child: Row( - // children: [ - // Expanded( - // child: Column( - // children: [ - // // Text( - // // "Affliations", - // // style: TextStyle( - // // color: Color.fromARGB(255, 0, 71, 137), - // // fontSize: 13.0, - // // fontWeight: FontWeight.bold, - // // ), - // // ), - // Text1( - // title: "Affliations", - // txtcolor: Color.fromARGB(255, 0, 71, 137), - // fontweight: FontWeight.bold, - // txtfont: 13.0), - // const SizedBox( - // height: 5.0, - // ), - // // Text( - // // "75", - // // style: TextStyle( - // // fontSize: 13.0, - // // color: Color.fromARGB(255, 0, 71, 137), - // // ), - // // ) - // Text1( - // title: widget.text!["affiliations_count"] - // .toString(), - // txtfont: 13.0, - // txtcolor: Color.fromARGB(255, 0, 71, 137), - // ) - // ], - // ), - // ), - // Expanded( - // child: Column( - // children: [ - // Text1( - // title: "Events", - // txtcolor: Color.fromARGB(255, 0, 71, 137), - // fontweight: FontWeight.bold, - // txtfont: 13.0), - // const SizedBox( - // height: 5.0, - // ), - // // Text( - // // "0", - // // style: TextStyle( - // // fontSize: 13.0, - // // color: Color.fromARGB(255, 0, 71, 137), - // // ), - // // ) - // Text1( - // title: - // widget.text!["events_count"].toString(), - // txtfont: 13.0, - // txtcolor: Color.fromARGB(255, 0, 71, 137), - // ) - // ], - // ), - // ), - // Expanded( - // child: Column( - // children: [ - // // Text( - // // "Publications", - // // style: TextStyle( - // // color: Color.fromARGB(255, 0, 71, 137), - // // fontSize: 13.0, - // // fontWeight: FontWeight.bold, - // // ), - // // ), - // Text1( - // title: "Publications", - // txtcolor: Color.fromARGB(255, 0, 71, 137), - // fontweight: FontWeight.bold, - // txtfont: 13.0), - // SizedBox( - // height: 5.0, - // ), - // // Text( - // // "251", - // // style: TextStyle( - // // fontSize: 13.0, - // // color: Color.fromARGB(255, 0, 71, 137), - // // ), - // // ) - // Text1( - // title: widget.text!["publications_count"] - // .toString(), - // txtfont: 13.0, - // txtcolor: Color.fromARGB(255, 0, 71, 137), - // ) - // ], - // ), - // ), - // Expanded( - // child: Column( - // children: [ - // // Text( - // // "Trails", - // // style: TextStyle( - // // color: Color.fromARGB(255, 0, 71, 137), - // // fontSize: 13.0, - // // fontWeight: FontWeight.bold, - // // ), - // // ), - // Text1( - // title: "Trails", - // txtcolor: Color.fromARGB(255, 0, 71, 137), - // fontweight: FontWeight.bold, - // txtfont: 13.0), - // SizedBox( - // height: 5.0, - // ), - // // Text( - // // "1", - // // style: TextStyle( - // // fontSize: 13.0, - // // color: Color.fromARGB(255, 0, 71, 137), - // // ), - // // ) - // Text1( - // title: "1", - // txtfont: 13.0, - // txtcolor: Color.fromARGB(255, 0, 71, 137), - // ) - // ], - // ), - // ), - // ], - // ), - // ), - // ), - // ) ], ), ], @@ -1494,8 +2171,15 @@ class _ProfileState extends State { ), ); } + + Future getCount(String form, InteractionProvider provider) async { + await provider.getRecords(); + + return provider.savedList.where((element) => element.form == form).length; + } } +/////////////////////////////////////////////////////////////////////////////////////////// // import 'package:discover_module/custom_widget/text.dart'; // import 'package:discover_module/provider_class/single_hcpprovider.dart'; diff --git a/lib/ui_screen/ranking.dart b/lib/ui_screen/ranking.dart index 0cf535e..2978301 100644 --- a/lib/ui_screen/ranking.dart +++ b/lib/ui_screen/ranking.dart @@ -1,3 +1,1132 @@ +// // import 'dart:convert'; +// // import 'dart:io'; +// // // import 'dart:js_interop'; + +// // import 'package:discover_module/custom_widget/floating_btn.dart'; +// // import 'package:discover_module/custom_widget/show_alert.dart'; +// // import 'package:discover_module/ui_screen/contacts.dart'; +// // import 'package:discover_module/ui_screen/profile.dart'; +// // import 'package:flutter/foundation.dart'; +// // import 'package:flutter/foundation.dart' show kIsWeb; +// // import 'package:flutter/material.dart'; +// // import 'package:hive_flutter/hive_flutter.dart'; +// // import 'package:open_file/open_file.dart'; +// // import 'package:path_provider/path_provider.dart'; +// // import 'package:syncfusion_flutter_xlsio/xlsio.dart'; +// // import 'package:universal_html/html.dart' show AnchorElement; + +// // class Ranking extends StatefulWidget { +// // @override +// // State createState() => _RankingState(); +// // } + +// // class _RankingState extends State { +// // late _DataSource _dataSource; + +// // List selectedno = []; +// // @override +// // void initState() { +// // super.initState(); +// // print("hii_initState"); +// // _dataSource = _DataSource(context); // Initialize _DataSource +// // } + +// // @override +// // Widget build(BuildContext context) { +// // return SafeArea( +// // child: Scaffold( +// // body: ListView( +// // padding: const EdgeInsets.all(3), +// // children: [ +// // PaginatedDataTable( +// // header: const Text( +// // 'HCP RANKING', +// // style: TextStyle( +// // fontWeight: FontWeight.bold, +// // fontSize: 18.0, +// // fontStyle: FontStyle.normal), +// // ), +// // showFirstLastButtons: true, +// // showEmptyRows: false, +// // showCheckboxColumn: true, +// // actions: [ +// // IconButton( +// // onPressed: () { +// // _createExcel(); +// // }, +// // icon: const Icon(Icons.download, +// // color: Color.fromARGB(255, 0, 71, 132))) +// // ], +// // rowsPerPage: 5, +// // columns: const [ +// // DataColumn( +// // label: FittedBox( +// // fit: BoxFit.scaleDown, +// // child: Text('Name', +// // style: TextStyle( +// // fontWeight: FontWeight.bold, +// // fontSize: 14.0, +// // fontStyle: FontStyle.normal)), +// // )), +// // DataColumn( +// // label: FittedBox( +// // fit: BoxFit.scaleDown, +// // child: Text('Tier', +// // style: TextStyle( +// // fontWeight: FontWeight.bold, +// // fontSize: 14.0, +// // fontStyle: FontStyle.normal)), +// // )), +// // DataColumn( +// // label: FittedBox( +// // fit: BoxFit.scaleDown, +// // child: Text('Rank', +// // style: TextStyle( +// // fontWeight: FontWeight.bold, +// // fontSize: 14.0, +// // fontStyle: FontStyle.normal)), +// // )), +// // DataColumn( +// // label: FittedBox( +// // fit: BoxFit.scaleDown, +// // child: Text('Score', +// // style: TextStyle( +// // fontWeight: FontWeight.bold, +// // fontSize: 14.0, +// // fontStyle: FontStyle.normal)), +// // )), +// // DataColumn( +// // label: FittedBox( +// // fit: BoxFit.scaleDown, +// // child: Text('Event', +// // style: TextStyle( +// // fontWeight: FontWeight.bold, +// // fontSize: 14.0, +// // fontStyle: FontStyle.normal)), +// // )), +// // DataColumn( +// // label: FittedBox( +// // fit: BoxFit.scaleDown, +// // child: Text('Affliations', +// // style: TextStyle( +// // fontWeight: FontWeight.bold, +// // fontSize: 14.0, +// // fontStyle: FontStyle.normal)), +// // )), +// // DataColumn( +// // label: FittedBox( +// // fit: BoxFit.scaleDown, +// // child: Text('Publications', +// // style: TextStyle( +// // fontWeight: FontWeight.bold, +// // fontSize: 14.0, +// // fontStyle: FontStyle.normal)), +// // )), +// // DataColumn( +// // label: FittedBox( +// // fit: BoxFit.scaleDown, +// // child: Text('Trails', +// // style: TextStyle( +// // fontWeight: FontWeight.bold, +// // fontSize: 14.0, +// // fontStyle: FontStyle.normal)), +// // )), +// // ], +// // source: _dataSource, +// // ), +// // ], +// // ), +// // floatingActionButton: Visibility( +// // visible: true, +// // child: FloatingBtn( +// // icon: Icons.add, +// // title: "add", +// // onTap: () async { +// // List selectedRowIds = _dataSource.getSelectedRowIds(); +// // // Do something with selectedRowIds +// // print('Selected Row IDstrndsss: $selectedRowIds'); + +// // if (selectedRowIds.isEmpty) { +// // showDialog( +// // context: context, +// // builder: (_) { +// // return Alert( +// // data: "Please Select the user", +// // onPressed: () { +// // Navigator.of(context).pop(); +// // print('OK button pressed'); +// // }, +// // ); +// // }); +// // } else { +// // for (int i = 0; i < selectedRowIds.length; i++) { +// // print('The id id : ${selectedRowIds[i]}'); + +// // print("checking_value_istrends: ${selectedRowIds[i]}"); + +// // // selectedno.add(selectedRowIds[i]); + +// // HiveFunctions.addno(selectedRowIds[i]); + +// // // _contactbox.put(i, selectedRowIds[i]); + +// // HiveFunctions.createUser({ +// // "name": "Gerosa,Gino", +// // "org": "Azienda Ospedaliera di Padova", +// // "adrr": "Via Giustiniani 2, Padova, Veneto 35128, Italy", +// // "phone": "+390498212410X12", +// // "Pphone": "+390498212410X12", +// // "email": "Gerosa,Gino@gmail.com", +// // "affno": "75", +// // "eveno": "8", +// // "pubno": "251", +// // "trailno": "1" +// // }); +// // } +// // showDialog( +// // context: context, +// // builder: (_) { +// // return Alert( +// // data: "User Added Successfully", +// // onPressed: () { +// // Navigator.of(context).pop(); +// // // Navigator.push(context, +// // // MaterialPageRoute(builder: (_) => Contacts())); +// // }, +// // ); +// // }); +// // } +// // }, +// // )), +// // ), +// // ); +// // } + +// // Future _createExcel() async { +// // //Create an Excel document. + +// // //Creating a workbook. +// // final Workbook workbook = Workbook(); +// // //Accessing via index +// // final Worksheet sheet = workbook.worksheets[0]; + +// // // sheet.getRangeByName('A1').setText('pooja'); +// // ///////////////////////////////////////////////////////////////////////////// + +// // sheet.getRangeByName('A1').setText('Name'); +// // sheet.getRangeByName('A2').setText('Gerosa, Gino'); +// // sheet.getRangeByName('A3').setText('Gerosa, Gino'); +// // sheet.getRangeByName('A4').setText('Gerosa, Gino'); + +// // final Style headingStyle = workbook.styles.add('HeadingStyle'); +// // headingStyle.bold = true; +// // headingStyle.hAlign = HAlignType.center; +// // headingStyle.wrapText = true; +// // sheet.getRangeByName('B1').setText('Tier'); +// // sheet.getRangeByName('B2').setText("Tier1"); +// // sheet.getRangeByName('B3').setText("Tier1"); +// // sheet.getRangeByName('B4').setText("Tier1"); +// // sheet.getRangeByName('C1').setText('Rank'); +// // sheet.getRangeByName('C2').setNumber(1); +// // sheet.getRangeByName('C3').setNumber(1); +// // sheet.getRangeByName('C4').setNumber(1); +// // sheet.getRangeByName('D1').setText('Score'); +// // sheet.getRangeByName('D2').setNumber(0); +// // sheet.getRangeByName('D3').setNumber(0); +// // sheet.getRangeByName('D4').setNumber(0); + +// // sheet.getRangeByName('E1').setText('Event'); +// // sheet.getRangeByName('E2').setNumber(0); +// // sheet.getRangeByName('E3').setNumber(0); +// // sheet.getRangeByName('E4').setNumber(0); + +// // sheet.getRangeByName('F1').setText('Affiliations'); +// // sheet.getRangeByName('F2').setNumber(0); +// // sheet.getRangeByName('F3').setNumber(0); +// // sheet.getRangeByName('F4').setNumber(0); + +// // sheet.getRangeByName('G1').setText('Publications'); +// // sheet.getRangeByName('G2').setNumber(0); +// // sheet.getRangeByName('G3').setNumber(0); +// // sheet.getRangeByName('G4').setNumber(0); + +// // sheet.getRangeByName('H1').setText('Trails'); +// // sheet.getRangeByName('H2').setNumber(0); +// // sheet.getRangeByName('H3').setNumber(0); +// // sheet.getRangeByName('H4').setNumber(0); + +// // //Defining a global style with properties. +// // final Style globalStyle = workbook.styles.add('globalStyle'); +// // //globalStyle.backColor = '#37D8E9'; +// // globalStyle.fontName = 'Times New Roman'; +// // globalStyle.fontSize = 12; +// // // globalStyle.fontColor = '#C67878'; +// // globalStyle.fontColor = '#C67878'; + +// // globalStyle.italic = true; +// // globalStyle.bold = true; +// // globalStyle.underline = true; +// // globalStyle.wrapText = true; +// // globalStyle.hAlign = HAlignType.center; +// // globalStyle.vAlign = VAlignType.center; +// // globalStyle.borders.all.lineStyle = LineStyle.thick; +// // // globalStyle.borders.all.color = '#9954CC'; + +// // final Style globalStyle1 = workbook.styles.add('globalStyle1'); +// // globalStyle1.fontSize = 14; +// // // globalStyle1.fontColor = '#362191'; +// // globalStyle1.hAlign = HAlignType.center; +// // globalStyle1.vAlign = VAlignType.center; +// // globalStyle1.borders.bottom.lineStyle = LineStyle.thin; +// // //globalStyle1.borders.bottom.color = '#829193'; +// // globalStyle1.numberFormat = '0.00'; + +// // //Apply GlobalStyle +// // // sheet.getRangeByName('A1:D1').cellStyle = globalStyle; + +// // // //Apply GlobalStyle1 +// // // sheet.getRangeByName('B2:D4').cellStyle = globalStyle1; +// // ////////////////////////////////////////////////////////////////////////////// + +// // final List bytes = workbook.saveSync(); + +// // print("hii"); + +// // if (kIsWeb) { +// // AnchorElement( +// // href: +// // 'data:application/octet-stream;charset=utf-16le;base64,${base64.encode(bytes)}') +// // ..setAttribute('download', 'Output.xlsx') +// // ..click(); +// // } else { +// // // final String path = (await getApplicationDocumentsDirectory()).path; +// // //final directory = await getExternalStorageDirectory(); + +// // Directory? directory = Platform.isAndroid +// // ? await getExternalStorageDirectory() +// // : await getApplicationDocumentsDirectory(); + +// // final path = directory!.path; + +// // final String filename = +// // Platform.isWindows ? '$path\\Output.xlsx' : '$path/Output.xlsx'; +// // // final String filename = '$path/Output.xlsx'; +// // final File file = File(filename); +// // await file.writeAsBytes(bytes, flush: true); +// // OpenFile.open(filename); +// // } +// // } +// // } + +// // class HiveFunctions { +// // // String userHiveBox="User Box"; +// // // Box which will use to store the things +// // static final _contactbox = Hive.box("mycontact"); +// // static var box1 = Hive.box('checkvalue'); + +// // static createUser(Map data) { +// // _contactbox.add(data); +// // } + +// // static List getAllUsers() { +// // final data = _contactbox.keys.map((key) { +// // final value = _contactbox.get(key); +// // print("Checking_Name : $value"); +// // return { +// // "name": value["name"], +// // "org": value["org"], +// // "adrr": value["adrr"], +// // "phone": value["phone"], +// // "Pphone": value["Pphone"], +// // "email": value["email"], +// // "affno": value["affno"], +// // "eveno": value["eveno"], +// // "pubno": value["pubno"], +// // "trailno": value["trailno"] +// // }; +// // }).toList(); + +// // return data.reversed.toList(); +// // } + +// // static List getindexUsers() { +// // final data = _contactbox.keys.map((key) { +// // final value = _contactbox.get(key); +// // print("Checking_Name : $value"); +// // return { +// // "name": value["name"], +// // "org": value["org"], +// // "adrr": value["adrr"], +// // "phone": value["phone"], +// // "Pphone": value["Pphone"], +// // "email": value["email"], +// // "affno": value["affno"], +// // "eveno": value["eveno"], +// // "pubno": value["pubno"], +// // "trailno": value["trailno"] +// // }; +// // }).toList(); + +// // return data.reversed.toList(); +// // } + +// // static addno(int selectedRowId) { +// // // final box1 = Hive.box("mycontact"); + +// // print("SelectedStoredvaluessss: $selectedRowId"); + +// // box1.add(selectedRowId); +// // } + +// // static getno() { +// // // final box1 = Hive.box("mycontact"); + +// // return box1.values; +// // } +// // } + +// // class _Row { +// // _Row( +// // this.identifier, +// // this.valueA, +// // this.valueC, +// // this.valueD, +// // this.valueE, +// // this.valueF, +// // this.valueG, +// // this.valueH, +// // this.valueI, +// // this.selected, // Add selected parameter +// // ); + +// // final int identifier; +// // final String valueA; +// // final String valueC; +// // final String valueD; +// // final String valueE; +// // final String valueF; +// // final String valueG; +// // final String valueH; +// // final String valueI; + +// // bool selected = false; +// // } + +// // class _DataSource extends DataTableSource { +// // final BuildContext context; +// // late List<_Row> _rows; +// // // late List _selectedRowsIndexes = []; // List to track selected rows +// // final List _selectedRowIds = []; + +// // _DataSource(this.context) { +// // _rows = <_Row>[ +// // for (int i = 0; i < 20; i++) +// // _Row( +// // i, 'Gerosa, Gino', 'Tier1', '1', '0', '0', '0', '0', '0', check(i)), +// // ]; +// // //} +// // } + +// // List getSelectedRowIds() { +// // return _selectedRowIds; // Return a copy to prevent direct modification +// // } + +// // int _selectedCount = 0; + +// // @override +// // DataRow? getRow(int index) { +// // assert(index >= 0); +// // if (index >= _rows.length) return null; +// // final row = _rows[index]; +// // return DataRow.byIndex( +// // index: index, +// // selected: row.selected, +// // onSelectChanged: (value) { +// // if (row.selected != value) { +// // // _selectedCount += value! ? 1 : -1; +// // // assert(_selectedCount >= 0); +// // row.selected = value!; + +// // if (value) { +// // print("Selected"); +// // _selectedRowIds.add(row.identifier); // Add the row ID to the list +// // print("Selected_selectedRowIds :$_selectedRowIds"); +// // } else { +// // _selectedRowIds +// // .remove(row.identifier); // Remove the row ID from the list +// // } +// // notifyListeners(); + +// // print("Selectedddd_is $value"); +// // print("Selectedddd_value ${row.valueA}"); +// // } +// // }, +// // cells: [ +// // DataCell( +// // Text(row.valueA), +// // onTap: () { +// // print("hiii Data cell tap ${row.valueA}"); + +// // Navigator.push( +// // context, MaterialPageRoute(builder: (context) => Profile())); +// // }, +// // ), +// // DataCell(Text(row.valueC)), +// // DataCell(Text(row.valueD.toString())), +// // DataCell(Text(row.valueE)), +// // DataCell(Text(row.valueF)), +// // DataCell(Text(row.valueG)), +// // DataCell(Text(row.valueH)), +// // DataCell(Text(row.valueI)), +// // ], +// // ); +// // } + +// // @override +// // int get rowCount => _rows.length; + +// // @override +// // bool get isRowCountApproximate => false; + +// // @override +// // int get selectedRowCount => _selectedCount; + +// // bool check(int i) { +// // // print("I_am_i: $i"); +// // print("_selectedRowIds_i: ${HiveFunctions.getno()}"); + +// // //HiveFunctions.getno(); +// // if (HiveFunctions.getno().contains(i)) { +// // print("Iam_in: $i"); +// // return true; +// // } + +// // return false; +// // } +// // } + +// import 'dart:convert'; +// import 'dart:io'; +// // import 'dart:js_interop'; + +// import 'package:discover_module/custom_widget/floating_btn.dart'; +// import 'package:discover_module/custom_widget/show_alert.dart'; +// import 'package:discover_module/hive_fun.dart'; +// import 'package:discover_module/provider_class/hcp%20_provider.dart'; +// import 'package:discover_module/ui_screen/contacts.dart'; +// import 'package:discover_module/ui_screen/filters_menu.dart'; +// import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart'; +// import 'package:discover_module/ui_screen/profile.dart'; +// import 'package:flutter/foundation.dart'; +// import 'package:flutter/foundation.dart' show kIsWeb; +// import 'package:flutter/material.dart'; +// import 'package:hive_flutter/hive_flutter.dart'; +// import 'package:open_file/open_file.dart'; +// import 'package:path_provider/path_provider.dart'; +// import 'package:provider/provider.dart'; +// import 'package:syncfusion_flutter_xlsio/xlsio.dart'; +// import 'package:universal_html/html.dart' show AnchorElement; + +// List<_Row> _rows = []; + +// class Ranking extends StatefulWidget { +// @override +// State createState() => _RankingState(); +// } + +// class _RankingState extends State { +// late _DataSource _dataSource; + +// List selectedno = []; +// @override +// void initState() { +// super.initState(); +// print("hii_initState"); + +// gethcpdata(); +// _dataSource = _DataSource(context); // Initialize _DataSource +// } + +// @override +// Widget build(BuildContext context) { +// return SafeArea( +// child: Scaffold( +// body: ListView( +// padding: const EdgeInsets.all(3), +// children: [ +// PaginatedDataTable( +// header: const Text( +// 'HCP RANKING', +// style: TextStyle( +// fontWeight: FontWeight.bold, +// fontSize: 18.0, +// fontStyle: FontStyle.normal), +// ), +// showFirstLastButtons: true, +// showEmptyRows: false, +// showCheckboxColumn: true, +// actions: [ +// IconButton( +// onPressed: () { +// _createExcel(); +// }, +// icon: const Icon(Icons.download, +// color: Color.fromARGB(255, 0, 71, 132))) +// ], +// rowsPerPage: 5, +// columns: const [ +// DataColumn( +// label: FittedBox( +// fit: BoxFit.scaleDown, +// child: Text('Name', +// style: TextStyle( +// fontWeight: FontWeight.bold, +// fontSize: 14.0, +// fontStyle: FontStyle.normal)), +// )), +// DataColumn( +// label: FittedBox( +// fit: BoxFit.scaleDown, +// child: Text('Tier', +// style: TextStyle( +// fontWeight: FontWeight.bold, +// fontSize: 14.0, +// fontStyle: FontStyle.normal)), +// )), +// DataColumn( +// label: FittedBox( +// fit: BoxFit.scaleDown, +// child: Text('Rank', +// style: TextStyle( +// fontWeight: FontWeight.bold, +// fontSize: 14.0, +// fontStyle: FontStyle.normal)), +// )), +// DataColumn( +// label: FittedBox( +// fit: BoxFit.scaleDown, +// child: Text('Score', +// style: TextStyle( +// fontWeight: FontWeight.bold, +// fontSize: 14.0, +// fontStyle: FontStyle.normal)), +// )), +// DataColumn( +// label: FittedBox( +// fit: BoxFit.scaleDown, +// child: Text('Event', +// style: TextStyle( +// fontWeight: FontWeight.bold, +// fontSize: 14.0, +// fontStyle: FontStyle.normal)), +// )), +// DataColumn( +// label: FittedBox( +// fit: BoxFit.scaleDown, +// child: Text('Affliations', +// style: TextStyle( +// fontWeight: FontWeight.bold, +// fontSize: 14.0, +// fontStyle: FontStyle.normal)), +// )), +// DataColumn( +// label: FittedBox( +// fit: BoxFit.scaleDown, +// child: Text('Publications', +// style: TextStyle( +// fontWeight: FontWeight.bold, +// fontSize: 14.0, +// fontStyle: FontStyle.normal)), +// )), +// DataColumn( +// label: FittedBox( +// fit: BoxFit.scaleDown, +// child: Text('Trails', +// style: TextStyle( +// fontWeight: FontWeight.bold, +// fontSize: 14.0, +// fontStyle: FontStyle.normal)), +// )), +// ], +// source: _dataSource, +// ), +// ], +// ), +// floatingActionButton: Visibility( +// visible: true, +// child: FloatingBtn( +// icon: Icons.add, +// title: "add", +// onTap: () async { +// List selectedRowIds = _dataSource.getSelectedRowIds(); +// // Do something with selectedRowIds +// print('Selected Row IDstrndsss: $selectedRowIds'); + +// if (selectedRowIds.isEmpty) { +// showDialog( +// context: context, +// builder: (_) { +// return Alert( +// data: "Please Select the user", +// onPressed: () { +// Navigator.of(context).pop(); +// print('OK button pressed'); +// }, +// ); +// }); +// } else { +// for (int i = 0; i < selectedRowIds.length; i++) { +// print('The id id : ${selectedRowIds[i]}'); +// //List<_Row> _rows = []; + +// final row = _rows[selectedRowIds[i] - 1]; + +// print( +// "checking_value_istrends: ${selectedRowIds[i]},${row.valueA}"); + +// // selectedno.add(selectedRowIds[i]); + +// HiveFunctions.addno(selectedRowIds[i]); + +// // _contactbox.put(i, selectedRowIds[i]); + +// HiveFunctions.createUser({ +// "id": selectedRowIds[i], +// "name": row.valueA, +// "org": row.org, +// "addr": row.addr, +// "phone": row.mno, +// "phone_no": row.mno, +// "email": row.valueC, +// "affiliations_count": row.valueG, +// "events_count": row.valueF, +// "publications_count": row.valueH, +// "trail_count": "1", +// "summarry": row.smry, +// "license_no": row.lin, +// "p_suffix": row.suffix, +// "speciality": row.spl, +// "sub_speciality": row.sub_spl, +// }); +// } +// showDialog( +// context: context, +// builder: (_) { +// return Alert( +// data: "User Added Successfully", +// onPressed: () { +// Navigator.of(context).pop(); +// // Navigator.push(context, +// // MaterialPageRoute(builder: (_) => Contacts())); +// }, +// ); +// }); +// } +// }, +// )), +// ), +// ); +// } + +// Future _createExcel() async { +// //Create an Excel document. + +// //Creating a workbook. +// final Workbook workbook = Workbook(); +// //Accessing via index +// final Worksheet sheet = workbook.worksheets[0]; + +// // sheet.getRangeByName('A1').setText('pooja'); +// ///////////////////////////////////////////////////////////////////////////// + +// sheet.getRangeByName('A1').setText('Name'); +// sheet.getRangeByName('A2').setText('Gerosa, Gino'); +// sheet.getRangeByName('A3').setText('Gerosa, Gino'); +// sheet.getRangeByName('A4').setText('Gerosa, Gino'); + +// final Style headingStyle = workbook.styles.add('HeadingStyle'); +// headingStyle.bold = true; +// headingStyle.hAlign = HAlignType.center; +// headingStyle.wrapText = true; +// sheet.getRangeByName('B1').setText('Tier'); +// sheet.getRangeByName('B2').setText("Tier1"); +// sheet.getRangeByName('B3').setText("Tier1"); +// sheet.getRangeByName('B4').setText("Tier1"); +// sheet.getRangeByName('C1').setText('Rank'); +// sheet.getRangeByName('C2').setNumber(1); +// sheet.getRangeByName('C3').setNumber(1); +// sheet.getRangeByName('C4').setNumber(1); +// sheet.getRangeByName('D1').setText('Score'); +// sheet.getRangeByName('D2').setNumber(0); +// sheet.getRangeByName('D3').setNumber(0); +// sheet.getRangeByName('D4').setNumber(0); + +// sheet.getRangeByName('E1').setText('Event'); +// sheet.getRangeByName('E2').setNumber(0); +// sheet.getRangeByName('E3').setNumber(0); +// sheet.getRangeByName('E4').setNumber(0); + +// sheet.getRangeByName('F1').setText('Affiliations'); +// sheet.getRangeByName('F2').setNumber(0); +// sheet.getRangeByName('F3').setNumber(0); +// sheet.getRangeByName('F4').setNumber(0); + +// sheet.getRangeByName('G1').setText('Publications'); +// sheet.getRangeByName('G2').setNumber(0); +// sheet.getRangeByName('G3').setNumber(0); +// sheet.getRangeByName('G4').setNumber(0); + +// sheet.getRangeByName('H1').setText('Trails'); +// sheet.getRangeByName('H2').setNumber(0); +// sheet.getRangeByName('H3').setNumber(0); +// sheet.getRangeByName('H4').setNumber(0); + +// //Defining a global style with properties. +// final Style globalStyle = workbook.styles.add('globalStyle'); +// //globalStyle.backColor = '#37D8E9'; +// globalStyle.fontName = 'Times New Roman'; +// globalStyle.fontSize = 12; +// // globalStyle.fontColor = '#C67878'; +// globalStyle.fontColor = '#C67878'; + +// globalStyle.italic = true; +// globalStyle.bold = true; +// globalStyle.underline = true; +// globalStyle.wrapText = true; +// globalStyle.hAlign = HAlignType.center; +// globalStyle.vAlign = VAlignType.center; +// globalStyle.borders.all.lineStyle = LineStyle.thick; +// // globalStyle.borders.all.color = '#9954CC'; + +// final Style globalStyle1 = workbook.styles.add('globalStyle1'); +// globalStyle1.fontSize = 14; +// // globalStyle1.fontColor = '#362191'; +// globalStyle1.hAlign = HAlignType.center; +// globalStyle1.vAlign = VAlignType.center; +// globalStyle1.borders.bottom.lineStyle = LineStyle.thin; +// //globalStyle1.borders.bottom.color = '#829193'; +// globalStyle1.numberFormat = '0.00'; + +// final List bytes = workbook.saveSync(); + +// print("hii"); + +// if (kIsWeb) { +// AnchorElement( +// href: +// 'data:application/octet-stream;charset=utf-16le;base64,${base64.encode(bytes)}') +// ..setAttribute('download', 'Output.xlsx') +// ..click(); +// } else { +// // final String path = (await getApplicationDocumentsDirectory()).path; +// //final directory = await getExternalStorageDirectory(); + +// Directory? directory = Platform.isAndroid +// ? await getExternalStorageDirectory() +// : await getApplicationDocumentsDirectory(); + +// final path = directory!.path; + +// final String filename = +// Platform.isWindows ? '$path\\Output.xlsx' : '$path/Output.xlsx'; +// // final String filename = '$path/Output.xlsx'; +// final File file = File(filename); +// await file.writeAsBytes(bytes, flush: true); +// OpenFile.open(filename); +// } +// } + +// void gethcpdata() { +// // final data = Provider.of(context, listen: false); +// } +// } + +// // class HiveFunctions { +// // // String userHiveBox="User Box"; +// // // Box which will use to store the things +// // static final _contactbox = Hive.box("mycontact"); +// // static var box1 = Hive.box('checkvalue'); + +// // static createUser(Map data) { +// // _contactbox.add(data); +// // } + +// // static List getAllUsers() { +// // final data = _contactbox.keys.map((key) { +// // final value = _contactbox.get(key); +// // print("Checking_Name : $value"); +// // return { +// // "name": value["name"], +// // "org": value["org"], +// // "adrr": value["adrr"], +// // "phone": value["phone"], +// // "Pphone": value["Pphone"], +// // "email": value["email"], +// // "affno": value["affno"], +// // "eveno": value["eveno"], +// // "pubno": value["pubno"], +// // "trailno": value["trailno"] +// // }; +// // }).toList(); + +// // return data.reversed.toList(); +// // } + +// // static List getindexUsers() { +// // final data = _contactbox.keys.map((key) { +// // final value = _contactbox.get(key); +// // print("Checking_Name : $value"); +// // return { +// // "name": value["name"], +// // "org": value["org"], +// // "adrr": value["adrr"], +// // "phone": value["phone"], +// // "Pphone": value["Pphone"], +// // "email": value["email"], +// // "affno": value["affno"], +// // "eveno": value["eveno"], +// // "pubno": value["pubno"], +// // "trailno": value["trailno"] +// // }; +// // }).toList(); + +// // return data.reversed.toList(); +// // } + +// // static addno(int selectedRowId) { +// // // final box1 = Hive.box("mycontact"); + +// // print("SelectedStoredvaluessss: $selectedRowId"); + +// // box1.add(selectedRowId); +// // } + +// // static getno() { +// // // final box1 = Hive.box("mycontact"); + +// // return box1.values; +// // } +// // } + +// class _Row { +// _Row({ +// required this.identifier, +// required this.valueA, +// required this.valueC, +// required this.valueD, +// required this.valueE, +// required this.valueF, +// required this.valueG, +// required this.valueH, +// required this.valueI, +// required this.selected, +// this.org, +// this.mno, +// this.smry, +// this.lin, +// this.suffix, +// this.spl, +// this.sub_spl, +// this.addr, // Add selected parameter +// }); + +// final int identifier; +// final String valueA; +// final String valueC; +// final String valueD; +// final String valueE; +// final String valueF; +// final String valueG; +// final String valueH; +// final String valueI; +// bool selected = false; +// String? org; +// String? mno; +// String? smry; +// String? lin; +// String? suffix; +// String? spl; +// String? sub_spl; +// String? addr; +// } + +// class _DataSource extends DataTableSource { +// final BuildContext context; +// // List<_Row> _rows = []; +// // late List _selectedRowsIndexes = []; // List to track selected rows +// final List _selectedRowIds = []; + +// List list = []; + +// _DataSource(this.context) { +// render_hcpdata(); +// // _rows = <_Row>[ +// // for (int i = 0; i < 20; i++) +// // _Row( +// // i, 'Gerosa, Gino', 'Tier1', '1', '0', '0', '0', '0', '0', check(i)), +// // ]; +// // } +// } + +// List getSelectedRowIds() { +// return _selectedRowIds; // Return a copy to prevent direct modification +// } + +// int _selectedCount = 0; + +// @override +// DataRow? getRow(int index) { +// assert(index >= 0); +// if (index >= _rows.length) return null; +// final row = _rows[index]; +// return DataRow.byIndex( +// index: index, +// selected: row.selected, +// onSelectChanged: (value) { +// if (row.selected != value) { +// // _selectedCount += value! ? 1 : -1; +// // assert(_selectedCount >= 0); +// row.selected = value!; + +// if (value) { +// print("Selected"); +// _selectedRowIds.add(row.identifier); // Add the row ID to the list +// print("Selected_selectedRowIds :$_selectedRowIds"); +// } else { +// _selectedRowIds +// .remove(row.identifier); // Remove the row ID from the list +// } +// notifyListeners(); + +// print("Selectedddd_is $value"); +// print("Selectedddd_value ${row.valueA}"); +// } +// }, +// cells: [ +// DataCell( +// Text(row.valueA), +// onTap: () { +// print("hiii Data cell tap ${row}"); + +// // Navigator.push( +// // context, MaterialPageRoute(builder: (context) => Profile())); +// }, +// ), +// DataCell(Text(row.valueC)), +// DataCell(Text(row.valueD.toString())), +// DataCell(Text(row.valueE)), +// DataCell(Text(row.valueF)), +// DataCell(Text(row.valueG)), +// DataCell(Text(row.valueH)), +// DataCell(Text(row.valueI)), +// ], +// ); +// } + +// @override +// int get rowCount => _rows.length; + +// @override +// bool get isRowCountApproximate => false; + +// @override +// int get selectedRowCount => _selectedCount; + +// bool check(int i) { +// // print("I_am_i: $i"); +// print("_selectedRowIds_i: ${HiveFunctions.getno()}"); + +// //HiveFunctions.getno(); +// if (HiveFunctions.getno().contains(i)) { +// print("Iam_in: $i"); +// return true; +// } + +// return false; +// } + +// Future render_hcpdata() async { +// NetworkConnectivity networkConnectivity = NetworkConnectivity(); +// bool isOnline = await networkConnectivity.isInternetAvailable(); + +// print("RankingPage_isOnline: $isOnline"); + +// if (isOnline) { +// final hcpdata = Provider.of(context, listen: false); + +// await hcpdata.getHCPProvider(); + +// final hcplist = hcpdata.list; + +// print("LookingHcpList: $hcplist"); + +// // _rows = <_Row>[ +// // for (int i = 0; i < 20; i++) +// // _Row( +// // i, 'Gerosa, Gino', 'Tier1', '1', '0', '0', '0', '0', '0', check(i)), +// // ]; + +// _rows = hcplist +// .map((e) => _Row( +// identifier: e['id'], +// valueA: e['name'], +// valueC: e['email'], +// valueD: e['rank'].toString(), +// valueE: e['score'].toString(), +// valueF: e['events_count'].toString(), +// valueG: e['affiliations_count'].toString(), +// valueH: e['publications_count'].toString(), +// valueI: '0', +// selected: check(e['id']), +// org: "Aissel", +// mno: e['phone_no'].toString(), +// smry: e['summarry'], +// lin: e['license_no'].toString(), +// suffix: e['p_suffix'], +// spl: e['speciality'], +// sub_spl: e['sub_speciality'], +// addr: e['addr'], +// )) +// .toList(); +// notifyListeners(); +// } else { +// print("get_Storeddata: ${HiveFunctions.gethcpdata()}"); + +// list = HiveFunctions.gethcpdata().toList(); +// // debugPrint(HiveFunctions.gethcpdata()); + +// // List offlinedata = HiveFunctions.gethcpdata(); +// print("offline_data_is: "); + +// print("offline_data_is: $list"); + +// _rows = list +// .map((e) => _Row( +// identifier: e['id'], +// valueA: e['name'], +// valueC: e['email'], +// valueD: e['rank'].toString(), +// valueE: e['score'].toString(), +// valueF: e['events_count'].toString(), +// valueG: e['affiliations_count'].toString(), +// valueH: e['publications_count'].toString(), +// valueI: '0', +// selected: check(e['id']), +// org: "Aissel", +// mno: e['phone_no'].toString(), +// smry: e['sumry'], +// lin: e['licno'].toString(), +// suffix: e['suffix'], +// spl: e['spl'], +// sub_spl: e['sub_sp'], +// )) +// .toList(); +// notifyListeners(); +// } +// } +// } +///////////////////////////////////////////////// +/// // import 'dart:convert'; // import 'dart:io'; // // import 'dart:js_interop'; @@ -528,6 +1657,7 @@ import 'package:syncfusion_flutter_xlsio/xlsio.dart'; import 'package:universal_html/html.dart' show AnchorElement; List<_Row> _rows = []; +bool isOnline1 = false; class Ranking extends StatefulWidget { @override @@ -542,11 +1672,27 @@ class _RankingState extends State { void initState() { super.initState(); print("hii_initState"); + setupConnectivityListener(); gethcpdata(); _dataSource = _DataSource(context); // Initialize _DataSource } + NetworkConnectivity networkConnectivity = NetworkConnectivity(); + + Future setupConnectivityListener() async { + while (true) { + bool isOnline = await networkConnectivity.isInternetAvailable(); + print('Internet available: $isOnline'); + // Perform actions based on connectivity status + await Future.delayed(Duration(seconds: 10)); + + // setState(() { + // isOnline1 = isOnline; + // }); // Example: Check every 10 seconds + } + } + @override Widget build(BuildContext context) { return SafeArea( @@ -841,73 +1987,6 @@ class _RankingState extends State { } } -// class HiveFunctions { -// // String userHiveBox="User Box"; -// // Box which will use to store the things -// static final _contactbox = Hive.box("mycontact"); -// static var box1 = Hive.box('checkvalue'); - -// static createUser(Map data) { -// _contactbox.add(data); -// } - -// static List getAllUsers() { -// final data = _contactbox.keys.map((key) { -// final value = _contactbox.get(key); -// print("Checking_Name : $value"); -// return { -// "name": value["name"], -// "org": value["org"], -// "adrr": value["adrr"], -// "phone": value["phone"], -// "Pphone": value["Pphone"], -// "email": value["email"], -// "affno": value["affno"], -// "eveno": value["eveno"], -// "pubno": value["pubno"], -// "trailno": value["trailno"] -// }; -// }).toList(); - -// return data.reversed.toList(); -// } - -// static List getindexUsers() { -// final data = _contactbox.keys.map((key) { -// final value = _contactbox.get(key); -// print("Checking_Name : $value"); -// return { -// "name": value["name"], -// "org": value["org"], -// "adrr": value["adrr"], -// "phone": value["phone"], -// "Pphone": value["Pphone"], -// "email": value["email"], -// "affno": value["affno"], -// "eveno": value["eveno"], -// "pubno": value["pubno"], -// "trailno": value["trailno"] -// }; -// }).toList(); - -// return data.reversed.toList(); -// } - -// static addno(int selectedRowId) { -// // final box1 = Hive.box("mycontact"); - -// print("SelectedStoredvaluessss: $selectedRowId"); - -// box1.add(selectedRowId); -// } - -// static getno() { -// // final box1 = Hive.box("mycontact"); - -// return box1.values; -// } -// } - class _Row { _Row({ required this.identifier, @@ -952,6 +2031,7 @@ class _Row { class _DataSource extends DataTableSource { final BuildContext context; + // List<_Row> _rows = []; // late List _selectedRowsIndexes = []; // List to track selected rows final List _selectedRowIds = []; @@ -1006,10 +2086,10 @@ class _DataSource extends DataTableSource { DataCell( Text(row.valueA), onTap: () { - print("hiii Data cell tap ${row.valueA}"); + print("hiii Data cell tap ${row}"); - Navigator.push( - context, MaterialPageRoute(builder: (context) => Profile())); + // Navigator.push( + // context, MaterialPageRoute(builder: (context) => Profile())); }, ), DataCell(Text(row.valueC)), @@ -1047,8 +2127,10 @@ class _DataSource extends DataTableSource { Future render_hcpdata() async { NetworkConnectivity networkConnectivity = NetworkConnectivity(); - bool isOnline = await networkConnectivity.isInternetAvailable(); + // bool isOnline = await networkConnectivity.isInternetAvailable(); + bool isOnline = await networkConnectivity.isInternetAvailable(); + print('Internet available: $isOnline'); print("RankingPage_isOnline: $isOnline"); if (isOnline) { @@ -1124,4 +2206,10 @@ class _DataSource extends DataTableSource { notifyListeners(); } } + + @override + void dispose() { + // TODO: implement dispose + super.dispose(); + } }