UI_Modifications

This commit is contained in:
poojakhatawate 2024-07-05 14:18:29 +05:30
parent 3c828dc74f
commit 7647e4737f
27 changed files with 9594 additions and 4689 deletions

View File

@ -2,4 +2,7 @@ import 'dart:ui';
class Constants { class Constants {
static Color k2color = Color.fromARGB(255, 0, 71, 132); static Color k2color = Color.fromARGB(255, 0, 71, 132);
//static const url = "http://192.168.172.50:8082/api";
static const url = 'http://192.168.2.143:8081/api';
} }

View File

@ -23,6 +23,7 @@ class _Text1State extends State<Text1> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Text( return Text(
widget.title, widget.title,
softWrap: true,
style: TextStyle( style: TextStyle(
color: widget.txtcolor, color: widget.txtcolor,
fontSize: widget.txtfont, fontSize: widget.txtfont,

View File

@ -1,5 +1,9 @@
import 'package:discover_module/provider_class/affiliationsprovider.dart';
import 'package:discover_module/provider_class/events_provider.dart';
import 'package:discover_module/provider_class/hcp%20_provider.dart'; import 'package:discover_module/provider_class/hcp%20_provider.dart';
import 'package:discover_module/provider_class/publications_provider.dart';
import 'package:discover_module/provider_class/single_hcpprovider.dart'; import 'package:discover_module/provider_class/single_hcpprovider.dart';
import 'package:discover_module/provider_class/trials_provider.dart';
import 'package:discover_module/ui_screen/contacts.dart'; import 'package:discover_module/ui_screen/contacts.dart';
import 'package:discover_module/ui_screen/discover.dart'; import 'package:discover_module/ui_screen/discover.dart';
import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart';
@ -11,6 +15,7 @@ import 'package:discover_module/ui_screen/interactionform/repository/hive_reposi
import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart';
import 'package:discover_module/ui_screen/listview.dart'; import 'package:discover_module/ui_screen/listview.dart';
import 'package:discover_module/ui_screen/filters_menu.dart'; import 'package:discover_module/ui_screen/filters_menu.dart';
import 'package:discover_module/ui_screen/new_contacts.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
@ -61,6 +66,10 @@ Future<void> main() async {
ChangeNotifierProvider(create: (_) => ViewInteractionProvider()), ChangeNotifierProvider(create: (_) => ViewInteractionProvider()),
ChangeNotifierProvider(create: (_) => hcpProvider()), ChangeNotifierProvider(create: (_) => hcpProvider()),
ChangeNotifierProvider(create: (_) => Singlehcpdetails()), ChangeNotifierProvider(create: (_) => Singlehcpdetails()),
ChangeNotifierProvider(create: (_) => AffiliationsProvider()),
ChangeNotifierProvider(create: (_) => PublicatioProvider()),
ChangeNotifierProvider(create: (_) => EventProvider()),
ChangeNotifierProvider(create: (_) => TrialsProvider()),
//ChangeNotifierProvider(create: (_) => ConfigDataProvider()), //ChangeNotifierProvider(create: (_) => ConfigDataProvider()),
ChangeNotifierProvider<HiveDataRepository>( ChangeNotifierProvider<HiveDataRepository>(
create: (_) => HiveDataRepository( create: (_) => HiveDataRepository(
@ -171,7 +180,7 @@ class _MyHomePageState extends State<MyHomePage> {
body: TabBarView( body: TabBarView(
children: [ children: [
Center(child: Contacts()), Center(child: const Contacts1()),
Center(child: Discover(outerTabValue)), Center(child: Discover(outerTabValue)),
Center(child: DataTableDemo()), Center(child: DataTableDemo()),
], ],

View File

@ -0,0 +1,63 @@
// To parse this JSON data, do
//
// final affiliations = affiliationsFromJson(jsonString);
import 'dart:convert';
List<Affiliations> affiliationsFromJson(String str) => List<Affiliations>.from(
json.decode(str).map((x) => Affiliations.fromJson(x)));
String affiliationsToJson(List<Affiliations> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Affiliations {
int id;
int userId;
String orgName;
String dept;
String role;
String timeFrame;
String orgType;
String emgType;
dynamic createdAt;
dynamic updatedAt;
Affiliations({
required this.id,
required this.userId,
required this.orgName,
required this.dept,
required this.role,
required this.timeFrame,
required this.orgType,
required this.emgType,
required this.createdAt,
required this.updatedAt,
});
factory Affiliations.fromJson(Map<String, dynamic> json) => Affiliations(
id: json["id"],
userId: json["user_id"],
orgName: json["org_name"],
dept: json["dept"],
role: json["role"],
timeFrame: json["time_frame"],
orgType: json["org_type"],
emgType: json["emg_type"],
createdAt: json["created_at"],
updatedAt: json["updated_at"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"org_name": orgName,
"dept": dept,
"role": role,
"time_frame": timeFrame,
"org_type": orgType,
"emg_type": emgType,
"created_at": createdAt,
"updated_at": updatedAt,
};
}

View File

@ -0,0 +1,59 @@
// To parse this JSON data, do
//
// final events = eventsFromJson(jsonString);
import 'dart:convert';
List<Events> eventsFromJson(String str) =>
List<Events>.from(json.decode(str).map((x) => Events.fromJson(x)));
String eventsToJson(List<Events> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Events {
int id;
int userId;
String eventName;
String sessionType;
String topic;
String role;
DateTime? createdAt;
DateTime? updatedAt;
Events({
required this.id,
required this.userId,
required this.eventName,
required this.sessionType,
required this.topic,
required this.role,
required this.createdAt,
required this.updatedAt,
});
factory Events.fromJson(Map<String, dynamic> json) => Events(
id: json["id"],
userId: json["user_id"],
eventName: json["event_name"],
sessionType: json["session_type"],
topic: json["topic"],
role: json["role"],
createdAt: json["created_at"] == null
? null
: DateTime.parse(json["created_at"]),
updatedAt: json["updated_at"] == null
? null
: DateTime.parse(json["updated_at"]),
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"event_name": eventName,
"session_type": sessionType,
"topic": topic,
"role": role,
"created_at": createdAt?.toIso8601String(),
"updated_at": updatedAt?.toIso8601String(),
};
}

View File

@ -0,0 +1,55 @@
// To parse this JSON data, do
//
// final publications = publicationsFromJson(jsonString);
import 'dart:convert';
List<Publications> publicationsFromJson(String str) => List<Publications>.from(
json.decode(str).map((x) => Publications.fromJson(x)));
String publicationsToJson(List<Publications> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Publications {
int id;
int userId;
String articalTitle;
String journalName;
DateTime date;
String author;
dynamic createdAt;
dynamic updatedAt;
Publications({
required this.id,
required this.userId,
required this.articalTitle,
required this.journalName,
required this.date,
required this.author,
required this.createdAt,
required this.updatedAt,
});
factory Publications.fromJson(Map<String, dynamic> json) => Publications(
id: json["id"],
userId: json["user_id"],
articalTitle: json["artical_title"],
journalName: json["journal_name"],
date: DateTime.parse(json["date"]),
author: json["author"],
createdAt: json["created_at"],
updatedAt: json["updated_at"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"artical_title": articalTitle,
"journal_name": journalName,
"date": date.toIso8601String(),
"author": author,
"created_at": createdAt,
"updated_at": updatedAt,
};
}

View File

@ -0,0 +1,67 @@
// To parse this JSON data, do
//
// final trials = trialsFromJson(jsonString);
import 'dart:convert';
List<Trials> trialsFromJson(String str) =>
List<Trials>.from(json.decode(str).map((x) => Trials.fromJson(x)));
String trialsToJson(List<Trials> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Trials {
int id;
int userId;
String ctId;
String trialName;
String status;
String sponsors;
String condition;
String intervention;
String phase;
dynamic createdAt;
dynamic updatedAt;
Trials({
required this.id,
required this.userId,
required this.ctId,
required this.trialName,
required this.status,
required this.sponsors,
required this.condition,
required this.intervention,
required this.phase,
required this.createdAt,
required this.updatedAt,
});
factory Trials.fromJson(Map<String, dynamic> json) => Trials(
id: json["id"],
userId: json["user_id"],
ctId: json["ct_id"],
trialName: json["trial_name"],
status: json["status"],
sponsors: json["sponsors"],
condition: json["condition"],
intervention: json["intervention"],
phase: json["phase"],
createdAt: json["created_at"],
updatedAt: json["updated_at"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"ct_id": ctId,
"trial_name": trialName,
"status": status,
"sponsors": sponsors,
"condition": condition,
"intervention": intervention,
"phase": phase,
"created_at": createdAt,
"updated_at": updatedAt,
};
}

View File

@ -0,0 +1,31 @@
import 'package:discover_module/model_class/affiliations.dart';
import 'package:discover_module/service.dart/service.dart';
import 'package:flutter/cupertino.dart';
class AffiliationsProvider extends ChangeNotifier {
final affapi = Callapi();
List affiliations1 = [];
List allaffiliations1 = [];
List get adddta => affiliations1;
List get affiliationsAll => allaffiliations1;
getAffiliationsdata() async {
print("Affiliations_is: ");
final affdata = await affapi.getaffiliationsdata();
print("Affiliations_is after:$affdata ");
affiliations1 = affdata;
notifyListeners();
}
getAllAffiliationsdata() async {
print("Affiliations_is: ");
final affdata = await affapi.getallaffiliationsdata();
print("Affiliations_is after:$affdata ");
allaffiliations1 = affdata;
notifyListeners();
}
}

View File

@ -0,0 +1,28 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:flutter/cupertino.dart';
class EventProvider extends ChangeNotifier {
final apicall = Callapi();
List eventlist = [];
List get EventsList => eventlist;
List alleventlist = [];
List get allEventsList => alleventlist;
geteventdata() async {
final events = await apicall.geteventsdata();
eventlist = events;
notifyListeners();
}
allgeteventdata() async {
final events = await apicall.allgeteventsdata();
alleventlist = events;
notifyListeners();
}
}

View File

@ -0,0 +1,25 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:flutter/cupertino.dart';
class PublicatioProvider extends ChangeNotifier {
final apicall = Callapi();
List publist = [];
List get publicationlist => publist;
List allpublist = [];
List get allpublicationlist => allpublist;
publicatininfo() async {
final publication_result = await apicall.getpublicationsdata();
publist = publication_result;
notifyListeners();
}
allpublicatininfo() async {
final publication_result = await apicall.getallpublicationsdata();
allpublist = publication_result;
notifyListeners();
}
}

View File

@ -0,0 +1,16 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:flutter/cupertino.dart';
class TrialsProvider extends ChangeNotifier {
final callapi = Callapi();
List trials = [];
List get trialsinfo => trials;
trialsdata() async {
final jsonres = await callapi.getalltrials();
trials = jsonres;
notifyListeners();
}
}

View File

@ -1,14 +1,20 @@
import 'dart:convert'; import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:discover_module/constants.dart';
import 'package:discover_module/hive_fun.dart'; import 'package:discover_module/hive_fun.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
const String curl = Constants.url;
class Callapi { class Callapi {
getallhcpdata() async { getallhcpdata() async {
// const url = 'http://127.0.0.1:8000/api/users'; // const url = 'http://127.0.0.1:8000/api/users';
//const url = 'http://192.168.2.143:8080/api/users'; // const url = 'http://192.168.2.143:8082/api/users';
const url = 'http://192.168.172.50:8080/api/users'; // const url = 'http://192.168.172.50:8082/api/users';
// const url = 'http://192.168.172.50:8081/api/users';
const url = '$curl/users';
final response = await Dio().get(url); final response = await Dio().get(url);
@ -47,8 +53,9 @@ class Callapi {
getsinglehcpdata() async { getsinglehcpdata() async {
// const url = 'http://127.0.0.1:8000/api/users/1'; // const url = 'http://127.0.0.1:8000/api/users/1';
// const url = 'http://192.168.2.143:8080/api/users/1'; // const url = 'http://192.168.2.143:8082/api/users/1';
const url = 'http://192.168.172.50:8080/api/users/1'; // const url = 'http://192.168.172.50:8081/api/users/1';
const url = '$curl/users/1';
final responsehcp = await Dio().post(url); final responsehcp = await Dio().post(url);
final jsonresponse1 = responsehcp.data; final jsonresponse1 = responsehcp.data;
@ -58,4 +65,91 @@ class Callapi {
print("Singlejsondata : ${jsonresponse1}"); print("Singlejsondata : ${jsonresponse1}");
return jsonresponse1; return jsonresponse1;
} }
getaffiliationsdata() async {
// const url = 'http://192.168.2.143:8082/api/affiliations';
// const url = 'http://192.168.172.50:8081/api/affiliations';
const url = '$curl/affiliations';
final affiliationres = await Dio().get(url);
final jsonresponse2 = affiliationres.data.take(2).toList();
return jsonresponse2;
}
getpublicationsdata() async {
//const url = 'http://192.168.2.143:8082/api/publications';
// const url = 'http://192.168.172.50:8081/api/publications';
const url = '$curl/publications';
final affiliationres = await Dio().get(url);
final jsonresponse2 = affiliationres.data.take(2).toList();
return jsonresponse2;
}
geteventsdata() async {
// const url = 'http://192.168.2.143:8082/api/events';
// const url = 'http://192.168.172.50:8081/api/events';
const url = '$curl/events';
final events = await Dio().get(url);
// final jsonEvent = events.data;
final jsonEvent = events.data;
print("All_event: $jsonEvent");
final jsonEvent1 = events.data.take(2).toList();
print("only few : $jsonEvent1");
return jsonEvent1;
}
getallaffiliationsdata() async {
// const url = 'http://192.168.2.143:8082/api/affiliations';
//const url = 'http://192.168.172.50:8081/api/affiliations';
const url = '$curl/affiliations';
final events = await Dio().get(url);
// final jsonEvent = events.data;
final jsonEvent = events.data;
print("All_event: $jsonEvent");
return jsonEvent;
}
getallpublicationsdata() async {
// const url = 'http://192.168.2.143:8082/api/publications';
//const url = 'http://192.168.172.50:8081/api/publications';
const url = '$curl/publications';
final events = await Dio().get(url);
// final jsonEvent = events.data;
final jsonEvent = events.data;
print("All_event: $jsonEvent");
return jsonEvent;
}
allgeteventsdata() async {
//const url = 'http://192.168.2.143:8082/api/events';
//const url = 'http://192.168.172.50:8081/api/events';
const url = '$curl/events';
final events = await Dio().get(url);
// final jsonEvent = events.data;
final jsonEvent = events.data;
print("All_event: $jsonEvent");
return jsonEvent;
}
getalltrials() async {
// const url = 'http://192.168.2.143:8082/api/trails';
const url = '$curl/trails';
final trials = await Dio().get(url);
final jsontrials = trials.data;
print("All_trialsss: $jsontrials");
return jsontrials;
}
} }

View File

@ -0,0 +1,99 @@
import 'package:discover_module/provider_class/affiliationsprovider.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class AffiliationsData extends StatefulWidget {
const AffiliationsData({super.key});
@override
State<AffiliationsData> createState() => _AffiliationsDataState();
}
class _AffiliationsDataState extends State<AffiliationsData> {
List hcpaffiliations = [];
@override
void initState() {
// TODO: implement initState
super.initState();
affdata();
}
affdata() async {
final affprovider =
Provider.of<AffiliationsProvider>(context, listen: false);
await affprovider.getAllAffiliationsdata();
final affdata = affprovider.affiliationsAll;
setState(() {
hcpaffiliations = affdata;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Affiliations'),
),
body: Scrollbar(
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Container(
constraints:
BoxConstraints(minWidth: MediaQuery.of(context).size.width),
color: Colors.white,
child: DataTable(
columns: const [
DataColumn(label: Expanded(child: Text('sl no'))),
DataColumn(
label: Expanded(
child: Text('Organization Name'),
)),
DataColumn(
label:
Expanded(child: Text('Department', softWrap: true))),
DataColumn(
label: Expanded(child: Text('Role', softWrap: true))),
DataColumn(
label:
Expanded(child: Text('Time Frame', softWrap: true))),
DataColumn(
label: Expanded(child: Text('Org Type', softWrap: true))),
DataColumn(
label: Expanded(child: Text('Eng Type', softWrap: true))),
// Add more columns as needed
],
rows: List.generate(
hcpaffiliations.length,
(index) => DataRow(
cells: [
DataCell(Text(hcpaffiliations[index]['id'].toString(),
softWrap: true)),
DataCell(Text(
hcpaffiliations[index]['org_name'].toString(),
softWrap: true)),
DataCell(Text(hcpaffiliations[index]['dept'].toString(),
softWrap: true)),
DataCell(Text(hcpaffiliations[index]['role'].toString(),
softWrap: true)),
DataCell(Text(
hcpaffiliations[index]['time_frame'].toString(),
softWrap: true)),
DataCell(Text(
hcpaffiliations[index]['org_type'].toString(),
softWrap: true)),
DataCell(Text(
hcpaffiliations[index]['emg_type'].toString(),
softWrap: true)),
// Add more DataCells as needed
],
),
),
),
),
),
));
}
}

View File

@ -285,6 +285,7 @@
import 'package:discover_module/provider_class/hcp%20_provider.dart'; import 'package:discover_module/provider_class/hcp%20_provider.dart';
import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart'; import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart';
import 'package:discover_module/ui_screen/new_profile.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_profile_picture/flutter_profile_picture.dart'; import 'package:flutter_profile_picture/flutter_profile_picture.dart';
@ -417,20 +418,34 @@ class _ContactsState extends State<Contacts> {
var data = value.list[index]; var data = value.list[index];
return ListTile( return ListTile(
onTap: () { onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => Profile(
// text: data,
// ),
// ),
// );
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => Profile( builder: (_) =>
text: data, NewProfile(text: data)));
),
),
);
}, },
leading: ProfilePicture( leading: data["img_path"] == null
name: data["name"], ? ProfilePicture(
radius: 20, name: data["name"],
fontsize: 12, radius: 20,
), fontsize: 12,
)
: ClipOval(
child: SizedBox.fromSize(
size: Size.fromRadius(20),
child: Image.network(data["img_path"],
fit: BoxFit.cover),
),
),
title: Text( title: Text(
data["name"], data["name"],
style: TextStyle( style: TextStyle(

View File

@ -0,0 +1,91 @@
import 'package:discover_module/provider_class/affiliationsprovider.dart';
import 'package:discover_module/provider_class/events_provider.dart';
import 'package:discover_module/provider_class/publications_provider.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class EventsData extends StatefulWidget {
const EventsData({super.key});
@override
State<EventsData> createState() => _EventsDataState();
}
class _EventsDataState extends State<EventsData> {
List hcppublication = [];
@override
void initState() {
// TODO: implement initState
super.initState();
affdata();
}
affdata() async {
final affprovider = Provider.of<EventProvider>(context, listen: false);
await affprovider.allgeteventdata();
final affdata = affprovider.allEventsList;
setState(() {
hcppublication = affdata;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Publications'),
),
body: Scrollbar(
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Container(
constraints:
BoxConstraints(minWidth: MediaQuery.of(context).size.width),
child: DataTable(
columns: const [
DataColumn(
label: Expanded(child: Text('sl no', softWrap: true))),
DataColumn(
label: Expanded(
child: Text('Event Name', softWrap: true),
)),
DataColumn(
label: Expanded(
child: Text('Session Type', softWrap: true))),
DataColumn(
label: Expanded(child: Text('Topic', softWrap: true))),
DataColumn(
label: Expanded(child: Text('Role', softWrap: true))),
// Add more columns as needed
],
rows: List.generate(
hcppublication.length,
(index) => DataRow(
cells: [
DataCell(Text(hcppublication[index]['id'].toString(),
softWrap: true)),
DataCell(Text(
hcppublication[index]['event_name'].toString(),
softWrap: true)),
DataCell(Text(
hcppublication[index]['session_type'].toString(),
softWrap: true)),
DataCell(Text(hcppublication[index]['topic'].toString(),
softWrap: true)),
DataCell(Text(hcppublication[index]['role'].toString(),
softWrap: true)),
// Add more DataCells as needed
],
),
),
),
),
),
));
}
}

View File

@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:dio/dio.dart';
class NetworkConnectivity { class NetworkConnectivity {
// Future<bool> isInternetAvailable() async { // Future<bool> isInternetAvailable() async {
@ -14,9 +15,13 @@ class NetworkConnectivity {
return false; return false;
} else { } else {
try { try {
final result = await InternetAddress.lookup('google.com'); // final result = await InternetAddress.lookup('google.com');
if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) { final result = await Dio().get('www.google.com');
if (result.statusCode == 200) {
// if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) {
return true; return true;
//}
} }
return false; return false;
} on SocketException catch (_) { } on SocketException catch (_) {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -54,12 +54,14 @@ class InteractionTextField extends StatelessWidget {
], ],
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
// contentPadding: EdgeInsets.all(11.0), // contentPadding: const EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 18,
// ),
contentPadding: EdgeInsets.all(13.0),
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
suffixIcon: suffixIcon, suffixIcon: suffixIcon,
hintText: hintText, hintText: hintText,
), ),

View File

@ -0,0 +1,236 @@
import 'package:discover_module/provider_class/hcp%20_provider.dart';
import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart';
import 'package:discover_module/ui_screen/new_profile.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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 Contacts1 extends StatefulWidget {
const Contacts1({Key? key}) : super(key: key);
@override
State<Contacts1> createState() => _Contacts1State();
}
class _Contacts1State extends State<Contacts1> {
final _contactBox = Hive.box("mycontact");
bool _switchValue = false;
bool isOnline2 = true;
@override
void initState() {
super.initState();
setupConnectivityListener();
getCall();
}
Future<void> 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<hcpProvider>(context, listen: false).getHCPProvider();
}
@override
Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(statusBarColor: Color.fromARGB(255, 0, 71, 132)));
return SafeArea(
child: Scaffold(
body: Consumer<hcpProvider>(
builder: (context, value, child) {
return Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
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,
),
),
),
),
Row(
mainAxisSize: MainAxisSize.min,
children: [
_switchValue
? const Text(
'All',
style: TextStyle(
fontSize: 12,
decoration: TextDecoration.lineThrough,
decorationThickness: 0.85,
),
)
: const Text(
'All',
style: TextStyle(
fontSize: 12,
),
),
CupertinoSwitch(
activeColor: Color.fromARGB(255, 0, 71, 132),
value: _switchValue,
onChanged: (value) {
setState(() {
_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 = value.list[index];
return Column(
children: [
ListTile(
onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => Profile(
// text: data,
// ),
// ),
// );
Navigator.push(
context,
MaterialPageRoute(
builder: (_) =>
NewProfile(text: data)));
},
leading: data["img_path"] == null
? ProfilePicture(
name: data["name"],
radius: 20,
fontsize: 12,
)
: ClipOval(
child: SizedBox.fromSize(
size: Size.fromRadius(20),
child: Image.network(
data["img_path"],
fit: BoxFit.cover),
),
),
trailing: Text("Added by\nPooja k"),
title: Text(
"${data["name"]}",
style: const TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
),
subtitle: Text(
"${data["speciality"]}\n${data["addr"]},",
style: const TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.normal,
),
),
),
Divider(),
],
);
},
),
)
: 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,
),
),
);
},
),
),
],
);
},
),
),
);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,296 @@
// 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/model/save_interaction.dart';
// import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart';
// import 'package:flutter/cupertino.dart';
// import 'package:flutter/material.dart';
// import 'package:flutter/widgets.dart';
// import 'package:provider/provider.dart';
// class FormList extends StatefulWidget {
// const FormList({super.key});
// @override
// State<FormList> createState() => _FormListState();
// }
// class _FormListState extends State<FormList> {
// List<SaveInteraction> savedList = [];
// @override
// void initState() {
// WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
// // if (!mytimer!.isActive) {
// // activateTimer();
// // }
// print("interactionListt");
// init();
// });
// super.initState();
// }
// init() async {
// print("init");
// await Provider.of<InteractionProvider>(context, listen: false)
// .initConfigData();
// await Provider.of<InteractionProvider>(context, listen: false).getRecords();
// setState(() {});
// }
// Future<int> getCount(String form, InteractionProvider provider) async {
// await provider.getRecords();
// return provider.savedList.where((element) => element.form == form).length;
// }
// @override
// Widget build(BuildContext context) {
// return Consumer<InteractionProvider>(
// builder: (BuildContext context, provider, Widget? child) {
// return SafeArea(
// child: Scaffold(
// appBar: AppBar(
// title: Text("Form List"),
// ),
// body: ListView.builder(
// itemCount: provider.intConfigDataList.length,
// cacheExtent:
// double.parse(provider.intConfigDataList.length.toString()),
// itemBuilder: (context, index) {
// return Column(
// children: [
// ListTile(
// title: const Text(
// "Add My Event",
// style: TextStyle(fontSize: 18.0),
// ),
// onTap: () async {
// final ConfigDataProvider configDataProvider =
// ConfigDataProvider();
// await configDataProvider.initConfigUIData123();
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) =>
// const InteractionListScreen()));
// // Navigator.push(context,
// // MaterialPageRoute(builder: (context) => AddEventScreen()));
// },
// trailing: const Icon(Icons.arrow_forward_ios),
// ),
// Divider(),
// // ListTile(
// // title: const Text(
// // "Interaction",
// // style: TextStyle(fontSize: 18.0),
// // ),
// // 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()));
// // },
// // trailing: const Icon(Icons.arrow_forward_ios),
// // ),
// ListTile(
// title: const Text(
// "Interaction",
// style: TextStyle(fontSize: 18.0),
// ),
// onTap: () async {
// print(
// "I am Interaction:${index}, ${provider.intConfigDataList[index].name}");
// // final ConfigDataProvider configDataProvider =
// // ConfigDataProvider();
// // await configDataProvider.initConfigUIData();
// // // Navigator.push(context, MaterialPageRoute(builder: (context)))=> InteractionScreen();
// // Navigator.push(
// // context,
// // MaterialPageRoute(
// // builder: (context) => InteractionListScreen()));
// if (provider.intConfigDataList.length == 1) {
// setState(() {});
// final ConfigDataProvider configDataProvider =
// ConfigDataProvider();
// await configDataProvider.initConfigUIData();
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (BuildContext context) =>
// InteractionScreen(
// index: index,
// form: provider
// .intConfigDataList[index].name,
// )));
// } else {
// final ConfigDataProvider configDataProvider =
// ConfigDataProvider();
// await configDataProvider.initConfigUIData();
// // Navigator.push(context, MaterialPageRoute(builder: (context)))=> InteractionScreen();
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) =>
// InteractionListScreen()));
// }
// },
// trailing: const Icon(Icons.arrow_forward_ios),
// ),
// const Divider(),
// ListTile(
// title: const Text(
// "New Medical Insight",
// style: TextStyle(fontSize: 18.0),
// ),
// onTap: () async {
// final ConfigDataProvider configDataProvider =
// ConfigDataProvider();
// await configDataProvider.initConfigUIDataMedical();
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) =>
// const InteractionListScreen()));
// },
// trailing: Icon(Icons.arrow_forward_ios),
// ),
// Divider(),
// ListTile(
// title: const Text(
// "Engagement",
// style: TextStyle(fontSize: 18.0),
// ),
// onTap: () async {
// final ConfigDataProvider configDataProvider =
// ConfigDataProvider();
// await configDataProvider.initConfigUIDataEng();
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) =>
// const InteractionListScreen()));
// },
// trailing: const Icon(Icons.arrow_forward_ios),
// ),
// Divider(),
// ListTile(
// title: Row(
// children: [
// Text(
// provider.intConfigDataList[index].name,
// ),
// const SizedBox(
// width: 20,
// ),
// IconButton(
// onPressed: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (BuildContext context) =>
// InteractionScreen(
// index: index,
// form: provider
// .intConfigDataList[index].name,
// )));
// },
// icon: const Icon(
// Icons.arrow_circle_right_outlined,
// size: 30,
// color: Color.fromARGB(255, 8, 39, 92),
// ),
// ),
// ],
// ),
// trailing: provider.savedList.indexWhere((element) =>
// element.form ==
// provider.intConfigDataList[index].name) !=
// -1
// ? InkWell(
// onTap: () {
// print("inwesm Screenindex $index");
// if (getCount(
// provider.intConfigDataList[index].name,
// provider) !=
// 0) {
// provider.savedList
// .where((element) =>
// element.form ==
// provider
// .intConfigDataList[index].name)
// .toList();
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (BuildContext context) =>
// SavedFormListScreen(
// formname: provider
// .intConfigDataList[index]
// .name,
// )));
// }
// },
// child: FittedBox(
// fit: BoxFit.scaleDown,
// child: Text(
// "${provider.savedList.where((element) => element.form == provider.intConfigDataList[index].name).length} record(s) saved",
// style: TextStyle(
// // fontSize: isTablet ? 18.0 : 14,
// fontSize: 18.0,
// color: Colors.blue.shade900),
// ),
// ),
// )
// : const SizedBox.shrink(),
// onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (BuildContext context) =>
// InteractionScreen(
// index: index,
// form: provider
// .intConfigDataList[index].name,
// )));
// },
// ),
// const Divider(),
// ],
// );
// }),
// ),
// );
// });
// }
// }
import 'package:discover_module/ui_screen/interactionform/configprovider.dart'; import 'package:discover_module/ui_screen/interactionform/configprovider.dart';
import 'package:discover_module/ui_screen/interactionform/interactionlistscreen.dart'; import 'package:discover_module/ui_screen/interactionform/interactionlistscreen.dart';
import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart';
class FormList extends StatefulWidget { class FormList extends StatefulWidget {
const FormList({super.key}); const FormList({super.key});
@ -12,6 +300,23 @@ class FormList extends StatefulWidget {
} }
class _FormListState extends State<FormList> { class _FormListState extends State<FormList> {
var formdata;
@override
void initState() {
// TODO: implement initState
super.initState();
idata();
}
idata() {
var iprovider = Provider.of<InteractionProvider>(context, listen: false);
setState(() {
formdata = iprovider.intConfigDataList;
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SafeArea( return SafeArea(
@ -41,6 +346,26 @@ class _FormListState extends State<FormList> {
trailing: const Icon(Icons.arrow_forward_ios), trailing: const Icon(Icons.arrow_forward_ios),
), ),
Divider(), Divider(),
// ListTile(
// title: const Text(
// "Interaction",
// style: TextStyle(fontSize: 18.0),
// ),
// 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()));
// },
// trailing: const Icon(Icons.arrow_forward_ios),
// ),
ListTile( ListTile(
title: const Text( title: const Text(
"Interaction", "Interaction",
@ -48,6 +373,7 @@ class _FormListState extends State<FormList> {
), ),
onTap: () async { onTap: () async {
print("I am Interaction"); print("I am Interaction");
final ConfigDataProvider configDataProvider = final ConfigDataProvider configDataProvider =
ConfigDataProvider(); ConfigDataProvider();

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,91 @@
import 'package:discover_module/provider_class/affiliationsprovider.dart';
import 'package:discover_module/provider_class/publications_provider.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class PublicationsData extends StatefulWidget {
const PublicationsData({super.key});
@override
State<PublicationsData> createState() => _PublicationsDataState();
}
class _PublicationsDataState extends State<PublicationsData> {
List hcppublication = [];
@override
void initState() {
// TODO: implement initState
super.initState();
affdata();
}
affdata() async {
final affprovider = Provider.of<PublicatioProvider>(context, listen: false);
await affprovider.allpublicatininfo();
final affdata = affprovider.allpublicationlist;
setState(() {
hcppublication = affdata;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Publications'),
),
body: Scrollbar(
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Container(
constraints:
BoxConstraints(minWidth: MediaQuery.of(context).size.width),
color: Colors.white,
child: DataTable(
columns: const [
DataColumn(
label: Expanded(child: Text('sl no', softWrap: true))),
DataColumn(
label: Expanded(
child: Text('Artical Title', softWrap: true),
)),
DataColumn(
label: Expanded(
child: Text('Journal Name', softWrap: true))),
DataColumn(
label: Expanded(child: Text('Date', softWrap: true))),
DataColumn(
label: Expanded(child: Text('Authors', softWrap: true))),
// Add more columns as needed
],
rows: List.generate(
hcppublication.length,
(index) => DataRow(
cells: [
DataCell(Text(hcppublication[index]['id'].toString(),
softWrap: true)),
DataCell(Text(
hcppublication[index]['artical_title'].toString(),
softWrap: true)),
DataCell(Text(
hcppublication[index]['journal_name'].toString(),
softWrap: true)),
DataCell(Text(hcppublication[index]['date'].toString(),
softWrap: true)),
DataCell(Text(hcppublication[index]['author'].toString(),
softWrap: true)),
// Add more DataCells as needed
],
),
),
),
),
),
));
}
}

View File

@ -241,6 +241,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.6" version: "2.3.6"
data_table_2:
dependency: "direct main"
description:
name: data_table_2
sha256: f02ec9b24f44420816a87370ff4f4e533e15b274f6267e4c9a88a585ad1a0473
url: "https://pub.dev"
source: hosted
version: "2.5.15"
dbus: dbus:
dependency: transitive dependency: transitive
description: description:
@ -289,6 +297,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.5" version: "2.0.5"
expandable:
dependency: "direct main"
description:
name: expandable
sha256: "9604d612d4d1146dafa96c6d8eec9c2ff0994658d6d09fed720ab788c7f5afc2"
url: "https://pub.dev"
source: hosted
version: "5.0.1"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:

View File

@ -59,6 +59,9 @@ dependencies:
hive_generator: ^2.0.1 hive_generator: ^2.0.1
responsive_grid: ^2.4.4 responsive_grid: ^2.4.4
popover: ^0.3.0+1 popover: ^0.3.0+1
data_table_2: ^2.5.15
expandable: ^5.0.1
dev_dependencies: dev_dependencies: