From ea442aafa772c1d9960e33ae86d45f089a5e7021 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Wed, 22 Jul 2026 09:41:21 -0500 Subject: [PATCH] fix: use widget.type in _ServiceViewState (build error) After converting ServiceView to StatefulWidget, the build() method and helper callbacks still referenced 'type' as a bare name instead of widget.type, causing compilation failure. Co-Authored-By: Claude Sonnet 4.6 --- lib/ui/views/service_view.dart | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/ui/views/service_view.dart b/lib/ui/views/service_view.dart index 6bf066f..72e0794 100644 --- a/lib/ui/views/service_view.dart +++ b/lib/ui/views/service_view.dart @@ -218,12 +218,12 @@ class _ServiceViewState extends State { ), ElevatedButton( onPressed: () { - if (type == 'user') { + if (widget.type == 'user') { NavigationService.navigateTo( '/dashboard/user/service/${service.id}/chat/${user.id}'); } - if (type == 'professional') { + if (widget.type == 'professional') { NavigationService.navigateTo( '/dashboard/professional/service/${service.id}/chat/${user.id}'); } @@ -266,7 +266,7 @@ class _ServiceViewState extends State { service.range1Hour2.minute, ); - if (type == 'user') { + if (widget.type == 'user') { if (service.status == ServiceStatus.completed && service.professionalScored == false) { return Stack( @@ -482,7 +482,7 @@ class _ServiceViewState extends State { } } - if (type == 'professional') { + if (widget.type == 'professional') { if (service.status == ServiceStatus.completed && service.userScored == false) { return Stack( @@ -732,7 +732,7 @@ class _ServiceViewState extends State { ), ); } else { - if (type == 'professional') { + if (widget.type == 'professional') { if (service.status == ServiceStatus.pending) { return Column( children: [ @@ -853,7 +853,7 @@ class _ServiceViewState extends State { } } - if (type == 'user') { + if (widget.type == 'user') { if (service.status == ServiceStatus.pending) { return ConstrainedBox( constraints: const BoxConstraints(maxWidth: 130), @@ -931,10 +931,10 @@ class _ServiceViewState extends State { constraints: const BoxConstraints(maxWidth: 130), child: ElevatedButton( onPressed: () { - if (type == 'professional') { + if (widget.type == 'professional') { navigateTo(Flurorouter.professionalServicesRequestsRoute); } - if (type == 'user') { + if (widget.type == 'user') { navigateTo(Flurorouter.dashboardRoute); } }, @@ -953,13 +953,13 @@ class _ServiceViewState extends State { } String _CustomServiceLocation(ServiceLocationPreferences location) { - if (type == 'user') { + if (widget.type == 'user') { if (location == ServiceLocationPreferences.office) { return 'Servicio en sitio / consultorio'; } } - if (type == 'professional') { + if (widget.type == 'professional') { if (location == ServiceLocationPreferences.office) { return 'Servicio en tu consultorio'; }