50 lines
1.3 KiB
Dart
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}');
|
|
}
|
|
}
|