Files
prosappco/lib/screens/professional/professional_profile_screen.dart
T
2024-03-18 17:46:03 -05:00

50 lines
1.3 KiB
Dart

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<ProfessionalProfileScreen> createState() =>
_ProfessionalProfileScreenState();
}
class _ProfessionalProfileScreenState extends State<ProfessionalProfileScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Perfil Profesional'),
),
body: BlocBuilder<ProfessionalBloc, ProfessionalState>(
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}');
}
}