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>
34 lines
901 B
Dart
34 lines
901 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
|
import 'package:prosapp_web_app/models/profession.dart';
|
|
|
|
class ProfessionsProvider extends ChangeNotifier {
|
|
List<Profession> professions = [];
|
|
bool isLoading = true;
|
|
|
|
final _professionsCollection =
|
|
FirebaseFirestore.instance.collection('professions');
|
|
|
|
ProfessionsProvider() {
|
|
getProfessions();
|
|
}
|
|
|
|
getProfessions() async {
|
|
try {
|
|
final documentSnapshot =
|
|
await _professionsCollection.doc('professions').get();
|
|
|
|
final data = documentSnapshot.data() as Map<String, dynamic>;
|
|
|
|
professions = (data['professions'] as List<dynamic>)
|
|
.map((item) => Profession(name: item as String))
|
|
.toList();
|
|
} catch (e) {
|
|
print('Error obteniendo profesiones: $e');
|
|
} finally {
|
|
isLoading = false;
|
|
notifyListeners();
|
|
}
|
|
}
|
|
}
|