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 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-22 09:41:21 -05:00
co-authored by Claude Sonnet 4.6
parent 646e44d126
commit ea442aafa7
+10 -10
View File
@@ -218,12 +218,12 @@ class _ServiceViewState extends State<ServiceView> {
), ),
ElevatedButton( ElevatedButton(
onPressed: () { onPressed: () {
if (type == 'user') { if (widget.type == 'user') {
NavigationService.navigateTo( NavigationService.navigateTo(
'/dashboard/user/service/${service.id}/chat/${user.id}'); '/dashboard/user/service/${service.id}/chat/${user.id}');
} }
if (type == 'professional') { if (widget.type == 'professional') {
NavigationService.navigateTo( NavigationService.navigateTo(
'/dashboard/professional/service/${service.id}/chat/${user.id}'); '/dashboard/professional/service/${service.id}/chat/${user.id}');
} }
@@ -266,7 +266,7 @@ class _ServiceViewState extends State<ServiceView> {
service.range1Hour2.minute, service.range1Hour2.minute,
); );
if (type == 'user') { if (widget.type == 'user') {
if (service.status == ServiceStatus.completed && if (service.status == ServiceStatus.completed &&
service.professionalScored == false) { service.professionalScored == false) {
return Stack( return Stack(
@@ -482,7 +482,7 @@ class _ServiceViewState extends State<ServiceView> {
} }
} }
if (type == 'professional') { if (widget.type == 'professional') {
if (service.status == ServiceStatus.completed && if (service.status == ServiceStatus.completed &&
service.userScored == false) { service.userScored == false) {
return Stack( return Stack(
@@ -732,7 +732,7 @@ class _ServiceViewState extends State<ServiceView> {
), ),
); );
} else { } else {
if (type == 'professional') { if (widget.type == 'professional') {
if (service.status == ServiceStatus.pending) { if (service.status == ServiceStatus.pending) {
return Column( return Column(
children: [ children: [
@@ -853,7 +853,7 @@ class _ServiceViewState extends State<ServiceView> {
} }
} }
if (type == 'user') { if (widget.type == 'user') {
if (service.status == ServiceStatus.pending) { if (service.status == ServiceStatus.pending) {
return ConstrainedBox( return ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 130), constraints: const BoxConstraints(maxWidth: 130),
@@ -931,10 +931,10 @@ class _ServiceViewState extends State<ServiceView> {
constraints: const BoxConstraints(maxWidth: 130), constraints: const BoxConstraints(maxWidth: 130),
child: ElevatedButton( child: ElevatedButton(
onPressed: () { onPressed: () {
if (type == 'professional') { if (widget.type == 'professional') {
navigateTo(Flurorouter.professionalServicesRequestsRoute); navigateTo(Flurorouter.professionalServicesRequestsRoute);
} }
if (type == 'user') { if (widget.type == 'user') {
navigateTo(Flurorouter.dashboardRoute); navigateTo(Flurorouter.dashboardRoute);
} }
}, },
@@ -953,13 +953,13 @@ class _ServiceViewState extends State<ServiceView> {
} }
String _CustomServiceLocation(ServiceLocationPreferences location) { String _CustomServiceLocation(ServiceLocationPreferences location) {
if (type == 'user') { if (widget.type == 'user') {
if (location == ServiceLocationPreferences.office) { if (location == ServiceLocationPreferences.office) {
return 'Servicio en sitio / consultorio'; return 'Servicio en sitio / consultorio';
} }
} }
if (type == 'professional') { if (widget.type == 'professional') {
if (location == ServiceLocationPreferences.office) { if (location == ServiceLocationPreferences.office) {
return 'Servicio en tu consultorio'; return 'Servicio en tu consultorio';
} }