- professional_form_provider: agregar rethusValidated al constructor Profesional - professional_provider: agregar rethusCode y rethusValidated al fallback del constructor - profile_view: quitar await de refreshUser() que retorna void Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
63 lines
1.7 KiB
Dart
63 lines
1.7 KiB
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';
|
|
import 'package:prosapp_web_app/services/api_service.dart';
|
|
|
|
class ProfessionalProvider extends ChangeNotifier {
|
|
Profesional? profesional;
|
|
bool _isProModeActive = false;
|
|
final _api = ApiService.instance;
|
|
|
|
bool get isProModeActive => _isProModeActive;
|
|
|
|
Future<Profesional> getProfessional(String uid) async {
|
|
try {
|
|
final data = await _api.get('/professionals/$uid');
|
|
profesional = Profesional.fromDocument(data as Map<String, dynamic>);
|
|
} catch (e) {
|
|
profesional = Profesional(
|
|
id: uid,
|
|
identification: '',
|
|
rethusCode: '',
|
|
rethusValidated: false,
|
|
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!;
|
|
}
|
|
|
|
void logout() {
|
|
_isProModeActive = false;
|
|
notifyListeners();
|
|
}
|
|
|
|
void toggleProMode() {
|
|
_isProModeActive = !_isProModeActive;
|
|
notifyListeners();
|
|
}
|
|
|
|
void setIsProModeActive(bool value) {
|
|
_isProModeActive = value;
|
|
notifyListeners();
|
|
}
|
|
|
|
sendProfessionalToReview() {}
|
|
}
|