import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:professional_repository/professional_repository.dart'; import 'package:prosappco/blocs/professional_bloc/professional_bloc.dart'; class ProfessionalProfileScreen extends StatefulWidget { const ProfessionalProfileScreen({super.key}); @override State createState() => _ProfessionalProfileScreenState(); } class _ProfessionalProfileScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('Perfil Profesional'), ), body: BlocBuilder( builder: (context, state) { return Scaffold( body: Center( child: content(context, state), ), ); }, ), ); } content(BuildContext context, ProfessionalState state) { if (state is LoadedModeProState) { if (state.isProModeActive) { if (state.proInfo == null) { return const Text('Loading...'); } else { return body(state.proInfo!); } } } return const Text('Go back'); } body(ProfessionalEntity proInfo) { return Text('Bienvenido Profesional ${proInfo.address}'); } }