Removed a few warnings
This commit is contained in:
parent
66c3b2fb9c
commit
01e27a1c11
@ -52,7 +52,7 @@ class Profile {
|
|||||||
String? lastName;
|
String? lastName;
|
||||||
List<String> qualifications;
|
List<String> qualifications;
|
||||||
|
|
||||||
var profileDescription;
|
String? profileDescription;
|
||||||
|
|
||||||
Profile({
|
Profile({
|
||||||
this.title,
|
this.title,
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import 'package:firebase_auth/firebase_auth.dart';
|
|||||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||||
import 'package:telemednet/data/models/doctor.dart';
|
import 'package:telemednet/data/models/doctor.dart';
|
||||||
|
|
||||||
import '../../controllers/doctor _controller.dart';
|
import '../../controllers/doctor_controller.dart';
|
||||||
|
|
||||||
class DoctorProfileService {
|
class DoctorProfileService {
|
||||||
static final String doctorProfileCollectionName =
|
static final String doctorProfileCollectionName =
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import 'package:firebase_ui_auth/firebase_ui_auth.dart';
|
import 'package:firebase_ui_auth/firebase_ui_auth.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:telemednet/screens/authentication/launch_screen.dart';
|
import 'package:telemednet/screens/authentication/launch_screen.dart';
|
||||||
import 'package:telemednet/screens/doctor_screens/Doctor_profile_screen.dart';
|
import 'package:telemednet/screens/doctor_screens/doctor_profile_screen.dart';
|
||||||
import 'package:telemednet/controller/patient_controller.dart';
|
import 'package:telemednet/controller/patient_controller.dart';
|
||||||
import 'package:telemednet/screens/doctor_screens/achivements.dart';
|
import 'package:telemednet/screens/doctor_screens/achivements.dart';
|
||||||
import 'package:telemednet/screens/doctor_screens/address_screen.dart';
|
import 'package:telemednet/screens/doctor_screens/address_screen.dart';
|
||||||
@ -16,7 +16,7 @@ import 'package:telemednet/screens/patientScreens/registrationScreens/patient_ad
|
|||||||
import 'package:telemednet/screens/patientScreens/registrationScreens/patient_family_members_screen.dart';
|
import 'package:telemednet/screens/patientScreens/registrationScreens/patient_family_members_screen.dart';
|
||||||
import 'package:telemednet/screens/patientScreens/registrationScreens/patient_registration_screen.dart';
|
import 'package:telemednet/screens/patientScreens/registrationScreens/patient_registration_screen.dart';
|
||||||
|
|
||||||
import 'controllers/doctor _controller.dart';
|
import 'controllers/doctor_controller.dart';
|
||||||
import 'screens/patientScreens/patient_landing_screen.dart';
|
import 'screens/patientScreens/patient_landing_screen.dart';
|
||||||
import 'screens/patientScreens/registrationScreens/family_members_edit_screen.dart';
|
import 'screens/patientScreens/registrationScreens/family_members_edit_screen.dart';
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ final Map<String, Widget Function(BuildContext)> routes = {
|
|||||||
// var user = ModalRoute.of(context)!.settings.arguments as TelemedUser?;
|
// var user = ModalRoute.of(context)!.settings.arguments as TelemedUser?;
|
||||||
// return UserProfileScreen(user: user);
|
// return UserProfileScreen(user: user);
|
||||||
// },
|
// },
|
||||||
RouteNames.profileUpload: (context) => ProfileUploadPage(),
|
RouteNames.profileUpload: (context) => const ProfileUploadPage(),
|
||||||
RouteNames.patientLandingScreen: (context) => const PatientLandingScreen(),
|
RouteNames.patientLandingScreen: (context) => const PatientLandingScreen(),
|
||||||
RouteNames.patientDashboardScreen: (context) =>
|
RouteNames.patientDashboardScreen: (context) =>
|
||||||
const PatientDashboardScreen(),
|
const PatientDashboardScreen(),
|
||||||
|
|||||||
@ -3,14 +3,16 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
import 'package:telemednet/route_names.dart';
|
import 'package:telemednet/route_names.dart';
|
||||||
import 'package:telemednet/screens/doctor_screens/address_screen.dart';
|
import 'package:telemednet/screens/doctor_screens/address_screen.dart';
|
||||||
import '../../controllers/doctor _controller.dart';
|
import '../../controllers/doctor_controller.dart';
|
||||||
|
|
||||||
class ProfileUploadPage extends StatefulWidget {
|
class ProfileUploadPage extends StatefulWidget {
|
||||||
|
const ProfileUploadPage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_ProfileUploadPageState createState() => _ProfileUploadPageState();
|
ProfileUploadPageState createState() => ProfileUploadPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ProfileUploadPageState extends State<ProfileUploadPage> {
|
class ProfileUploadPageState extends State<ProfileUploadPage> {
|
||||||
final DoctorController _controller = DoctorController();
|
final DoctorController _controller = DoctorController();
|
||||||
final _titleController = TextEditingController();
|
final _titleController = TextEditingController();
|
||||||
final _surnameController = TextEditingController();
|
final _surnameController = TextEditingController();
|
||||||
@ -56,7 +58,7 @@ class _ProfileUploadPageState extends State<ProfileUploadPage> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _validateAndProceed() {
|
bool validateAndProceed() {
|
||||||
_controller.profileController.updateTitle(_titleController.text);
|
_controller.profileController.updateTitle(_titleController.text);
|
||||||
_controller.profileController.updateSurName(_surnameController.text);
|
_controller.profileController.updateSurName(_surnameController.text);
|
||||||
_controller.profileController.updateLastName(_firstnameController.text);
|
_controller.profileController.updateLastName(_firstnameController.text);
|
||||||
@ -69,10 +71,10 @@ class _ProfileUploadPageState extends State<ProfileUploadPage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text('Doctor Profile'),
|
title: const Text('Doctor Profile'),
|
||||||
),
|
),
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
padding: EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@ -83,11 +85,11 @@ class _ProfileUploadPageState extends State<ProfileUploadPage> {
|
|||||||
radius: 60,
|
radius: 60,
|
||||||
backgroundImage: _image != null ? FileImage(_image!) : null,
|
backgroundImage: _image != null ? FileImage(_image!) : null,
|
||||||
child:
|
child:
|
||||||
_image == null ? Icon(Icons.camera_alt, size: 50) : null,
|
_image == null ? const Icon(Icons.camera_alt, size: 50) : null,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
_buildTextField(
|
_buildTextField(
|
||||||
'Title',
|
'Title',
|
||||||
'Mr, Ms..',
|
'Mr, Ms..',
|
||||||
@ -112,42 +114,42 @@ class _ProfileUploadPageState extends State<ProfileUploadPage> {
|
|||||||
_middlenameController,
|
_middlenameController,
|
||||||
(value) => _controller.profileController.updateMiddleName(value),
|
(value) => _controller.profileController.updateMiddleName(value),
|
||||||
),
|
),
|
||||||
SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
Text(
|
const Text(
|
||||||
'Qualifications',
|
'Qualifications',
|
||||||
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextField(
|
child: TextField(
|
||||||
controller: _qualificationController,
|
controller: _qualificationController,
|
||||||
decoration: InputDecoration(
|
decoration: const InputDecoration(
|
||||||
hintText: 'Add Qualification',
|
hintText: 'Add Qualification',
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: _addQualification,
|
onPressed: _addQualification,
|
||||||
child: Icon(Icons.add),
|
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
shape: CircleBorder(),
|
shape: const CircleBorder(),
|
||||||
padding: EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
),
|
),
|
||||||
|
child: const Icon(Icons.add),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
Wrap(
|
Wrap(
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
runSpacing: 8,
|
runSpacing: 8,
|
||||||
children: _controller.profileController.model.qualifications
|
children: _controller.profileController.model.qualifications
|
||||||
.map((qual) => Chip(
|
.map((qual) => Chip(
|
||||||
label: Text(qual),
|
label: Text(qual),
|
||||||
deleteIcon: Icon(Icons.close),
|
deleteIcon: const Icon(Icons.close),
|
||||||
onDeleted: () => _removeQualification(qual),
|
onDeleted: () => _removeQualification(qual),
|
||||||
))
|
))
|
||||||
.toList(),
|
.toList(),
|
||||||
@ -191,7 +193,7 @@ class _ProfileUploadPageState extends State<ProfileUploadPage> {
|
|||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: label,
|
labelText: label,
|
||||||
hintText: hint,
|
hintText: hint,
|
||||||
border: OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
),
|
),
|
||||||
onChanged: onChanged,
|
onChanged: onChanged,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../../controllers/doctor _controller.dart';
|
import '../../controllers/doctor_controller.dart';
|
||||||
import '../../route_names.dart';
|
import '../../route_names.dart';
|
||||||
|
|
||||||
class AchievementsScreen extends StatefulWidget {
|
class AchievementsScreen extends StatefulWidget {
|
||||||
final DoctorController controller;
|
final DoctorController controller;
|
||||||
|
|
||||||
const AchievementsScreen({
|
const AchievementsScreen({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.controller,
|
required this.controller,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<AchievementsScreen> createState() => _AchievementsScreenState();
|
State<AchievementsScreen> createState() => _AchievementsScreenState();
|
||||||
@ -146,11 +146,11 @@ class _AchievementsScreenState extends State<AchievementsScreen> {
|
|||||||
body: Column(
|
body: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
const Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: EdgeInsets.all(16.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: const [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Add Your Achievements',
|
'Add Your Achievements',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
@ -1,14 +1,13 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:telemednet/screens/doctor_screens/profile_description_screen.dart';
|
import 'package:telemednet/screens/doctor_screens/profile_description_screen.dart';
|
||||||
import '../../common/custom_style.dart';
|
import '../../common/custom_style.dart';
|
||||||
import '../../controllers/doctor _controller.dart';
|
import '../../controllers/doctor_controller.dart';
|
||||||
import '../../route_names.dart';
|
import '../../route_names.dart';
|
||||||
|
|
||||||
class DoctorAddressScreen extends StatefulWidget {
|
class DoctorAddressScreen extends StatefulWidget {
|
||||||
final DoctorController controller;
|
final DoctorController controller;
|
||||||
|
|
||||||
const DoctorAddressScreen({Key? key, required this.controller})
|
const DoctorAddressScreen({super.key, required this.controller});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<DoctorAddressScreen> createState() => _DoctorAddressScreenState();
|
State<DoctorAddressScreen> createState() => _DoctorAddressScreenState();
|
||||||
@ -51,7 +50,7 @@ class _DoctorAddressScreenState extends State<DoctorAddressScreen> {
|
|||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _validateAndProceed() {
|
bool validateAndProceed() {
|
||||||
// Update the address model
|
// Update the address model
|
||||||
addressController.updateFloorBuilding(_floorBuildingController.text);
|
addressController.updateFloorBuilding(_floorBuildingController.text);
|
||||||
addressController.updateStreet(_streetController.text);
|
addressController.updateStreet(_streetController.text);
|
||||||
|
|||||||
@ -1,278 +1,7 @@
|
|||||||
// // import 'package:flutter/material.dart';
|
|
||||||
// // import 'dart:io';
|
|
||||||
// // import 'package:image_picker/image_picker.dart';
|
|
||||||
// // import '../../controllers/doctor _controller.dart';
|
|
||||||
|
|
||||||
// // class DigitalSignatureScreen extends StatefulWidget {
|
|
||||||
// // final DoctorController controller;
|
|
||||||
|
|
||||||
// // const DigitalSignatureScreen({
|
|
||||||
// // Key? key,
|
|
||||||
// // required this.controller,
|
|
||||||
// // }) : super(key: key);
|
|
||||||
|
|
||||||
// // @override
|
|
||||||
// // State<DigitalSignatureScreen> createState() => _DigitalSignatureScreenState();
|
|
||||||
// // }
|
|
||||||
|
|
||||||
// // class _DigitalSignatureScreenState extends State<DigitalSignatureScreen> {
|
|
||||||
// // File? _signatureFile;
|
|
||||||
// // final ImagePicker _picker = ImagePicker();
|
|
||||||
|
|
||||||
// // Future<void> _pickImage() async {
|
|
||||||
// // try {
|
|
||||||
// // final XFile? image = await _picker.pickImage(source: ImageSource.gallery);
|
|
||||||
// // if (image != null) {
|
|
||||||
// // setState(() {
|
|
||||||
// // _signatureFile = File(image.path);
|
|
||||||
// // });
|
|
||||||
// // widget.controller.updateDigitalSignature(image.path);
|
|
||||||
// // }
|
|
||||||
// // } catch (e) {
|
|
||||||
// // debugPrint('Error picking image: $e');
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
|
|
||||||
// // @override
|
|
||||||
// // Widget build(BuildContext context) {
|
|
||||||
// // return Scaffold(
|
|
||||||
// // appBar: AppBar(
|
|
||||||
// // title: const Text(
|
|
||||||
// // 'Digital Signature',
|
|
||||||
// // style: TextStyle(
|
|
||||||
// // fontSize: 24,
|
|
||||||
// // fontWeight: FontWeight.bold,
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// // actions: [
|
|
||||||
// // TextButton(
|
|
||||||
// // onPressed: () {
|
|
||||||
// // Navigator.pop(context);
|
|
||||||
// // },
|
|
||||||
// // child: const Text(
|
|
||||||
// // 'Skip',
|
|
||||||
// // style: TextStyle(
|
|
||||||
// // color: Color(0xFF5BC0DE),
|
|
||||||
// // fontSize: 16,
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// // ],
|
|
||||||
// // ),
|
|
||||||
// // body: Column(
|
|
||||||
// // crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
// // children: [
|
|
||||||
// // const SizedBox(height: 20),
|
|
||||||
// // Center(
|
|
||||||
// // child: SizedBox(
|
|
||||||
// // width: 605,
|
|
||||||
// // height: 205,
|
|
||||||
// // child: Container(
|
|
||||||
// // decoration: BoxDecoration(
|
|
||||||
// // border: Border.all(color: Colors.grey.shade300),
|
|
||||||
// // borderRadius: BorderRadius.circular(12),
|
|
||||||
// // ),
|
|
||||||
// // child: Stack(
|
|
||||||
// // children: [
|
|
||||||
// // if (_signatureFile != null)
|
|
||||||
// // ClipRRect(
|
|
||||||
// // borderRadius: BorderRadius.circular(12),
|
|
||||||
// // child: Image.file(
|
|
||||||
// // _signatureFile!,
|
|
||||||
// // width: 605,
|
|
||||||
// // height: 205,
|
|
||||||
// // fit: BoxFit.contain,
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// // Positioned(
|
|
||||||
// // right: 16,
|
|
||||||
// // bottom: 16,
|
|
||||||
// // child: ElevatedButton.icon(
|
|
||||||
// // onPressed: _pickImage,
|
|
||||||
// // icon: const Icon(Icons.upload),
|
|
||||||
// // label: const Text('Upload'),
|
|
||||||
// // style: ElevatedButton.styleFrom(
|
|
||||||
// // backgroundColor: Colors.white,
|
|
||||||
// // foregroundColor: Colors.black,
|
|
||||||
// // shape: RoundedRectangleBorder(
|
|
||||||
// // borderRadius: BorderRadius.circular(20),
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// // ],
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// // const Spacer(),
|
|
||||||
// // Padding(
|
|
||||||
// // padding: const EdgeInsets.all(16),
|
|
||||||
// // child: ElevatedButton(
|
|
||||||
// // onPressed: () {
|
|
||||||
// // if (widget.controller.validateProfile()) {
|
|
||||||
// // Navigator.pop(context);
|
|
||||||
// // }
|
|
||||||
// // },
|
|
||||||
// // style: ElevatedButton.styleFrom(
|
|
||||||
// // backgroundColor: const Color(0xFF5BC0DE),
|
|
||||||
// // shape: const CircleBorder(),
|
|
||||||
// // padding: const EdgeInsets.all(24),
|
|
||||||
// // ),
|
|
||||||
// // child: const Icon(
|
|
||||||
// // Icons.arrow_forward_ios,
|
|
||||||
// // color: Colors.white,
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// // ],
|
|
||||||
// // ),
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'dart:io';
|
|
||||||
// import 'package:image_picker/image_picker.dart';
|
|
||||||
// import '../../controllers/doctor _controller.dart';
|
|
||||||
|
|
||||||
// class DigitalSignatureScreen extends StatefulWidget {
|
|
||||||
// final DoctorController controller;
|
|
||||||
|
|
||||||
// const DigitalSignatureScreen({
|
|
||||||
// Key? key,
|
|
||||||
// required this.controller,
|
|
||||||
// }) : super(key: key);
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// State<DigitalSignatureScreen> createState() => _DigitalSignatureScreenState();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// class _DigitalSignatureScreenState extends State<DigitalSignatureScreen> {
|
|
||||||
// File? _signatureFile;
|
|
||||||
// final ImagePicker _picker = ImagePicker();
|
|
||||||
|
|
||||||
// Future<void> _pickImage() async {
|
|
||||||
// try {
|
|
||||||
// final XFile? image = await _picker.pickImage(source: ImageSource.gallery);
|
|
||||||
// if (image != null) {
|
|
||||||
// setState(() {
|
|
||||||
// _signatureFile = File(image.path);
|
|
||||||
// });
|
|
||||||
// widget.controller.updateDigitalSignature(image.path);
|
|
||||||
// }
|
|
||||||
// } catch (e) {
|
|
||||||
// debugPrint('Error picking image: $e');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Scaffold(
|
|
||||||
// appBar: AppBar(
|
|
||||||
// title: const Text(
|
|
||||||
// 'Digital Signature',
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 24,
|
|
||||||
// fontWeight: FontWeight.bold,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// actions: [
|
|
||||||
// TextButton(
|
|
||||||
// onPressed: () {
|
|
||||||
// Navigator.pop(context);
|
|
||||||
// },
|
|
||||||
// child: const Text(
|
|
||||||
// 'Save and Skip',
|
|
||||||
// style: TextStyle(
|
|
||||||
// color: Color(0xFF5BC0DE),
|
|
||||||
// fontSize: 16,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// body: Column(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
// children: [
|
|
||||||
// const SizedBox(height: 20),
|
|
||||||
// Center(
|
|
||||||
// child: SizedBox(
|
|
||||||
// width: 605,
|
|
||||||
// height: 205,
|
|
||||||
// child: Container(
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// border: Border.all(color: Colors.grey.shade300),
|
|
||||||
// borderRadius: BorderRadius.circular(12),
|
|
||||||
// ),
|
|
||||||
// child: Stack(
|
|
||||||
// children: [
|
|
||||||
// if (_signatureFile != null)
|
|
||||||
// ClipRRect(
|
|
||||||
// borderRadius: BorderRadius.circular(12),
|
|
||||||
// child: Image.file(
|
|
||||||
// _signatureFile!,
|
|
||||||
// width: 605,
|
|
||||||
// height: 205,
|
|
||||||
// fit: BoxFit.contain,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// if (_signatureFile == null)
|
|
||||||
// Center(
|
|
||||||
// child: Text(
|
|
||||||
// 'No signature uploaded',
|
|
||||||
// style: TextStyle(
|
|
||||||
// color: Colors.grey.shade400,
|
|
||||||
// fontSize: 16,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 20),
|
|
||||||
// ElevatedButton.icon(
|
|
||||||
// onPressed: _pickImage,
|
|
||||||
// icon: const Icon(Icons.upload),
|
|
||||||
// label: const Text('Upload Signature'),
|
|
||||||
// style: ElevatedButton.styleFrom(
|
|
||||||
// backgroundColor: const Color(0xFF5BC0DE),
|
|
||||||
// foregroundColor: Colors.white,
|
|
||||||
// shape: RoundedRectangleBorder(
|
|
||||||
// borderRadius: BorderRadius.circular(8),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// const Spacer(),
|
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.all(16),
|
|
||||||
// child: ElevatedButton(
|
|
||||||
// onPressed: () {
|
|
||||||
// if (widget.controller.validateProfile()) {
|
|
||||||
// Navigator.pop(context);
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// style: ElevatedButton.styleFrom(
|
|
||||||
// backgroundColor: const Color(0xFF5BC0DE),
|
|
||||||
// shape: const CircleBorder(),
|
|
||||||
// padding: const EdgeInsets.all(24),
|
|
||||||
// ),
|
|
||||||
// child: const Icon(
|
|
||||||
// Icons.arrow_forward_ios,
|
|
||||||
// color: Colors.white,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
import '../../controllers/doctor _controller.dart';
|
import '../../controllers/doctor_controller.dart';
|
||||||
import '../../data/services/doctor_profile_service.dart';
|
import '../../data/services/doctor_profile_service.dart';
|
||||||
import '../../route_names.dart';
|
import '../../route_names.dart';
|
||||||
|
|
||||||
@ -280,9 +9,9 @@ class DigitalSignatureScreen extends StatefulWidget {
|
|||||||
final DoctorController controller;
|
final DoctorController controller;
|
||||||
|
|
||||||
const DigitalSignatureScreen({
|
const DigitalSignatureScreen({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.controller,
|
required this.controller,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<DigitalSignatureScreen> createState() => _DigitalSignatureScreenState();
|
State<DigitalSignatureScreen> createState() => _DigitalSignatureScreenState();
|
||||||
@ -307,20 +36,22 @@ class _DigitalSignatureScreenState extends State<DigitalSignatureScreen> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _saveProfile() async {
|
Future<void> _saveProfile() async {
|
||||||
// Directly save the doctor profile without validation
|
|
||||||
bool success =
|
bool success =
|
||||||
await DoctorProfileService.saveDoctorProfile(widget.controller);
|
await DoctorProfileService.saveDoctorProfile(widget.controller);
|
||||||
|
if (mounted) {
|
||||||
if (success) {
|
setState(() {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
if (success) {
|
||||||
const SnackBar(content: Text('Doctor profile saved successfully!')),
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
);
|
const SnackBar(content: Text('Doctor profile saved successfully!')),
|
||||||
Navigator.of(context).pushNamed(RouteNames.doctorAddressScreen);
|
);
|
||||||
} else {
|
Navigator.of(context).pushNamed(RouteNames.doctorAddressScreen);
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
} else {
|
||||||
const SnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
content: Text('Failed to save profile. Please try again.')),
|
const SnackBar(
|
||||||
);
|
content: Text('Failed to save profile. Please try again.')),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,18 +1,17 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../../controllers/doctor _controller.dart';
|
import '../../controllers/doctor_controller.dart';
|
||||||
import '../../route_names.dart';
|
import '../../route_names.dart';
|
||||||
|
|
||||||
class ExperienceScreen extends StatefulWidget {
|
class ExperienceScreen extends StatefulWidget {
|
||||||
final DoctorController controller;
|
final DoctorController controller;
|
||||||
|
|
||||||
const ExperienceScreen({Key? key, required this.controller})
|
const ExperienceScreen({super.key, required this.controller});
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_ExperienceScreenState createState() => _ExperienceScreenState();
|
ExperienceScreenState createState() => ExperienceScreenState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ExperienceScreenState extends State<ExperienceScreen> {
|
class ExperienceScreenState extends State<ExperienceScreen> {
|
||||||
String? _selectedExperience;
|
String? _selectedExperience;
|
||||||
final _licenseController = TextEditingController();
|
final _licenseController = TextEditingController();
|
||||||
late final DoctorController _controller;
|
late final DoctorController _controller;
|
||||||
|
|||||||
@ -1,21 +1,21 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../../controllers/doctor _controller.dart';
|
import '../../controllers/doctor_controller.dart';
|
||||||
import '../../route_names.dart';
|
import '../../route_names.dart';
|
||||||
|
|
||||||
class ProfileDescriptionScreen extends StatefulWidget {
|
class ProfileDescriptionScreen extends StatefulWidget {
|
||||||
final DoctorController controller;
|
final DoctorController controller;
|
||||||
|
|
||||||
const ProfileDescriptionScreen({
|
const ProfileDescriptionScreen({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.controller,
|
required this.controller,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_ProfileDescriptionScreenState createState() =>
|
ProfileDescriptionScreenState createState() =>
|
||||||
_ProfileDescriptionScreenState();
|
ProfileDescriptionScreenState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ProfileDescriptionScreenState extends State<ProfileDescriptionScreen> {
|
class ProfileDescriptionScreenState extends State<ProfileDescriptionScreen> {
|
||||||
final _descriptionController = TextEditingController();
|
final _descriptionController = TextEditingController();
|
||||||
late final DoctorController _controller;
|
late final DoctorController _controller;
|
||||||
bool _isEditing = false;
|
bool _isEditing = false;
|
||||||
@ -78,7 +78,7 @@ class _ProfileDescriptionScreenState extends State<ProfileDescriptionScreen> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _validateAndProceed() {
|
bool validateAndProceed() {
|
||||||
if (!_validateDescription()) {
|
if (!_validateDescription()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../../controllers/doctor _controller.dart';
|
import '../../controllers/doctor_controller.dart';
|
||||||
import '../../route_names.dart';
|
import '../../route_names.dart';
|
||||||
|
|
||||||
class SpecialitiesScreen extends StatefulWidget {
|
class SpecialitiesScreen extends StatefulWidget {
|
||||||
final DoctorController controller;
|
final DoctorController controller;
|
||||||
|
|
||||||
const SpecialitiesScreen({
|
const SpecialitiesScreen({
|
||||||
Key? key,
|
super.key,
|
||||||
required this.controller,
|
required this.controller,
|
||||||
}) : super(key: key);
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<SpecialitiesScreen> createState() => _SpecialitiesScreenState();
|
State<SpecialitiesScreen> createState() => _SpecialitiesScreenState();
|
||||||
@ -164,11 +164,11 @@ class _SpecialitiesScreenState extends State<SpecialitiesScreen> {
|
|||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
const Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: EdgeInsets.all(16.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: const [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Select Your Specialization',
|
'Select Your Specialization',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
@ -79,11 +79,11 @@ class _PatientDashboardScreenState extends State<PatientDashboardScreen> {
|
|||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
child: const Text('Consultation >'),
|
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
foregroundColor: Colors.black,
|
foregroundColor: Colors.black,
|
||||||
),
|
),
|
||||||
|
child: const Text('Consultation >'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -38,13 +38,13 @@ class _PatientFamilyMembersScreenState
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text('Family members'),
|
title: const Text('Family members'),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// Handle 'Done' action
|
// Handle 'Done' action
|
||||||
},
|
},
|
||||||
child: Text('Done', style: TextStyle(color: Colors.blue)),
|
child: const Text('Done', style: TextStyle(color: Colors.blue)),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -60,8 +60,8 @@ class _PatientFamilyMembersScreenState
|
|||||||
),
|
),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
onPressed: _addFamilyMember,
|
onPressed: _addFamilyMember,
|
||||||
child: Icon(Icons.add),
|
|
||||||
backgroundColor: Colors.blue,
|
backgroundColor: Colors.blue,
|
||||||
|
child: const Icon(Icons.add),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -117,30 +117,30 @@ class FamilyMemberCard extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Card(
|
return Card(
|
||||||
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text('Name: ${familyMember.name}',
|
Text('Name: ${familyMember.name}',
|
||||||
style: TextStyle(fontWeight: FontWeight.bold)),
|
style: const TextStyle(fontWeight: FontWeight.bold)),
|
||||||
SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Text('Gender: ${familyMember.gender}'),
|
Text('Gender: ${familyMember.gender}'),
|
||||||
SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Text('Date of Birth: ${familyMember.dateOfBirth}'),
|
Text('Date of Birth: ${familyMember.dateOfBirth}'),
|
||||||
SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Text('Relation: ${familyMember.relation}'),
|
Text('Relation: ${familyMember.relation}'),
|
||||||
SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(Icons.edit, color: Colors.blue),
|
icon: const Icon(Icons.edit, color: Colors.blue),
|
||||||
onPressed: onEdit,
|
onPressed: onEdit,
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(Icons.delete, color: Colors.red),
|
icon: const Icon(Icons.delete, color: Colors.red),
|
||||||
onPressed: onDelete,
|
onPressed: onDelete,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -22,7 +22,7 @@ class _PatientAddressScreenState extends State<PatientAddressScreen> {
|
|||||||
String? state;
|
String? state;
|
||||||
String? city;
|
String? city;
|
||||||
String? addressType;
|
String? addressType;
|
||||||
Map<String, String> _errors = {};
|
final Map<String, String> _errors = {};
|
||||||
bool _hasErrors = false;
|
bool _hasErrors = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user