Files
prosappweb/lib/providers/professional_provider.dart
T
Lizandro GuarnizoandClaude Sonnet 4.6 15175c1b91 replace: swap prosappweb content for prosapp_web_app (more complete version)
prosapp_web_app has chat, dashboard, calendar, support, 13 providers and
Fluro URL routing. Keep Dockerfile + nginx.conf from previous prosappweb.
Upgrade google_fonts 6.2.1 → 8.1.0 (Dart 3.12 compat fix).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 15:26:32 -05:00

70 lines
1.8 KiB
Dart

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/widgets.dart';
import 'package:prosapp_web_app/models/location_preferences.dart';
import 'package:prosapp_web_app/models/payment_method_entity.dart';
import 'package:prosapp_web_app/models/profesional.dart';
import 'package:prosapp_web_app/models/schedules.dart';
class ProfessionalProvider extends ChangeNotifier {
Profesional? profesional;
bool _isProModeActive = false;
final FirebaseAuth _firebaseAuth = FirebaseAuth.instance;
bool get isProModeActive {
return _isProModeActive;
}
Future<Profesional> getProfessional(String uid) async {
try {
final professional = await FirebaseFirestore.instance
.collection('professional_info')
.doc(uid)
.get();
profesional = Profesional.fromDocument(professional.data()!);
} catch (e) {
profesional = Profesional(
id: _firebaseAuth.currentUser!.uid,
identification: '',
address: '',
aditionalAddress: '',
profession: '',
ratePreferences: false,
rate: '',
locationPreferences: LocationPreferences.office,
bannerPicture: '',
identificationPicture: '',
certificatePicture: '',
latitude: 0,
longitude: 0,
specializations: [],
specializationsPictures: [],
schedules: Schedules.empty,
paymentMethods: PaymentMethodEntity.empty,
);
}
notifyListeners();
return profesional!;
}
logout() {
_isProModeActive = false;
notifyListeners();
}
void toggleProMode() {
_isProModeActive = !_isProModeActive;
notifyListeners();
}
void setIsProModeActive(bool value) {
_isProModeActive = value;
notifyListeners();
}
sendProfessionalToReview() {}
}