fix pov user y profesional

This commit is contained in:
Felipe
2024-04-18 10:23:43 -05:00
parent 2facd1b1d8
commit 142c09d389
8 changed files with 619 additions and 173 deletions
@@ -7,9 +7,11 @@ import 'package:injector/injector.dart';
import 'package:intl/intl.dart';
import 'package:professional_repository/professional_repository.dart';
import 'package:prosappco/blocs/service_bloc/service_bloc.dart';
import 'package:prosappco/components/general_reputation.dart';
import 'package:prosappco/components/general_secondary_button.dart';
import 'package:prosappco/screens/chat/chat_screen.dart';
import 'package:prosappco/screens/score/score_screen.dart';
import 'package:score_repository/score_repository.dart';
import 'package:service_repository/service_repository.dart';
import 'package:setting_repository/setting_repository.dart';
import 'package:url_launcher/url_launcher.dart';
@@ -75,49 +77,126 @@ class _ProfessionalServiceScreenState extends State<ProfessionalServiceScreen> {
child: SingleChildScrollView(
child: Column(
children: [
ListTile(
leading: Container(
width: 60,
height: 60,
decoration: BoxDecoration(
color: Colors.grey.shade300,
shape: BoxShape.circle,
image: userInfo.picture == null
? null
: DecorationImage(
image: NetworkImage(
userInfo.picture!,
),
fit: BoxFit.contain,
),
),
child: userInfo.picture == null
? Icon(
CupertinoIcons.person,
color: Colors.grey.shade400,
size: 40,
)
: null,
),
title: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
SizedBox(
width: double.infinity,
child: Stack(
alignment: Alignment.center,
children: [
Text(
'${userInfo.name}',
style: const TextStyle(
fontWeight: FontWeight.bold),
Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 95,
height: 95,
decoration: BoxDecoration(
color: Colors.grey.shade300,
shape: BoxShape.circle,
image: userInfo.picture == null
? null
: DecorationImage(
image: NetworkImage(
userInfo.picture!),
fit: BoxFit.contain,
),
),
child: userInfo.picture == null
? Icon(
CupertinoIcons.person,
color:
Colors.grey.shade400,
size: 50,
)
: null,
),
const SizedBox(height: 8),
Text(
'${userInfo.name}',
style: const TextStyle(
fontSize: 17,
fontWeight: FontWeight.bold,
),
),
Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Expanded(
child: Center(
child: Text(
'${DateFormat('dd MMMM', 'es').format(DateTime.parse(service.day))} - ${ScheduleEntity.getFormatTime(service.range1Hour1)}',
style: TextStyle(
fontSize: 15,
color: Colors.grey[600],
),
),
),
),
],
),
],
),
const SizedBox(width: 5),
Text(
'${DateFormat('dd MMMM', 'es').format(DateTime.parse(service.day))} - ${ScheduleEntity.getFormatTime(service.range1Hour1)}',
style: TextStyle(
color: Colors.grey[600],
),
GeneralReputation(
userId: service.userId,
builder: (BuildContext context,
ReputationEntity reputation) {
final average = reputation.average;
return Positioned(
top: 3,
right: MediaQuery.of(context)
.size
.width *
0.3,
child: Container(
padding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 3,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.circular(20),
boxShadow: [
BoxShadow(
color: Colors.black
.withOpacity(0.1),
spreadRadius: 1,
blurRadius: 2,
offset: const Offset(
0,
1,
),
),
],
),
child: Row(
mainAxisSize:
MainAxisSize.min,
children: [
const Icon(
Icons.star,
color: Colors.yellow,
size: 20,
),
const SizedBox(width: 4),
Flexible(
child: Text(
average
.toStringAsFixed(2),
style: const TextStyle(
fontSize: 15,
),
),
),
],
),
),
);
},
),
],
),
subtitle: const Text('Rating: 5.0'),
),
Container(
margin: const EdgeInsets.only(
@@ -376,19 +455,19 @@ class _ProfessionalServiceScreenState extends State<ProfessionalServiceScreen> {
),
child: const Padding(
padding: EdgeInsets.symmetric(
vertical: 20,
vertical: 15,
horizontal: 0,
),
child: Icon(
Icons.near_me,
size: 30,
size: 25,
color: Colors.white,
),
),
),
const SizedBox(width: 15),
SizedBox(
width: 230,
width: MediaQuery.of(context).size.width * 0.6,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
+168 -41
View File
@@ -7,9 +7,12 @@ import 'package:injector/injector.dart';
import 'package:intl/intl.dart';
import 'package:professional_repository/professional_repository.dart';
import 'package:prosappco/blocs/service_bloc/service_bloc.dart';
import 'package:prosappco/components/drawer_reputation.dart';
import 'package:prosappco/components/general_reputation.dart';
import 'package:prosappco/screens/chat/chat_screen.dart';
import 'package:prosappco/components/general_secondary_button.dart';
import 'package:prosappco/screens/score/score_screen.dart';
import 'package:score_repository/score_repository.dart';
import 'package:service_repository/service_repository.dart';
import 'package:setting_repository/setting_repository.dart';
import 'package:url_launcher/url_launcher.dart';
@@ -76,50 +79,174 @@ class _UserServiceScreenState extends State<UserServiceScreen> {
child: SingleChildScrollView(
child: Column(
children: [
ListTile(
leading: Container(
width: 60,
height: 60,
decoration: BoxDecoration(
color: Colors.grey.shade300,
shape: BoxShape.circle,
image: userInfo.picture == null
? null
: DecorationImage(
image: NetworkImage(
userInfo.picture!,
),
fit: BoxFit.contain,
),
),
child: userInfo.picture == null
? Icon(
CupertinoIcons.person,
color: Colors.grey.shade400,
size: 40,
)
: null,
),
title: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
SizedBox(
width: double.infinity,
child: Stack(
alignment: Alignment.center,
children: [
Text(
'${userInfo.name}',
style: const TextStyle(
fontWeight: FontWeight.bold),
Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 95,
height: 95,
decoration: BoxDecoration(
color: Colors.grey.shade300,
shape: BoxShape.circle,
image: userInfo.picture == null
? null
: DecorationImage(
image: NetworkImage(
userInfo.picture!),
fit: BoxFit.contain,
),
),
child: userInfo.picture == null
? Icon(
CupertinoIcons.person,
color:
Colors.grey.shade400,
size: 50,
)
: null,
),
const SizedBox(height: 8),
Text(
'${userInfo.name}',
style: const TextStyle(
fontSize: 17,
fontWeight: FontWeight.bold,
),
),
Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Expanded(
child: Center(
child: Text(
'${DateFormat('dd MMMM', 'es').format(DateTime.parse(service.day))} - ${ScheduleEntity.getFormatTime(service.range1Hour1)}',
style: TextStyle(
fontSize: 15,
color: Colors.grey[600],
),
),
),
),
],
),
],
),
const SizedBox(width: 5),
Text(
'${DateFormat('dd MMMM', 'es').format(DateTime.parse(service.day))} - ${ScheduleEntity.getFormatTime(service.range1Hour1)}',
style: TextStyle(
color: Colors.grey[600],
),
GeneralReputation(
userId: service.professionalId,
builder: (BuildContext context,
ReputationEntity reputation) {
final average =
reputation.averagePro;
return Positioned(
top: 3,
right: MediaQuery.of(context)
.size
.width *
0.3,
child: Container(
padding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 3,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.circular(20),
boxShadow: [
BoxShadow(
color: Colors.black
.withOpacity(0.1),
spreadRadius: 1,
blurRadius: 2,
offset: const Offset(
0,
1,
),
),
],
),
child: Row(
mainAxisSize:
MainAxisSize.min,
children: [
const Icon(
Icons.star,
color: Colors.yellow,
size: 20,
),
const SizedBox(width: 4),
Flexible(
child: Text(
average
.toStringAsFixed(2),
style: const TextStyle(
fontSize: 15,
),
),
),
],
),
),
);
},
),
],
),
subtitle: const Text('Rating: 5.0'),
),
// ListTile(
// leading: Container(
// width: 60,
// height: 60,
// decoration: BoxDecoration(
// color: Colors.grey.shade300,
// shape: BoxShape.circle,
// image: userInfo.picture == null
// ? null
// : DecorationImage(
// image: NetworkImage(
// userInfo.picture!,
// ),
// fit: BoxFit.contain,
// ),
// ),
// child: userInfo.picture == null
// ? Icon(
// CupertinoIcons.person,
// color: Colors.grey.shade400,
// size: 40,
// )
// : null,
// ),
// title: Row(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Text(
// '${userInfo.name}',
// style: const TextStyle(
// fontWeight: FontWeight.bold),
// ),
// const SizedBox(width: 5),
// Text(
// '${DateFormat('dd MMMM', 'es').format(DateTime.parse(service.day))} - ${ScheduleEntity.getFormatTime(service.range1Hour1)}',
// style: TextStyle(
// color: Colors.grey[600],
// ),
// ),
// ],
// ),
// subtitle: const Text('Rating: 5.0'),
// ),
Container(
margin: const EdgeInsets.only(
left: 40,
@@ -345,19 +472,19 @@ class _UserServiceScreenState extends State<UserServiceScreen> {
),
child: const Padding(
padding: EdgeInsets.symmetric(
vertical: 20,
vertical: 15,
horizontal: 0,
),
child: Icon(
Icons.near_me,
size: 30,
size: 25,
color: Colors.white,
),
),
),
const SizedBox(width: 15),
SizedBox(
width: 230,
width: MediaQuery.of(context).size.width * 0.6,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [