servicios
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||
import 'package:prosappco/src/authentication/authentication_repository.dart';
|
||||
import 'package:prosappco/src/components/pop_appbar.dart';
|
||||
import 'package:prosappco/src/components/primary_btn.dart';
|
||||
import 'package:prosappco/src/models/event_model.dart';
|
||||
import 'package:prosappco/src/models/scores_model.dart';
|
||||
import 'package:prosappco/src/screens/cita.dart';
|
||||
import 'package:table_calendar/table_calendar.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
@@ -22,6 +24,8 @@ class _CalendarScreenState extends State<CalendarScreen> {
|
||||
final _titleController = TextEditingController();
|
||||
final _descriptionController = TextEditingController();
|
||||
|
||||
ScoresModel? scoresModel;
|
||||
|
||||
EventoService eventoService = EventoService();
|
||||
CalendarFormat _calendarFormat = CalendarFormat.month;
|
||||
DateTime today = DateTime.now();
|
||||
@@ -63,6 +67,12 @@ class _CalendarScreenState extends State<CalendarScreen> {
|
||||
_events = value;
|
||||
}));
|
||||
}
|
||||
|
||||
if (scoresModel == null) {
|
||||
ScoresModel.scoreFrom(uid.toString(), false).then(
|
||||
(ScoresModel s) => setState(() => scoresModel = s),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void _onDaySelected(DateTime day, DateTime focusedDay) {
|
||||
@@ -287,6 +297,7 @@ class _CalendarScreenState extends State<CalendarScreen> {
|
||||
today.toString(),
|
||||
_selectedTime1!.format(context).toString(),
|
||||
_selectedTime2!.format(context).toString(),
|
||||
uid.toString(),
|
||||
)
|
||||
.then((value) {
|
||||
Navigator.pop(context);
|
||||
@@ -380,8 +391,34 @@ class _CalendarScreenState extends State<CalendarScreen> {
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('${e.description}'),
|
||||
Text('${e.description}'),
|
||||
Row(
|
||||
children: [
|
||||
RatingBar.builder(
|
||||
initialRating: scoresModel?.average ?? 0,
|
||||
minRating: 1,
|
||||
direction: Axis.horizontal,
|
||||
allowHalfRating: true,
|
||||
itemCount: 5,
|
||||
itemSize: 25,
|
||||
maxRating: 5,
|
||||
itemPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 0),
|
||||
itemBuilder: (context, _) => const Icon(
|
||||
Icons.star,
|
||||
color: Color(0xFF2BA4EC),
|
||||
),
|
||||
onRatingUpdate: (rating) {},
|
||||
ignoreGestures: true,
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
'(${scoresModel?.total.toString()}) ${scoresModel?.average.toString()}'),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'" ${e.description} "',
|
||||
style: const TextStyle(fontStyle: FontStyle.italic),
|
||||
),
|
||||
],
|
||||
),
|
||||
trailing: const Icon(Icons.keyboard_arrow_right),
|
||||
|
||||
Reference in New Issue
Block a user