Actualizacion de mejoras
This commit is contained in:
@@ -40,20 +40,27 @@ class _ReviewScreenState extends State<ReviewScreen> {
|
||||
}
|
||||
|
||||
setState(() => _loading = true);
|
||||
await DbHelper.insertReview(ReviewModel(
|
||||
userId: auth.currentUser!.id!,
|
||||
colonia: widget.colonia,
|
||||
routeId: widget.routeId,
|
||||
estrellas: _estrellas,
|
||||
comentario: _comentCtrl.text.trim().isEmpty
|
||||
? 'Sin comentario' : _comentCtrl.text.trim(),
|
||||
fecha: DateTime.now().toIso8601String(),
|
||||
nombreUsuario: auth.currentUser!.nombre,
|
||||
));
|
||||
|
||||
context.read<RouteSimulatorService>().clearReviewPrompt(widget.routeId);
|
||||
if (!mounted) return;
|
||||
setState(() { _loading = false; _sent = true; });
|
||||
try {
|
||||
await DbHelper.insertReview(ReviewModel(
|
||||
userId: auth.currentUser!.id!,
|
||||
colonia: widget.colonia,
|
||||
routeId: widget.routeId,
|
||||
estrellas: _estrellas,
|
||||
comentario: _comentCtrl.text.trim().isEmpty
|
||||
? 'Sin comentario' : _comentCtrl.text.trim(),
|
||||
fecha: DateTime.now().toIso8601String(),
|
||||
nombreUsuario: auth.currentUser!.nombre,
|
||||
));
|
||||
context.read<RouteSimulatorService>().clearReviewPrompt(widget.routeId);
|
||||
if (!mounted) return;
|
||||
setState(() { _loading = false; _sent = true; });
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
setState(() => _loading = false);
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
content: Text('Error al guardar: ${e.toString()}'),
|
||||
backgroundColor: AppColors.rojoError));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user