|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hmg_nurses/config/routes.dart';
|
|
|
|
|
import 'package:hmg_nurses/main.dart';
|
|
|
|
|
import 'package:hmg_nurses/provider/dashboard_provider_model.dart';
|
|
|
|
|
import 'package:hmg_nurses/ui/dashboard/widgets/home_patient_card.dart';
|
|
|
|
|
import 'package:hmg_nurses/widgets/icons_app/doctor_app_icons.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
class DashboardPage extends StatefulWidget {
|
|
|
|
|
@override
|
|
|
|
|
State<DashboardPage> createState() => _DashboardPageState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _DashboardPageState extends State<DashboardPage> {
|
|
|
|
|
late DashboardProviderModel provider;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
provider = Provider.of<DashboardProviderModel>(navigatorKey.currentContext!);
|
|
|
|
|
provider.getDocProfile();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: AppBar(
|
|
|
|
|
actions: [
|
|
|
|
|
IconButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
appState.isLogged = false;
|
|
|
|
|
Navigator.pushReplacementNamed(context, AppRoutes.login, arguments: false);
|
|
|
|
|
},
|
|
|
|
|
icon: const Icon(
|
|
|
|
|
Icons.logout,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
body: Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
showHomeButton(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget showHomeButton() {
|
|
|
|
|
return Container(
|
|
|
|
|
width: 120,
|
|
|
|
|
height: 120,
|
|
|
|
|
child: HomePatientCard(
|
|
|
|
|
gradient: const LinearGradient(
|
|
|
|
|
begin: Alignment(-1.0, -2.0),
|
|
|
|
|
end: Alignment(1.0, 2.0),
|
|
|
|
|
colors: [
|
|
|
|
|
Colors.red,
|
|
|
|
|
Color(0xFFAD3B3B),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
backgroundIconColor: Colors.white12,
|
|
|
|
|
cardIcon: DoctorApp.search,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
text: "Search Patient",
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.searchPatient);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|